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 / deployment-topology

Deployment topology and runtime operations

HyperDX runs as a set of cooperating services that receive telemetry, store it, and present it through a web interface. The standard Compose topology keeps the application, MongoDB, ClickHouse, and OpenTelemetry Collector on one private network. Deployment choices decide which services are exposed and whether the application uses bundled or external data stores. See also Observability platform, Telemetry ingestion and storage, API services and background tasks, and Development and test workflows.

Runtime topology

The deployment has four main roles. The app serves the UI and API, MongoDB keeps HyperDX settings and account state, ClickHouse stores telemetry, and the OpenTelemetry Collector accepts telemetry and writes it to ClickHouse. Service names provide the internal links between containers, so the public network does not need direct access to the data stores.

This diagram shows the main user, telemetry, storage, and control paths.

flowchart LR
    User[Engineer] --> Edge[Optional reverse proxy]
    Edge --> App[HyperDX app]
    SDK[Applications and SDKs] --> Collector[OpenTelemetry Collector]
    Collector --> ClickHouse[ClickHouse]
    App --> ClickHouse
    App --> Mongo[MongoDB]
    Collector <--> App

The normal production Compose file is docker-compose.yml. It uses the internal network and persistent host volumes for MongoDB and ClickHouse. The app depends on MongoDB and ClickHouse, while the collector depends on ClickHouse. These relationships express the data path but do not replace readiness checks for every service.

References: docker-compose.yml• L17-27 docker-compose.yml• L28-57 docker-compose.yml• L58-109

Service roles

Each service has one clear place in the runtime path. This separation lets operators scale or replace the data and edge layers without changing the user-facing HyperDX role.

ServiceSystem roleMain connection
appServes the web UI, API, and alert task processMongoDB, ClickHouse, and the Collector's OpAMP endpoint
otel-collectorReceives OTLP and Fluentd telemetry and exports it to ClickHouseClickHouse and the app's OpAMP endpoint
otel-collector-jsonProvides an optional development path for JSON-shaped telemetryClickHouse and the app's OpAMP endpoint
ch-serverStores logs, traces, metrics, and related observability dataInternal HTTP and native ClickHouse endpoints
dbStores HyperDX application stateInternal MongoDB endpoint
Optional proxyPublishes the UI through a public host or URL subpathThe app's web port

The app exposes separate API and UI ports in the Compose stack. The collector exposes health, OTLP gRPC, OTLP HTTP, Fluentd, and metrics ports. MongoDB and ClickHouse stay internal by default because their ports are commented out in the production-oriented file. StatsD ingestion is also optional and stays disabled unless an operator adds both its receiver pipeline and UDP port mapping. The local ClickHouse configuration provides Prometheus-compatible metric and query paths for a local runtime, while the all-in-one configuration keeps the Prometheus API path without the local remote-write and metric-exporter block.

The development stack adds a separate JSON collector on a dedicated host port. It writes to a separate ClickHouse database and requires the matching JSON schema setting when that schema is used. A Prometheus service is also available through a Compose profile for local metric work.

References: docker-compose.yml• L28-57 docker-compose.yml• L58-109 docker-compose.yml• L110-130 docker-compose.dev.yml• L19-108 docker-compose.dev.yml• L165-181 docker/…/config.xml• L39-87 docker/…/clickhouseConfig.xml• L40-58

Container images

HyperDX supports both a split service layout and an all-in-one image. The split layout can use a combined production image for the API and web UI or separate service images, together with a collector image and separate MongoDB and ClickHouse images. The all-in-one image packages the app, collector, ClickHouse, and MongoDB into one container for simple local or small deployments.

Split images

The main Compose stack pulls a versioned HyperDX app image and a versioned collector image from configured repositories. The combined production image contains the API and Next.js UI. Its production entrypoint starts the application and its runtime tasks, while its health check reports whether the API is ready. Standalone API and web UI images are also available when an operator wants to run those services as separate units. Their production images expose service-specific ports and health checks. The collector image contains the custom OpenTelemetry Collector and its supervisor, then exposes the telemetry receivers and health endpoint. It provides separate development and production image targets for the local and deployed paths.

References: docker-compose.yml• L28-50 docker-compose.yml• L58-73 docker/…/Dockerfile• L74-146 docker/…/Dockerfile• L148-227 packages/…/Dockerfile• L19-27 packages/…/Dockerfile• L52-86 packages/…/Dockerfile• L17-24 packages/…/Dockerfile• L74-113 docker/…/Dockerfile• L65-111

