Commit graph

32 commits

Author SHA1 Message Date
Warren Lee
28f374ef12
[HDX-3929] Migrate OTel Collector build to use OCB (OpenTelemetry Collector Builder) (#2109) 2026-04-14 12:04:20 -07:00
Warren Lee
b9c9682972
Enable parallel integration testing across multiple worktrees (#1917)
## Summary

- Enable multiple agents/developers to run `make dev-int` simultaneously from different git worktrees without Docker port conflicts
- Compute a deterministic port offset (0-99) from the worktree directory name via `cksum`, giving each worktree its own isolated Docker Compose project and port range
- Switch `.env.test` files to use `${HDX_CI_*:-default}` variable expansion (powered by `dotenv-expand`) so test processes connect to the correct dynamic ports

## How it works

Each worktree gets a unique **slot** derived from its directory name. All service ports are offset by that slot:

| Service         | Base port | Example (slot 68) |
|-----------------|-----------|-------------------|
| ClickHouse HTTP | 18123     | 18191             |
| MongoDB         | 39999     | 40067             |
| API test server | 19000     | 19068             |
| OpAMP           | 14320     | 14388             |

Docker Compose project names are also unique (`int-<slot>`), isolating containers and networks.

Backward compatible — when no `HDX_CI_*` env vars are set, all ports fall back to their original defaults.

## Changes

- **Makefile**: Added `HDX_CI_SLOT` computation and dynamic project names/ports for all `dev-int` targets
- **docker-compose.ci.yml**: Ports use `${HDX_CI_*:-default}` env vars; removed unused OTel collector published port; removed hardcoded network name (auto-generated from project name)
- **packages/api/.env.test** / **packages/common-utils/.env.test**: Ports use `${HDX_CI_*:-default}` expansion syntax
- **packages/api/jest.config.js** / **packages/common-utils/jest.int.config.js**: Switched from `dotenv/config` to `dotenv-expand/config` to enable variable expansion
- **packages/api/package.json** / **packages/common-utils/package.json**: Added `dotenv-expand` devDependency
- **agent_docs/development.md**: Documented multi-agent worktree support

## Testing

Ran full Alert integration test suite (`make dev-int FILE=alerts`) — **6 test suites, 150 tests passed** on slot 68 with dynamic ports.
2026-03-16 19:42:08 +00:00
Warren Lee
cabe4d8edc
fix: add whereLanguage to tile alerts (#1842)
## Summary

- Fix tile alerts to support `groupBy` for Gauge/Sum metrics — each group-by value appears as its own column in the response
- Add missing `whereLanguage` to tile alert config so Lucene WHERE conditions are parsed correctly
- Replace stale fixture-based ClickHouse schema with otel-collector's canonical schema in integration tests

Ref: HDX-3576
2026-03-04 18:54:10 +00:00
Drew Davis
d760d2db5b
chore: Run integration tests on different ports (#1801)
# Summary

This PR updates the CI (integration tests) docker compose and env file so that the integration tests run on a separate set of ports, so that they can be run locally without interfering with an instance of the app running locally.

## Testing

To test locally

Start the app
```
yarn dev
```

Run the integration tests
```
make ci-int
```

Note that both can run at the same time without docker port conflicts. `make ci-int` can also be run without running the app - it uses its own independent mongo + clickhouse + api.
2026-02-25 20:52:17 +00:00
Aaron Knudtson
8772f5e294
chore: update clickhouse version for compose files to 26.1 (#1791) 2026-02-24 15:24:43 -05:00
Warren Lee
baf18da4c0
feat: add TLS support for OTel collector migration script (#1714)
Moved the inline goose CLI script to its own go script.
For the seed DDLs, we don’t create the version tables, and they should all be idempotent.
2026-02-10 02:40:28 +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
Warren Lee
fd81c4cb4f
chore: bump MongoDB version to 5.0.32 (#1569)
For the patch of CVE-2025-14847
2026-01-07 18:38:49 +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
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
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
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
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
Warren
bb6abc28d9
chore: lock ch version to 24-alpine (#613) 2025-02-12 19:48:42 +00:00
github-actions[bot]
7c03397fe9
Version common-utils + Setup int test environment (#566)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to v2, this PR will be updated.


# Releases
## @hyperdx/common-utils@0.0.10

### Patch Changes

-   fc4548f: feat: add alert schema + types


Co-authored-by: Warren <5959690+wrn14897@users.noreply.github.com>
2025-01-22 23:30:13 +00:00
Warren
74d6f4d1cd
style: deprecate INGESTOR_API_URL env var (#565) 2025-01-22 14:18:36 +00:00
Warren
8b6e09c20a
migration: alert v2 model (#542)
This PR includes changes:
1. Rename `type` field to `thresholdType` (enum 'above' or 'below')
2. Introduce alert source enum ('saved_search' or 'tile')
3. Rename `dashboardId` field to `dashboard`
4. Deprecate unused `cron` field
5. Deprecate external alert translation layers
6. Deprecate `appType` flag
7. Copied over 'common' pkgs from app dir (mostly clickhouse query helpers + types) -> will become a sharable pkg between app and api
2025-01-07 20:15:02 +00:00
Warren
9993fb2097
DX: standalone app docker image (#532)
For better self-hosting experience, users should be able to run
```
docker run -e MONGO_URI=xxx -p 8080:8080 hyperdx/hyperdx:2-beta
```
to spin up the project that includes the server components
2024-12-16 23:13:16 +00:00
Warren
74767e820e
feat: enable alerts-part 1 (#531)
1. Enable CI integration tests
2. Migrate `logView` to `savedSearch` and `chartId` to `tileId` in alert model
3. Add more alert route tests
2024-12-12 21:59:06 +00:00
Warren
7a766f7977
style: remove aggregator related codes (#521) 2024-12-09 09:59:36 -08:00
Warren
6a24dcf405
feat: single app image (#519) 2024-12-06 16:27:23 -08:00
Warren
aa165fcc46 feat: move more codes 2024-11-21 21:44:33 -08:00
Warren
b16456fc39 feat: move v2 codes 2024-11-12 05:53:15 -07:00
Warren
523443eb7c
fix: aggregator should return 413 (Content Too Large) to make ingestor ARC work properly (#461)
500 errors will cause ingestors to slow down due to ARC (https://vector.dev/docs/reference/configuration/sinks/http/#request.adaptive_concurrency), which is good.
However, for case like 413 (due to aggregator payload size limit), ingestors shouldn't slow down and be blocked.
The fix here is to return the original status code so ARC will tune up the concurrency properly

Before:
Events buffer will be queued up and ingestors will be blocked (concurrency stays)

<img width="1170" alt="Screenshot 2024-07-08 at 4 46 10 PM" src="https://github.com/hyperdxio/hyperdx/assets/5959690/a149092a-b062-4508-b62b-a85116ac74b2">


Now:
Events buffer will be cleared out properly (concurrency increases) 

<img width="1237" alt="Screenshot 2024-07-08 at 4 43 22 PM" src="https://github.com/hyperdxio/hyperdx/assets/5959690/7871593b-0e2f-4a1e-960c-c27d90869514">

TODO: we want to revisit the error global handler to make sure the proper status code is returned
2024-07-09 00:59:41 +00:00
Warren
bbc0aee3de chore: release v1.8.0 2024-04-19 16:29:50 -07:00
Mike Shi
ed82ff4cc8
Add multi-group-by support to metrics (#251) 2024-01-18 23:19:31 +00:00
Warren
499c537ea5
style: inject ingestor url (otel config file) + aggregator/go-parser url (ingestor config file) through env vars (#241) 2024-01-17 01:54:25 +00:00
Warren
39ac7eaa95
ci: run healthcheck for otel-collector + ingestor (#238)
To validate ingestor and otel-collector configs in CI
2024-01-16 08:52:48 +00:00
Warren
79c2761904
chore: bump ch base image to v23.8.8 (#165) 2023-12-28 07:21:48 +00:00
Warren
8443a080f9
Implement CHART source alert (scheduled task) (#108) 2023-11-17 13:50:59 -08:00
Warren
f231d1f65f
fix: boolean env var type issue (older compose version) (#72)
for docker-vompose v1x, it throws error like:
```
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.ingestor.environment.VECTOR_OPENSSL_LEGACY_PROVIDER contains false, which is an invalid type, it should be a string, number, or a null
```
2023-10-21 00:36:56 +00:00
Warren
0826d4dd89 first commit 2023-09-12 20:08:05 -07:00