Introducing a new way to review your PRs.

Read the announcement

hyperdxio / hyperdx

Resolve production issues, fast. An open source observability platform unifying session replays, logs, metrics, traces and errors powered by ClickHouse and OpenTelemetry.

View on GitHub

19 documents · Updated Oct 30, 2026

docs / telemetry-ingestion-and-storage

Telemetry ingestion and storage

HyperDX uses an OpenTelemetry Collector as the front door for observability data. The collector accepts logs, traces, metrics, and browser session events from several protocols, applies a small set of shared controls, and writes the data to ClickHouse tables that the product can query. The API can manage the collector through OpAMP, while standalone deployments use the same core pipeline from local configuration. See Observability platform architecture for the system-level view.

Collector operating modes

The collector has two control paths. In supervisor mode, the OpAMP supervisor receives a remote configuration from the API. In standalone mode, the container starts with local YAML files and adds optional authentication, Prometheus remote write, or custom configuration when the related settings are present.

OpAMP-managed configuration

OpAMP is the remote control link between the API and each collector agent. The API builds a configuration from team keys and feature flags. The configuration enables the standard intake paths and sends telemetry to ClickHouse, while the bootstrap file keeps processor lists available for local overrides. The supervisor also reports health, effective configuration, and its own telemetry back to the API.

The managed configuration starts with nop receivers where a signal is not enabled. It adds OTLP when team ingestion keys are available. It can also add Datadog intake and Prometheus remote write as opt-in paths. Authentication is attached to OTLP when team enforcement is on, and Datadog uses the same team keys through its DD-API-KEY header.

References: packages/…/opampController.ts• L171-205 packages/…/opampController.ts• L285-365 packages/…/opampController.ts• L368-400 docker/…/supervisor_docker.yaml.tmpl• L1-36

Standalone configuration

Standalone mode uses the OTLP receiver on ports 4317 and 4318. It sends traces and metrics directly to ClickHouse. Logs first pass through a routing connector so normal logs and browser replay events can use different ClickHouse exporters. The entrypoint adds bearer-token or OIDC authentication only when configured, and it adds the Prometheus remote-write pipeline only when an endpoint exists.

Static bearer-token protection accepts the bare token and the usual Bearer-prefixed Authorization value. It also accepts case variants of the scheme so clients with different header casing can use the same intake path.

This mode is useful when no OpAMP server is available. It still shares the base processors and the same storage schema as the managed path. A custom file can add receivers such as host metrics or add development-only exports without changing the image.

References: docker/…/config.standalone.yaml• L4-76 docker/…/entrypoint.sh• L40-91 docker/…/config.standalone.auth.yaml• L1-27 docker/…/config.standalone.oidc.yaml• L1-27 docker/…/config.standalone.promql.yaml• L1-22

Ingestion interfaces

The collector translates several input styles into the same signal pipelines. OTLP is the main interface for applications and SDKs. Fluent Forward, Prometheus scraping, Datadog intake, StatsD, and host or file collection are supported for systems that already use those formats.

Receiver support

The custom collector image contains the following receiver families. A receiver being present in the image means that a managed or custom configuration can use it; it does not mean that every deployment enables it.

ReceiverSignal or useUsual activation
otlpLogs, traces, and metrics over OTLP gRPC or HTTPDefault application intake
fluentforwardFluent Forward logsManaged pipeline
prometheusScraped metricsManaged pipeline and collector metrics
datadogDatadog traces, metrics, and logsOpt-in with ENABLE_DATADOG_RECEIVER
statsdStatsD and DogStatsD metricsUser-defined pipeline through CUSTOM_OTELCOL_CONFIG_FILE
hostmetricsHost CPU, load, memory, disk, file system, and network metricsCustom configuration
filelogFile-based logsCustom configuration
dockerstatsDocker container metricsCustom configuration
k8scluster and kubeletstatsKubernetes cluster and node or pod metricsCustom configuration

The Datadog receiver exposes one intake endpoint and converts all three Datadog signal types into the existing trace, metric, and log paths. This keeps Datadog data subject to the same ClickHouse storage rules as OTLP data.

