@@ -2313,6 +2313,122 @@ In case of `child` instance it is a bit simpler. By default, hostPath: `/var/lib
23132313in: ` /var/lib/netdata ` . You can disable it, but this option is pretty much required in a real life scenario, as without
23142314it each pod deletion will result in a new replication node for a parent.
23152315
2316+ ### Collecting logs with OpenTelemetry
2317+
2318+ Netdata can ingest, store, and visualize your cluster's container logs through OpenTelemetry.
2319+ This relies on two components — ** both disabled by default** :
2320+
2321+ - ** ` netdataOpentelemetry ` ** — Netdata's OpenTelemetry receiver. It runs as its own ` Deployment `
2322+ (the ` netdata-otel ` node) and listens for OTLP data on port ` 4317 ` . It receives, stores, and
2323+ displays the logs in the Netdata UI. It does ** not** collect logs itself.
2324+ - ** ` otel-collector ` ** — the upstream [ OpenTelemetry Collector] ( https://opentelemetry.io/docs/platforms/kubernetes/helm/collector/ ) ,
2325+ bundled as an optional subchart. It runs as a ` DaemonSet ` (one pod per node), reads each node's
2326+ local container log files, and forwards them over OTLP to ` netdataOpentelemetry ` .
2327+
2328+ ` netdataOpentelemetry ` is the destination; ` otel-collector ` is what feeds it. The collector is
2329+ bundled only as a convenient, working default, and is off by default because it is not the only
2330+ option. If you already run a log pipeline (Fluent Bit, Vector, an existing Collector, or any
2331+ OTLP-capable agent), leave ` otel-collector ` disabled and point that pipeline's OTLP exporter at
2332+ the ` netdata-otel ` service on port ` 4317 ` instead.
2333+
2334+ ** Log flow:**
2335+
2336+ ```
2337+ container stdout/stderr
2338+ │ the container runtime writes them to node-local files (/var/log/pods/…)
2339+ ▼
2340+ otel-collector DaemonSet (one pod per node, needs host log access)
2341+ │ reads each node's log files, pushes over OTLP
2342+ ▼
2343+ netdata-otel:4317 → stored and shown in the Netdata UI
2344+ ```
2345+
2346+ #### Securing the endpoint with TLS
2347+
2348+ By default the ` netdata-otel ` receiver listens on port ` 4317 ` in ** plaintext** — TLS is ** disabled**
2349+ (` tls_cert_path ` , ` tls_key_path ` , and ` tls_ca_cert_path ` are unset in
2350+ ` netdataOpentelemetry.configs.otel.data ` ). The steps below turn it on with a self-signed
2351+ certificate. TLS affects ** both sides** : the receiver must serve the certificate, and every client
2352+ (including the bundled ` otel-collector ` ) must be switched to TLS, or it will stop delivering data.
2353+
2354+ ** 1. Generate a self-signed certificate and key** (Linux, ` openssl ` ):
2355+
2356+ ```
2357+ openssl req -x509 -newkey rsa:4096 -nodes \
2358+ -keyout tls.key -out tls.crt -days 365 \
2359+ -subj "/CN=netdata-otel"
2360+ ```
2361+
2362+ ** 2. Create a Kubernetes TLS secret** from those files, in the chart's namespace:
2363+
2364+ ```
2365+ kubectl create secret tls netdata-otel-tls \
2366+ --cert=tls.crt --key=tls.key \
2367+ --namespace <your-namespace>
2368+ ```
2369+
2370+ ** 3. Mount the secret into the receiver and point the config at it.** The certificate paths live
2371+ inside ` netdataOpentelemetry.configs.otel.data ` , which is a single block — supply it in full with
2372+ the two ` tls_*_path ` values filled in (keep the ` metrics ` and ` logs ` sections in sync with the
2373+ chart's ` values.yaml ` ). Mounting the secret alone does nothing until these paths are set:
2374+
2375+ ``` yaml
2376+ netdataOpentelemetry :
2377+ extraVolumes :
2378+ - name : otel-tls
2379+ secret :
2380+ secretName : netdata-otel-tls
2381+ extraVolumeMounts :
2382+ - name : otel-tls
2383+ mountPath : /etc/netdata/otel-certs
2384+ readOnly : true
2385+ configs :
2386+ otel :
2387+ data : |
2388+ endpoint:
2389+ path: "0.0.0.0:4317"
2390+ tls_cert_path: /etc/netdata/otel-certs/tls.crt
2391+ tls_key_path: /etc/netdata/otel-certs/tls.key
2392+ tls_ca_cert_path: null
2393+ metrics:
2394+ print_flattened: false
2395+ buffer_samples: 10
2396+ throttle_charts: 100
2397+ chart_configs_dir: otel.d/v1/metrics
2398+ logs:
2399+ journal_dir: otel/v1
2400+ size_of_journal_file: "100MB"
2401+ number_of_journal_files: 10
2402+ size_of_journal_files: "1GB"
2403+ duration_of_journal_files: "7 days"
2404+ duration_of_journal_file: "2 hours"
2405+ store_otlp_json: false
2406+ ` ` `
2407+
2408+ **4. Switch every client to TLS.** A TLS listener rejects plaintext connections, so any sender must
2409+ be reconfigured — otherwise logs silently stop arriving. For the bundled ` otel-collector`, enable
2410+ TLS on its OTLP exporter. Because the certificate is self-signed, skip verification with
2411+ ` insecure_skip_verify` — this keeps the connection encrypted but does not validate the certificate
2412+ chain (only the `tls` block is overridden; the exporter's `endpoint` is kept from the chart
2413+ defaults) :
2414+
2415+ ` ` ` yaml
2416+ otel-collector:
2417+ config:
2418+ exporters:
2419+ otlp:
2420+ tls:
2421+ insecure: false
2422+ insecure_skip_verify: true
2423+ ` ` `
2424+
2425+ Apply the same change to any external OTLP client — Fluent Bit, Vector, or another Collector —
2426+ pointing at the `netdata-otel` service.
2427+
2428+ > For production, replace the self-signed certificate with one issued by a trusted CA, give it a
2429+ > `CN`/`SAN` that matches the `netdata-otel` service DNS name, and have clients trust that CA via
2430+ > `tls_ca_cert_path` instead of skipping verification.
2431+
23162432# ## Service discovery and supported services
23172433
23182434Netdata's [service discovery](https://github.com/netdata/agent-service-discovery/), which is installed as part of the
0 commit comments