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.
| Service | System role | Main connection |
|---|---|---|
app | Serves the web UI, API, and alert task process | MongoDB, ClickHouse, and the Collector's OpAMP endpoint |
otel-collector | Receives OTLP and Fluentd telemetry and exports it to ClickHouse | ClickHouse and the app's OpAMP endpoint |
otel-collector-json | Provides an optional development path for JSON-shaped telemetry | ClickHouse and the app's OpAMP endpoint |
ch-server | Stores logs, traces, metrics, and related observability data | Internal HTTP and native ClickHouse endpoints |
db | Stores HyperDX application state | Internal MongoDB endpoint |
| Optional proxy | Publishes the UI through a public host or URL subpath | The 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, andFRONTEND_URLdescribe how users reach the UI and API. The Compose file buildsFRONTEND_URLfrom the app URL and UI port. - Persistent stores:
MONGO_URIpoints the app to MongoDB.DEFAULT_CONNECTIONSandDEFAULT_SOURCESdescribe 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_PORTandOPAMP_SERVER_URLconnect 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:
- Provide image, URL, port, storage, and security values through the Compose environment.
- Start the stack with
docker compose up -d. - Confirm the app and collector health endpoints.
- Send OTLP data to the published collector endpoint.
- 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_*_PORTvalues 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
8125only 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
| Trigger | Consequence | Guard |
|---|---|---|
| Exposing MongoDB or ClickHouse ports without network controls | Data stores become reachable from outside the host | Leave their production port mappings disabled and publish only required edge or telemetry ports |
HYPERDX_BASE_PATH and NEXT_PUBLIC_HYPERDX_BASE_PATH differ | The proxy and browser produce different paths for pages, API calls, or assets | Set both to the same leading-slash path |
FRONTEND_URL omits the public subpath or uses the wrong scheme | Redirects, links, or alerts point to an unusable address | Set the full externally visible URL |
| Collector starts before ClickHouse is ready | Telemetry export or collector startup fails | Use the health-aware developer dependency and check collector health after startup |
| A development slot or Compose project is not isolated | Worktrees compete for ports or share the wrong data volume | Source scripts/dev-env.sh and use its project and volume values |
| Local no-auth mode is used for a shared deployment | Users and telemetry lack the protection expected from an authenticated instance | Use the auth image or the production app path and set a random session secret |
| A local all-in-one process exits first | The shared container stops even if the other services are healthy | Check 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 port | StatsD data is dropped or the Compose stack fails to start | Add 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 settings | JSON telemetry is rejected or is not visible through the expected source | Keep the JSON exporter, database, and ClickHouse schema settings paired |
| Trace TTL or schema fields do not match the running ClickHouse schema | Trace writes, retention, or search views fail or lose expected data | Apply the matching schema seed and keep ${TRACES_TTL} and derived fields valid |
| A runtime uses the wrong ClickHouse configuration variant | Prometheus remote read or write requests fail even though ClickHouse is running | Use 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 path | The container can lack the expected config or health behavior | Use 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 route | The service can run but fail proxy checks or appear unhealthy | Align 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 image | The browser keeps sending telemetry to the old endpoint | Set 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 processes | The app can start while storage or collector management fails | Keep ch-server, db, and the local OpAMP listener aligned with the all-in-one process layout |
Key files
| File | Why to read it |
|---|---|
| docker-compose.yml | Defines the standard service topology, internal network, image inputs, ports, and persistent volumes. |
| docker-compose.dev.yml | Shows the developer topology, local collector builds, optional services, slot labels, and readiness behavior. |
docker/hyperdx/Dockerfile | Describes the combined production image and the bundled all-in-one image variants. |
packages/api/Dockerfile | Shows the standalone API image path and its development and production service boundaries. |
packages/app/Dockerfile | Shows the standalone web UI image path and its browser configuration and health boundary. |
docker/otel-collector/Dockerfile | Describes the collector build targets, bundled receiver files, health endpoint, and runtime entrypoint. |
| docker/…/entry.prod.sh | Shows how the production app image starts the API, UI, and background alert process. |
| docker/…/entry.local.base.sh | Shows the local all-in-one process order, local service aliases, access mode, and internal service wiring. |
| docker/…/config.xml | Defines the local ClickHouse ports and Prometheus-compatible metric, remote-write, remote-read, and query paths. |
| docker/…/clickhouseConfig.xml | Defines the ClickHouse configuration used inside the all-in-one image and its supported Prometheus API path. |
| docker/…/00005_otel_traces.sql | Defines trace fields, search paths, daily partitions, and retention behavior in ClickHouse. |
| proxy/README.md | Defines the proxy subpath contract and the public URL values that must agree. |
proxy/nginx/nginx.conf.template | Illustrates root redirects, asset and API rewrites, and subpath forwarding. |
| scripts/dev-env.sh | Explains development slot isolation and the host port map. |
| DEPLOY.md | Summarizes the supported deployment choices and production exposure warnings. |