StatsD support is also image capability rather than a default intake path. A user's custom pipeline can use it to send StatsD or DogStatsD metrics directly to the existing metric path without a separate bridge.

References: packages/…/builder-config.yaml• L21-53 packages/…/opampController.ts• L206-227 packages/…/opampController.ts• L368-400 packages/…/CHANGELOG.md• L7-12 packages/…/README.md• L132-158

Exporter support

The custom collector can send data to ClickHouse for product storage or copy metrics to a Prometheus-compatible remote-write service. It also includes OTLP and OTLP/HTTP exporters for forwarding telemetry, plus debug and no-op exporters for diagnostics or deliberately unused paths. The active configuration decides which available exporter receives data.

This separation keeps the collector image broad enough for managed and standalone use without making every deployment send data to every destination. A new exporter must be both included in the image and connected to a pipeline before it has an effect.

References: packages/…/builder-config.yaml• L107-127 packages/…/opampController.ts• L331-346 docker/…/config.standalone.yaml• L27-76

Custom signal processing

The image also includes an optional span-metrics connector for custom pipelines. It can turn spans into call-count and duration metrics, which lets a deployment derive RED-style metrics from trace data before export. This does not change the default pipelines.

References: packages/…/CHANGELOG.md• L20-29

Authentication and intake safety

Standalone OTLP intake can use one static bearer token or short-lived OIDC tokens. Static authentication matches the configured token in either bare or Bearer-prefixed Authorization form, with common scheme case variants accepted. OIDC validates the token issuer, signature, and audience. Managed OTLP intake uses the team API keys when collector authentication is enforced. Datadog follows the same team boundary through its API-key header.

The collector also limits memory and groups records into batches before export. These controls protect the process during load and reduce the number of ClickHouse inserts. The base configuration uses a memory limit and a batch size tuned for ClickHouse. A custom configuration can replace a processor by naming a new processor and changing the pipeline that uses it.

References: docker/…/config.yaml• L123-150 docker/…/config.standalone.auth.yaml• L4-27 docker/…/config.standalone.oidc.yaml• L11-27 packages/…/opampController.ts• L348-365 smoke-tests/…/bearer-auth.bats• L34-82 smoke-tests/…/docker-compose.yaml• L159-188 packages/…/README.md• L160-281

Signal routing

All signals follow a short path from a receiver to an exporter. Logs have one extra decision point because browser replay records must be kept in the sessions table rather than the general logs table. The diagram shows the normal paths and the optional branches.

flowchart LR
  A[OTLP] --> T[Traces pipeline]
  A --> M[Metrics pipeline]
  A --> L[Logs input]
  B[Fluent Forward] --> L
  C[Datadog optional] --> T
  C --> M
  C --> L
  D[Prometheus scrape] --> M
  E[StatsD custom pipeline] --> M
  F[Host or custom receivers] --> M
  L --> R{rr-web.event present?}
  R -->|No| CH[ClickHouse exporter]
  R -->|Yes| S[Session exporter]
  T --> CH
  M --> CH
  M --> P[Prometheus remote write optional]

Log and session routing

The routing connector treats a log with an rr-web.event attribute as a browser replay event. Normal logs go to otel_logs. Replay records go to hyperdx_sessions through a separate exporter configuration. The session table retains the event body and attributes needed to rebuild a replay while preserving trace and service links.

This split matters because session exploration joins session identifiers with trace data. The product expects the session source to expose the session identifier from ResourceAttributes['rum.sessionId'] and the replay event body from Body. See Session replay and exploration when the user-facing replay flow is the concern.

References: docker/…/config.standalone.yaml• L17-24 docker/…/config.standalone.yaml• L27-76 docker/…/00004_hyperdx_sessions.sql• L1-35 packages/…/source.ts• L46-57

Optional Prometheus path

The collector can copy OTLP metrics to a Prometheus-compatible remote-write endpoint. This path is separate from the ClickHouse metric tables, so enabling it adds an external metrics consumer without replacing ClickHouse storage. The feature is enabled only when the endpoint is configured and the deployment feature flag allows it.

References: packages/…/opampController.ts• L331-346 docker/…/config.standalone.promql.yaml• L9-22 packages/…/builder-config.yaml• L121-127

ClickHouse storage model

