feat(otel-collector): add statsdreceiver for StatsD/DogStatsD ingestion - #3100
feat(otel-collector): add statsdreceiver for StatsD/DogStatsD ingestion#3100arj22 wants to merge 6 commits into
Conversation
Compiles in `statsdreceiver` so StatsD and DogStatsD-formatted metrics can be ingested directly, without a separate StatsD-to-OTLP bridge. Documents that it doesn't support horizontally-scaled deployments (a real, upstream-documented limitation, not HyperDX-specific) and that it should not be wired into the OpAMP-managed otel-collector Deployment, which runs multiple replicas for OTLP ingest availability. Verified against the real compiled binary (pinned v0.155.0): confirmed `statsdreceiver` is not currently compiled in, added it, rebuilt, and confirmed the documented config both passes `otelcontribcol validate --config` and actually starts (`otelcontribcol --config ...`, reaching "Everything is ready. Begin running and processing data."), using the same multi-config merge the container's own entrypoint uses. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@arj22 is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: bba51b6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile SummaryAdds opt-in StatsD and DogStatsD ingestion support to the custom OpenTelemetry Collector.
Confidence Score: 5/5The PR appears safe to merge; the outstanding default port-conflict issue was fully fixed by making UDP publication opt-in. No new actionable failures or repository-rule violations remain. The resolved regression-coverage thread was explicitly accepted as follow-up work, the DogStatsD simple-tag documentation was corrected, and the previously unresolved unconditional port binding is now removed from both Compose configurations.
|
| Filename | Overview |
|---|---|
| packages/otel-collector/builder-config.yaml | Adds the upstream StatsD receiver to the custom collector build. |
| packages/otel-collector/README.md | Documents configuration, port publication, DogStatsD tags, OpAMP behavior, and aggregation constraints. |
| docker-compose.yml | Provides an opt-in commented UDP mapping without reserving port 8125 in the default stack. |
| docker-compose.dev.yml | Provides the corresponding configurable, opt-in UDP mapping for development. |
| docker/otel-collector/Dockerfile | Advertises the StatsD UDP port in both standalone collector images without publishing it. |
| docker/hyperdx/Dockerfile | Advertises the StatsD UDP port in the all-in-one image. |
| .changeset/statsd-receiver.md | Records the additive receiver support as a minor collector release. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[StatsD or DogStatsD client] -->|UDP 8125, when published| B[statsd receiver]
B --> C[Dedicated metrics/statsd pipeline]
C --> D[memory_limiter]
D --> E[batch]
E --> F[ClickHouse exporter]
Reviews (5): Last reviewed commit: "fix(otel-collector): make statsd's compo..." | Re-trigger Greptile
Deep Review✅ No critical issues found. This is a purely additive, opt-in change: it compiles 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (6): correctness, security, previous-comments, project-standards, maintainability, testing. Testing gaps: No automated assertion that |
PR Review5 finding(s): 🔴 0 critical · 🟠 1 major · 🔵 4 minor 5 posted as inline comment(s) on the changed lines. Severity is the reviewer's own estimate and is used for ordering, not filtering. |
…laim - Removed the timer_histogram_mapping example claiming to route "timer/histogram-type" metrics to an exponential histogram. Verified against the pinned v0.155.0 source (factory.go's defaultTimerHistogramMapping): timer, histogram, AND distribution all default to a gauge observer, and the example only remapped `timing` - histogram/distribution metrics would still land as gauges, contradicting the comment. - Reframed the section around plain StatsD rather than DogStatsD specifically - the receiver handles any StatsD client; DogStatsD's tag extension is supported but not required, and centering the docs on one vendor's dialect was misleading and pulled in the now-removed, Datadog-distribution-specific histogram-mapping example. - Net simplification: fewer lines, no vendor-specific framing, no incorrect claim. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e_simple_tags - Adding statsd to the default `metrics` pipeline via CUSTOM_OTELCOL_CONFIG_FILE silently no-ops in OpAMP supervisor mode (HyperDX's default deployment): opampController.ts overwrites that pipeline's receivers/exporters at runtime the same way it does for spanmetricsconnector (see the span metrics section above, hyperdxio#2351). Added a second example using a dedicated `metrics/statsd` pipeline name, which the remote config never touches, mirroring the existing OpAMP-mode span_metrics example. Verified against the real compiled binary by reconstructing opampController's generated base config as a static fixture and running `validate --config` against the merge. - Corrected the multi-replica warning: it was written as if OpAMP mode itself implies multiple replicas, but HyperDX's shipped default deployments run the OpAMP-managed collector as a single instance — the actual constraint is scaling *whichever* collector ingests statsd beyond one replica, independent of which mode it runs in. - Restored `enable_simple_tags: true` to both examples and qualified the intro claim about DogStatsD tag support: valued tags work with no extra config, but bare tags (`#mytag`) are silently dropped without this option. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
StatsD defaults to UDP, and neither the shipped compose files nor the collector/all-in-one Dockerfiles published or exposed 8125 - a user who added the documented statsd config verbatim on top of the default stack got no data and no error (UDP sends are fire-and-forget, so nothing logs the drop). Publish `8125:8125/udp` on the otel-collector service in docker-compose.yml and docker-compose.dev.yml (parameterized via HDX_DEV_OTEL_STATSD_PORT, matching the other dev port overrides), and add 8125/udp to the EXPOSE lines in docker/otel-collector/Dockerfile (both dev and prod stages) and docker/hyperdx/Dockerfile (all-in-one). statsd itself stays opt-in (nothing listens on the port until a pipeline config adds the receiver), so this is a no-op for anyone not using it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
An unconditional fixed host port mapping fails the whole otel-collector service's startup if anything else already owns 8125/udp (a local StatsD daemon or Datadog Agent commonly does) - since statsd itself is opt-in and off by default, this would have broken the default stack for anyone not using the feature, just for having it in their environment. Commented the mapping out by default in both compose files, matching the existing opt-in-port convention already used in the same files (db's 27017, ch-server's 8123/9000). Uncommenting it remains a one-line change, documented in the README section.
|
@wrn14897 this is ready for review. |
Summary
Adds the OpenTelemetry
statsdreceiverto HyperDX's custom collector build, so users can ingest StatsD metrics directly without a separate bridge. Purely additive/opt-in — no default pipeline or behavior changes.The docs call out one real limitation from upstream: this receiver keeps aggregation state per-instance with no cross-replica coordination, so it shouldn't be wired into HyperDX's multi-replica
otel-collectorDeployment — it needs a dedicated single-replica instance.Test plan
statsdreceiverwasn't previously compiled in, then confirmed it's present after the change (otelcontribcol components).validate.🤖 Generated with Claude Code