All-in-one image

The all-in-one image is intended to reduce the number of runtime units for local use. Its shared base includes the Node runtime, ClickHouse, MongoDB, the HyperDX-built collector, and migration tools, together with the configuration needed for the bundled data path. Two runtime variants select the access model: all-in-one-noauth is for local no-auth use, while all-in-one-auth keeps authentication enabled. The image exposes the app, OTLP, health, and ClickHouse ports for the bundled services. The bundled processes share one container lifecycle, so an early process exit can stop the deployment.

References: docker/…/Dockerfile• L148-227 docker/…/Dockerfile• L229-259

Proxy options

A reverse proxy is an edge layer that accepts browser traffic and forwards it to the app. It is optional when the app port is directly exposed, but it is useful for TLS termination, shared domains, and URL subpaths.

Nginx and Traefik routing

The development Compose file provides commented examples for Nginx and Traefik. Both examples publish the proxy on port 4040 and forward to the app's web port. The Nginx template redirects / to the configured base path, rewrites root-level API and asset requests, and passes already-prefixed requests through. The Traefik option follows the same subpath goal with a different proxy product.

References: docker-compose.dev.yml• L142-163 proxy/…/nginx.conf.template• L1-43 proxy/README.md• L53-74

For a subpath deployment, HYPERDX_BASE_PATH controls proxy routing and NEXT_PUBLIC_HYPERDX_BASE_PATH controls links generated by the UI. They must have the same value, such as /hyperdx. FRONTEND_URL must be the full public URL and must include that subpath. This keeps browser links, redirects, and proxy routing aligned.

References: proxy/README.md• L13-51

TLS edge

The demo Nginx configuration redirects HTTP to HTTPS and forwards HTTPS requests to the app. It is a local example rather than a complete production edge policy. For a real deployment, the public proxy should own certificates and public exposure, while app, MongoDB, and ClickHouse ports remain private unless an explicit operator need requires otherwise.

References: docker/…/nginx.conf• L14-54 docker/…/README.md• L1-15 DEPLOY.md• L51-59

Environment wiring

Environment values connect the services by separating public addresses from container-local addresses. Compose substitutes image and port values, while service configuration uses Docker DNS names such as db, ch-server, and otel-collector for internal traffic.

The key wiring groups are:

  • Public app settings: HYPERDX_APP_URL, HYPERDX_APP_PORT, HYPERDX_API_PORT, and FRONTEND_URL describe how users reach the UI and API. The Compose file builds FRONTEND_URL from the app URL and UI port.
  • Persistent stores: MONGO_URI points the app to MongoDB. DEFAULT_CONNECTIONS and DEFAULT_SOURCES describe the ClickHouse connection and the telemetry sources shown to the UI.
  • Telemetry path: the app and collector use the ClickHouse endpoint for storage. The app sends its own OTLP data to otel-collector:4318.
  • Control path: OPAMP_PORT and OPAMP_SERVER_URL connect the collector supervisor to the app for collector management.
  • Access and policy: HYPERDX_API_KEY, webhook allowlist settings, token encryption, usage statistics, and optional PromQL flags control access or product behavior.

The app entrypoint supplies defaults for local internal URLs and renders runtime NEXT_PUBLIC_* values into the browser environment file. The local all-in-one entrypoint maps ch-server and db to localhost, points the collector's control endpoint at the local app, selects the authenticated all-in-one image by default, and uses a no-auth image only for the explicit local-app marker. It also waits for ClickHouse before it starts the collector, then starts the API, UI, and alert task together. This lets one image serve many environments without rebuilding the frontend.

References: docker-compose.yml• L28-38 docker-compose.yml• L58-109 docker/…/entry.prod.sh• L1-15 docker/…/entry.local.base.sh• L7-47 docker/…/entry.local.base.sh• L59-94 docker/…/refresh-env.js• L1-20

Startup paths

HyperDX has different startup paths for a deployed stack, a developer stack, and a single-container local instance. The paths share the same broad roles but differ in image source, persistence, authentication, and port exposure.

Production Compose startup

