On running the OpenTelemetry Collector on NixOS and rejoicing in its declarative goodness
Blog post from Dash0
OpenTelemetry Collector can provide a vendor-neutral, declarative monitoring stack for NixOS by collecting host and selected process metrics, journald logs, and systemd service health before enriching, filtering, and exporting telemetry to compatible backends. The recommended NixOS setup uses the contrib Collector package, which includes capabilities such as journald and file log receivers, and defines configuration through the module’s `settings` option to enable Nix-native composition and reuse. Collector configurations organize receivers, processors, exporters, extensions, and pipelines, while secure authentication should avoid placing secrets in the Nix store; systemd encrypted credentials offer host- and TPM-bound secrets that are exposed only at runtime, though they require recovery planning after hardware or system changes. Journald collection requires persistent file storage to prevent duplicate ingestion and may need transformation to make JSON-encoded journal metadata easier to query. Host metrics can cover CPU, memory, disks, networking, load, and process counts, while per-process metrics should be narrowly scoped and filtered to avoid excessive telemetry. Resource detection and resource processors add standardized host, operating system, cloud, service, and deployment metadata, with processor ordering determining which values take precedence. The article also recommends build-time Collector configuration validation, careful use of OTTL filters to prevent unintended data loss, and external synthetic health checks, including a custom systemd-unit-healthz service that exposes selected unit status over authenticated HTTPS, to detect failures that internal telemetry alone may miss.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| OpenTelemetry | 38 | 125 | 18 | 15 | -83% |
| Secrets Management | 9 | 451 | 99 | 43 | -80% |
| Serverless | 3 | 156 | 54 | 28 | -80% |
| Kubernetes | 2 | 956 | 75 | 30 | -73% |
| Observability | 1 | 472 | 102 | 54 | -85% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.