Skip to content

Commit 7bd0b71

Browse files
author
Vitor Arins
committed
Refactor regex to get the metrics values.
1 parent 4ac7def commit 7bd0b71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tinyproxy_exporter

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TinyproxyCollector(object):
1919
opener = urllib.request.build_opener(handler)
2020
urllib.request.install_opener(opener)
2121
response = urllib.request.urlopen('http://{0}'.format(self.stathost))
22-
values = [float(x) for x in re.findall(b'>(\d+).+td', response.read())]
22+
values = [float(x) for x in re.findall(b'(\d+)<', response.read())]
2323
yield GaugeMetricFamily('tinyproxy_connections_open', 'Number of open connections', values[0])
2424
yield CounterMetricFamily('tinyproxy_requests_total', 'Number of requests', values[1])
2525
yield CounterMetricFamily('tinyproxy_connections_bad_total', 'Number of bad connections', values[2])

0 commit comments

Comments
 (0)