<!-- review: finished -->

<a id="external-otel"></a>

# OTel

OTel 模块提供对 OpenTelemetry 分布式追踪的支持。
该模块支持 W3C 上下文传播和 OTLP/gRPC 导出协议。

<a id="installation-21"></a>

## 安装

要 [安装](https://cn.angie.software//angie/docs/installation/index.md#install-packages) 该模块，请使用以下软件包之一：

- Angie：`angie-module-otel`
- Angie PRO：`angie-pro-module-otel`

<a id="loading-the-module-21"></a>

## 加载模块

要使用该模块，必须在 `main{}` 上下文中加载它：

```nginx
load_module modules/ngx_otel_module.so;
```

<a id="configuration-example-95"></a>

## 配置示例

```nginx
http {
    otel_exporter {
        endpoint localhost:4317;
    }

    server {
        listen 80;

        location / {
            otel_trace         on;
            otel_trace_context inject;

            proxy_pass http://backend;
        }
    }
}
```

<a id="additional-information-22"></a>

## 更多信息

详细文档和源代码可在以下位置获取：
[https://github.com/nginxinc/nginx-otel](https://github.com/nginxinc/nginx-otel)