ClickHouse is the durable analytics store for the four product data classes. Each class has a table shape that follows the OpenTelemetry signal and a retention rule. The tables use MergeTree-family engines so recent data can be written in batches and queried by time, service, signal name, or attributes.

Signal tables

Data classPrimary tablesStored purpose
Logsotel_logsLog time, body, severity, trace IDs, service, scope, and resource or log attributes
Tracesotel_tracesSpan identity and links, service and span names, duration, status, events, and attributes
Metricsotel_metrics_gauge, otel_metrics_sum, otel_metrics_histogram, otel_metrics_exponential_histogram, otel_metrics_summaryThe OpenTelemetry metric data types and their values, buckets, exemplars, and temporality fields
Sessionshyperdx_sessionsBrowser replay records with session, trace, service, body, and attribute data

Logs and traces also expose materialized fields for common Kubernetes, deployment, and RUM session attributes. These fields support fast filtering without changing the source event shape. Trace spans materialize a sample-rate value so queries can account for sampled data.

References: docker/…/00002_otel_logs.sql• L2-44 docker/…/00003_otel_metrics.sql• L2-37 docker/…/00003_otel_metrics.sql• L39-209 docker/…/00004_hyperdx_sessions.sql• L2-34 docker/…/00005_otel_traces.sql• L2-43 packages/…/000002_add_sample_rate_column_to_otel_traces.up.sql• L1-4

Retention and query aids

Each signal table has a time-based TTL. The default retention is 720 hours, with separate settings available for logs, traces, metrics, and sessions. Tables are partitioned by date and ordered around the fields used most often in product queries. Attribute and text indexes help narrow searches, while rollup tables count common log and trace key-value pairs in fifteen-minute buckets.

The trace table uses text indexes for trace IDs, session IDs, attribute keys, attribute values, and span names. It also uses a numeric index for duration. These indexes support the product's common trace and session filters without changing the stored span shape.

The rollups are maintained by materialized views. They are query aids, not a second source of truth. Raw signal rows remain in the main tables and expire under the matching signal retention rule.

Existing table TTLs can also be reconciled when that option is enabled. The migration tool changes only simple fixed-interval policies that differ from the configured value. It leaves compound tiering or rollup policies and calendar-based intervals unchanged.

References: packages/…/main.go• L35-43 packages/…/main.go• L282-300 docker/…/00005_otel_traces.sql• L26-43 docker/…/00006_otel_logs_rollups.sql• L3-22 docker/…/00007_otel_traces_rollups.sql• L3-22 packages/…/CHANGELOG.md• L43-47

PromQL time-series storage

PromQL support has a separate experimental metrics_ts table based on ClickHouse's TimeSeries engine. The schema is created only when PromQL is enabled. This keeps the optional feature out of deployments that only use the standard metric tables.

References: docker/…/00008_otel_metrics_timeseries.sql• L1-4 packages/…/main.go• L678-687 packages/…/main.go• L817-822

Schema lifecycle

The collector image carries the ClickHouse seed SQL and a Go-based migration command. At startup, the entrypoint prepares the schema for the target database and runs the seed with retry support. The seed uses idempotent statements and does not use a goose version table because ClickHouse transaction behavior does not fit that mode.

Version and compatibility selection

Before seeding, the migration command checks the ClickHouse version. ClickHouse versions before 26.2 use compatibility schemas for logs and traces because they do not support the full-text index form used by the main schemas. The migration command selects one variant and does not run both.

The command expands the database and retention values into temporary SQL files. It can also reconcile the TTL of existing managed tables when that setting is enabled. A retention policy that contains custom tiering, recompression, rollup, or several rules is left unchanged rather than rewritten by guesswork.

References: packages/…/main.go• L616-645 packages/…/main.go• L647-718 packages/…/main.go• L774-822 packages/…/main.go• L841-847 docker/…/00002_otel_logs_compat.sql• L1-6 docker/…/00005_otel_traces_compat.sql• L1-6

Schema change paths

There are two related schema change paths. The collector seed creates and maintains the telemetry tables used by ingestion. The API ClickHouse migrations change existing product tables or add fields that the API and UI expect. Changes to a shared column contract must account for both paths when the same data is read by ingestion and query code.

