{"id":15176392,"url":"https://github.com/sysulq/nginx-vts-exporter","last_synced_at":"2025-04-14T05:17:56.397Z","repository":{"id":47126551,"uuid":"75994831","full_name":"sysulq/nginx-vts-exporter","owner":"sysulq","description":"Simple server that scrapes Nginx vts stats and exports them via HTTP for Prometheus consumption","archived":false,"fork":false,"pushed_at":"2024-12-30T19:56:21.000Z","size":19156,"stargazers_count":655,"open_issues_count":24,"forks_count":145,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-14T05:17:39.274Z","etag":null,"topics":["go","nginx","nginx-vts-exporter","prometheus","prometheus-exporter","vts"],"latest_commit_sha":null,"homepage":"https://sysulq.github.io/nginx-vts-exporter/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysulq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-09T02:41:58.000Z","updated_at":"2025-04-11T18:07:59.000Z","dependencies_parsed_at":"2024-02-02T09:08:07.718Z","dependency_job_id":"c230644e-a59e-4847-85dc-ef68a0e21ec3","html_url":"https://github.com/sysulq/nginx-vts-exporter","commit_stats":{"total_commits":213,"total_committers":20,"mean_commits":10.65,"dds":0.3802816901408451,"last_synced_commit":"c12edaab1412e04005642fe7d58411409fc41d18"},"previous_names":["sysulq/nginx-vts-exporter","hnlq715/nginx-vts-exporter"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysulq%2Fnginx-vts-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysulq%2Fnginx-vts-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysulq%2Fnginx-vts-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysulq%2Fnginx-vts-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysulq","download_url":"https://codeload.github.com/sysulq/nginx-vts-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824694,"owners_count":21167345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","nginx","nginx-vts-exporter","prometheus","prometheus-exporter","vts"],"created_at":"2024-09-27T13:03:55.441Z","updated_at":"2025-04-14T05:17:56.360Z","avatar_url":"https://github.com/sysulq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx-vts-exporter\n\n[![Go](https://github.com/sysulq/nginx-vts-exporter/actions/workflows/go.yml/badge.svg)](https://github.com/sysulq/nginx-vts-exporter/actions/workflows/go.yml)\n[![Docker Pulls](https://img.shields.io/docker/pulls/sophos/nginx-vts-exporter.svg)](https://hub.docker.com/r/sophos/nginx-vts-exporter)\n[![Github All Releases](https://img.shields.io/github/downloads/sysulq/nginx-vts-exporter/total.svg)](https://github.com/sysulq/nginx-vts-exporter)\n[![GitHub release](https://img.shields.io/github/release/sysulq/nginx-vts-exporter.svg)](https://github.com/sysulq/nginx-vts-exporter)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sysulq/nginx-vts-exporter)](https://goreportcard.com/report/github.com/sysulq/nginx-vts-exporter)\n\n\u003e nginx-vts-exporter is powered by [Kod](https://github.com/go-kod/kod), which is a dependency injection framework for Go.  \n\u003e It is designed to be simple and easy to use, and to provide a consistent way to manage dependencies across your application.\n\nSimple server that scrapes Nginx [vts](https://github.com/vozlt/nginx-module-vts) stats and exports them via HTTP for Prometheus consumption\n\nTo support time related histogram metrics, please refer to [sysulq/nginx-prometheus-metrics](https://github.com/sysulq/nginx-prometheus-metrics) or [#43](https://github.com/sysulq/nginx-vts-exporter/issues/43).\n\n## ANN\n\nIt's hard to say that this project is **not maintained** any longer, and it is recommended to use [nginx-vtx-module](https://github.com/vozlt/nginx-module-vts) instead, which supports multiple vhost_traffic_status_display_format, like `\u003cjson|html|jsonp|prometheus\u003e`.\n\nHope you guys enjoy it, and thanks for all the contributors and the issue finders. 😃\n\n## Table of Contents\n- [nginx-vts-exporter](#nginx-vts-exporter)\n  - [ANN](#ann)\n  - [Table of Contents](#table-of-contents)\n  - [Dependency](#dependency)\n  - [Download](#download)\n  - [Compile](#compile)\n    - [build binary](#build-binary)\n    - [build RPM package](#build-rpm-package)\n    - [build docker image](#build-docker-image)\n  - [Docker Hub Image](#docker-hub-image)\n  - [Run](#run)\n    - [run binary](#run-binary)\n    - [run docker](#run-docker)\n  - [Environment variables](#environment-variables)\n  - [Metrics](#metrics)\n    - [Server main](#server-main)\n    - [Server zones](#server-zones)\n    - [Filter zones](#filter-zones)\n    - [Upstreams](#upstreams)\n\n## Dependency\n\n* [nginx-module-vts](https://github.com/vozlt/nginx-module-vts)\n* [Prometheus](https://prometheus.io/)\n* [Golang](https://golang.org/)\n\n## Download\n\nBinary can be downloaded from [Releases](https://github.com/sysulq/nginx-vts-exporter/releases) page.\n\n## Compile\n\n### build binary\n\n``` shell\nmake\n```\n\n### build RPM package\n``` shell\nmake rpm\n```\n\n### build docker image\n``` shell\nmake docker\n```\n\n## Docker Hub Image\n``` shell\ndocker pull sophos/nginx-vts-exporter:latest\n```\nIt can be used directly instead of having to build the image yourself.\n([Docker Hub sophos/nginx-vts-exporter](https://hub.docker.com/r/sophos/nginx-vts-exporter/))\n\n## Run\n\n### run binary\n``` shell\nnohup /bin/nginx-vts-exporter -nginx.scrape_uri=http://localhost/status/format/json\n```\n\n### run docker\n```\ndocker run  -ti --rm --env NGINX_STATUS=\"http://localhost/status/format/json\" sophos/nginx-vts-exporter\n```\n\n## Environment variables\n\nThis image is configurable using different env variables\n\nVariable name | Default     | Description\n------------- | ----------- | --------------\nNGINX_STATUS |  http://localhost/status/format/json | Nginx JSON format status page\nMETRICS_ENDPOINT | /metrics  | Metrics endpoint exportation URI\nMETRICS_ADDR | :9913 | Metrics exportation address:port\nMETRICS_NS | nginx | Prometheus metrics Namespaces\n\n## Metrics\n\nDocuments about exposed Prometheus metrics.\n\nFor details on the underlying metrics please see [nginx-module-vts](https://github.com/vozlt/nginx-module-vts#json-used-by-status)\n\nFor grafana dashboard please see [nginx-vts-exporter dashboard](https://grafana.com/dashboards/2949)\n\n### Server main\n\n**Metrics details**\n\nNginx data         | Name                            | Exposed informations     \n------------------ | ------------------------------- | ------------------------\n **Info**          | `{NAMESPACE}_server_info`       | hostName, nginxVersion, uptimeSec |\n **Connections**   | `{NAMESPACE}_server_connections`| status [active, reading, writing, waiting, accepted, handled]\n\n**Metrics output example**\n\n``` txt\n# Server Info\nnginx_server_info{hostName=\"localhost\", nginxVersion=\"1.11.1\"} 9527\n# Server Connections\nnginx_server_connections{status=\"accepted\"} 70606\n```\n\n### Server zones\n\n**Metrics details**\n\nNginx data         | Name                            | Exposed informations     \n------------------ | ------------------------------- | ------------------------\n **Requests**      | `{NAMESPACE}_server_requests`    | code [2xx, 3xx, 4xx, 5xx, total], host _(or domain name)_\n **Bytes**         | `{NAMESPACE}_server_bytes`       | direction [in, out], host _(or domain name)_\n **Cache**         | `{NAMESPACE}_server_cache`       | status [bypass, expired, hit, miss, revalidated, scarce, stale, updating], host _(or domain name)_\n\n**Metrics output example**\n\n``` txt\n# Server Requests\nnginx_server_requests{code=\"1xx\",host=\"test.domain.com\"} 0\n\n# Server Bytes\nnginx_server_bytes{direction=\"in\",host=\"test.domain.com\"} 21\n\n# Server Cache\nnginx_server_cache{host=\"test.domain.com\",status=\"bypass\"} 2\n```\n\n### Filter zones\n\n**Metrics details**\n\nNginx data         | Name                              | Exposed informations\n------------------ | --------------------------------- | ------------------------\n **Requests**      | `{NAMESPACE}_filter_requests`     | code [2xx, 3xx, 4xx, 5xx and total], filter, filter name\n **Bytes**         | `{NAMESPACE}_filter_bytes`        | direction [in, out], filter, filter name\n **Response time** | `{NAMESPACE}_filter_responseMsec` | filter, filter name\n\n**Metrics output example**\n\n``` txt\n# Filter Requests\nnginx_upstream_requests{code=\"1xx\", filter=\"country\", filterName=\"BY\"} 0\n\n# Filter Bytes\nnginx_upstream_bytes{direction=\"in\", filter=\"country\", filterName=\"BY\"} 0\n\n# Filter Response time\nnginx_upstream_responseMsec{filter=\"country\", filterName=\"BY\"} 99\n```\n\n\n### Upstreams\n\n**Metrics details**\n\nNginx data         | Name                                | Exposed informations\n------------------ | ----------------------------------- | ------------------------\n **Requests**      | `{NAMESPACE}_upstream_requests`     | code [2xx, 3xx, 4xx, 5xx and total], upstream _(or upstream name)_\n **Bytes**         | `{NAMESPACE}_upstream_bytes`        | direction [in, out], upstream _(or upstream name)_\n **Response time** | `{NAMESPACE}_upstream_responseMsec` | backend (or server), in_bytes, out_bytes, upstream _(or upstream name)_\n\n**Metrics output example**\n\n``` txt\n# Upstream Requests\nnginx_upstream_requests{code=\"1xx\",upstream=\"XXX-XXXXX-3000\"} 0\n\n# Upstream Bytes\nnginx_upstream_bytes{direction=\"in\",upstream=\"XXX-XXXXX-3000\"} 0\n\n# Upstream Response time\nnginx_upstream_responseMsec{backend=\"10.2.15.10:3000\",upstream=\"XXX-XXXXX-3000\"} 99\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysulq%2Fnginx-vts-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysulq%2Fnginx-vts-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysulq%2Fnginx-vts-exporter/lists"}