NGINX metrics
Collect metrics from NGINX
Requirements
ngx_http_stub_status_module
should be enabled.Configuration
Example configurations
{
"sources": {
"my_source_id": {
"type": "nginx_metrics",
"endpoints": [
"http://localhost:8000/basic_status"
],
"scrape_interval_secs": 15
}
}
}
[sources.my_source_id]
type = "nginx_metrics"
endpoints = [ "http://localhost:8000/basic_status" ]
scrape_interval_secs = 15
---
sources:
my_source_id:
type: nginx_metrics
endpoints:
- http://localhost:8000/basic_status
scrape_interval_secs: 15
{
"sources": {
"my_source_id": {
"type": "nginx_metrics",
"endpoints": [
"http://localhost:8000/basic_status"
],
"scrape_interval_secs": 15,
"namespace": "nginx",
"tls": null,
"proxy": null,
"auth": null
}
}
}
[sources.my_source_id]
type = "nginx_metrics"
endpoints = [ "http://localhost:8000/basic_status" ]
scrape_interval_secs = 15
namespace = "nginx"
---
sources:
my_source_id:
type: nginx_metrics
endpoints:
- http://localhost:8000/basic_status
scrape_interval_secs: 15
namespace: nginx
tls: null
proxy: null
auth: null
auth
optional objectauth.password
required string literalauth.strategy
required string literal enumOption | Description |
---|---|
basic | The basic authentication strategy. |
bearer | The bearer token authentication strategy. |
auth.token
required string literalauth.user
required string literalendpoints
required [string]ngx_http_stub_status_module
module.proxy
optional objectproxy.http
optional string literalproxy.https
optional string literalproxy.no_proxy
optional [string]A list of hosts to avoid proxying. Allowed patterns here include:
Pattern | Example match |
---|---|
Domain names | example.com matches requests to example.com |
Wildcard domains | .example.com matches requests to example.com and its subdomains |
IP addresses | 127.0.0.1 matches requests to 127.0.0.1 |
CIDR blocks | 192.168.0.0./16 matches requests to any IP addresses in this range |
Splat | * matches all hosts |
tls
optional objecttls.alpn_protocols
optional [string]Sets the list of supported ALPN protocols.
Declare the supported ALPN protocols, which are used during negotiation with peer. Prioritized in the order they are defined.
tls.ca_file
optional string literalAbsolute path to an additional CA certificate file.
The certificate must be in the DER or PEM (X.509) format. Additionally, the certificate can be provided as an inline string in PEM format.
tls.crt_file
common optional string literalAbsolute path to a certificate file used to identify this server.
The certificate must be in DER, PEM (X.509), or PKCS#12 format. Additionally, the certificate can be provided as an inline string in PEM format.
If this is set, and is not a PKCS#12 archive, key_file
must also be set.
tls.key_file
common optional string literalAbsolute path to a private key file used to identify this server.
The key must be in DER or PEM (PKCS#8) format. Additionally, the key can be provided as an inline string in PEM format.
tls.key_pass
optional string literalPassphrase used to unlock the encrypted key file.
This has no effect unless key_file
is set.
tls.verify_certificate
optional boolEnables certificate verification.
If enabled, certificates must be valid in terms of not being expired, as well as being issued by a trusted issuer. This verification operates in a hierarchical manner, checking that not only the leaf certificate (the certificate presented by the client/server) is valid, but also that the issuer of that certificate is valid, and so on until reaching a root certificate.
Relevant for both incoming and outgoing connections.
Do NOT set this to false
unless you understand the risks of not verifying the validity of certificates.
true
tls.verify_hostname
optional boolEnables hostname verification.
If enabled, the hostname used to connect to the remote host must be present in the TLS certificate presented by the remote host, either as the Common Name or as an entry in the Subject Alternative Name extension.
Only relevant for outgoing connections.
Do NOT set this to false
unless you understand the risks of not verifying the remote hostname.
true
Environment variables
HTTPS_PROXY
common optional string literalThe global URL to proxy HTTPS requests through.
If another HTTPS proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
HTTP_PROXY
common optional string literalThe global URL to proxy HTTP requests through.
If another HTTP proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
NO_PROXY
common optional string literalList of hosts to avoid proxying globally.
Allowed patterns here include:
Pattern | Example match |
---|---|
Domain names | example.com matches requests to example.com |
Wildcard domains | .example.come matches requests to example.com and its subdomains |
IP addresses | 127.0.0.1 matches requests to 127.0.0.1 |
CIDR blocks | 192.168.0.0./16 matches requests to any IP addresses in this range |
Splat | * matches all hosts |
If another no_proxy
value is set in the configuration file or at a component level, this
one is overridden.
The lowercase variant has priority over the uppercase one.
http_proxy
common optional string literalThe global URL to proxy HTTP requests through.
If another HTTP proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
https_proxy
common optional string literalThe global URL to proxy HTTPS requests through.
If another HTTPS proxy is set in the configuration file or at a component level, this one will be overridden.
The lowercase variant has priority over the uppercase one.
no_proxy
common optional string literalList of hosts to avoid proxying globally.
Allowed patterns here include:
Pattern | Example match |
---|---|
Domain names | example.com matches requests to example.com |
Wildcard domains | .example.come matches requests to example.com and its subdomains |
IP addresses | 127.0.0.1 matches requests to 127.0.0.1 |
CIDR blocks | 192.168.0.0./16 matches requests to any IP addresses in this range |
Splat | * matches all hosts |
If another no_proxy
value is set in the configuration file or at a component level, this
one is overridden.
The lowercase variant has priority over the uppercase one.
Outputs
<component_id>
Output Data
Metrics
connections_accepted_total
counterconnections_active
gaugeWaiting
connections.connections_handled_total
counteraccepts
unless some resource limits have been reached (for example, the worker_connections
limit).connections_reading
gaugeconnections_waiting
gaugeconnections_writing
gaugeTelemetry
Metrics
linkcollect_completed_total
countercollect_duration_seconds
histogramcomponent_received_events_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_event_bytes_total
countercomponent_id
instead. The value is the same as component_id
.component_sent_events_total
countercomponent_id
instead. The value is the same as component_id
.events_in_total
countercomponent_received_events_total
instead.component_id
instead. The value is the same as component_id
.events_out_total
countercomponent_sent_events_total
instead.component_id
instead. The value is the same as component_id
.http_request_errors_total
counterparse_errors_total
countersource_lag_time_seconds
histogramcomponent_id
instead. The value is the same as component_id
.