Commit Graph

15 Commits

Author SHA1 Message Date
Aliaksandr Valialkin
17839691f2
Add UnregisterAllMetrics() and GetDefaultSet() functions
While at it, make sure that ListMetricNames() returns sorted list of the registered metrics
2022-10-25 10:59:37 +03:00
Aliaksandr Valialkin
4ca082233a
all: go fmt from Go1.19 2022-08-08 17:15:06 +03:00
Aliaksandr Valialkin
c6c6640e5b
add RegisterSet() and UnregisterSet() functions for registering the set in metrics export via global WritePrometheus() call 2022-08-08 17:13:46 +03:00
Aliaksandr Valialkin
0ee99fd214
set.go: fix data race in Set.ListMetricNames when accessing Set.m map
The Set.m map can be updated by concurrent goroutines when ListMetricNames is called
2021-11-01 14:52:22 +02:00
Roman Khavronenko
be819551e3
summary: fix Unregister behaviour for summary metric type (#16)
The change covers two things:
1. Cleanup of Set.a metrics list from per-quantile metrics
for summary.
2. Register summary metric and per-quantile metrics in one take.
This prevents registry corruption when Unregister called in the
middle of metric register process.
2020-08-07 12:59:44 +03:00
Roman Khavronenko
dd0c59c0d6
Remove timeseries with quantile labels when Unregister is called for summary #14 (#15) 2020-07-28 21:58:28 +03:00
Aliaksandr Valialkin
a494df3462 Properly unregister Summary metric in Set.UnregisterMetric 2020-02-26 20:37:47 +02:00
Roland Lammel
900c892625
Allow unregistration of metrics (#6)
* Allow unregistration of metrics

* Provide metrics.WritePrometheusSet to write using a dedicated metric set

* Cleanup unregister metrics patch, add generic WriteProcessMetrics
2020-02-26 19:52:38 +02:00
Ivan G
e6d6f46b5d Proposal: Add new type of counter: FloatCounter (#5)
* Add new type of counter: FloatCounter
* sometimes you need to count things with more precision than uint64
* FloatCounter also usefull if you need setable Gauge w/o callback func

* Fix PR review:
* sync.RWMutex -> sync.Mutex
* more idiomatic add/sub
2020-01-23 12:48:00 +02:00
Aliaksandr Valialkin
fcb89496ec Prevent from possible deadlock in Set.WritePrometheus when Gague callback could call Set.mu.Lock 2019-12-02 22:26:56 +02:00
Aliaksandr Valialkin
eb780f4caa Buffer all the output in memory before writing it to the provided io.Writer in WritePrometheus
This should prevent from indefinite locking of internal structures in the case of laggy io.Writer
2019-11-25 13:01:26 +02:00
Aliaksandr Valialkin
984b12dbb5 Add easy-to-use histograms 2019-11-23 00:16:38 +02:00
Aleksandr Razumov
42ee365914 all: fix typo lables -> labels (#3)
Thanks!
2019-09-30 00:06:17 +03:00
Aliaksandr Valialkin
6fc4c03c79 Update Summary quantiles before writing them to the output.
Previously Summary quantiles were updated after writing them to the output,
so the output contained old quantile values.
2019-06-28 11:13:39 +03:00
Aliaksandr Valialkin
ebce157dde Add Set for controlling metric sets to be exported via WritePrometheus call 2019-06-01 23:18:41 +03:00