文档文档

Nginx Stream Server Traffic Input Plugin

此插件使用 外部流服务器流量状态模块Nginx Web 服务器收集指标。该模块提供对流主机状态信息的访问,其中包含服务器、上游和缓存的当前状态,类似于 Nginx Plus 的实时活动监控。有关模块配置的详细信息,请参阅模块文档

Introduced in: Telegraf v1.15.0 Tags: server, web OS support: all

全局配置选项

插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md

配置

# Read Nginx virtual host traffic status module information (nginx-module-sts)
[[inputs.nginx_sts]]
  ## An array of ngx_http_status_module or status URI to gather stats.
  urls = ["https:///status", "http+unix:///var/run/nginx.sock:/status"]

  ## HTTP response timeout (default: 5s)
  response_timeout = "5s"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

Metrics

  • nginx_sts_connections

    • 标签 (tags)
      • source
      • port
    • 字段 (fields)
      • active
      • reading
      • writing
      • waiting
      • accepted
      • handled
      • requests
  • nginx_sts_server

    • 标签 (tags)
      • source
      • port
      • zone
    • 字段 (fields)
      • connects
      • in_bytes
      • out_bytes
      • response_1xx_count
      • response_2xx_count
      • response_3xx_count
      • response_4xx_count
      • response_5xx_count
      • session_msec_counter
      • session_msec
  • nginx_sts_filter

    • 标签 (tags)
      • source
      • port
      • filter_name
      • filter_key
    • 字段 (fields)
      • connects
      • in_bytes
      • out_bytes
      • response_1xx_count
      • response_2xx_count
      • response_3xx_count
      • response_4xx_count
      • response_5xx_count
      • session_msec_counter
      • session_msec
  • nginx_sts_upstream

    • 标签 (tags)
      • source
      • port
      • upstream
      • upstream_address
    • 字段 (fields)
      • connects
      • in_bytes
      • out_bytes
      • response_1xx_count
      • response_2xx_count
      • response_3xx_count
      • response_4xx_count
      • response_5xx_count
      • session_msec_counter
      • session_msec
      • upstream_session_msec_counter
      • upstream_session_msec
      • upstream_connect_msec_counter
      • upstream_connect_msec
      • upstream_firstbyte_msec_counter
      • upstream_firstbyte_msec
      • weight
      • max_fails
      • fail_timeout
      • backup
      • down

示例输出

nginx_sts_upstream,host=localhost,port=80,source=127.0.0.1,upstream=backend_cluster,upstream_address=1.2.3.4:8080 upstream_connect_msec_counter=0i,out_bytes=0i,down=false,connects=0i,session_msec=0i,upstream_session_msec=0i,upstream_session_msec_counter=0i,upstream_connect_msec=0i,upstream_firstbyte_msec_counter=0i,response_3xx_count=0i,session_msec_counter=0i,weight=1i,max_fails=1i,backup=false,upstream_firstbyte_msec=0i,in_bytes=0i,response_1xx_count=0i,response_2xx_count=0i,response_4xx_count=0i,response_5xx_count=0i,fail_timeout=10i 1584699180000000000
nginx_sts_upstream,host=localhost,port=80,source=127.0.0.1,upstream=backend_cluster,upstream_address=9.8.7.6:8080 upstream_firstbyte_msec_counter=0i,response_2xx_count=0i,down=false,upstream_session_msec_counter=0i,out_bytes=0i,response_5xx_count=0i,weight=1i,max_fails=1i,fail_timeout=10i,connects=0i,session_msec_counter=0i,upstream_session_msec=0i,in_bytes=0i,response_1xx_count=0i,response_3xx_count=0i,response_4xx_count=0i,session_msec=0i,upstream_connect_msec=0i,upstream_connect_msec_counter=0i,upstream_firstbyte_msec=0i,backup=false 1584699180000000000
nginx_sts_server,host=localhost,port=80,source=127.0.0.1,zone=* response_2xx_count=0i,response_4xx_count=0i,response_5xx_count=0i,session_msec_counter=0i,in_bytes=0i,out_bytes=0i,session_msec=0i,response_1xx_count=0i,response_3xx_count=0i,connects=0i 1584699180000000000
nginx_sts_connections,host=localhost,port=80,source=127.0.0.1 waiting=1i,accepted=146i,handled=146i,requests=13421i,active=3i,reading=0i,writing=2i 1584699180000000000

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2