| 1 | <!--startmeta |
| 2 | custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/crates/netdata-otel/otel-plugin/README.md" |
| 3 | meta_yaml: "https://github.com/netdata/netdata/edit/master/src/crates/netdata-otel/otel-plugin/metadata.yaml" |
| 4 | sidebar_label: "OpenTelemetry" |
| 5 | learn_status: "Published" |
| 6 | learn_rel_path: "Collecting Metrics/Collectors/Cloud and DevOps" |
| 7 | keywords: ['opentelemetry', 'otel', 'otlp', 'grpc', 'metrics', 'logs', 'observability'] |
| 8 | message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" |
| 9 | endmeta--> |
| 10 | |
| 11 | # OpenTelemetry |
| 12 | |
| 13 | |
| 14 | <img src="https://netdata.cloud/img/opentelemetry.svg" width="150"/> |
| 15 | |
| 16 | |
| 17 | Plugin: otel.plugin |
| 18 | Module: otel |
| 19 | |
| 20 | <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> |
| 21 | |
| 22 | ## Overview |
| 23 | |
| 24 | This plugin enables the Netdata Agent to receive OpenTelemetry metrics and logs |
| 25 | via the OTLP/gRPC protocol from any compatible source — collectors, SDKs, or |
| 26 | instrumented applications. |
| 27 | |
| 28 | Metrics are automatically visualized as Netdata charts with full alerting support. |
| 29 | Logs are stored in systemd-compatible journal files and can be explored through |
| 30 | the Netdata Logs tab. |
| 31 | |
| 32 | |
| 33 | The plugin listens on a configurable gRPC endpoint for incoming OTLP data. |
| 34 | |
| 35 | Incoming metrics are mapped to Netdata charts using YAML mapping rules placed in the |
| 36 | chart configs directory (default `/etc/netdata/otel.d/v1/metrics/`). Each file can |
| 37 | contain entries that match metrics by instrumentation scope and metric name, and control |
| 38 | how data point attributes translate to chart instances and dimensions. Per-metric |
| 39 | overrides for the collection interval and grace period are also supported. Without a |
| 40 | matching rule, the plugin creates charts using default settings. Charts with no incoming |
| 41 | data are automatically expired and removed. |
| 42 | |
| 43 | | Mapping file option | Description | |
| 44 | |:--------------------|:------------| |
| 45 | | `instrumentation_scope.name` | Regex to match the instrumentation scope name | |
| 46 | | `instrumentation_scope.version` | Regex to match the instrumentation scope version | |
| 47 | | `dimension_attribute_key` | Data point attribute whose value becomes the dimension name | |
| 48 | | `interval_secs` | Per-metric collection interval override (1–3600 seconds) | |
| 49 | | `grace_period_secs` | Per-metric grace period override | |
| 50 | |
| 51 | Incoming logs are written to journal files with configurable rotation and retention |
| 52 | policies. |
| 53 | |
| 54 | |
| 55 | This collector is only supported on the following platforms: |
| 56 | |
| 57 | - Linux |
| 58 | |
| 59 | This collector only supports collecting metrics from a single instance of this integration. |
| 60 | |
| 61 | |
| 62 | ### Default Behavior |
| 63 | |
| 64 | #### Auto-Detection |
| 65 | |
| 66 | The plugin starts automatically and listens on `127.0.0.1:4317` for incoming OTLP/gRPC connections. |
| 67 | |
| 68 | |
| 69 | #### Limits |
| 70 | |
| 71 | The default configuration for this integration does not impose any limits on data collection. |
| 72 | |
| 73 | #### Performance Impact |
| 74 | |
| 75 | The default configuration for this integration is not expected to impose a significant performance impact on the system. |
| 76 | |
| 77 | ## Setup |
| 78 | |
| 79 | |
| 80 | ### Prerequisites |
| 81 | |
| 82 | #### OpenTelemetry data source |
| 83 | |
| 84 | An OpenTelemetry Collector, SDK, or instrumented application configured to send OTLP data |
| 85 | to the Netdata agent's gRPC endpoint. |
| 86 | |
| 87 | |
| 88 | |
| 89 | ### Configuration |
| 90 | |
| 91 | #### Options |
| 92 | |
| 93 | The plugin is configured via `otel.yaml` in the Netdata configuration directory. |
| 94 | Only the fields you want to change need to be specified. |
| 95 | |
| 96 | Any option can also be overridden via environment variables with the `NETDATA_OTEL_` |
| 97 | prefix (highest priority). The variable name is the config option in all caps with |
| 98 | dots replaced by underscores — e.g. `endpoint.tls_cert_path` becomes |
| 99 | `NETDATA_OTEL_ENDPOINT_TLS_CERT_PATH`. |
| 100 | |
| 101 | |
| 102 | <details open><summary>Config options</summary> |
| 103 | |
| 104 | |
| 105 | |
| 106 | | Option | Description | Default | Required | |
| 107 | |:-----|:------------|:--------|:---------:| |
| 108 | | endpoint.path | gRPC endpoint to listen on for incoming OTLP data. | 127.0.0.1:4317 | no | |
| 109 | | endpoint.tls_cert_path | Path to TLS certificate file. Enables TLS when provided. | | no | |
| 110 | | endpoint.tls_key_path | Path to TLS private key file. Required when TLS certificate is provided. | | no | |
| 111 | | endpoint.tls_ca_cert_path | Path to TLS CA certificate file for client authentication. | | no | |
| 112 | | [metrics.chart_configs_dir](#option-metrics-chart-configs-dir) | Directory containing metric mapping YAML files. | /etc/netdata/otel.d/v1/metrics/ | no | |
| 113 | | metrics.interval_secs | Collection interval in seconds (1–3600). Defines the Netdata chart update frequency. | 10 | no | |
| 114 | | metrics.grace_period_secs | Grace period in seconds. After the last data point, the plugin waits this long before gap-filling. | 60 | no | |
| 115 | | metrics.expiry_duration_secs | Expiry duration in seconds. Charts with no data for this long are removed. | 900 | no | |
| 116 | | [metrics.max_new_charts_per_request](#option-metrics-max-new-charts-per-request) | Maximum new charts created per gRPC request. | 100 | no | |
| 117 | | logs.journal_dir | Directory to store journal files for ingested logs. | | yes | |
| 118 | | logs.size_of_journal_file | Maximum file size before rotating to a new journal file. | 100MB | no | |
| 119 | | logs.entries_of_journal_file | Maximum log entries per journal file. | 50000 | no | |
| 120 | | logs.duration_of_journal_file | Maximum time span within a single journal file. | 2 hours | no | |
| 121 | | logs.number_of_journal_files | Maximum number of journal files to keep. | 10 | no | |
| 122 | | logs.size_of_journal_files | Maximum total size of all journal files. | 1GB | no | |
| 123 | | logs.duration_of_journal_files | Maximum age of journal files. | 7 days | no | |
| 124 | | [logs.store_otlp_json](#option-logs-store-otlp-json) | Store the complete OTLP JSON in each log entry. | no | no | |
| 125 | |
| 126 | <a id="option-metrics-chart-configs-dir"></a> |
| 127 | ##### metrics.chart_configs_dir |
| 128 | |
| 129 | Each file defines how OTLP metrics are mapped to Netdata charts. |
| 130 | Files can match metrics by instrumentation scope and name, set the |
| 131 | dimension attribute key, and override timing parameters. The plugin |
| 132 | ships stock mappings; user files in this directory take priority. |
| 133 | |
| 134 | |
| 135 | <a id="option-metrics-max-new-charts-per-request"></a> |
| 136 | ##### metrics.max_new_charts_per_request |
| 137 | |
| 138 | Limits cardinality explosion from high-cardinality label combinations. |
| 139 | |
| 140 | |
| 141 | <a id="option-logs-store-otlp-json"></a> |
| 142 | ##### logs.store_otlp_json |
| 143 | |
| 144 | Useful for debugging and reprocessing, but increases storage usage. |
| 145 | |
| 146 | |
| 147 | |
| 148 | </details> |
| 149 | |
| 150 | |
| 151 | |
| 152 | #### via File |
| 153 | |
| 154 | The configuration file name for this integration is `otel.yaml`. |
| 155 | |
| 156 | |
| 157 | You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the |
| 158 | Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory). |
| 159 | |
| 160 | ```bash |
| 161 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 162 | sudo ./edit-config otel.yaml |
| 163 | ``` |
| 164 | |
| 165 | ##### Examples |
| 166 | |
| 167 | ###### Basic configuration |
| 168 | |
| 169 | Listen on default endpoint with default settings. |
| 170 | |
| 171 | ```yaml |
| 172 | endpoint: |
| 173 | path: "127.0.0.1:4317" |
| 174 | metrics: |
| 175 | chart_configs_dir: /etc/netdata/otel.d/v1/metrics/ |
| 176 | interval_secs: 10 |
| 177 | grace_period_secs: 60 |
| 178 | expiry_duration_secs: 900 |
| 179 | max_new_charts_per_request: 100 |
| 180 | logs: |
| 181 | journal_dir: /var/log/netdata/otel-journals |
| 182 | |
| 183 | ``` |
| 184 | ###### Partial user override |
| 185 | |
| 186 | Override only specific fields in the user config. All other settings |
| 187 | are inherited from the stock config. Unknown fields are ignored for |
| 188 | forward compatibility. |
| 189 | |
| 190 | |
| 191 | <details open><summary>Config</summary> |
| 192 | |
| 193 | ```yaml |
| 194 | endpoint: |
| 195 | path: "0.0.0.0:4317" |
| 196 | logs: |
| 197 | number_of_journal_files: 20 |
| 198 | duration_of_journal_files: "14 days" |
| 199 | |
| 200 | ``` |
| 201 | </details> |
| 202 | |
| 203 | ###### Metric mapping file |
| 204 | |
| 205 | Place YAML files like this in `/etc/netdata/otel.d/v1/metrics/` to control how |
| 206 | OTLP metrics are mapped to Netdata charts. This example maps metrics from the |
| 207 | OpenTelemetry Collector hostmetrics receiver. |
| 208 | |
| 209 | |
| 210 | <details open><summary>Config</summary> |
| 211 | |
| 212 | ```yaml |
| 213 | metrics: |
| 214 | "system.network.connections": |
| 215 | - instrumentation_scope: |
| 216 | name: .*hostmetricsreceiver.*networkscraper$ |
| 217 | dimension_attribute_key: state |
| 218 | |
| 219 | "system.cpu.utilization": |
| 220 | - instrumentation_scope: |
| 221 | name: .*hostmetricsreceiver.*cpuscraper$ |
| 222 | dimension_attribute_key: state |
| 223 | |
| 224 | "system.memory.usage": |
| 225 | - instrumentation_scope: |
| 226 | name: .*hostmetricsreceiver.*memoryscraper$ |
| 227 | dimension_attribute_key: state |
| 228 | interval_secs: 5 |
| 229 | |
| 230 | ``` |
| 231 | </details> |
| 232 | |
| 233 | ###### TLS-enabled configuration |
| 234 | |
| 235 | Listen with TLS enabled for secure connections. |
| 236 | |
| 237 | <details open><summary>Config</summary> |
| 238 | |
| 239 | ```yaml |
| 240 | endpoint: |
| 241 | path: "0.0.0.0:4317" |
| 242 | tls_cert_path: /etc/netdata/ssl/cert.pem |
| 243 | tls_key_path: /etc/netdata/ssl/key.pem |
| 244 | metrics: |
| 245 | chart_configs_dir: /etc/netdata/otel.d/v1/metrics/ |
| 246 | interval_secs: 10 |
| 247 | grace_period_secs: 60 |
| 248 | expiry_duration_secs: 900 |
| 249 | max_new_charts_per_request: 100 |
| 250 | logs: |
| 251 | journal_dir: /var/log/netdata/otel-journals |
| 252 | |
| 253 | ``` |
| 254 | </details> |
| 255 | |
| 256 | |
| 257 | |
| 258 | ## Alerts |
| 259 | |
| 260 | There are no alerts configured by default for this integration. |
| 261 | |
| 262 | |
| 263 | ## Metrics |
| 264 | |
| 265 | Metrics are dynamically created based on the OpenTelemetry data received. |
| 266 | The specific metrics depend on the OTLP sources sending data to the plugin. |
| 267 | |
| 268 |