grafana / xk6-output-prometheus-remote

k6 extension to output real-time test metrics using Prometheus Remote Write.
GNU Affero General Public License v3.0
156 stars 72 forks source link

Incorrect data saved to prometheus #37

Closed Kostoni closed 1 year ago

Kostoni commented 2 years ago

Hi

I have a problem with prometheus. When I run script with saving metrics to prometheus I see aproximately 5 min of fake data at the end of test run metrics.

It repeats on your sample from readme file. If you go to prometheus after test.js script execution you'll see that you have 5 minutes of data after the data for 10 seconds your test script saved.

2022-08-31_16-56-33

You can see this fake data also using grafana dashboard from your example.

2022-08-31_17-02-33

Repeated in 0.38, 0.39 version of k6

Thank you for your job!

Kostoni commented 2 years ago

Hi again, we've found that reason was in flag query.lookback-delta with default value 5m. I think need to add this prometheus behavior to readme file and fix docker-compose file to create prometheus image with correct behavior.

This fix should be enough to correct work.

command: --web.enable-remote-write-receiver --query.lookback-delta=1s --config.file=/etc/prometheus/prometheus.yml

Thanks!

codebien commented 1 year ago

Note: this should be automatically fixed when https://github.com/grafana/xk6-output-prometheus-remote/issues/68 is added.