mbolek / locust_exporter Goto Github PK
View Code? Open in Web Editor NEWA locust exporter for prometheus
A locust exporter for prometheus
my focust web url is "http://192.168.181.93:30089",and the result of the url as below:
i can get my request statistics by visite the url "http://192.168.181.93:30089/stats/requests",and the response as below:
{"errors": [], "stats": [{"median_response_time": 22, "min_response_time": 13, "current_rps": 5.2, "name": "/portal/info", "num_failures": 0, "max_response_time": 517, "avg_content_length": 287, "avg_response_time": 25.88888888888889, "method": "GET", "num_requests": 1143}, {"median_response_time": 22, "min_response_time": 13, "current_rps": 5.2, "name": "Total", "num_failures": 0, "max_response_time": 517, "avg_content_length": 287, "avg_response_time": 25.88888888888889, "method": null, "num_requests": 1143}], "fail_ratio": 0.0, "slave_count": 2, "state": "stopped", "user_count": 0, "total_rps": 5.2}
i want to know if has a url to get the response time distribution data?just like 'http://192.168.181.93:30089/stats/respones'. but sadlly it did not work.
i want to get the response time distribution by visiting url not download the csv.
Hi,
I am getting following error on terminal (where my locust_exporter is running), when trying to open the url localhost:8000
Traceback (most recent call last):
File "/Users/locust_exporter.py", line 70, in
REGISTRY.register(LocustCollector(str(sys.argv[2])))
File "/Users/.venv/lib/python3.9/site-packages/prometheus_client/registry.py", line 26, in register
names = self._get_names(collector)
File "/Users/.venv/lib/python3.9/site-packages/prometheus_client/registry.py", line 66, in _get_names
for metric in desc_func():
File "/Users/locust_exporter.py", line 35, in collect
metric.add_sample('locust_errors', value=err['occurences'], labels={'path':err['name'], 'method':err['method']})
KeyError: 'occurences'
FYI command used on terminal to run locust_exporter is [./locus_exporter 8000 localhost:8089] and also Locust is running on browser.
Please tell how to solve this issue
Hey there,
we would love to use your code in our environments.
But sadly the code (eg. locust_exporter.py) is missing.
Could you please add it to the repository?
Otherwise it seems that this repo is not usable right now.
Thanks in advance & kind regards,
Martin
Start local_ Exporter
python3 locust_exporter.py 8888 127.0.0.1:8089
I am using the latest version of Prometheus_ When accessing the 8888 port on the client, an error was reported. What should I do
liufujia@zou python_protobuf % python3 locust_exporter.py 8888 127.0.0.1:8089 Connecting to locust on: 127.0.0.1:8089 Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/wsgiref/handlers.py", line 137, in run self.result = application(self.environ, self.start_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prometheus_client/exposition.py", line 128, in prometheus_app status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prometheus_client/exposition.py", line 104, in _bake_output output = encoder(registry) ^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prometheus_client/exposition.py", line 228, in generate_latest output.append(sample_line(s)) ^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prometheus_client/exposition.py", line 185, in sample_line ['{}="{}"'.format( File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prometheus_client/exposition.py", line 186, in <listcomp> 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_length', labels={'path': '/lb/v1/dashboard/project', 'method': 'GET'}, value=83.0, timestamp=None, exemplar=None), Sample(name='locust_requests_avg_content_length', labels={'path': 'Aggregated', 'method': None}, value=83.0, timestamp=None, exemplar=None)]))
Hi,
I am python3.7.4. I cloned your code and try to run using the below command
python3 locust_exporter.py 1234 localhost:8089
I am getting Failed to connect to Locust: http://localhost:8089/stats/requests. What am I missing here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.