Skip to content

Commit 08e1f5b

Browse files
committed
feat: Add custom OTel configuration section
1 parent 2358d56 commit 08e1f5b

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

content/nginx-one/agent/metrics/configure-otel-metrics.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,91 @@ You can validate that metrics are successfully exported by using the methods bel
3939
```text
4040
Everything is ready. Begin running and processing data.
4141
```
42+
43+
### Custom OTel Configuration
44+
45+
NGINX Agent generates a default OpenTelemetry config to send metrics to your management plane located at `/etc/nginx-agent/opentelemetry-collector-agent.yaml`. An option is provided to
46+
bring your own OpenTelemetry configs which will be merged with the NGINX Agent default config.
47+
48+
OpenTelemetry will merge your [OpenTelemetry Config](https://opentelemetry.io/). The order of the OpenTelemetry config files matters,
49+
the last config in the list will take priority over others listed if they have the same value configured.
50+
51+
To have NGINX Agent use your own OpenTelemetry config:
52+
53+
1. Edit the configuration file `sudo vim /etc/nginx-agent/nginx-agent.conf`
54+
2. Add the collector property
55+
56+
```yaml
57+
collector:
58+
additional_config_paths:
59+
- "/my_config.yaml"
60+
```
61+
62+
### Example usage:
63+
64+
{{< call-out "important" >}} NGINX Agent uses `/default` for naming its default processors, exporters and pipelines using the same naming in your own config might cause issues with sending metrics to your management plane {{< /call-out >}}
65+
66+
#### Add Prometheus Exporter
67+
```yaml
68+
exporters:
69+
prometheus:
70+
endpoint: "127.0.0.1:5643"
71+
resource_to_telemetry_conversion:
72+
enabled: true
73+
74+
service:
75+
pipelines:
76+
metrics/prometheus-example-pipeline:
77+
receivers:
78+
- containermetrics
79+
- hostmetrics
80+
processors:
81+
- resource/default
82+
exporters:
83+
- prometheus
84+
```
85+
86+
#### Add Debug Exporter
87+
```yaml
88+
exporters:
89+
debug:
90+
verbosity: detailed
91+
sampling_initial: 5
92+
sampling_thereafter: 200
93+
94+
service:
95+
pipelines:
96+
metrics/debug-example-pipeline:
97+
receivers:
98+
- containermetrics
99+
- hostmetrics
100+
processors:
101+
- resource/default
102+
exporters:
103+
- debug
104+
```
105+
106+
107+
#### Debug Merging Configs
108+
109+
To view the merged OpenTelemetry configuration set the Agent log level to debug in `/etc/nginx-agent/nginx-agent.conf` and restart NGINX Agent
110+
111+
1. Edit the configuration file `sudo vim /etc/nginx-agent/nginx-agent.conf`
112+
2. Change the log property
113+
```yaml
114+
log:
115+
level: debug
116+
```
117+
3. Restart NGINX Agent
118+
4. View merged OpenTelemetry configuration `cat /var/lib/nginx-agent/opentelemetry-collector-agent-debug.yaml`
119+
120+
121+
122+
123+
124+
125+
126+
127+
128+
129+

0 commit comments

Comments
 (0)