envoyproxy / envoyproxy/envoy

Add custom stat through configuration

Open
#37,523 0 comments 0 reactions 0 assignees View on GitHub
area/stats enhancement help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
428

Description

*Title*: Add a custom, static stat to Envoy’s stat output through configuration

*Description*:
I want to be able to add a stat (metric) to envoy through configuration.
For example a configuration of stat name 'foo' with fixed_value '1' would then be output a gauge like
`foo 1`

```jsonc
"stats_config": {
"stats_tags": [
{
"tag_name": "environment",
"fixed_value": "prod"
}
],
# proposed new config key:
"static_stats": [
{
"stat_name": "foo",
"fixed_value": 1,
}
]
},
```

Above is an idea on where to put it, adjust the `StatsConfig` object https://www.envoyproxy.io/docs/envoy/v1.32.1/api-v3/config/metrics/v3/stats.proto.html#config-metrics-v3-statsconfig

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.