---
title: Telegraf Documentation
description: Telegraf plugin for collecting metrics from Nginx Stream Server Traffic
url: https://docs.influxdata.com/telegraf/v1/input-plugins/nginx_sts/
estimated_tokens: 1771
product: Telegraf
version: v1
---

-   Telegraf v1.15.0+

# Nginx Stream Server Traffic Input Plugin

This plugin gathers metrics from the [Nginx web server](https://www.nginx.com) using the [external stream server traffic status module](https://github.com/vozlt/nginx-module-sts). This module provides access to stream host status information containing the current status of servers, upstreams and caches, similar to the live activity monitoring of Nginx plus. For module configuration details please see the [module documentation](https://github.com/vozlt/nginx-module-sts#synopsis).

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

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# 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 = ["http://localhost/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

## Example Output

```text
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
```

#### Related

-   [Configure plugins](/telegraf/v1/configure_plugins/)
-   [Nginx Stream Server Traffic Plugin Source](https://github.com/influxdata/telegraf/tree/v1.38.4/plugins/inputs/nginx_sts/README.md)
