﻿---
title: Nginx OpenTelemetry Integration
description: Nginx is a high-performance web server, reverse proxy, and load balancer. This integration collects Nginx telemetry through OpenTelemetry Collector receivers...
url: https://docs-v3-preview.elastic.dev/elastic/integration-docs/tree/main/reference/nginx_otel_integration
products:
  - Elastic integrations
applies_to:
  - Serverless Observability projects: Preview
  - Serverless Security projects: Preview
  - Elastic Stack: Preview since 9.4
---

# Nginx OpenTelemetry Integration
|                                                                                                                               |                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| **Version**                                                                                                                   | 0.1.0 <applies-to>: Preview</applies-to> ([View all](#changelog)) |
| **Subscription level**[What's this?](https://www.elastic.co/subscriptions)                                                    | Basic                                                             |
| **Developed by**[What's this?](https://docs-v3-preview.elastic.dev/elastic/integration-docs/tree/main/reference/developed-by) | Elastic                                                           |
| **Minimum Kibana version(s)**                                                                                                 | 9.4.0                                                             |

<admonition title="The Nginx (OpenTelemetry) integration v0.1.0 is in technical preview">
  To use pre-release integrations, go to the **Integrations** page in Kibana, scroll down, and toggle on the _Display beta integrations_ option.
</admonition>

[Nginx](https://nginx.org/) is a high-performance web server, reverse proxy, and load balancer.

## Overview

This integration collects Nginx telemetry through OpenTelemetry Collector receivers managed by Elastic Agent:
- **Metrics** (`nginxreceiver.otel`) — stub_status request count, accepted and handled connections, and current connections by state (active, reading, writing, waiting), scraped by the [nginxreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/nginxreceiver)
- **Access logs** (`nginx.access.otel`) — HTTP access log lines tailed by the [filelogreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver) and parsed by a transform processor into fields such as `http.request.method`, `http.response.status_code`, `url.original`, `url.path`, `source.address`, `network.protocol.version`, and `user_agent.name`
- **Error logs** (`nginx.error.otel`) — error log lines tailed by the filelogreceiver, with multiline support, parsed into `severity_text`, `process.pid`, `thread.id`, and request details from the message (`source.address`, `http.request.method`)

Metrics and logs are stored with the native OTel schema — no field renaming or custom mapping is applied.
Once data starts flowing, the **[NGINX OpenTelemetry Assets](https://www.elastic.co/docs/reference/integrations/nginx_otel)** package provides dashboards, alerting rule templates, and SLO templates.

## Compatibility

This integration requires Nginx with the `stub_status` module enabled. It has been tested with Nginx 1.27 and Elastic Stack 9.4.0+.

## Requirements

You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended, or self-manage the Elastic Stack on your own hardware.
The Elastic Agent (or EDOT Collector) must be able to reach the Nginx `stub_status` endpoint and read the access and error log files.

## Prerequisites


| Requirement         | Details                                                                         |
|---------------------|---------------------------------------------------------------------------------|
| **Nginx**           | `stub_status` module enabled and a reachable status URL                         |
| **Log files**       | Agent must have read access to the access and error log paths                   |
| **Elastic Stack**   | 9.4.0+                                                                          |
| **Input packages**  | `nginx_otel_input` and `filelog_otel` (installed automatically as dependencies) |
| **Content package** | `nginx_otel` (installed automatically as a dependency)                          |


## Setup

1. Enable `stub_status` in Nginx and confirm the endpoint is reachable from the agent host. For example:
   ```
   server {
       listen 80;
       server_name localhost;
       location /nginx_status {
           stub_status on;
           allow 127.0.0.1;
           deny all;
       }
   }
   ```
2. Confirm the agent can read the access and error log files (typically `/var/log/nginx/access.log` and `/var/log/nginx/error.log`).
3. Add the integration in Kibana:
   - Go to **Management** → **Integrations** → search for "Nginx (OpenTelemetry)"
- Click **Add Nginx (OpenTelemetry)**
- Set **Nginx Status Endpoint** to your `stub_status` URL
- Confirm the access and error log paths match your host
- Set **Timezone** on error logs to the Nginx host IANA zone if it is not UTC (error timestamps have no offset)


### Verify data

In **Discover**:
- Metrics: `data_stream.dataset: "nginxreceiver.otel"`
- Access logs: `data_stream.dataset: "nginx.access.otel"`
- Error logs: `data_stream.dataset: "nginx.error.otel"`


## Reference


### Metrics


| Signal  | Data stream                    | Fields                                                                                                                                              |
|---------|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| Metrics | `metrics-nginxreceiver.otel-*` | [NGINX receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/nginxreceiver/documentation.md) |


| Metric                       | Description                                                                       | Type    |
|------------------------------|-----------------------------------------------------------------------------------|---------|
| `nginx.requests`             | Total number of client requests                                                   | Counter |
| `nginx.connections_accepted` | Total number of accepted client connections                                       | Counter |
| `nginx.connections_handled`  | Total number of handled connections                                               | Counter |
| `nginx.connections_current`  | Current client connections by `state` (`active`, `reading`, `writing`, `waiting`) | Gauge   |


### Logs


| Signal      | Data stream                | Notes                                                                                                                                    |
|-------------|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| Access logs | `logs-nginx.access.otel-*` | Combined access log format, parsed by `transform/parse_nginx_access`                                                                     |
| Error logs  | `logs-nginx.error.otel-*`  | Multiline entries start with `YYYY/MM/DD HH:MM:SS` (no offset). Set **Timezone** to the Nginx host IANA zone so `@timestamp` is correct. |


## Changelog

<dropdown title="Changelog">
  | Version   | Details                                                                                                                                                                                                                | Minimum Kibana version |
  |-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
  | **0.1.0** | **Enhancement** ([View pull request](https://github.com/elastic/integrations/pull/21202))Initial release of the Nginx OpenTelemetry composable integration for metrics via nginxreceiver and logs via filelogreceiver. | 9.4.0                  |
</dropdown>