【问题标题】:`nginx_filter_xxx` metrics are missing`nginx_filter_xxx` 指标缺失
【发布时间】:2017-10-18 16:54:03
【问题描述】:

我有:

  • 激活nginx_module_vts(见下面的配置)
  • 配置并启动nginx_vts_exporter
  • 配置prometheus 以从nginx_vts_exporter 抓取指标

我可以在 prometheus 图形控制台中看到 nginx_server_xxxnginx_upstream_xxx 指标。但是,我看不到 nginx_filter_xxx 指标。

此外,filterZones 属性存在完整数据以响应/status/format/json

prometheus 中获取nginx_filter_xxx 指标缺少什么?

下面是nginx_module_vts的配置:

http {
  vhost_traffic_status_zone;
  vhost_traffic_status_filter_by_set_key $uri uri::$server_name;
  ...
}

location /status {
  vhost_traffic_status_display;
  vhost_traffic_status_display_format json;
}

/status/format/json 输出示例:

{
    "hostName": "ctrl.localdomain",
    ...
    "connections": {
        "active": 4,
        ...
    },
    "sharedZones": {
        "name": "ngx_http_vhost_traffic_status",
        ...
    },
    "serverZones": {
        "nginx-vts.localhost": {
            "requestCounter": 5,
            ...
        },
        "php-fpm.localhost": {
            "requestCounter": 6,
            ...
        },
        ...
        "*": {
            "requestCounter": 18,
            ...
        }
    },
    "filterZones": {
        "uri::nginx-vts.localhost": {
            "/status/format/json": {
                "requestCounter": 5,
                ...
            }
        },
        "uri::php-fpm.localhost": {
            "/status": {
                "requestCounter": 6,
                ...
            }
        },
        ...
    },
    "upstreamZones": {
        "::nogroups": [{
            "server": "127.0.0.1:9000",
            "requestCounter": 6,
            ...
            "inBytes": 624,
        }, {
            "server": "127.0.0.1:49090",
            "requestCounter": 7,
            ...
        }]
    }
}

【问题讨论】:

    标签: nginx prometheus


    【解决方案1】:

    我使用的nginx_vts_exporter 0.6 版不支持过滤区域。 2017 年 11 月 10 日发布的 0.7 版支持它。

    详情请咨询nginx_filter_xxx metrics are missing in prometheus graph console

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-05
      • 1970-01-01
      • 2018-01-15
      • 1970-01-01
      • 2019-08-25
      • 1970-01-01
      • 2021-05-23
      • 1970-01-01
      相关资源
      最近更新 更多