Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus metrics endpoint in k6 REST API #1787

Closed
szkiba opened this issue Jan 11, 2021 · 5 comments
Closed

Prometheus metrics endpoint in k6 REST API #1787

szkiba opened this issue Jan 11, 2021 · 5 comments
Labels

Comments

@szkiba
Copy link
Contributor

szkiba commented Jan 11, 2021

I'm going to use smoke test with a long running k6 instance for monitoring my service. I'd like to collect metrics from test using Prometheus.

This is not about exporting, pushing k6 normal result to Prometheus, that is another story. This is about monitoring smoke test process itself and make alerts on some monitored metric values.

I'd like to develop this feature if you agree on that this is useful, and there is a chance to merge.

Feature Description

k6 REST API endpoint for monitoring test process with Prometheus. Primary use case is a long running smoke test with monitored metrics. Collect metrics and make alerts when something isn't works as expected.

Suggested Solution

Add "/v1/monitor" REST API endpoint, to provide Prometheus formatted metrics. Add same metrics as the "/v1/metrics" endpoint. Use https://godoc.org/github.com/prometheus/common/expfmt for formating metrics in Prometheus format.

@alexanderscott

This comment has been minimized.

@benc-uk
Copy link

benc-uk commented Feb 27, 2021

I've created a project to explore providing a sidecar solution to getting data from k6 into Prometheus

https://github.com/benc-uk/k6-prometheus-exporter

@na--
Copy link
Member

na-- commented Mar 2, 2021

Worth mentioning that this will have to be done as an output, for the reasons explained in #1875 (comment)
The good news is that k6 will support output extensions after k6 v0.31.0 (slated to be released next week), so if anyone is interested, an extension with this should be easy to create soon.

@na--
Copy link
Member

na-- commented May 10, 2021

Worth repeating #1792 (comment) here as well, if anyone stumbles on this issue: @szkiba has created an xk6 output extension for Prometheus: https://github.com/szkiba/xk6-prometheus

@szkiba
Copy link
Contributor Author

szkiba commented May 15, 2021

Worth repeating #1792 (comment) here as well, if anyone stumbles on this issue: @szkiba has created an xk6 output extension for Prometheus: https://github.com/szkiba/xk6-prometheus

Yes, and this is why I close this PR now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants