You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #554 I feel like it is pretty common and legitimate use-case when trying to expose external system metrics using prometheus. For example, there is a autoanalyze_count FROM pg_stat_user_tables stat which is pretty closely mapped to prometheus counter (name gives it away). The problem is that there is no easy safe way to accomplish correct increment. The "obvious" solution is to retrieve current counter value and increment the difference. But this has obvious race condition issues, where anything can happen between value is read and increment is added, where the end result becomes out of sync. In such case, what really is needed is "increment to" method. prometheus-net library provides exactly that: https://github.com/prometheus-net/prometheus-net/blob/master/Prometheus/Counter.cs#L55
The text was updated successfully, but these errors were encountered:
Similar to #554 I feel like it is pretty common and legitimate use-case when trying to expose external system metrics using prometheus. For example, there is a
autoanalyze_count FROM pg_stat_user_tables
stat which is pretty closely mapped to prometheus counter (name gives it away). The problem is that there is no easy safe way to accomplish correct increment. The "obvious" solution is to retrieve current counter value and increment the difference. But this has obvious race condition issues, where anything can happen between value is read and increment is added, where the end result becomes out of sync. In such case, what really is needed is "increment to" method.prometheus-net
library provides exactly that: https://github.com/prometheus-net/prometheus-net/blob/master/Prometheus/Counter.cs#L55The text was updated successfully, but these errors were encountered: