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>
PushConfig represents a struct package uses for pushing
metrics to remote destination. Having a structure
helps to extend functionality in the future, without
touching the signature of existing functions.
For example, `PushConfig` supports custom HTTP headers
via `Headers` param.
Updates https://github.com/VictoriaMetrics/metrics/issues/52
Updates https://github.com/VictoriaMetrics/metrics/issues/36
Co-authored-by: hagen1778 <roman@victoriametrics.com>
It is unclear how and when to reset summary - it is smoothed during the Go app uptime.
On the other hand, histogram buckets can be wrapped into increase() or rate() in order
to calculate the histogram distribution on arbitrary time range.
Limit the number of buckets per Go runtime histogram to 30 in order to prevent from high cardinality issues.
- 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
* go_metrics: adds new runtime metrics
go_sched_latency_seconds - Distribution of the time goroutines have spent in the scheduler in a runnable state before actually running
go_mutex_wait_total_seconds - Approximate cumulative time goroutines have spent blocked on a sync.Mutex or sync.RWMutex
https://github.com/VictoriaMetrics/metrics/issues/54
* fixes data race
* add tests
* wip
* wip
---------
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
* process_metrics: adds metrics for windows OS
* windows: fixes build constraints
* bumps github ci go to 1.20 version
* bumps go version at go.mod
* go mod vendor
It is better to just log the error once if /proc/self/io cannot be opened,
without exposing additional counters.
The error message should contain directions on how to fix the error.
Updates https://github.com/VictoriaMetrics/metrics/issues/42