References: packages/…/main.go• L585-613 packages/…/000001_add_is_delta_n_is_monotonic_fields_to_metric_stream_table.up.sql• L1-3 packages/…/000002_add_sample_rate_column_to_otel_traces.up.sql• L1-4

The collector owns intake, signal routing, batching, and writes to ClickHouse. The API owns team-aware configuration and query access. The shared query toolkit defines the source fields that let the product treat the signal tables as logs, traces, metrics, or sessions rather than as unrelated tables.

For the neighboring responsibilities, read API services and background tasks, Deployment topology, and Shared domain and query toolkit.

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the OpAMP-generated pipelines and standalone pipeline files aligned. A new receiver or exporter can work in one operating mode and silently be absent in the other.
  • Keep the rr-web.event routing rule aligned with the hyperdx_sessions schema and the session source expressions. A change in the attribute name or body field can turn replay rows into normal logs or make stored sessions unreadable.
  • When changing a signal table, update the matching exporter table settings, seed schema, compatibility schema, rollup view, and source inference contract.
  • When changing retention, check both new table TTL macros and the optional existing-table reconciliation path. Compound operator-authored TTL rules are intentionally not rewritten.
  • When adding a collector component, update the builder manifest and the configuration path that activates it. Including a component in the image alone does not attach it to a pipeline.
  • When changing PromQL support, keep the feature flag, remote-write pipeline, and optional metrics_ts schema behavior consistent.
  • When changing static OTLP authentication, keep the accepted Authorization forms aligned with the standalone auth fragment, its container settings, and the bearer-auth smoke checks.

Important failure modes

TriggerConsequenceGuard
ClickHouse is below 26.2 and the full-text schema is usedSchema creation fails on unsupported index syntaxStartup selects the compatibility logs and traces schemas
HYPERDX_OTEL_EXPORTER_CLICKHOUSE_JSON_ENABLE=trueThe normal migration path is skipped and legacy schema mode is forcedTreat JSON mode as a legacy compatibility choice and verify the matching schema
OIDC issuer is set without an audienceStandalone collector exits before accepting telemetryConfigure both OIDC values or use static bearer-token auth
A custom file adds values to the existing memory limiter without changing its nameThe original memory-size settings can still winDefine a new processor name and replace the pipeline reference
rr-web.event routing or session columns change without source updatesSession replay queries return missing or invalid recordsReview the routing rule, session schema, and session source expressions together
A managed receiver is compiled but not added to a pipelineThe endpoint exists in the binary but receives no useful dataUpdate the OpAMP builder or standalone service pipeline
A client sends no token or a token that does not match the configured static tokenThe standalone OTLP request is rejected before it reaches signal storageSet OTLP_AUTH_TOKEN and send one of the accepted Authorization forms

Key files

FileWhy to read it
docker/…/config.yamlBase processors, batching, memory protection, health, and collector metrics
docker/…/config.standalone.yamlEnd-to-end standalone receivers, routing, and ClickHouse exporters
docker/…/config.standalone.auth.yamlStatic bearer-token protection for standalone OTLP intake
packages/…/opampController.tsManaged configuration, feature gates, team authentication, and pipeline assembly
packages/…/builder-config.yamlReceiver, processor, exporter, connector, extension, and provider support included in the custom collector image
packages/…/CHANGELOG.mdRecent collector capabilities, including StatsD intake and optional span-derived metrics
docker/…/entrypoint.shStartup mode selection, schema migration, compatibility handling, and optional config loading
packages/…/main.goClickHouse connection, retention expansion, version selection, retries, and TTL reconciliation
docker/…/00002_otel_logs.sqlCanonical log storage shape and search-oriented fields
docker/…/00003_otel_metrics.sqlMetric table variants and their OpenTelemetry data shapes
docker/…/00004_hyperdx_sessions.sqlBrowser session storage shape and retention
docker/…/00005_otel_traces.sqlTrace storage shape, query indexes, session link, and sample-rate field
packages/…/source.tsProduct-side mapping from ClickHouse columns to log, trace, metric, and session sources
smoke-tests/otel-collector/bearer-auth.batsEnd-to-end contract for accepted and rejected static-auth requests