nginx_request_exporter

Nginx Request Exporter for Prometheus

  • 所有者: markuslindenberg/nginx_request_exporter
  • 平台:
  • 许可证: Apache License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Nginx Request Exporter for Prometheus

This is a Prometheus exporter for Nginx requests.

In contrast to existing exporters nginx_request_exporter does not scrape the stub status module for server status but records statistics for HTTP requests.

By default nginx_request_exporter listens on port 9147 for HTTP requests.

Installation

Using go get

go get github.com/markuslindenberg/nginx_request_exporter

Using Docker

docker pull markuslindenberg/nginx_request_exporter
docker run --rm -p 9147:9147 -p 9514:9514/udp markuslindenberg/nginx_request_exporter

Configuration

nginx_request_exporter consumes access log records using the syslog protocol. Nginx needs to be configured to log to nginx_request_exporter's syslog port. To enable syslog logging add a access_log statement to your Nginx configuration:

access_log syslog:server=127.0.0.1:9514 prometheus;

Log format

nginx_request_exporter uses a custom log format that needs to be defined in the http context.

The format has to only include key/value pairs:

  • A key/value pair delimited by a colon denotes a metric name&value
  • A key/value pair delimited by a equal sign denotes a label name&value that is added to all metrics.

Example:

log_format prometheus 'time:$request_time status=$status host="$host" method="$request_method" upstream="$upstream_addr"';

Multiple metrics can be recorded and all variables available in Nginx can be used.
Currently nginx_request_exporter has to be restarted when the log format is changed.

主要指标

概览
名称与所有者markuslindenberg/nginx_request_exporter
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证Apache License 2.0
所有者活动
创建于2016-05-10 20:13:31
推送于2017-11-16 11:05:42
最后一次提交2017-05-05 22:50:17
发布数0
用户参与
星数59
关注者数5
派生数11
提交数12
已启用问题?
问题数4
打开的问题数2
拉请求数3
打开的拉请求数1
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?