SigNoz Cloud - This page is relevant for SigNoz Cloud editions.
Self-Host - This page is relevant for self-hosted SigNoz editions.

NGINX Opentelemetry Instrumentation

This document contains instructions on how to set up OpenTelemetry instrumentation in your NGINX Web Servers and send Traces, Metrics and Logs to SigNoz.

Send traces to SigNoz Cloud

Based on your application environment, you can choose the setup below to send traces to SigNoz Cloud.

From VMs, there are two ways to send data to SigNoz Cloud.

Send traces directly to SigNoz cloud

Step 1 : Install NGINX module

apt-get update && apt-get install -y nginx-otel-module

Step 2: Configure NGINX

Add the following to top of your nginx.conf file, this will load the installed module.

load_module modules/ngx_http_opentelemetry_module.so;

http {
  opentelemetry_config /etc/nginx/opentelemetry_config.yaml;
}

Step 3: Make OpenTelemetry configuration file

Modify the /etc/nginx/opentelemetry_config.yaml with following:

opentelemetry_config.yaml
service_name: <service_name>
sampler:
  type: always_on
exporter:
  otlp:
    endpoint: https://ingest.<region>.signoz.cloud:443/v1/traces
    headers:
      signoz-ingestion-key: <your-ingestion-key>
  • Set the <region> to match your SigNoz Cloud region
  • Replace <your-ingestion-key> with your SigNoz ingestion key
  • <service_name> is name of your service

Step 4: Restart NGINX

Restart nginx using the below command:

systemctl restart nginx

The traces should start getting generated.

Send traces via OTel Collector binary

Step 1. Install OTel Collector binary

OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes.

You can find instructions to install OTel Collector binary here in your VM.

Step 2 : Install NGINX module

apt-get update && apt-get install -y nginx-otel-module

Step 3: Configure NGINX

Add the following to top of your nginx.conf file, this will load the installed module.

nginx.conf
load_module modules/ngx_http_opentelemetry_module.so;

http {
  opentelemetry_config /etc/nginx/opentelemetry_config.yaml;
}

Step 4: Make OpenTelemetry configuration file

Modify the /etc/nginx/opentelemetry_config.yaml with following:

opentelemetry_config.yaml
service_name: <service_name>
sampler:
  type: always_on
exporter:
  otlp:
    endpoint: http://localhost:4318/v1/traces
  • <service_name> is name of your service

Step 5: Restart NGINX

Restart nginx using the below command:

systemctl restart nginx

The traces should start getting generated.

Send metrics to SigNoz Cloud

Step 1. Install OTel Collector binary

OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes.

You can find instructions to install OTel Collector binary here in your VM.

Step 2. Add /status route to nginx.conf

Add the following block to your nginx.conf, this adds /status route to the NGINX server. This will serve the metrics.

nginx.conf
server {

location /status {
stub_status on;
}

Step 3. Modify config.yaml of Otel Collector

Add the following in config.yaml of otel-col.

config.yaml
receivers:
  nginx:
    endpoint: 'http://localhost:80/status'
    collection_interval: 10s

service:
  telemetry:
    metrics:
      level: basic
  pipelines:
    metrics:
      receivers: [otlp, nginx]
      processors: [batch]
      exporters: [otlp]
    logs:
      receivers: [filelog]
      processors: [attributes]
      exporters: [otlp]

Step 4. Run the NGINX server

Execute the following command to run otel-col in background.

./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$\!" > otel-pid

Send logs to SigNoz Cloud

Logs for NGINX are enabled and stored on the path /var/log/nginx/access.log. We can export the logs to SigNoz as follows.

Step 1. Install OTel Collector binary

OTel Collector binary helps to collect logs, hostmetrics, resource and infra attributes.

You can find instructions to install OTel Collector binary here in your VM.

Step 2. Modify config.yaml of Otel Collector

Add the following in config.yaml of otel-col.

config.yaml
filelog:
  include:
    - /var/log/nginx/*.log

Step 3. Run the NGINX server

Execute the following command to run otel-col in background.

./otelcol-contrib --config ./config.yaml &> otelcol-output.log & echo "$\!" > otel-pid

Sample NGINX Application

We have included a sample NGINX Server at Sample NGINX Server Github Repo

Monitor NGINX Logs

Follow this documentation for monitoring NGINX logs.

Last updated: January 17, 2026

Edit on GitHub

Was this page helpful?