envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.94k stars 4.8k forks source link

stats: prevent disabling some stats #14051

Open jmarantz opened 3 years ago

jmarantz commented 3 years ago

Description:

Some stats can potentially be used for functional purposes during operation. However, the fact that they can be disabled via a stats matcher expression makes that an anti-pattern currently. We should have a mechanism to mark a stat as being immune from disabling. Since the disabling happens during stat instantiation, this would need to occur during stat construction.

Relevant Links:

https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/metrics/v3/stats.proto#config-metrics-v3-statsmatcher

jmarantz commented 3 years ago

https://github.com/envoyproxy/envoy/pull/13684#issuecomment-728461466 is an example of a case where it would be convenient to have stats that can be relied on.

jmarantz commented 3 years ago

Thinking about this further, I fear it would be a lot of toil to change (say) the COUNTER macro to include a new bool, or to add a new COUNTER macro variant for always-enabled stats. But we could add new Scope APIs or optional args to the existing ones to force construction regardless of stats disablement settings.

Maybe we don't need to worry about supporting force-enabled stats for the convenience macros.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.