sysulq / nginx-vts-exporter

Simple server that scrapes Nginx vts stats and exports them via HTTP for Prometheus consumption
https://sysulq.github.io/nginx-vts-exporter/
MIT License
645 stars 142 forks source link

`nginx_filter_xxx` metrics are missing in `prometheus` graph console #40

Closed ouadi closed 6 years ago

ouadi commented 7 years ago

I have:

I'm able to see nginx_server_xxx and nginx_upstream_xxx metrics in prometheus graph console. However, I can't see nginx_filter_xxx metrics.

Also, filterZones property is present with full data in response to /status/format/json.

What I'm missing to get nginx_filter_xxx metrics in prometheus?

Below is the config of 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;
}

Example of /status/format/json output:

{
    "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,
            ...
        }]
    }
}
remeika commented 6 years ago

Filter zones don't work in the latest release, 0.6; if you build from the master branch, filter zones work.

ouadi commented 6 years ago

Thank you for the info. I will check and update the issue's status accordingly.

ouadi commented 6 years ago

I confirm, version 0.7, released 10 days ago (Nov 10th, 2017) filter zones work. Issue closed.