Skip to content

Commit cdc8318

Browse files
authored
Merge pull request #24 from dmitryint/fix/lb-type-detection
PR merged and released Thank you for contributing
2 parents 42ff711 + 9da3f1b commit cdc8318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def get_metrics(metrics_type, lbid):
158158

159159

160160
for services in load_balancer['services']:
161-
if services['protocol'] == 'http':
161+
if services['protocol'] in ['http', 'https']:
162162
LOAD_BALANCER_TYPE = 'http'
163163
else:
164164
LOAD_BALANCER_TYPE = 'tcp'
@@ -195,7 +195,7 @@ def get_metrics(metrics_type, lbid):
195195
hetzner_connections_per_second.labels(hetzner_load_balancer_id=load_balancer_id,
196196
hetzner_load_balancer_name=lb_name).set(get_metrics('connections_per_second',load_balancer_id)["metrics"]["time_series"]["connections_per_second"]["values"][0][1])
197197
if load_balancer_type == 'http':
198-
hetzner_connections_per_second.labels(hetzner_load_balancer_id=load_balancer_id,
198+
hetzner_requests_per_second.labels(hetzner_load_balancer_id=load_balancer_id,
199199
hetzner_load_balancer_name=lb_name).set(get_metrics('requests_per_second',load_balancer_id)["metrics"]["time_series"]["requests_per_second"]["values"][0][1])
200200
hetzner_bandwidth_in.labels(hetzner_load_balancer_id=load_balancer_id,
201201
hetzner_load_balancer_name=lb_name).set(get_metrics('bandwidth',load_balancer_id)["metrics"]["time_series"]["bandwidth.in"]["values"][0][1])

0 commit comments

Comments
 (0)