0
votes

I came accross locust exporter. So I installed it and followed the steps and as said in document I ran the commmand locust_exporter.py 1234 localhost:8089 where 1234 is a port. But it throwing some error.

Exception happened during processing of request from ('127.0.0.1', 11950) Traceback (most recent call last): File "E:\Python\lib\socketserver.py", line 650, in process_request_thread self.finish_request(request, client_address) File "E:\Python\lib\socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "E:\Python\lib\socketserver.py", line 720, in init self.handle() File "E:\Python\lib\http\server.py", line 426, in handle self.handle_one_request() File "E:\Python\lib\http\server.py", line 414, in handle_one_request method() File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 152, in do_GET output = encoder(registry) File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 121, in generate_latest output.append(sample_line(s)) File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 77, in sample_line ['{0}="{1}"'.format( File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 78, in k, v.replace('\', r'\').replace('\n', r'\n').replace('"', r'\"')) AttributeError: ("'NoneType' object has no attribute 'replace'", Metric(locust_requests_avg_content_ length, Locust requests avg_content_length, gauge, , [Sample(name='locust_requests_avg_content_lengt h', labels={'path': '/charts.html', 'method': 'GET'}, value=19561.0, timestamp=None, exemplar=None), Sample(name='locust_requests_avg_content_length', labels={'path': '/index.html', 'method': 'GET'}, value=31333.0, timestamp=None, exemplar=None), Sample(name='locust_requests_avg_content_length', lab els={'path': 'Aggregated', 'method': None}, value=25447.0, timestamp=None, exemplar=None)]))

Exception happened during processing of request from ('127.0.0.1', 11951) Traceback (most recent call last): File "E:\Python\lib\socketserver.py", line 650, in process_request_thread self.finish_request(request, client_address) File "E:\Python\lib\socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "E:\Python\lib\socketserver.py", line 720, in init self.handle() File "E:\Python\lib\http\server.py", line 426, in handle self.handle_one_request() File "E:\Python\lib\http\server.py", line 414, in handle_one_request method() File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 152, in do_GET output = encoder(registry) File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 121, in generate_latest output.append(sample_line(s)) File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 77, in sample_line ['{0}="{1}"'.format( File "E:\Python\lib\site-packages\prometheus_client\exposition.py", line 78, in k, v.replace('\', r'\').replace('\n', r'\n').replace('"', r'\"')) AttributeError: ("'NoneType' object has no attribute 'replace'", Metric(locust_requests_avg_content_ length, Locust requests avg_content_length, gauge, , [Sample(name='locust_requests_avg_content_lengt h', labels={'path': '/charts.html', 'method': 'GET'}, value=19561.0, timestamp=None, exemplar=None), Sample(name='locust_requests_avg_content_length', labels={'path': '/index.html', 'method': 'GET'}, value=31333.0, timestamp=None, exemplar=None), Sample(name='locust_requests_avg_content_length', lab els={'path': 'Aggregated', 'method': None}, value=25447.0, timestamp=None, exemplar=None)])

Not sure what the error is all about.How to resolve this?

1

1 Answers

1
votes

You can try to use this exporter: ContainerSolutions/locust_exporter

docker run --net=host containersol/locust_exporter

by default it will try to connect to locust on http://localhost:8089 and metrics will be exposed on http://localhost:9646/metrics

I wrote a blog post about How to Move Metrics from Locust.io to Grafana via Prometheus.