Previously it was expected that the user calls s.UnregisterAllMetrics() after calling UnregisterSet(s).
This led to many subtle memory leak bugs like https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6247 .
Solve this issue by adding `destroySet bool` arg to UnregisterSet(), so it automatically calls
s.UnregisterAllMetrics() if destroySet=true.
This changes UnregisterSet() function signature, so users need to update UnregisterSet() calls across their code bases
after upgrading to the new version of github.com/VictoriaMetrics/metrics package. This is OK, since this allows
fixing subtle memory leak bugs like https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6247 .
* allow exposing meta information for registered metrics
New public method `ExposeMetadata` allows enabling exposition
of dummy meta-info for all exposed metrics across all Sets.
This feature is needed to improve compatibility
with 3rd-party scrapers that require meta information to be present.
This commit doesn't update exposition of default system/process
metrics to keep the list of changes small. This change should
be added in a follow-up commit.
https://github.com/VictoriaMetrics/metrics/issues/48
* cleanup
* wip
* wip
* wip
* wip
---------
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
- Expose Go runtime histograms as summaries, since they have too many buckets,
which may lead to high cardinality issues at scraper side.
- Expose go_gc_pauses_seconds summary
- Document exposed go_* metrics
* Allow unregistration of metrics
* Provide metrics.WritePrometheusSet to write using a dedicated metric set
* Cleanup unregister metrics patch, add generic WriteProcessMetrics