artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.04k stars 511 forks source link

artillery-plugin-publish-metrics doesn't publish metrics to Prometheus #1539

Open cuonghuunguyen opened 2 years ago

cuonghuunguyen commented 2 years ago

Version info:

2.0.0-22

Running this command:

artillery run

with plugin artillery-plugin-publish-metrics with any scenarios.

I expected to see this happen:

The metrics are sent to the Prometheus push gateway.

Instead, this happened:

The requests are terminated before the requests are sent to the push gateway.

Files being used: The plugin doesn't wait for the request in https://github.com/artilleryio/artillery-plugin-publish-metrics/blob/master/lib/prometheus.js#L120 to be terminated before calling done in the function cleanup.

Suggested approach: Wait for all push promises to be resolved before calling done()

hassy commented 2 years ago

thank you @cuonghuunguyen! is this something that broke in 2.0.0-22? or are you trying the plugin for the first time?

cuonghuunguyen commented 2 years ago

I used the plugin a long time ago and it was broken. Now I tried it again and it is still broken. In the past, I have to add the thought period at the end of the script to wait for the push promise to be resolved

dubilyer commented 2 years ago

Same issue here. Any news about the resolution?