The production-oriented path starts the four-service stack from docker-compose.yml. It pulls versioned app and collector images, creates the internal network, mounts persistent data directories, and publishes the app ports plus the collector's health and telemetry receiver ports. Operators normally place TLS and public routing in front of this stack, then restrict direct access to internal services.

The high-level production sequence is:

  1. Provide image, URL, port, storage, and security values through the Compose environment.
  2. Start the stack with docker compose up -d.
  3. Confirm the app and collector health endpoints.
  4. Send OTLP data to the published collector endpoint.
  5. Open the UI through the configured public URL or proxy.

References: DEPLOY.md• L36-59 docker-compose.yml• L17-130

Developer Compose startup

The developer path uses docker-compose.dev.yml for infrastructure and runs the app from the working tree. It builds the main collector locally, mounts collector configuration files, publishes data services for inspection, and adds optional JSON collector and Prometheus services. scripts/dev-env.sh assigns a slot-specific port band and Compose project name, which allows several worktrees to run without port collisions.

This path is for code change and service inspection rather than a production image test. The collector points at the host's OpAMP port, and the developer can reach MongoDB, ClickHouse, OTLP, and app ports from the host. See Development and test workflows for the wider developer lifecycle.

References: docker-compose.dev.yml• L1-18 docker-compose.dev.yml• L19-64 docker-compose.dev.yml• L64-108 docker-compose.dev.yml• L109-140 docker-compose.dev.yml• L165-181 scripts/dev-env.sh• L3-34 scripts/dev-env.sh• L44-84

Local all-in-one startup

The local path starts one hyperdx-local or all-in-one container with forwarded UI and OTLP ports. It favors immediate inspection over durable multi-user operation. The all-in-one-noauth mode is selected only for the explicit local-app marker, while the normal local path selects all-in-one-auth and keeps authentication enabled. The local process maps the container service names to localhost, starts ClickHouse and MongoDB, waits for ClickHouse, then starts the collector, API, UI, and alert task together.

This startup order gives the bundled collector a usable storage endpoint before it begins ingestion. The container waits for any of the app processes to exit, so one failed process ends the all-in-one runtime.

References: DEPLOY.md• L61-72 LOCAL.md• L20-41 docker/…/entry.local.base.sh• L7-31 docker/…/entry.local.base.sh• L45-94 docker/…/Dockerfile• L213-259

Trace storage lifecycle

The trace seed schema defines the ClickHouse shape used by the collector's storage path. It preserves span identity, service and span names, attributes, events, links, status, and duration. It also derives search fields and a RUM session identifier so the stored data supports trace lookup and session-oriented views.

The table is partitioned by day and uses a time-to-live value from the deployment configuration. This makes trace retention an operational setting rather than a fixed property of the image. The schema change adds derived access paths for trace ID, RUM session ID, attribute keys and values, duration, and lower-case span-name search.

References: docker/…/00005_otel_traces.sql• L2-43

Change checklist

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

  • Keep the app's public URL, proxy base path, and browser base path aligned. A mismatch can break redirects or static assets without stopping the containers.
  • Keep the collector's ClickHouse database and schema flags aligned with the app's default sources and any PromQL setting.
  • Keep published port changes synchronized with the app's HYPERDX_*_PORT values and the URLs used by developer tooling.
  • Keep the all-in-one image mode names aligned with the access mode expected by application startup and ingestion bootstrap.
  • Keep persistent volume paths stable when changing Compose project names or development slots. A new path can look like an empty deployment.
  • Keep proxy target ports and TLS settings aligned when changing the app listener or moving proxy termination outside Compose.
  • Keep trace retention and trace query fields aligned when changing the ClickHouse trace schema. Changes to derived fields can affect trace search and session views.
  • Keep the ClickHouse configuration variant aligned with the runtime path. Local Compose supports Prometheus remote read and write, while the bundled all-in-one configuration does not enable those handlers.
  • Keep the collector image target aligned with the startup path. The development target and production target package the same receiver surface but serve different build contexts.
  • Keep standalone API and web UI image ports and health paths aligned with the service URLs when those images replace the combined production image.
  • Keep browser telemetry build values aligned with the runtime collector endpoint. The standalone web UI image embeds these values during its build rather than taking them only at container start.
  • Keep optional StatsD changes paired: add the receiver to a collector pipeline and publish UDP 8125 only when the host can reserve that port.
  • Keep the optional JSON collector's database and schema flags aligned with its receiver configuration and the ClickHouse settings.
  • Keep local service-name aliases and the local OpAMP address aligned with the bundled process layout. A change can leave the app running while breaking collector control or storage access.

