Add Prometheus metrics endpoint #4944
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a friend who is using k6 for some massive database load-tests that run for hours. However, k6 is OOMing sometimes and they'd like to understand if they need to modify GOGC values.
The easiest way for them to do it is to leverage the Prometheus Golang runtime metrics. This was brought up before in #3535 however, it was rejected for two reasons:
client_golang
dependency might go away in favor of OTelHowever I'd like to reopen this for two reasons.
client_golang
is a dependency ofopentelemetry-go
as well. So that dependency is not going away.But the more important reason is that there are already many high performance Golang systems exposing
/metrics
and the metrics and tooling around them is pretty mature and extensive.The OTel Golang runtime metrics are new and not yet stable: https://opentelemetry.io/docs/specs/semconv/runtime/go-metrics/ Reimplementing everything for these metrics is not a trivial effort.
make check
) and all pass.cc @joanlopez @oleiade @mstoykov @dgzlopes
Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)