Repository navigation
feat(otel-collector): add statsdreceiver for StatsD/DogStatsD ingestion #3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5be2e79
5e89043
a275adf
867f232
e1de31d
bba51b6
f3a5c71
48f67af
c20d0cd
a8b78a2
92e8f5e
2e3d164
be88262
d50af91
7f1860c
2712e01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| "@hyperdx/otel-collector": minor | ||
| --- | ||
|
|
||
| feat(otel-collector): compile in statsdreceiver | ||
|
|
||
| Available for a user's own pipeline config (e.g. via | ||
| `CUSTOM_OTELCOL_CONFIG_FILE`) to ingest StatsD/DogStatsD metrics | ||
| directly, without a separate StatsD-to-OTLP bridge. Purely additive: | ||
| being compiled in changes no default pipeline or behavior on its own. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,12 @@ services: | |
| - '${HDX_DEV_OTEL_GRPC_PORT:-4317}:4317' # OTLP gRPC receiver | ||
| - '${HDX_DEV_OTEL_HTTP_PORT:-4318}:4318' # OTLP http receiver | ||
| - '${HDX_DEV_OTEL_METRICS_PORT:-8888}:8888' # metrics extension | ||
| # Uncomment to enable statsd ingestion (also requires adding the | ||
| # `statsd` receiver to a pipeline in custom.config.yaml - see | ||
| # packages/otel-collector/README.md). Left commented out by default: | ||
| # a fixed host port mapping fails the whole service's startup if | ||
| # something else on the host already owns 8125/udp. | ||
| # - '${HDX_DEV_OTEL_STATSD_PORT:-8125}:8125/udp' # statsd receiver | ||
|
arj22 marked this conversation as resolved.
Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — Every other
arj22 marked this conversation as resolved.
Resolved
|
||
| restart: always | ||
| networks: | ||
| - internal | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,14 @@ services: | |
| - '4317:4317' # OTLP gRPC receiver | ||
| - '4318:4318' # OTLP http receiver | ||
| - '8888:8888' # metrics extension | ||
| # Uncomment to enable statsd ingestion (also requires adding the | ||
| # `statsd` receiver to a pipeline via CUSTOM_OTELCOL_CONFIG_FILE - see | ||
|
arj22 marked this conversation as resolved.
Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — docker-compose.yml's otel-collector has no Unlike |
||
| # packages/otel-collector/README.md). Left commented out by default: | ||
| # a fixed host port mapping fails the whole service's startup if | ||
| # something else on the host (e.g. a local StatsD daemon or Datadog | ||
| # Agent) already owns 8125/udp, which would otherwise break the | ||
| # default stack for anyone not using this feature. | ||
| # - '8125:8125/udp' # statsd receiver | ||
| restart: always | ||
| networks: | ||
| - internal | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,7 @@ custom OTel configurations without rebuilding the collector. | |
| | `k8scluster` | contrib | user configs | | ||
| | `kubeletstats` | contrib | user configs | | ||
| | `prometheus` | contrib | OpAMP controller, smoke tests | | ||
| | `statsd` | contrib | user configs | | ||
|
|
||
| ### Processors | ||
|
|
||
|
|
@@ -322,6 +323,86 @@ run (`otelcontribcol --config ...`, not just `validate`): it reaches | |
| `span_metrics` connector, confirming `validate`'s static schema/graph | ||
| checks aren't hiding a startup-only failure here. | ||
|
|
||
| ## Ingesting StatsD metrics | ||
|
|
||
| `statsdreceiver` is compiled in so StatsD-formatted metrics can be ingested | ||
|
arj22 marked this conversation as resolved.
Resolved
|
||
| directly, without a separate StatsD-to-OTLP bridge — this covers any StatsD | ||
| client, not just a particular vendor's dialect. It also understands the | ||
| DogStatsD tag extension: valued tags (`#tag:value`) work with no extra | ||
| config, but bare tags (`#mytag`, no value) need `enable_simple_tags: true` | ||
|
arj22 marked this conversation as resolved.
Resolved
|
||
| (set below) or they're silently dropped. | ||
|
|
||
| **This component does not support horizontally-scaled deployments** — not | ||
| a HyperDX-specific limitation, it's stated directly in the upstream | ||
| component's own docs. Aggregation state lives independently in each | ||
| collector instance's memory with no cross-replica coordination, so the | ||
| same metric landing on two different replicas (e.g. behind a | ||
| load-balanced Service) gets aggregated separately by each one instead of | ||
| together, silently splitting/undercounting it. HyperDX's default | ||
| deployments (`docker-compose.yml`, the all-in-one image) run the | ||
| OpAMP-managed collector as a single instance, so this doesn't bite out of | ||
| the box — it only matters once *some* collector instance ingesting | ||
| `statsd` is scaled to multiple replicas, at which point that traffic | ||
| needs to go to one dedicated single-replica instance instead. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — New section doesn't note that
|
||
|
|
||
| `docker-compose.yml`/`docker-compose.dev.yml` have an `8125/udp` port | ||
|
arj22 marked this conversation as resolved.
Resolved
|
||
| mapping for the `otel-collector` service, commented out by default — | ||
| uncomment it to enable statsd ingestion. It's opt-in rather than always | ||
| on because a fixed host port mapping fails that service's entire startup | ||
| if something else on the host (e.g. a local StatsD daemon or Datadog | ||
| Agent) already owns 8125/udp, which would otherwise break the default | ||
| stack for anyone not using this feature. The standalone/all-in-one images | ||
| also `EXPOSE 8125/udp` (metadata only, doesn't reserve the host port on | ||
| its own). | ||
|
|
||
| **In standalone mode**, `metrics` is a plain pipeline in your own config | ||
| file, so add `statsd` to it directly: | ||
|
|
||
| ```yaml | ||
| receivers: | ||
| statsd: | ||
| # Defaults to localhost:8125, which only accepts local traffic - | ||
|
arj22 marked this conversation as resolved.
Resolved
|
||
| # 0.0.0.0 is required here since traffic arrives from outside the | ||
| # container (the published port above forwards to the container's | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — The parenthetical explaining why A published port is DNAT'd to the container's bridge interface, not to the container's loopback — which is precisely why a receiver bound to |
||
| # own loopback otherwise). | ||
| endpoint: 0.0.0.0:8125 | ||
|
arj22 marked this conversation as resolved.
Resolved
arj22 marked this conversation as resolved.
Resolved
arj22 marked this conversation as resolved.
Resolved
arj22 marked this conversation as resolved.
Resolved
|
||
| enable_simple_tags: true | ||
| service: | ||
| pipelines: | ||
| metrics: | ||
| receivers: [otlp/hyperdx, statsd] | ||
|
arj22 marked this conversation as resolved.
Resolved
arj22 marked this conversation as resolved.
Resolved
|
||
| ``` | ||
|
|
||
| **In OpAMP supervisor mode** (HyperDX's default), editing the `metrics` | ||
| pipeline this way will not work: `receivers:`/`exporters:` on it are set | ||
| dynamically by `opampController.ts`, and the remote config overwrites | ||
| (not merges) those keys — see the [span metrics section | ||
| above](#computing-span-metrics-from-ingested-traces) for the same | ||
| behavior. Adding `statsd` to `metrics.receivers` from | ||
| `CUSTOM_OTELCOL_CONFIG_FILE` gets silently dropped: no error, the receiver | ||
|
arj22 marked this conversation as resolved.
Resolved
arj22 marked this conversation as resolved.
Resolved
arj22 marked this conversation as resolved.
Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — README says an unwired When the OpAMP remote config overwrites |
||
| just starts and is wired to nothing. Use a separate pipeline name instead, | ||
| which the remote config never touches: | ||
|
|
||
| ```yaml | ||
| receivers: | ||
| statsd: | ||
| endpoint: 0.0.0.0:8125 | ||
|
greptile-apps[bot] marked this conversation as resolved.
Resolved
|
||
| enable_simple_tags: true | ||
| service: | ||
| pipelines: | ||
| metrics/statsd: | ||
|
arj22 marked this conversation as resolved.
Resolved
|
||
| receivers: [statsd] | ||
| exporters: [clickhouse] | ||
| processors: [memory_limiter, batch] | ||
| ``` | ||
|
|
||
| Both shapes are verified against the real compiled binary via | ||
| `otelcontribcol validate --config`, and the standalone shape was also | ||
| actually run (`otelcontribcol --config ...`, not just `validate`), | ||
| reaching `"Everything is ready. Begin running and processing data."` — | ||
| the same rigor as the span metrics section above, using the same | ||
| multi-`--config` merge the container actually uses. | ||
|
|
||
| ## Overriding base components via `CUSTOM_OTELCOL_CONFIG_FILE` | ||
|
|
||
| The collector ships with a default `memory_limiter` processor sized for a | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.