Skip to content

Commit 699601e

Browse files
Harsh AroraHarsh Arora
authored andcommitted
updated version 1.4.7
1 parent 15f435b commit 699601e

5 files changed

Lines changed: 32 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ All notable changes to this project will be documented in this file.
2626

2727
### BugFixes:
2828
- Error handling modification
29+
30+
31+
## [1.4.7] - 2021-01-28
32+
### Added
33+
- Added adc_probe_success metric to indicate successful/Failed scrape
34+
- Added new metric "citrixadc_throughput_tx_mbits_rate"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ For this:
100100
<summary>Usage as a Container</summary>
101101
<br>
102102

103-
In order to use the exporter as a container, the image ```quay.io/citrix/citrix-adc-metrics-exporter:1.4.6``` will need to be pulled using;
103+
In order to use the exporter as a container, the image ```quay.io/citrix/citrix-adc-metrics-exporter:1.4.7``` will need to be pulled using;
104104
```
105-
docker pull quay.io/citrix/citrix-adc-metrics-exporter:1.4.6
105+
docker pull quay.io/citrix/citrix-adc-metrics-exporter:1.4.7
106106
```
107107
**NOTE:** It can also be build locally using ```docker build -f Dockerfile -t <image_name>:<tag> ./```
108108

109109
Now, the exporter can be run using:
110110
```
111-
docker run -dt -p <host_port>:<container_port> --mount type=bind,source=<host-path-for-config-file>,target=/exporter/config.yaml quay.io/citrix/citrix-adc-metrics-exporter:1.4.6 [flags] --config-file=/exporter/config.yaml
111+
docker run -dt -p <host_port>:<container_port> --mount type=bind,source=<host-path-for-config-file>,target=/exporter/config.yaml quay.io/citrix/citrix-adc-metrics-exporter:1.4.7 [flags] --config-file=/exporter/config.yaml
112112
```
113113
where the flags are:
114114

@@ -131,7 +131,7 @@ flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
131131

132132
To setup the exporter as given in the diagram, the following command can be used:
133133
```
134-
docker run -dt -p 8888:8888 --mount type=bind,source=/path/to/config.yaml,target=/exporter/config.yaml --name citrix-adc-exporter quay.io/citrix/citrix-adc-metrics-exporter:1.4.6 --target-nsip=10.0.0.1 --port=8888 --config-file=/exporter/config.yaml
134+
docker run -dt -p 8888:8888 --mount type=bind,source=/path/to/config.yaml,target=/exporter/config.yaml --name citrix-adc-exporter quay.io/citrix/citrix-adc-metrics-exporter:1.4.7 --target-nsip=10.0.0.1 --port=8888 --config-file=/exporter/config.yaml
135135
```
136136
This directs the exporter container to scrape the 10.0.0.1 IP, and the expose the stats it collects on port 8888.
137137

@@ -160,7 +160,7 @@ For this:
160160
Certificate should then be mounted at the '--cacert-path' provided. For instance, if cert is 'cacert.pem' and '--cacert-path' provided in 'config.yaml' is '/exporter/cacert.pem'
161161

162162
```
163-
docker run -dt -p 8888:8888 --mount type=bind,source=/path/to/config.yaml,target=/exporter/config.yaml --mount type=bind,source=/path/to/cacert.pem,target=/exporter/cacert.pem --name citrix-adc-exporter quay.io/citrix/citrix-adc-metrics-exporter:1.4.6 --target-nsip=10.0.0.1 --port=8888 --config-file=/exporter/config.yaml
163+
docker run -dt -p 8888:8888 --mount type=bind,source=/path/to/config.yaml,target=/exporter/config.yaml --mount type=bind,source=/path/to/cacert.pem,target=/exporter/cacert.pem --name citrix-adc-exporter quay.io/citrix/citrix-adc-metrics-exporter:1.4.7 --target-nsip=10.0.0.1 --port=8888 --config-file=/exporter/config.yaml
164164
```
165165
**NOTE:** If default port to connect with ADC is not 80/443 for HTTP/HTTPS respectively, then append --target-nsip with port. For instance, if port for ADC is 9080 then use: --target-nsip=10.0.0.1:9080
166166

@@ -191,7 +191,7 @@ metadata:
191191
spec:
192192
containers:
193193
- name: exporter
194-
image: quay.io/citrix/citrix-adc-metrics-exporter:1.4.6
194+
image: quay.io/citrix/citrix-adc-metrics-exporter:1.4.7
195195
args:
196196
- "--target-nsip=10.0.0.1"
197197
- "--port=8888"
@@ -270,7 +270,7 @@ metadata:
270270
spec:
271271
containers:
272272
- name: exporter
273-
image: quay.io/citrix/citrix-adc-metrics-exporter:1.4.6
273+
image: quay.io/citrix/citrix-adc-metrics-exporter:1.4.7
274274
args:
275275
- "--target-nsip=10.0.0.1"
276276
- "--port=8888"

exporter.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,16 @@ def __init__(self, nsip, metrics, username, password, protocol,
267267
def collect(self):
268268

269269
if self.stats_access_pending or self.ns_session_pending:
270+
yield self.populate_probe_status(self.FAILURE)
270271
return
271272

272273
if not self.login():
274+
yield self.populate_probe_status(self.FAILURE)
273275
return
274276

275277
data = {}
276278
self.stats_access_pending = True
279+
status = self.INVALID
277280
for entity in self.metrics.keys():
278281
logger.debug('Collecting metric {}'.format(entity))
279282
try:
@@ -283,6 +286,7 @@ def collect(self):
283286

284287
if status == self.FAILURE:
285288
self.ns_session_clear()
289+
yield self.populate_probe_status(status)
286290
return
287291

288292
if entity_data:
@@ -298,6 +302,7 @@ def collect(self):
298302

299303
if status == self.FAILURE:
300304
self.ns_session_clear()
305+
yield self.populate_probe_status(status)
301306
return
302307

303308
# Add labels to metrics and provide to Prometheus
@@ -390,6 +395,7 @@ def collect(self):
390395

391396
yield g
392397
self.stats_access_pending = False
398+
yield self.populate_probe_status(status)
393399

394400
# Function to fire nitro commands and collect data from NS
395401
def collect_data(self, entity):
@@ -677,6 +683,16 @@ def collect_lbvs_config(self):
677683
logger.error('Error in fetching lbvs config entries {}'.format(e))
678684
return self.FAILURE, None
679685

686+
def populate_probe_status(self, status):
687+
label_names = []
688+
label_names.append('nsip')
689+
g = GaugeMetricFamily("citrixadc_probe_success", "probe_success", labels=label_names)
690+
if status == self.FAILURE:
691+
g.add_metric([self.nsip], int("0"))
692+
else:
693+
g.add_metric([self.nsip], int("1"))
694+
695+
return g
680696

681697
def main():
682698
parser = argparse.ArgumentParser()

metrics.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@
427427

428428
"ns": {
429429
"gauges": [
430-
["rxmbitsrate", "citrixadc_throughput_rx_mbits_rate"]
430+
["rxmbitsrate", "citrixadc_throughput_rx_mbits_rate"],
431+
["txmbitsrate", "citrixadc_throughput_tx_mbits_rate"]
431432
]
432433
},
433434

version/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.6
1+
1.4.7

0 commit comments

Comments
 (0)