Commit graph

105 commits

Author SHA1 Message Date
Warren Lee
683ec1a80e
fix: add TLS parameters for https ClickHouse endpoints in goose DB string (#1689)
Need to add `secure=true&skip_verify=false` TLS params for https (CHC)

Ref: https://github.com/pressly/goose/pull/796/changes
2026-02-02 23:13:56 +00:00
Warren Lee
c2a6193393
feat: add OTLP auth token support for standalone mode (#1684)
Ref: HDX-3317
2026-02-02 17:25:38 +00:00
Warren Lee
6f4c8efba0
feat: Enforce ClickStack schemas by default (#1682)
- Introduce a new flag `HYPERDX_OTEL_EXPORTER_CREATE_LEGACY_SCHEMA` (default to false) to otel collector
- Custom ClickStack schemas should be enforced by default
- ClickHouse tables migration logs should be stored in `clickstack_db_version_xxx` tables
- The collector will run the migration at startup and retry if it fails to connect to the database (using exponential backoff).
- Fully backward compatible

Ref: HDX-3301
2026-02-02 16:39:20 +00:00
Rahul
0d321ea15f
update Docker images for Docker Scout Score improvements (#1680)
Co-authored-by: Himanshu Kapoor <himanshu.kapoor@clickhouse.com>
2026-01-29 16:37:22 -06:00
Warren Lee
43de467864
feat: allow otel-collector to run without OpAMP server (#1672)
Today, users have to set up an OpAMP server to run with our clickstack OTel collector. Instead, we should allow users to disable OpAMP when they're using ClickHouse Cloud with the clickstack integration.

This can be determined by `OPAMP_SERVER_URL` not being defined by the user.

The end result is that a user can do

```
docker run \
  -e CLICKHOUSE_ENDPOINT=${CLICKHOUSE_ENDPOINT} \
  -e CLICKHOUSE_USER=default \
  -e CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD} \
  -p 8080:8080 -p 4317:4317 -p 4318:4318 \
  clickhouse/clickstack-otel-collector:latest
```

Ref: HDX-3300
2026-01-29 17:50:24 +00:00
Dan Hable
d07e30d5fb
feat: associate logged in user to clickhouse query (#1636)
Allows setting a custom setting prefix on a connection. When set in HyperDX and the ClickHouse settings, the HyperDX app will set a custom setting for each query. These are recorded in the query log and can be used to identify which user issues the query.

## Testing

The commit also updates the local dev ClickHouse instance to support a custom setting prefix of `hyeprdx`. After running `make dev-up`, you should be able to edit the connection and set the the prefix to `hyperdx`. 

<img width="955" height="197" alt="Screenshot 2026-01-21 at 1 23 14 PM" src="https://github.com/user-attachments/assets/607fc945-d93f-4976-9862-3118b420c077" />

After saving, just allow the app to live tail a source like logs. If you connect to the ClickHouse database, you should then be able to run

```
SELECT query, Settings
FROM system.query_log
WHERE has(mapKeys(Settings), 'hyperdx_user')
FORMAT Vertical
```

and then see a bunch of queries with the user set to your logged in user.

```
Row 46:
───────
query:    SELECT Timestamp, ServiceName, SeverityText, Body, TimestampTime FROM default.otel_logs WHERE (TimestampTime >= fromUnixTimestamp64Milli(_CAST(1769022372269, 'Int64'))) AND (TimestampTime <= fromUnixTimestamp64Milli(_CAST(1769023272269, 'Int64'))) ORDER BY (TimestampTime, Timestamp) DESC LIMIT _CAST(0, 'Int32'), _CAST(200, 'Int32') FORMAT JSONCompactEachRowWithNamesAndTypes
Settings: {'use_uncompressed_cache':'0','load_balancing':'in_order','log_queries':'1','max_memory_usage':'10000000000','cancel_http_readonly_queries_on_client_close':'1','parallel_replicas_for_cluster_engines':'0','date_time_output_format':'iso','hyperdx_user':'\'dan@hyperdx.io\''}
```
2026-01-28 14:58:05 +00:00
Dale McDiarmid
66f56cb1d0
chore: Move schema configs to file (#1635)
Co-authored-by: Tom Alexander <tom.alexander@clickhouse.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-28 14:52:54 +01:00
Drew Davis
1cf8cebb4b
feat: Support JSON Sessions (#1628) 2026-01-21 19:25:39 -05:00
Dan Hable
6537884825
build: remove lingering references to log-rotator.sh (#1520)
We removed the rotator script when we used the named pipe approach to the otel collector logging. There were some references left over that caused the docker build to fail.
2025-12-23 16:22:46 +00:00
Dan Hable
0bb7407747
fix: support otel collector logging with minimal storage (#1509)
This commit sets up a FIFO named pipe with the same name/path that the otel collector and supervisor are expecting. By starting to tail that pipe before starting the collector, we can send log files to stdio without the memory required by the `passthrough_logs` feature or and storage on the volume.

---
Running locally in orbstack, we're still seeing logs on stdout

<img width="2316" height="1452" alt="image" src="https://github.com/user-attachments/assets/f86961cf-6ea4-4faa-82f8-54f9596b5f16" />

but the file size for `agent.log` remains at 0

<img width="1606" height="838" alt="image" src="https://github.com/user-attachments/assets/6feb9470-e220-4d8a-b5b3-10a221926158" />

disk usage stats also remain stable

<img width="1728" height="860" alt="image" src="https://github.com/user-attachments/assets/ff5fe593-4936-446e-9396-606fb495d60d" />
2025-12-19 19:18:33 +00:00
Daniel Lockyer
99ea6395cf
chore: drop npx prefix from concurrently commands (#1505)
Co-authored-by: Drew Davis <drew.davis@clickhouse.com>
2025-12-19 11:55:02 -05:00
Dan Hable
7a53880356
Revert "fix(otel-collector): fix log rotation script (#1479)" (#1495)
This reverts commit 0b19f915e8.
2025-12-17 17:27:51 +00:00
Dan Hable
0b19f915e8
fix(otel-collector): fix log rotation script (#1479)
There were two issues with the log rotation script:

1. Logs could be lost since copying and then truncating the file might not finish before logs arrive.

2. The otel collector application will keeps the file handle and offset cached. After truncating, it will write starting at the last offset leaving the unallocated garbage in the beginning of the file. This garbage uses space.

This commit moves the file instead of copying. That allows the collector to continue writing to the rolled file until a SIGHUP is sent. This causes a config refresh, which also opens a new log file. After, the rolled file and the new log file have correct sizes.

--
**ADDITIONAL NOTES**: 

Claude's code review is not accurate here.

* The alpine image is based on busybox and fuser is a command implemented by busybox. This can be verified by just running the collector and watching the log rotate behavior.
* The mv command updates the name of the file in the file system but doesn't change the inode number. A process only uses the file path the first time the file is open to resolve it into a inode number. Moving the file changes the name but doesn't change the inode number so the process will continue to write to that file.
2025-12-15 16:08:11 +00:00
Tom Alexander
52d2798582
chore: Update to next 16, react 19, add react compiler (#1434)
fixes: HDX-2956

Co-authored-by: Brandon Pereira <7552738+brandon-pereira@users.noreply.github.com>
2025-12-04 23:40:59 +00:00
Jarrad
7cf4ba4d70
allow configuring the app's listen address with HYPERDX_APP_LISTEN_HOSTNAME (#1344) 2025-11-25 16:22:07 +01:00
Aaron Knudtson
19c5085cde
chore: split json otel collector to enable both during dev (#1247)
Gets us closer to a staging instance of json

<img width="216" height="174" alt="image" src="https://github.com/user-attachments/assets/b5cc3cf8-aef0-4ba4-9e9a-8c1d4fad5451" />


Co-authored-by: Warren <5959690+wrn14897@users.noreply.github.com>
2025-11-04 21:16:41 +00:00
Ruud Kamphuis
c6ad250f3d
Enable auto-provisioning for no-auth mode (#1297)
Co-authored-by: Aaron Knudtson <87577305+knudtty@users.noreply.github.com>
2025-10-29 09:42:39 -04:00
Warren
131a1c1edb
revert: api esbuild (#1280)
This PR reverts https://github.com/hyperdxio/hyperdx/pull/937

Ref: HDX-2620
2025-10-21 09:27:47 +00:00
Brandon Pereira
e032af5509
attempt to ensure otel collector logs go to stdout (#1228) 2025-10-01 11:51:24 -06:00
Drew Davis
45e8e1b62d
fix: Update tsconfigs to resolve IDE type errors (#1150) 2025-09-11 08:55:14 -04:00
Aaron Knudtson
8568580127
feat: add custom ingestion key via INGESTION_API_KEY (#1112)
Closes HDX-2283

This adds an environment variable `INGESTION_API_KEY` that can be set by the user. This apiKey will be valid and accepted by the Otel collector. It is in addition to the autogenerated apiKey and will not show in the team settings apiKey section.
2025-08-29 20:10:46 +00:00
Warren
3636fc570d
style: update otelcol config file volume mount from dev stage (#1091) 2025-08-21 14:03:45 +00:00
Warren
56fd856d7a
fix: otelcol process in aio build (#1085) 2025-08-20 19:17:39 +00:00
Warren
d29e2bcb67
fix: handle the case when CUSTOM_OTELCOL_CONFIG_FILE is not specified (#1080)
plus fixing startup issue when the team isn't created yet
2025-08-19 17:08:49 +00:00
Warren
ab50b12a6b
feat: support custom otel collector config (BETA) (#1074)
plus the fix to reduce bloat in opamp agent logs

Users should be able to mount the custom otel collector config file and add/overrider receivers, processors and exporters
For example:
```
receivers:
  hostmetrics:
    collection_interval: 5s
    scrapers:
      cpu:
      load:
      memory:
      disk:
      filesystem:
      network:
# override the default processors
processors:
  batch:
    send_batch_size: 10000
    timeout: 10s
  memory_limiter:
    limit_mib: 2000
service:
  pipelines:
    metrics/hostmetrics:
      receivers: [hostmetrics]
      # attach existing processors
      processors: [memory_limiter, batch]
      # attach existing exporters
      exporters: [clickhouse]
```
This will add a new `hostmetrics` receiver + `metrics/hostmetrics` pipeline and update existing `batch` + `memory_limiter` processors 

WARNING: This feature is still in beta, and future updates may change how it works, potentially affecting compatibility

Ref: HDX-1865
2025-08-18 21:22:43 +00:00
Warren
6c134035c4
fix: use '--kill-others-on-fail' to prevent processes from terminating when RUN_SCHEDULED_TASKS_EXTERNALLY is enabled (#1015)
Ref: HDX-2044

Co-authored-by: Dan Hable <418679+dhable@users.noreply.github.com>
2025-07-24 21:56:38 +00:00
Mike Shi
ecb0f2c889
feat: Add JSON support to all in one build (#972) 2025-07-03 22:54:59 +00:00
Mike Shi
52ca1823a4
feat: Add ClickHouse JSON Type Support (#969)
- Upgrades ClickHouse to 25.6, fixes breaking config change, needed for latest JSON type
- Upgrades OTel Collector to 0.129.1, fixes breaking config change, needed for latest JSON support in exporter
- Upgrades OTel OpAMP Supervisor to 0.128.0
- Fixes features to support JSON type columns in OTel in HyperDX (filtering, searching, graphing, opening rows, etc.)

Requires users to set `BETA_CH_OTEL_JSON_SCHEMA_ENABLED=true` in `ch-server` and `OTEL_AGENT_FEATURE_GATE_ARG='--feature-gates=clickhouse.json'` in `otel-collector` to enable JSON schema. Users must start a new ClickHouse DB or migrate their own table manually to enable as it is not schema compatible and migration is not automatic.

Closes HDX-1849, HDX-1969, HDX-1849, HDX-1966, HDX-1964

Co-authored-by: Tom Alexander <3245235+teeohhem@users.noreply.github.com>
2025-07-03 17:11:03 +00:00
Aaron Knudtson
93e36b5581
fix: connection creation revamp (#947)
Fixes HDX-1926
2025-06-26 15:08:47 +00:00
Aaron Knudtson
9191c11323
fix: disable nx daemon (#942) 2025-06-24 16:51:59 +00:00
Aaron Knudtson
ad6887796f
feat: bundle api for image size reduction (#937)
all-in-one image: 1.51 gb -> 1.21 gb
app image: 573 mb -> 271 mb

Ref HDX-1803
2025-06-24 15:51:34 +00:00
Tom Alexander
661a1ec915
chore: Make passthrough_logs an envvar controlled setting in collector (#922)
Adds environment variable to allow for passthrough_logs to be enabled in the supervisor config

Test locally with:
Edit docker-compose.dev.yaml
Add `OTEL_SUPERVISOR_PASSTHROUGH_LOGS: 'true'` under the otel environment variables

```
make dev-up
```

Ref: HDX-1859
2025-06-10 23:16:52 +00:00
Warren
2063774866
perf: build next app in standalone mode to cut down images size (#916)
App image: 1.29GB -> 561MB
Local image: 2.23GB -> 1.5GB

Ref: HDX-1803
2025-06-09 23:40:02 +00:00
Warren
31e22dcff4
feat: introduce clickhouse db init script (#843)
Ref: HDX-1777

This shouldn't have any impact on users
2025-06-09 16:45:23 +00:00
Warren
ab387e1168
fix: missing types in app build (#905)
bonus adjust logging (otel config + exception)
2025-06-03 20:20:56 +00:00
Warren
ab3b5cb628
perf: merge api + app packages to dedupe node_modules (#901)
aio: 3GB -> 2.2GB
app: 2.05GB -> 1.27GB

Ref: HDX-1803
2025-06-02 20:53:45 +00:00
Warren
4863175c34
style: improve aio startup logs + silent ch stdout (#868)
Ref: HDX-1801

startup logs are like

```
Send OpenTelemetry data via:
  http/protobuf: OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
  gRPC: OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

Exporting data to ClickHouse:
  Endpoint: tcp://ch-server:9000?dial_timeout=10s
  Database: default

Waiting for ClickHouse to be ready...
ClickHouse is ready!

Visit the HyperDX UI at http://localhost:8080

```
2025-05-28 22:36:16 +00:00
Aaron Knudtson
59ee6d2edc
usage info (#846)
Ref: HDX-1692
2025-05-28 22:31:57 +00:00
Warren
e27c24a13f
feat: introduce a few env vars to config otel collector (#864)
- Support `CLICKHOUSE_ENDPOINT` to switch aio clickhouse endpoint (Ref: HDX-1758)
- Support `HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE ` (Ref: HDX-1786)

Support command like
```
docker run -e CLICKHOUSE_ENDPOINT=<CH-CLOUD-ENDPOINT> -e CLICKHOUSE_USER=default -e CLICKHOUSE_PASSWORD='BLABLA' -e HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE =hyperdx -p 8080:8080 -p 4317:4317 -p 4318:4318 hyperdx/hyperdx-local:2-nightly
```
So users can export data to other services like clickhouse cloud
2025-05-28 18:54:13 +00:00
Warren
54622bb060
build: config opamp port (#866)
Ref: HDX-1799
2025-05-28 16:51:10 +00:00
Mike Shi
854c4b1509
feat: Add default connections and sources to docker compose and docker all in one images (#865)
Fixes HDX-1798
2025-05-28 04:17:57 +00:00
Warren
d63deeddbe
fix: support otelcol opamp in aio build (#859)
Ref: HDX-1734
2025-05-27 18:56:11 +00:00
Warren
0ab1b2bf8d
DX: pull opampsupervisor base image from dockerhub (#857)
Pulling the image from ghcr creates more friction for users, especially when dealing with issues like expired tokens. For example, you might see errors such as
```
docker pull ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-opampsupervisor:0.126.0

Error response from daemon: Head "https://ghcr.io/v2/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-opampsupervisor/manifests/0.126.0": denied: denied
```
2025-05-26 21:37:25 +00:00
Mike Shi
d72d1d2d26
Add ingestion key check to otel collector via OpAMP (#825)
HDX-1698
2025-05-23 01:41:35 +00:00
Warren
c60b975e29
chore: bump node to v22.16.0 (#839)
Ref: HDX-1757
2025-05-22 17:05:30 +00:00
Warren
86465a2027
fix: map CLICKHOUSE_SERVER_ENDPOINT to exporter 'endpoint' (#838)
For users connecting to ClickHouse Cloud or a TLS endpoint, add the `secure=true` query parameter or use the HTTPS protocol. Providing the full URL via the `CLICKHOUSE_SERVER_ENDPOINT` in the exporter's endpoint field should resolve this issue

Ref: HDX-1743
2025-05-22 05:56:18 +00:00
Dan Hable
d9ab75710e
feat: normalize the text case of severity text (#834) 2025-05-22 04:42:00 +00:00
Warren
e7262d1288
feat: introduce all-one-one (auth vs noauth) multi-stage build (#821)
1. Merge 'fullstack' and 'local' (auth + noauth) builds into a single Dockerfile
2. Introduce 'all-in-one-auth' and 'all-in-one-noauth' build stages
3. Lock `IS_LOCAL_APP_MODE` env var
4. Fix bug in ctrl-c exit with docker run
5. Enable alerts in local mode (no-auth)
6. Build `common-utils` on the fly (no longer needing pulling pkg from npm)

Ref: HDX-1709
Ref: HDX-1713
Ref: HDX-1254
Ref: HDX-1729

To match v2 product definition, we are going to release three images:
- hyperdx/hyperdx (--target=prod): app only without any other deps (clickhouse, otelcol, mongodb), used in default compose + helm deployment
- hyperdx/hyperdx-all-in-one (--target=all-in-one-auth): all-in-one build + auth
- hyperdx/hyperdx-local (--target=all-in-one-noauth): all-in-one build + no-auth

Production impacts:
- hyperdx/hyperdx: none
- hyperdx/hyperdx-all-in-one: new
- hyperdx/hyperdx-local: add server components (alerts, saved searches, dashboards)
2025-05-19 22:35:48 +00:00
Mike Shi
15bb9e6c7e
chore: remove unused dependencies (#791)
- removes redis from stack (using in memory rate limiter)
- deletes unused miner code (moved to browser-based pyodide module)
- fixes rate limit bug

fixes HDX-1248
2025-05-06 03:13:20 +00:00
Dan Hable
1c54b59939
feat: Handle JSON-like structured logs better (#763)
Updates the OTEL pipeline to handle structured logs better. If the body content is an OTEL map, it will merge the body map into the log attributes map. If the body is a JSON object, it will parse the JSON string into an OTEL map, then merge the fields into the log attributes map.

Replacing the Body field doesn't work since the Clickhouse exporter schema defines Body as string, so any parsed out object ends up turning back into a string. At least as log resources, it's a lighter weight means of grouping and filtering in the UI.

Ref: HDX-1453
2025-04-21 18:11:00 +00:00