Important failure modes

TriggerConsequenceGuard
Exposing MongoDB or ClickHouse ports without network controlsData stores become reachable from outside the hostLeave their production port mappings disabled and publish only required edge or telemetry ports
HYPERDX_BASE_PATH and NEXT_PUBLIC_HYPERDX_BASE_PATH differThe proxy and browser produce different paths for pages, API calls, or assetsSet both to the same leading-slash path
FRONTEND_URL omits the public subpath or uses the wrong schemeRedirects, links, or alerts point to an unusable addressSet the full externally visible URL
Collector starts before ClickHouse is readyTelemetry export or collector startup failsUse the health-aware developer dependency and check collector health after startup
A development slot or Compose project is not isolatedWorktrees compete for ports or share the wrong data volumeSource scripts/dev-env.sh and use its project and volume values
Local no-auth mode is used for a shared deploymentUsers and telemetry lack the protection expected from an authenticated instanceUse the auth image or the production app path and set a random session secret
A local all-in-one process exits firstThe shared container stops even if the other services are healthyCheck the first failed app, collector, or data-store process and use the split topology for stronger process isolation
StatsD is enabled without a matching receiver pipeline or free UDP portStatsD data is dropped or the Compose stack fails to startAdd the receiver configuration and reserve 8125/udp before publishing it
The JSON collector writes to a database or schema that does not match its ClickHouse settingsJSON telemetry is rejected or is not visible through the expected sourceKeep the JSON exporter, database, and ClickHouse schema settings paired
Trace TTL or schema fields do not match the running ClickHouse schemaTrace writes, retention, or search views fail or lose expected dataApply the matching schema seed and keep ${TRACES_TTL} and derived fields valid
A runtime uses the wrong ClickHouse configuration variantPrometheus remote read or write requests fail even though ClickHouse is runningUse the local configuration for those handlers or provide an equivalent configuration in the bundled image
The Compose collector uses an image target that does not match its build or release pathThe container can lack the expected config or health behaviorUse the production target for released images and the development target for local builds
A standalone API or web UI image uses a port or health path that does not match its routeThe service can run but fail proxy checks or appear unhealthyAlign PORT, published ports, proxy targets, and health URLs for the selected image
Browser telemetry values are changed only at container start for a standalone web UI imageThe browser keeps sending telemetry to the old endpointSet the NEXT_PUBLIC_* telemetry build values before building the image
The local entrypoint uses a service alias or OpAMP address that does not match the bundled processesThe app can start while storage or collector management failsKeep ch-server, db, and the local OpAMP listener aligned with the all-in-one process layout

Key files

FileWhy to read it
docker-compose.ymlDefines the standard service topology, internal network, image inputs, ports, and persistent volumes.
docker-compose.dev.ymlShows the developer topology, local collector builds, optional services, slot labels, and readiness behavior.
docker/hyperdx/DockerfileDescribes the combined production image and the bundled all-in-one image variants.
packages/api/DockerfileShows the standalone API image path and its development and production service boundaries.
packages/app/DockerfileShows the standalone web UI image path and its browser configuration and health boundary.
docker/otel-collector/DockerfileDescribes the collector build targets, bundled receiver files, health endpoint, and runtime entrypoint.
docker/…/entry.prod.shShows how the production app image starts the API, UI, and background alert process.
docker/…/entry.local.base.shShows the local all-in-one process order, local service aliases, access mode, and internal service wiring.
docker/…/config.xmlDefines the local ClickHouse ports and Prometheus-compatible metric, remote-write, remote-read, and query paths.
docker/…/clickhouseConfig.xmlDefines the ClickHouse configuration used inside the all-in-one image and its supported Prometheus API path.
docker/…/00005_otel_traces.sqlDefines trace fields, search paths, daily partitions, and retention behavior in ClickHouse.
proxy/README.mdDefines the proxy subpath contract and the public URL values that must agree.
proxy/nginx/nginx.conf.templateIllustrates root redirects, asset and API rewrites, and subpath forwarding.
scripts/dev-env.shExplains development slot isolation and the host port map.
DEPLOY.mdSummarizes the supported deployment choices and production exposure warnings.