mbaran0v.ansible_role_prometheus_nginxlog_exporter

Ansible 角色: prometheus-nginxlog-exporter

构建状态 许可证 GitHub 标签 开源支持 欢迎提交 PR

这是一个用于安装和配置 Prometheus Nginx 日志导出器 的 Ansible 角色。目前这个角色适用于 Debian 和 RedHat 基础的 Linux 系统。测试平台包括:

  • Ubuntu 16.04
  • CentOS 7

要求

没有特殊要求;请注意,该角色需要 root 访问权限,因此请在 playbook 中设置 global become: yes。

角色变量

可以传递给该角色的变量及其简要描述如下。(有关所有变量,请查看 defaults/main.yml)

nginxlog_exporter_version: 1.3.0

安装版本

nginxlog_exporter_listen_port: 4040

监听端口

nginxlog_exporter_root_dir: /opt/nginxlog_exporter

安装目录

nginxlog_exporter_config_vars: |
  listen:
    port: {{ nginxlog_exporter_listen_port }}
    address: {{ nginxlog_exporter_listen_address }}
  namespaces:
    - name: nginx
      format: "$remote_addr [$time_local] \"$request\" $status $body_bytes_sent $request_time $upstream_response_time"
      source_files:
        - "/var/log/nginx/exporter.log"
      histogram_buckets: [.1, .3, .5, .7, 1, 3, 5, 7]

配置文件 https://github.com/martin-helmich/prometheus-nginxlog-exporter#configuration-file

依赖

示例 Playbook

- hosts: app
  become: yes
  roles:
      - mbaran0v.prometheus-nginxlog-exporter

许可证

MIT / BSD

作者信息

该角色由 Maxim Baranov 于 2019 年创建。

关于项目

Prometheus Nginx access log Exporter https://github.com/martin-helmich/prometheus-nginxlog-exporter

安装
ansible-galaxy install mbaran0v.ansible_role_prometheus_nginxlog_exporter
许可证
Unknown
下载
1.1M
拥有者
Experienced DevOps Engineer