envoyproxy/envoy

Add custom stat through configuration

Open

#37,523 建立於 2024年12月5日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)C++ (5,373 fork)batch import
area/statsenhancementhelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

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

          "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

貢獻者指南