nginxossreceiver

package
v3.0.0-...-f3ec0d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

NGINX Receiver

This receiver can fetch stats from a NGINX instance via two sources:

  • The ngx_http_stub_status_module module's status endpoint.
  • The NGINX access logs.

Configuration

NGINX Module

You must configure NGINX to expose status information by editing the NGINX configuration.
Please see ngx_http_stub_status_module for a guide to configuring the NGINX stats module ngx_http_stub_status_module.

You must also configure an access log as well. Please see Setting Up the Access Log for a guide to configuring an access log.

Receiver Config

The following settings are required:

  • endpoint (default: http://localhost:80/status): The URL of the NGINX status endpoint

The following settings are optional:

  • collection_interval (default = 10s): This receiver collects metrics on an interval. This value must be a string readable by Golang's time.ParseDuration. Valid time units are ns, us (or µs), ms, s, m, h.

  • initial_delay (default = 1s): defines how long this receiver waits before starting.

  • access_logs (default = []): defines a list of access logs to scrape.

    • file_path: The file path to the access log.
    • log_format: The format of the access log.

Example:

receivers:
  nginx:
    endpoint: "http://localhost:80/status"
    collection_interval: 10s
    access_logs:
      - log_format: "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"\"$upstream_cache_status\""
        file_path: "/var/log/nginx/access-custom.conf"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

nolint: ireturn

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL