diff --git a/.env b/.env index 32c2952ff..0f31ad49a 100644 --- a/.env +++ b/.env @@ -2,14 +2,15 @@ HDX_IMAGE_REPO=docker.hyperdx.io CH_IMAGE_REPO=docker.clickhouse.com IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx +NEXT_IMAGE_NAME_DOCKERHUB=clickhouse/clickstack NEXT_LOCAL_IMAGE_NAME_DOCKERHUB=clickhouse/clickstack-local LOCAL_IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx-local NEXT_ALL_IN_ONE_IMAGE_NAME_DOCKERHUB=clickhouse/clickstack-all-in-one ALL_IN_ONE_IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx-all-in-one NEXT_OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB=clickhouse/clickstack-otel-collector OTEL_COLLECTOR_IMAGE_NAME_DOCKERHUB=hyperdx/hyperdx-otel-collector -CODE_VERSION=2.43.0 -IMAGE_VERSION_SUB_TAG=.43.0 +CODE_VERSION=2.45.0 +IMAGE_VERSION_SUB_TAG=.45.0 IMAGE_VERSION=2 IMAGE_NIGHTLY_TAG=2-nightly IMAGE_LATEST_TAG=latest diff --git a/.fork-surface b/.fork-surface index 6cd51e08e..06ac07e64 100644 --- a/.fork-surface +++ b/.fork-surface @@ -44,9 +44,10 @@ # top of every session, and keep their line intact at the bottom. Low churn - # upstream rarely touches that single line - so rerere replays it cleanly. CLAUDE.md -LOCAL.md knip.json README.md +# Our security policy, kept whole in place of the one upstream ships. +SECURITY.md agent_docs/tech_stack.md # Published on the DFE docs site, so its HyperDX mentions say the console - see docs/fork/what-we-changed.md. docs/alert-webhook-template-variables.md @@ -56,7 +57,6 @@ docs/alert-webhook-template-variables.md docker-compose.ci.yml docker/hyperdx/entry.prod.sh docker/nginx/README.md -docker/otel-collector/custom.config.yaml docker/otel-collector/schema/README.md nx.json package.json @@ -86,6 +86,10 @@ packages/app/public/pyodide/pyodide.asm.js packages/app/public/pyodide/pyodide.js # One hook entry on the ky instance: a 4xx carries the response body's reason. packages/app/src/api.ts +# The DFE brand: the name, marks and Mantine theme come from dfe/brand.tsx, and +# the CSS tokens from theme/themes/dfe - see docs/fork/what-we-changed.md. +packages/app/src/ThemeWrapper.tsx +packages/app/src/brand/index.tsx packages/app/src/DBChartPage.tsx packages/app/src/DBDashboardPage.tsx packages/app/src/DBSearchPage.tsx @@ -94,7 +98,6 @@ packages/app/src/LandingPage.tsx # and the preset dashboards route through dfe/presetDashboards.ts, which offers # none - see docs/fork/what-we-changed.md. packages/app/src/Spotlights.tsx -packages/app/src/UserPreferencesModal.tsx packages/app/src/components/AppNav/AppNav.tsx packages/app/src/components/ContextSidePanel.tsx # The restore-shipped control in the toolbar, and the preset dashboards removed @@ -111,11 +114,7 @@ packages/app/src/config.ts packages/app/src/fonts.ts packages/app/src/hooks/useRowWhere.tsx packages/app/src/layout.tsx -packages/app/src/theme/ThemeProvider.tsx -packages/app/src/theme/index.ts -packages/app/src/theme/themes/_base-tokens.scss -packages/app/src/theme/types.ts -packages/app/src/utils.ts +packages/app/src/theme/_base-tokens.scss packages/app/styles/LogTable.module.scss packages/app/styles/globals.css packages/app/src/components/SQLEditor/SQLInlineEditor.tsx diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..853acf197 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# One reviewer is picked round robin by the team's code review settings. +* @ClickHouse/clickstack diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 93dc43ee4..49cf5f8d8 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -17,7 +17,7 @@ paste the URL if it does. If you're working from the repo, `yarn app:dev:local` plus onboarding → "Connect to Demo Server" gives you the same data locally. If it only happens with your own data, include the table schema (`SHOW CREATE TABLE ...`) and source settings. -See https://github.com/hyperdxio/hyperdx/blob/main/CONTRIBUTING.md#reproducing-issues-and-prs +See https://github.com/ClickHouse/ClickStack/blob/main/CONTRIBUTING.md#reproducing-issues-and-prs --> **Reproduces on play.hyperdx.io?** diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index cfa0fd29c..042c90c39 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -7,7 +7,7 @@ contact_links: about: For usage questions, setup help, and general discussion, ask on Discord. - name: First-time contributor? - url: https://github.com/hyperdxio/hyperdx/blob/main/CONTRIBUTING.md#getting-vouched + url: https://github.com/ClickHouse/ClickStack/blob/main/CONTRIBUTING.md#getting-vouched about: No need to open an issue to get vouched. Open your pull request and a maintainer vouches from there. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 98b7b2990..8d80c0289 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -26,4 +26,4 @@ labels: enhancement, Needs Feedback New issues start as `Needs Feedback` so we can discuss scope before anyone writes code. Once a maintainer swaps that for `Accepting PR`, the issue is ready to be picked up — see -[CONTRIBUTING.md](https://github.com/hyperdxio/hyperdx/blob/main/CONTRIBUTING.md#from-issue-to-pull-request). +[CONTRIBUTING.md](https://github.com/ClickHouse/ClickStack/blob/main/CONTRIBUTING.md#from-issue-to-pull-request). diff --git a/.github/VOUCHED.td b/.github/VOUCHED.td index 95533ec1a..34f99e793 100644 --- a/.github/VOUCHED.td +++ b/.github/VOUCHED.td @@ -1,4 +1,4 @@ -# Vouched contributors for hyperdxio/hyperdx. +# Vouched contributors for ClickHouse/ClickStack. # # Pull requests from GitHub users who are not in this list are closed # automatically by .github/workflows/vouch.yml. See CONTRIBUTING.md for how to @@ -29,10 +29,13 @@ adityapimpalkar alex-fedotyev alok87 +andrewdunndev archat-hash arj22 aryainguz bahltushar +bcanvural +bferreirq bilalatique brandon-pereira colehpage diff --git a/.github/images/search_splash.png b/.github/images/search_splash.png index d6d6d4fb7..2342a18bf 100644 Binary files a/.github/images/search_splash.png and b/.github/images/search_splash.png differ diff --git a/.github/prompts/code-review.md b/.github/prompts/code-review.md index 62605a048..a7f9adf73 100644 --- a/.github/prompts/code-review.md +++ b/.github/prompts/code-review.md @@ -1,4 +1,4 @@ -REPO: hyperdxio/hyperdx +REPO: ClickHouse/ClickStack PR: #{{PR_NUMBER}} Review this pull request. diff --git a/.github/scripts/code-review/review-comments.cjs b/.github/scripts/code-review/review-comments.cjs index 8818e6c2f..f0cdc1b4f 100644 --- a/.github/scripts/code-review/review-comments.cjs +++ b/.github/scripts/code-review/review-comments.cjs @@ -25,7 +25,7 @@ const MAX_BODY = 65536; * FOOTER repeats the rule and this anchor; the anchor test pins both to the AGENTS.md heading. */ const GUIDE_URL = - 'https://github.com/hyperdxio/hyperdx/blob/main/AGENTS.md#responding-to-review-feedback'; + 'https://github.com/ClickHouse/ClickStack/blob/main/AGENTS.md#responding-to-review-feedback'; const GUIDE_LINK = `[How to respond](${GUIDE_URL})`; /** diff --git a/.upstream-version b/.upstream-version index 327aa79bd..b30d9add0 100644 --- a/.upstream-version +++ b/.upstream-version @@ -9,6 +9,6 @@ # # Written by the sync workflow; bump it in the same commit as the merge. -upstream_ref: '@hyperdx/app@2.43.0' -upstream_sha: 31f865e9d326cd081afec1b9ba3a89a27858f1cf -synced: 2026-10-30 +upstream_ref: '@hyperdx/app@2.45.0' +upstream_sha: 0096a355c0f6fba3e691d2e8efe83228bc35751b +synced: 2026-11-14 diff --git a/.vex/openssl-mongodb.vex.json b/.vex/openssl-mongodb.vex.json index 20e3a67fd..4a8aecdd8 100644 --- a/.vex/openssl-mongodb.vex.json +++ b/.vex/openssl-mongodb.vex.json @@ -1,6 +1,6 @@ { "@context": "https://openvex.dev/ns/v0.2.0", - "@id": "https://github.com/hyperdxio/hyperdx/blob/main/.vex/openssl-mongodb.vex.json", + "@id": "https://github.com/ClickHouse/ClickStack/blob/main/.vex/openssl-mongodb.vex.json", "author": "HyperDX Team", "role": "Supplier", "timestamp": "2026-02-17T00:00:00Z", diff --git a/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch b/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch new file mode 100644 index 000000000..80a885b11 --- /dev/null +++ b/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch @@ -0,0 +1,40 @@ +diff --git a/dist/uPlot.cjs.js b/dist/uPlot.cjs.js +index 98b7582dff68d4f4d9e0068cc77bec9d33ea4904..d137fbcb9f24358d7e59350907181106fc5b231d 100644 +--- a/dist/uPlot.cjs.js ++++ b/dist/uPlot.cjs.js +@@ -441,7 +441,14 @@ function _rangeNum(_min, _max, cfg) { + } + + // alternative: https://stackoverflow.com/a/2254896 +-const numFormatter = new Intl.NumberFormat(domEnv ? nav.language : 'en-US'); ++// Patched: Intl rejects POSIX-style tags such as 'en-US@posix', which some ++// browsers report as navigator.language. Fall back instead of throwing at import. ++let numFormatter; ++try { ++ numFormatter = new Intl.NumberFormat(domEnv ? nav.language : 'en-US'); ++} catch (e) { ++ numFormatter = new Intl.NumberFormat('en-US'); ++} + const fmtNum = val => numFormatter.format(val); + + const M = Math; +diff --git a/dist/uPlot.esm.js b/dist/uPlot.esm.js +index 87473c9cfb3366f57883cb803114a87c64d4b6b8..740bd3626a1f8bd6bbe352878e55e898e759784c 100644 +--- a/dist/uPlot.esm.js ++++ b/dist/uPlot.esm.js +@@ -439,7 +439,14 @@ function _rangeNum(_min, _max, cfg) { + } + + // alternative: https://stackoverflow.com/a/2254896 +-const numFormatter = new Intl.NumberFormat(domEnv ? nav.language : 'en-US'); ++// Patched: Intl rejects POSIX-style tags such as 'en-US@posix', which some ++// browsers report as navigator.language. Fall back instead of throwing at import. ++let numFormatter; ++try { ++ numFormatter = new Intl.NumberFormat(domEnv ? nav.language : 'en-US'); ++} catch (e) { ++ numFormatter = new Intl.NumberFormat('en-US'); ++} + const fmtNum = val => numFormatter.format(val); + + const M = Math; diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c49e905..8298c188c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,536 @@ PR — keep the `hyperdx-release-notes` comment marker intact when editing so yo edits survive regeneration. Per-package detail lives in each `packages/*/CHANGELOG.md`. +## v2.45.0 — 2026-11-13 + + + +**PromQL evaluation choice and ClickHouse 26.10** + +You can now choose how a PromQL source on ClickHouse is evaluated — through the +Prometheus HTTP API or the `prometheusQuery` table functions — instead of +leaving HyperDX to probe the server on every query. The service map can also now +be split by up to three extra group-by expressions, so a single slow or failing +pod no longer disappears into its service average. This release also moves the +all-in-one image and the Docker Compose files to ClickHouse 26.10.3.7. Two +things change underneath you: TimeSeries tables created from now on default to +schema version 8, which keeps each series' time range in a separate inner table, +and ClickHouse's own `system.metric_log` switches to the bucketed schema. Your +existing TimeSeries tables keep the layout they already have, but metric_log +rows written before the upgrade are left behind in `system.metric_log_0`, so +check anything that reads that table before you upgrade. + +### 💥 Breaking Changes + +- **`system.metric_log` moves to the bucketed schema**: ClickHouse now writes + `system.metric_log` in its bucketed form, and the rows recorded before the + upgrade move to `system.metric_log_0`. A dashboard, alert or saved query + reading ClickHouse's own metrics from `system.metric_log` will see only + post-upgrade rows until you point it at both tables. +- **New TimeSeries tables default to schema version 8**: TimeSeries tables + created after the upgrade keep each series' time range in a separate inner + table. Existing tables are untouched and keep their current layout, so a table + created after the upgrade no longer matches the shape of one created before + it. +- **`clickstack_service_health` no longer returns a verdict**: the MCP tool has + stopped labelling services critical, degraded or healthy, and no longer tells + an agent a service needs "no action" — each service keeps its threshold flags, + score and a factual summary, so agents reason from the numbers rather than a + verdict that service-wide totals can get wrong. `summary.statusCounts` is + replaced by `summary.servicesFlagged`, and the span attributes + `mcp.service_health.critical_count` and `mcp.service_health.degraded_count` + are replaced by `mcp.service_health.flagged_count`, so update anything that + reads those fields. + +### ✨ New Features + +- **Choose how a PromQL source is evaluated**: a PromQL source on ClickHouse can + now be set to use either the Prometheus HTTP API or the `prometheusQuery` + table functions, rather than having HyperDX work it out for itself. A source + pinned to the HTTP API against a server that does not serve it now fails with + a clear error instead of an obscure one, and onboarding pins a PromQL source + it detects to the HTTP API when the server serves it. +- **Split the service map by extra dimensions**: you can now add up to three + extra group-by SQL expressions to the service map — for example + `ResourceAttributes['k8s.pod.name']` — so a node becomes a service plus those + values and a slow or failing pod stands on its own instead of being averaged + into its service. + +### 🔧 Improvements + +- **PromQL label lookups go through ClickHouse's Prometheus HTTP API**: on + ClickHouse 26.9+ with the `prometheus_api_v1` handler, label and label-value + lookups for a ClickHouse-backed PromQL source now proxy to the handler instead + of querying the TimeSeries tags table with SQL. Older servers, servers without + the handler, and sources set to `table-function` keep the SQL path, so a + source that runs queries over HTTP on 26.6-26.8 still gets label + autocomplete. +- **The MCP `describe_source` tool reads its label catalogue the same way**: + asked about a ClickHouse-backed PromQL source, `describe_source` now lists + label and metric names through the `prometheus_api_v1` handler on ClickHouse + 26.9+, so an agent sees the same catalogue the app does. It falls back to SQL + on older servers, servers without the handler, and sources set to + `table-function`. +- **Fewer probes for sources without an explicit choice**: a PromQL source that + does not say how it should be evaluated is still probed, but the answer is now + kept for 5 minutes instead of being worked out again on every query. + +### 🐛 Bug Fixes + +- **`{{note}}` is filled in when an alert actually fires**: a webhook body using + `{{note}}` now carries the alert's note on real alert notifications, not only + on "Send test", so the context you wrote on the alert reaches the people + paged by it. +- **MCP webhook and alert tools are declared open-world**: saving a webhook or + an alert sends HTTP requests to third-party endpoints, so + `clickstack_save_webhook` and `clickstack_save_alert` now carry + `openWorldHint: true`. MCP clients that treat open-world tools differently — + by asking you to confirm before they run, for instance — will now do so for + these two. + +### 📦 Build / Packaging + +- **Bundled ClickHouse is now 26.10.3.7**: the all-in-one image and the Docker + Compose files use `clickhouse/clickhouse-server:26.10.3.7-alpine`. + + + +### 📦 Package changelogs + +- `@hyperdx/api` 2.44.0 → 2.45.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/api/CHANGELOG.md#2450) +- `@hyperdx/app` 2.44.0 → 2.45.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/app/CHANGELOG.md#2450) +- `@hyperdx/common-utils` 0.34.0 → 0.35.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/common-utils/CHANGELOG.md#0350) +- `@hyperdx/otel-collector` 2.44.0 → 2.45.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/otel-collector/CHANGELOG.md#2450) + + + +## v2.44.0 — 2026-11-11 + + + +**Time zone picker and optional webhook emoji** + +You can now pick a time zone straight from the time picker on the search and +dashboard pages, overriding the one set in your User Preferences, and teams can +create their own API keys — with a description and an expiry — that keep working +after the person who created them leaves. Webhooks now take an optional +`titleEmoji` setting: set it to `false` and notification titles sent through that +webhook arrive without the emoji prefix. Columns added to a ClickHouse table +after HyperDX starts — a new MATERIALIZED column, say — are now visible within +five minutes, with no restart needed. Note before upgrading that the app now +always uses ClickStack branding — brand selection, the HyperDX palette and the +font picker are gone — that HyperDX instruments itself with the ClickStack SDKs +now, which changes the shape of its own telemetry and where that telemetry goes +by default, and that webhooks pointing at private or reserved addresses are now +blocked unless you allowlist their hostnames. + +### 💥 Breaking Changes + +- **ClickStack branding is now the only theme**: brand selection, the HyperDX + palette and the font picker have been removed, so the app always uses + ClickStack branding and its standard font. If you or your team had chosen the + HyperDX palette or a different font, that choice no longer applies. Light, + dark and system colour mode stay in Preferences. +- **Webhooks to private or reserved addresses are blocked**: generic and + incident.io webhooks whose hostname resolves to a private or reserved address + are now rejected, and the check runs on the address actually dialled, so it + also covers DNS rebinding. If your self-hosted setup notifies an internal + hostname, add it to `WEBHOOK_HOSTNAME_ALLOWLIST` before upgrading or those + notifications will stop going out. +- **HyperDX self-instruments with the ClickStack SDKs**: HyperDX's own telemetry + now comes from `@clickhouse/clickstack-node` and + `@clickhouse/clickstack-browser` in place of `@hyperdx/node-opentelemetry` and + `@hyperdx/browser`, and it changes shape. HTTP spans carry the stable semantic + convention keys (`http.request.method`, `http.response.status_code`, + `url.full`), pino records arrive under the + `@opentelemetry/instrumentation-pino` scope with real severity numbers instead + of the `node-logger` scope at severity number 0, console capture covers every + `console` call in the API, browser console output is recorded as log records + rather than spans, uncaught exceptions are recorded as FATAL log records, and + an API error is an exception event on the Express span instead of a separate + error span. Browser telemetry names the user as `user.id`, `user.email` and + `user.name` instead of `userEmail` and `userName`, keeps the team name as + `teamName`, no longer records a `user navigated` action, and no longer records + request and response headers or bodies on fetch and XHR spans; browser + sessions restart once after the upgrade. Update anything — a saved search, + alert or dashboard — keyed on the old attribute names before you upgrade. +- **Self-telemetry is configured with the OpenTelemetry variables**: + `HYPERDX_API_KEY` still enables self-instrumentation, but without + `OTEL_EXPORTER_OTLP_ENDPOINT` server-side self-telemetry now goes to + `http://localhost:4318` instead of `https://in-otel.hyperdx.io`, so set the + endpoint explicitly. `HDX_NODE_*` variables are no longer read; capture + request headers and bodies with `OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_*` + and `CLICKSTACK_CAPTURE_HTTP_BODY` instead. Browser traces and logs are now + sent gzip-compressed every 5 seconds, so if the browser sends to a collector + other than ClickStack's, that collector's CORS `allowed_headers` must be `"*"` + or include `content-type` and `content-encoding` (and `authorization`), and a + proxy in front of it must forward `Content-Encoding` unchanged. The per-signal + browser endpoints and `NEXT_PUBLIC_OTEL_RESOURCE_ATTRIBUTES` work as before. +- **The Next.js server reports telemetry from production builds too**: with + `HYPERDX_API_KEY` or `OTEL_EXPORTER_OTLP_HEADERS` set, the Next.js server now + sends its own telemetry in production builds, not only under `next dev`. It + reports under its own service name — the configured one plus `-next` + (`hdx-oss-app-next` in the docker-compose `app` service and when no name is + set) — so its spans stay apart from the API's and the browser's, and the + HyperDX images now default `OTEL_SERVICE_NAME` to `hdx-oss-app`. Each `/api` + request gains Next.js server spans for the proxy hop, while requests for build + and `public/` assets such as `/_next/static/*`, `/__ENV.js` and `/pyodide/*` + are not traced. `HDX_EXPORTER_ENABLED=false` turns it off along with browser + telemetry. + +### ✨ New Features + +- **Pick a time zone from the time picker**: the search and dashboard pages let + you choose the time zone they display, overriding the zone set in User + Preferences. The picker shows the zone it is using, and your choice is kept in + the URL and carried through links from charts and tables, so a shared link + opens in the same zone you were reading. +- **Emoji prefix in webhook titles is now optional**: webhooks take a new + `titleEmoji` option, and setting it to `false` sends notification titles + through that webhook without the leading emoji — useful where the receiving + system renders it poorly or your team would rather read a plain title. +- **Team-owned API keys**: team members can now create API keys that belong to + the team rather than to the person who made them, each with a description and + an expiry. A key keeps working after its creator leaves, so an integration no + longer stops the day someone moves on. +- **Ad hoc dashboard filters can narrow their own suggestions**: an ad hoc + filter on a SQL source can now carry a SQL or Lucene "Keys and values filter", + much like a queried filter's dropdown values filter, limiting the rows its + keys and values are suggested from, and it can reference the dashboard's other + variables. While it points at a required filter with nothing selected, the ad + hoc filter won't add or edit conditions and names the filter it is waiting on, + and a suggestion lookup that fails now shows the database's error message. +- **Browser events on the trace waterfall and in the row side panel**: the + waterfall now plots the request timings an OpenTelemetry browser SDK records + as dots along fetch and XHR spans, and shows the click that triggered a + browser trace, so you can see where time went in the browser without leaving + the trace. The row side panel summarises the clicks, navigations and console + messages those SDKs record, and navigation rows no longer show an HTTP Request + section that never applied to them. +- **JavaScript stack traces broken into frames**: the Exception panel now parses + the JavaScript stack traces that OpenTelemetry SDKs report into individual + frames, with its own section for each `Caused by:` error, so you can follow an + exception and the errors behind it instead of reading one block of text. +- **Session IDs from older browser SDKs land on `session.id`**: spans, logs and + session replay events from older `@hyperdx/browser` SDKs carry the session id + only in the `rum.sessionId` resource attribute, and the collector now gives + them the OpenTelemetry `session.id` attribute as well, so anything keyed off + the standard attribute sees them too. An existing `session.id` is never + overwritten and `rum.sessionId` is kept; if you override pipeline + `processors:` lists in `CUSTOM_OTELCOL_CONFIG_FILE`, add `transform/session_id` + to keep this. Newly created `hyperdx_sessions` and `otel_logs` tables also get + `MATERIALIZED` session id columns with skip indexes, so session queries no + longer read the attribute maps — existing tables need an + `ALTER TABLE ... ADD COLUMN` to benefit. +- **Filter the v2 list alerts endpoint**: the v2 API for listing alerts now + accepts tag, search, source and state filters, so you can ask for just the + alerts you care about rather than fetching them all and filtering yourself. +- **Connect an AI agent without pasting a key**: the new + `npx @hyperdx/cli mcp install` asks for a personal access key or an + organisation API key with hidden input, checks it, and adds the ClickStack MCP + server to Claude Code, Codex, Cursor and VS Code. Team Settings now leads with + this command, so a key no longer has to go into a copied command or an agent + chat; the per-agent snippets are still there for setting up one agent by hand. +- **Describe any table over MCP**: the new `clickstack_describe_table` tool + lists the tables in a database and describes one that is not a registered + source — its columns, keys, engine, skipping indices, approximate size and an + optional row sample — so an assistant can look into data you have not set up + as a source yet. +- **Set a dashboard's saved filter values over MCP**: the MCP dashboard tools + can now set a dashboard's `savedFilterValues`, so an assistant building or + updating a dashboard can leave its filters pre-filled rather than having you + set them by hand afterwards. +- **Run up to ten MCP SQL queries in parallel**: `clickstack_sql` now accepts a + `queries` array and runs up to ten independent queries at once under a shared + 60 second deadline, with each query reporting its own `ok`, `error` or + `timeout` status so one failure does not take the others down with it. + Single-query calls using `sql` behave exactly as before. +- **Narrower MCP table queries**: `clickstack_table` now takes an optional + `limit` and `having`, so an assistant can cut a grouped result down to the + rows worth reading rather than filtering them afterwards. Grouped results with + no `orderBy` now come back ordered by the first select item, descending, which + puts the largest values first instead of leaving the order to ClickHouse. + +### 🧪 Experimental + +PromQL support is gated behind the `ENABLE_PROMQL` flag; these changes apply +once it is on. + +- **PromQL sources and tiles over MCP**: `clickstack_describe_source` now + returns a PromQL source's label names and metric names — from a ClickHouse + TimeSeries table or a Prometheus-compatible endpoint — instead of a column + schema, and both it and `clickstack_list_sources` say which backend the source + uses, explaining how to read a TimeSeries table with `clickstack_sql`. + Prometheus endpoint sources no longer show a placeholder table, and the MCP + dashboard tools read and write PromQL tiles and `PROMETHEUS_LABEL` filters. + With `ENABLE_PROMQL` off, MCP hides PromQL sources from listing, describing + and deleting, `clickstack_save_source` no longer accepts `kind: "promql"`, and + the dashboard tools hide PromQL tiles rather than discarding them, so a + dashboard edited through MCP keeps its PromQL tiles intact. +- **Run a PromQL query over MCP**: the new `clickstack_promql` tool runs PromQL + against a PromQL source, and the MCP prompts and instructions now cover + PromQL sources, tiles and label filters while PromQL is enabled, so an + assistant knows how to reach them. Label lookups and queries also refuse a + Prometheus endpoint response over 8 MB rather than buffering the whole thing + into memory. +- **Query a PromQL tile over MCP**: the `query_tile` and `query_tiles` tools now + run PromQL tiles as well, against both Prometheus-compatible endpoints and + ClickHouse TimeSeries tables, so an assistant can read the numbers behind a + PromQL tile rather than only its definition. PromQL table and histogram + heatmap tiles come back in the rows the dashboard itself draws, so what the + assistant reads matches what you see on the dashboard. + +### 🔧 Improvements + +- **The ClickStack hexagon and bolt mark across the app**: the logo, the + collapsed nav and the favicon now carry the ClickStack hexagon and bolt mark, + so the browser tab and the sidebar match the branding the rest of the app + uses. The expanded sidebar spells out the ClickStack name as text beside the + symbol, and a new favicon set, an SVG included, covers the browser tab, + bookmarks and touch icon. +- **A tighter trace side panel**: the trace waterfall starts higher up the + panel, because a span no longer repeats its name in a box under the panel + title or shows its service as a chip beside the metadata row that already + names it, and the "⌘/Ctrl + scroll to zoom" hint has moved into the timeline's + top-left corner instead of claiming a row of its own. Span names too long for + the title keep their box, and log panels are unchanged. +- **Opening a row queries it once**: the side panel ran the same `SELECT *` row + query twice, once for the panel and again when its Overview or Column Values + tab mounted. A row that was found is now reused from the cache, so that tab + and later tab switches do not query it again; a different row or source still + runs the query, and a row that was not found is looked up again. +- **One name when you alert on a search**: creating an alert from the search + page now asks for a single name rather than two. An unsaved search is named + once in the alert modal's header and the alert inherits that name and its + tags; on a saved search the alert's own field is labelled "Alert name" and + shows the inherited name as its placeholder instead of pre-filling a + duplicate. +- **Collapsed pinned filters stay collapsed**: a pinned filter you collapse in + the search sidebar stays collapsed the next time that source loads, instead of + opening again every time. +- **Better compression for newly created tables**: the collector's seed schemas + now pin `ZSTD(3)` rather than `ZSTD(1)`, which compresses your data further + for a small insert-time CPU cost and no change to read performance. Only + tables created from here on are affected; existing tables keep the codecs they + already have. +- **Logs with a severity number but no severity text get a level**: logs that + arrive with a severity number and an empty severity text, such as those from + the new browser SDK, now get the matching level text (`info`, `error`, and so + on), so they read and filter like every other log. Severity text set by the + producer is never overwritten. +- **Browsers cache the collector's CORS preflights for 10 minutes**: the OTLP + receiver now answers preflight requests with `Access-Control-Max-Age: 600`. + Browsers previously cached a preflight for only 5 seconds, which is exactly + how often the browser SDK exports, so about half of its requests to the + collector were preflights. +- **Persisted `_block_number` and `_block_offset` columns detected more + reliably**: when a table's `CREATE` query omits them, HyperDX now falls back to + the server's MergeTree settings to work out whether they are persisted — + reading `system.shared_merge_tree_settings` first on ClickHouse Cloud, then + `system.merge_tree_settings` per key — so the features that rely on those + columns keep working on tables where the setting is applied server-side rather + than spelled out in the schema. +- **Sharper query guidance for MCP agents**: the MCP tool descriptions and the + query guide now recommend the quoted Lucene form `field:"value"` for exact + matches, and bare terms or phrases for log body text, so the queries an + assistant writes still make use of the primary key and the text index. +- **`minAutoGranularity` documented in the external API**: `GET`, `POST` and + `PUT /api/v2/sources` already accepted and returned `minAutoGranularity` on + metric and PromQL sources, but the OpenAPI spec left it out, so clients + generated from the spec dropped or rejected the field. The spec now documents + it, and generated clients can set and read it like any other source setting. + +### 🐛 Bug Fixes + +- **Metric points with no recorded value stay out of charts and alerts**: when a + scraped series goes away or a scrape fails, the collector's `prometheus` + receiver sends a point flagged "no recorded value" — a Prometheus staleness + marker — and the ClickHouse exporter stores it as zeros. Charts and alerts + read that as a real measurement, so a gauge's `min` and `avg` dropped and its + `count` still included the series that had gone, and a counter or histogram + that came back after the marker counted its whole total over again. Metric + queries now skip points carrying the flag. +- **Cached table columns refresh after 5 minutes**: the metadata cache kept each + table's `DESCRIBE` result for the life of the process, so columns added with + `ALTER TABLE`, such as new MATERIALIZED columns, were not picked up until the + API restarted. Cached columns now expire after 5 minutes; other cached + metadata is unchanged. +- **Alerts can no longer be set on tiles that never fire**: dashboard tiles the + alert checker does not evaluate — PromQL tiles, and builder tiles with an + unsupported display type — now reject alerts outright, instead of accepting + one that stayed silent forever. Any such alert already saved is dropped the + next time its dashboard is saved, so move it to a tile the checker supports if + you were relying on it. +- **Resolved grouped alerts name the group that resolved**: when a group + vanishes from the data, the alert resolves with that group's values filled in + for `{{attributes.*}}` in the title and message, and `{{var.*}}` in the webhook + body, so you can tell from the notification which group went quiet. +- **Row detail lookups work on FIPS ClickHouse and with special characters in + JSON keys**: looking up a JSON row no longer relies on MD5, which FIPS-enabled + deployments refuse to run — the lookup uses SHA256 instead — and path segments + containing special characters, a key prefixed with `@`, say, now stay quoted. + Row details and drill-down return the row rather than failing or reading the + key as something else. +- **Row details no longer open the wrong row on tables with a single block + column**: the key-only lookup is used only where a table persists both + `_block_number` and `_block_offset`. One block column on its own — from a + server-wide `enable_block_offset_column`, say — is not unique against a + second-precision primary key and could open a different row, so it is now + added only as a tiebreaker to the full-row lookup. +- **"Denoise results" removes noise on ordinary data again**: a pattern now + counts as noisy above 5% of the sampled events rather than 10%, a bar that + often matched nothing at all, so denoising a typical result set actually hides + the repetitive lines it was meant to — and patterns containing error or + warning lines are never hidden. Denoise also mines the source's body column + instead of whatever the last column in the table happened to be, strips + ANSI-coloured rows matching a noisy pattern, tells you when results can't be + denoised, and lists what it hid as a short, expandable summary. The MCP + `denoise` option uses the same 5% threshold. +- **Charts show a spinner while they load**: a chart tile now shows a spinner + and "Loading Chart Data..." while its query is in flight, including when the + previous result was empty — before, it kept reading "No data found within time + range." until the new query finished, which looked like an answer rather than + a wait. Loaders are a neutral grey now instead of yellow. +- **Row details show a loader while they load**: expanded search rows and the + trace viewer's span details read "Empty" or "No body for this event." while + the row was still on its way, which looked like a row with nothing in it. Both + now show a loader until the row arrives. +- **Session replays from separate page loads no longer collide**: browser SDKs + up to `@clickhouse/clickstack-browser` 1.2.0 number replay events from 1 again + on every page load, so when a page closed before all the chunks of a large + event were sent, its leftover chunk could be joined onto a later page's event + of the same number — that snapshot then failed to parse and never rendered. + Chunks are now grouped by event number and full-precision timestamp, and + replay rows are ordered by that timestamp, so rows from two page loads in the + same second no longer interleave. The app's own browser telemetry moves to + `@clickhouse/clickstack-browser` 1.2.1, whose replay event numbers no longer + repeat across page loads. +- **Legacy `STATUS_CODE_ERROR` spans count as errors on the service map and + trace waterfall**: spans from collectors that emit the long status form were + not recognised as errored in either view, so both undercounted errors. That + value is now counted alongside the short `Error` form. +- **Prometheus connections with credentials in the host work again**: a host + such as `http://user:pass@prometheus:9090` failed every PromQL query with + "Failed to reach Prometheus", because `fetch` rejects URLs carrying + credentials. Those credentials are now sent as a Basic auth header instead. +- **PromQL label lookups work on ClickHouse 26.10's TimeSeries tables**: schema + version 8, the default from ClickHouse 26.10, keeps each series' time range in + a separate time ranges table rather than in the tags table's + `min_time`/`max_time`, so dashboard variables and label autocomplete failed + with "requires store_min_time_and_max_time = 1" and time-bounded lookups read + the whole tags table. Those lookups now read the time ranges table, so they + resolve on version 8 tables and stay bounded by the window you asked for, and + a lookup with `match[]` reads only the matched metrics' tags rows when every + selector names its metric, rather than every metric's. +- **Saving a search no longer reloads the page**: the newly saved search opens + with a client-side navigation instead of a full page load, which also fixes + the 404 this caused on the static ClickStack build. +- **Heatmap tooltips no longer shift the tile**: hovering a heatmap added + scrollbars and nudged the tile, because the tooltip was drawn inside the + chart. It now sits above the chart, so the tile stays put as you read across + it. +- **The sidebar toggle works on narrow screens**: on compact viewports the + toggle did nothing at all. It now opens the full nav as an overlay over the + page, so you can reach every section without widening the window. +- **The app loads in browsers reporting a POSIX-style language**: a browser + whose language reads as something like `en-US@posix` crashed the app on load. + Those locales are handled now, so the app starts as it should. +- **Dashboards and saved searches keep their team and owner**: a PATCH request + that included `team` or `createdBy` could move a dashboard or saved search to + another team, or rewrite who owned it. Both fields are now ignored on update, + so neither can be changed that way. +- **Usage stats run against password-protected ClickHouse connections**: the + usage stats job failed ClickHouse authentication whenever the connection + required a password. It now authenticates correctly, so those deployments + report usage stats again. +- **Event pattern drill-downs return the events they describe**: each pattern + from `clickstack_event_patterns` now carries a SQL `whereSnippet` that keeps + the template's token order and variable positions and includes both the + caller's filter and the source table filter, so handing it to + `clickstack_search` returns that pattern's events. Previously a template like + `Sending <*> rows` produced `Body:"Sending rows"`, which matched nothing, and + map fields produced Lucene that would not parse. Patterns can also be mined + from a key inside a JSON body, and the tool now reports its sample coverage + and the trend bucket interval and boundaries it actually used. + `clickstack_event_patterns`, `clickstack_emerging_signals` and dashboard + event-pattern tiles also apply the log source's `tableFilterExpression` now, + so their counts can drop for sources that set one, and each cluster is + reported with its own template rather than occasionally that of a different + cluster of the same length. +- **Oversized MCP responses keep more of what you asked for**: a response over + the size budget now shortens a long string with a `…(+N chars)` suffix instead + of replacing it outright, and records what it cut in `trimNotes`. + `clickstack_event_patterns` and `clickstack_emerging_signals` drop samples and + shorten long patterns before they discard whole patterns, so the `topN` you + asked for survives wherever it can. + +### 📦 Build / Packaging + +- **systeminformation updated past its command injection advisories**: the API + pulls systeminformation in through + `@opentelemetry/instrumentation-host-metrics`, but the root `resolutions` pin + held the lockfile at 5.30.7, which carries known command injection advisories + — among them two high-severity ones in `networkInterfaces()` on Linux + (GHSA-5xpp-75jx-m839, GHSA-hvx9-hwr7-wjj9). The pin now starts at 5.33.19, the + newest 5.x release, which fixes all of them. +- **The app image is now published as `clickhouse/clickstack` as well**: the + HyperDX image goes out under `clickhouse/clickstack` alongside the existing + `hyperdx/hyperdx`, matching the other `clickhouse/clickstack-*` images, so you + can pull it under either name. Release workflows no longer log in to ghcr.io, + which was receiving no pushes. +- **Project links and the bundled compose file point at ClickStack**: the GitHub + links the app and packages carry — changelog, support and package metadata — + now point at `ClickHouse/ClickStack`, and `docker-compose.yml` pulls the app + image as `clickhouse/clickstack`. +- **App builds no longer fail on extensionless Google Fonts URLs**: the app + moves to Next.js 16.4.3, fixing the intermittent build failures that happened + when Google Fonts returned a font URL without a file extension. Only builds of + the app from source are affected. + + + +### 📦 Package changelogs + +- `@hyperdx/api` 2.43.1 → 2.44.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/api/CHANGELOG.md#2440) +- `@hyperdx/app` 2.43.1 → 2.44.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/app/CHANGELOG.md#2440) +- `@hyperdx/cli` 0.8.0 → 0.9.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/cli/CHANGELOG.md#090) +- `@hyperdx/common-utils` 0.33.0 → 0.34.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/common-utils/CHANGELOG.md#0340) +- `@hyperdx/otel-collector` 2.43.1 → 2.44.0 — [changelog](https://github.com/ClickHouse/ClickStack/blob/main/packages/otel-collector/CHANGELOG.md#2440) + + + +## v2.43.1 — 2026-10-31 + + + +**Multipath TCP disabled in the collector image** + +The collector image now sets `GODEBUG=multipathtcp=0` at startup, so it no longer +opens Multipath TCP listeners — Go 1.24 and later turn them on by default — which +mitigates CVE-2026-98432 with no change needed on your side. The all-in-one image +picks up the same setting. Any other `GODEBUG` values you pass through are kept, +and an explicit `multipathtcp=` of your own is left exactly as you set it, so you +can still opt back in to MPTCP. Patching the host kernel remains the actual fix. + +### 📦 Build / Packaging + +- **Multipath TCP listeners no longer opened by the collector**: the collector + image, and the all-in-one image with it, starts with + `GODEBUG=multipathtcp=0`, mitigating CVE-2026-98432 on hosts where Go 1.24+ + would otherwise listen over MPTCP. Your own `GODEBUG` settings are preserved + and an explicit `multipathtcp=` value is honoured as written; patching the host + kernel is still the real fix. + + + +### 📦 Package changelogs + +- `@hyperdx/api` 2.43.0 → 2.43.1 — [changelog](https://github.com/hyperdxio/hyperdx/blob/main/packages/api/CHANGELOG.md#2431) +- `@hyperdx/app` 2.43.0 → 2.43.1 — [changelog](https://github.com/hyperdxio/hyperdx/blob/main/packages/app/CHANGELOG.md#2431) +- `@hyperdx/otel-collector` 2.43.0 → 2.43.1 — [changelog](https://github.com/hyperdxio/hyperdx/blob/main/packages/otel-collector/CHANGELOG.md#2431) + + + ## v2.43.0 — 2026-10-30 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5c22126a8..fd948ba21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ steps](#reproducing-issues-and-prs), and has [before/after screenshots](#ui-changes-need-beforeafter-screenshots) if it touches the UI. Good places to start: the [good first -issue](https://github.com/hyperdxio/hyperdx/labels/good%20first%20issue) label, +issue](https://github.com/ClickHouse/ClickStack/labels/good%20first%20issue) label, and [Discord](https://discord.gg/FErRRKU78j) if the dev setup gives you trouble. Why we do this: AI tools make it cheap to open a plausible-looking PR with no @@ -96,7 +96,7 @@ problem (or the fix) for themselves. If a maintainer can't reproduce it, they can't triage the issue or review the PR. **Try the demo environment first.** [play.hyperdx.io](https://play.hyperdx.io) -is a hosted HyperDX connected to a public demo dataset (logs, traces, metrics +is a hosted ClickStack instance connected to a public demo dataset (logs, traces, metrics and session replays from the OpenTelemetry demo app). If your bug shows up there, link the exact URL — search and chart explorer keep their query, filters and time range in the URL — and that's most of the repro. @@ -176,13 +176,13 @@ Service Descriptions: - OpenTelemetry Collector (otel-collector): Receives OpenTelemetry data from instrumented applications and forwards it to ClickHouse for storage. Includes - OpAMP supervisor that dynamically pulls configuration from HyperDX API. + OpAMP supervisor that dynamically pulls configuration from ClickStack API. - ClickHouse (ch-server): ClickHouse database, stores all telemetry. - MongoDB (db): Stores user/saved search/alert/dashboard data. -- HyperDX API (api): Node.js API, executes ClickHouse queries on behalf of the +- ClickStack API (api): Node.js API, executes ClickHouse queries on behalf of the frontend and serves the frontend. serves the frontend. Can also run alert checker. -- HyperDX UI (app): Next.js frontend, serves the UI. +- ClickStack UI (app): Next.js frontend, serves the UI. ## Development @@ -214,6 +214,11 @@ yarn dev:down To enable self-instrumentation and demo logs, you can set the `HYPERDX_API_KEY` to your ingestion key (visit the Team settings page after creating your account). +The API and the Next.js server pass it to the ClickStack SDK +(`@clickhouse/clickstack-node`) as `apiKey`, and the browser SDK +(`@clickhouse/clickstack-browser`) gets it from `/api/config`. The API and the +alert task report as `hdx-oss-dev-api`, the Next.js server as +`hdx-oss-dev-app-next`, and the browser as `hdx-oss-dev-app`. To do this, create a `.env.local` file in the root of the project and add the following: @@ -335,7 +340,7 @@ pin. Drop it if that blanket resolution is ever narrowed. ## AI-Assisted Development -HyperDX includes an [MCP server](https://modelcontextprotocol.io/) that lets AI assistants query observability data, manage dashboards, and +ClickStack includes an [MCP server](https://modelcontextprotocol.io/) that lets AI assistants query observability data, manage dashboards, and explore data sources. See [MCP.md](/MCP.md) for setup instructions. The repo also ships with configuration for AI coding assistants that enables interactive browser-based E2E test generation and debugging via diff --git a/DEPLOY.md b/DEPLOY.md index 52735ada6..3710de6c0 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -1,26 +1,44 @@ -# HyperDX Deployment Guide +# ClickStack Deployment Guide -[HyperDX](https://hyperdx.io) helps engineers quickly figure out why production +[ClickStack](https://hyperdx.io) helps engineers quickly figure out why production is broken by making it easy to search & visualize logs and traces on top of any ClickHouse cluster (imagine Kibana, for ClickHouse). You can learn more about -HyperDX in our [README](/README.md). +ClickStack in our [README](/README.md). -HyperDX can be deployed in a few different ways: +ClickStack can be deployed in a few different ways: - [Bring Your Own ClickHouse](#bring-your-own-clickhouse) - [All-in-one Docker Compose Stack](#all-in-one-docker-compose-stack) - [Local Development Mode](#local-development-mode) +## Container image names + +ClickStack images are published to Docker Hub under the `clickhouse` namespace +and are also served from `docker.clickhouse.com`: + +| Image | Name | +| --------------------------- | -------------------------------------- | +| ClickStack (UI + API) | `clickhouse/clickstack` | +| All-in-one (with auth) | `clickhouse/clickstack-all-in-one` | +| Local (all-in-one, no auth) | `clickhouse/clickstack-local` | +| OpenTelemetry collector | `clickhouse/clickstack-otel-collector` | + +The legacy `hyperdx/hyperdx`, `hyperdx/hyperdx-all-in-one`, +`hyperdx/hyperdx-local` and `hyperdx/hyperdx-otel-collector` names (also served +from `docker.hyperdx.io`) keep receiving the same tags for a transition period. +Switch to the `clickhouse/clickstack-*` names now; the date the legacy names +stop updating will be announced in the changelog. + ## Bring Your Own ClickHouse -If you already have an existing ClickHouse cluster, you can simply deploy a -HyperDX container that connects to your ClickHouse cluster. You'll need a +If you already have an existing ClickHouse cluster, you can simply deploy the +ClickStack container that connects to your ClickHouse cluster. You'll need a separate MongoDB instance to persist your users, dashboards, searches and more. To get started, you can run the following image: ```bash -docker run -e MONGO_URI=mongodb://YOUR_MONGODB_URI -p 8080:8080 docker.hyperdx.io/hyperdx/hyperdx:2-beta +docker run -e MONGO_URI=mongodb://YOUR_MONGODB_URI -p 8080:8080 docker.clickhouse.com/clickhouse/clickstack:2 ``` You'll need to set the `MONGO_URI` environment variable to the URI of your @@ -34,13 +52,13 @@ replicas from sharing sessions. The old public value `hyperdx is cool 👋` is also replaced with a per-process secret when authentication is enabled. To customize the frontend URL, set the `FRONTEND_URL` environment variable to -the URL your HyperDX instance is hosted on. +the URL your ClickStack instance is hosted on. ## All-in-one Docker Compose Stack -The easiest way to get started with HyperDX from scratch is to use our +The easiest way to get started with ClickStack from scratch is to use our all-in-one Docker Compose stack. This stack will start ClickHouse, an -OpenTelemetry collector, and HyperDX with a MongoDB instance. +OpenTelemetry collector, the ClickStack UI and API, and MongoDB. To get started, clone this repository and run the following command: @@ -48,7 +66,7 @@ To get started, clone this repository and run the following command: docker compose up -d ``` -This will start the HyperDX stack and open a port for the UI, API, and OTel +This will start the ClickStack stack and open a port for the UI, API, and OTel collector. When deploying into production, you'll want to disable any extra ports outside @@ -73,13 +91,13 @@ replicas from sharing sessions. The old public value is not a production secret. ## Local Development Mode -HyperDX can also be deployed alongside your existing local development stack to +ClickStack can also be deployed alongside your existing local development stack to help you debug issues locally. This mode will start an OpenTelemetry collector, -ClickHouse, and HyperDX with a MongoDB in a single instance, without any +ClickHouse, the ClickStack UI and API, and MongoDB in a single container, without any authentication or configuration persistence. To get started, spin up the local mode container: ```bash -docker run -p 8080:8080 docker.hyperdx.io/hyperdx/hyperdx-local:2-beta +docker run -p 8080:8080 docker.clickhouse.com/clickhouse/clickstack-local:2 ``` diff --git a/Dockerfile b/Dockerfile index 30bac664e..ccbc0d8dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,8 +67,6 @@ ENV NEXT_PUBLIC_HDX_LOCAL_DEFAULT_CONNECTIONS=$NEXT_PUBLIC_HDX_LOCAL_DEFAULT_CON ARG NEXT_PUBLIC_HDX_LOCAL_DEFAULT_SOURCES= ENV NEXT_PUBLIC_HDX_LOCAL_DEFAULT_SOURCES=$NEXT_PUBLIC_HDX_LOCAL_DEFAULT_SOURCES -ARG NEXT_PUBLIC_THEME=hyperi -ENV NEXT_PUBLIC_THEME=$NEXT_PUBLIC_THEME ENV NX_DAEMON=false RUN npx nx run-many --target=build --projects=@hyperdx/common-utils,@hyperdx/api,@hyperdx/app diff --git a/LOCAL.md b/LOCAL.md index 6eb000a99..7a218147f 100644 --- a/LOCAL.md +++ b/LOCAL.md @@ -1,22 +1,13 @@ -# HyperDX Local +# ClickStack Local -HyperDX Local is a single container local-optimized version of -[HyperDX](https://www.hyperdx.io/) that allows you to pipe OpenTelemetry -telemetry (logs, metrics, traces) to a local instance of HyperDX running on your -own machine. This makes it easily to debug complex applications locally using -the same telemetry you have in prod or to test your instrumentation before -pushing it into production. +ClickStack Local is a single container local-optimized version of [ClickStack](https://www.hyperdx.io/) that allows you to pipe OpenTelemetry telemetry (logs, metrics, traces) to a local instance of ClickStack running on your own machine. This makes it easily to debug complex applications locally using the same telemetry you have in prod or to test your instrumentation before pushing it into production. -HyperDX Local has a few additional benefits tuned to local development over the -regular version: - -- 📦 Packaged in a single container, to slot alongside your existing dev - environment (ex. Docker Compose stack) +ClickStack Local has a few additional benefits tuned to local development over the regular version: +- 📦 Packaged in a single container, to slot alongside your existing dev environment (ex. Docker Compose stack) - 🔑 No need to auth to send and view telemetry - 🐏 Optimized for lower memory footprint -And it has all the features you would expect from HyperDX: - +And it has all the features you would expect from ClickStack: - 🔭 Native OpenTelemetry logs, metrics, and traces support - 🔍 Full text searching of logs and traces - `{` Automatic JSON structured log parsing @@ -24,48 +15,36 @@ And it has all the features you would expect from HyperDX: - 📈 Charting logs, metrics and traces in a single UI
-Demo of using HyperDX Local for debugging a local app +Demo of using ClickStack Local for debugging a local app ## Getting Started -To get started, simply run the Docker container with the appropriate ports -forwarded: +To get started, simply run the Docker container with the appropriate ports forwarded: ``` -docker run -p 8000:8000 -p 4318:4318 -p 4317:4317 -p 8080:8080 -p 8002:8002 docker.hyperdx.io/hyperdx/hyperdx-local +docker run -p 8000:8000 -p 4318:4318 -p 4317:4317 -p 8080:8080 -p 8002:8002 docker.clickhouse.com/clickhouse/clickstack-local ``` -Afterwards, you can visit `http://localhost:8080` and immediately jump into the -HyperDX UI. +Afterwards, you can visit `http://localhost:8080` and immediately jump into the ClickStack UI. -> We recommend having _at least_ 1GB of RAM and 1 CPU core available for the -> container. +> We recommend having _at least_ 1GB of RAM and 1 CPU core available for the container. ## Configuring Instrumentation -Configuring instrumentation for HyperDX local is similar to configuring it for -the regular open source version. You should point your OpenTelemetry -instrumentation to the OpenTelemetry endpoints: +Configuring instrumentation for ClickStack Local is similar to configuring it for the regular open source version. You should point your OpenTelemetry instrumentation to the OpenTelemetry endpoints: - `http://localhost:4318` for HTTP - `localhost:4317` for gRPC -Most instrumentations can be configured using the `OTEL_EXPORTER_OTLP_ENDPOINT` -environment variable. Ex: `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`. +Most instrumentations can be configured using the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable. Ex: `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`. -If you're using a HyperDX maintained SDK, you may need to give a non-empty -`HYPERDX_API_KEY` as well, API keys are not validated in HyperDX Local and -therefore can be any non-empty value. +If you're using a ClickStack SDK, pass the key as the `apiKey` init option. `@clickhouse/clickstack-node` also accepts `OTEL_EXPORTER_OTLP_HEADERS=authorization=`, and `@clickhouse/clickstack-browser` only takes `apiKey`. Older HyperDX SDKs (`@hyperdx/*`) may need a non-empty `HYPERDX_API_KEY` instead. API keys are not validated in ClickStack Local and therefore can be any non-empty value. ## Customizing Ports -If you need to customize the app (8080) or api (8000) ports that HyperDX Local -runs on, you'll need to modify the `docker run` command to forward the -appropriate ports and set a few environment variables. +If you need to customize the app (8080) or api (8000) ports that ClickStack Local runs on, you'll need to modify the `docker run` command to forward the appropriate ports and set a few environment variables. -Customizing the OpenTelemetry ports can simply be changed by modifying the port -forwarding flags. Ex. Replacing `-p 4318:4318` with `-p 4999:4318` to change the -OpenTelemetry HTTP port to 4999. +Customizing the OpenTelemetry ports can simply be changed by modifying the port forwarding flags. Ex. Replacing `-p 4318:4318` with `-p 4999:4318` to change the OpenTelemetry HTTP port to 4999. ```bash HYPERDX_APP_PORT=YOUR_CUSTOM_APP_PORT \ @@ -77,26 +56,22 @@ docker run \ -p 4318:4318 -p 4317:4317 \ -p $HYPERDX_APP_PORT:8080 \ -p 8002:8002 \ -docker.hyperdx.io/hyperdx/hyperdx-local +docker.clickhouse.com/clickhouse/clickstack-local ``` ## Open Source & Cloud Versions (Beyond Local) -If you're looking to deploy HyperDX to monitor a production environment (or -anything outside your local environment), you can check out the -[regular open source version](https://github.com/hyperdxio/hyperdx) or the -[cloud hosted version](https://hyperdx.io/). +If you're looking to deploy ClickStack to monitor a production environment (or anything outside your local environment), you can check out the [regular open source version](https://github.com/ClickHouse/ClickStack) or the [cloud hosted version](https://hyperdx.io/). ### Local vs Non-Local Versions -There are a few missing features in HyperDX Local compared to the other versions -of HyperDX: +There are a few missing features in ClickStack Local compared to other ClickStack deployments: -- HyperDX Local is single-user only (due to skipping auth) +- ClickStack Local is single-user only (due to skipping auth) - Has no support for [management APIs](https://www.hyperdx.io/docs/api/alerts) - No alerting support (alerts will not fire) - DB queries will not be reduced into query patterns -- No persistence of data (telemetry and settings) if the container is torn down +- No persistence of data (telemetry and settings) if the container is torn down ## Notes @@ -104,14 +79,13 @@ of HyperDX: - `4317` - OpenTelemetry gRPC endpoint - `4318` - OpenTelemetry HTTP endpoint -- `8000` - Private HyperDX API for the UI -- `8002` - HyperDX HTTP Logging Endpoint -- `8080` - HyperDX UI (Next.js) +- `8000` - Private ClickStack API for the UI +- `8002` - ClickStack HTTP Logging Endpoint +- `8080` - ClickStack UI (Next.js) ### Build Image (Only For Development) -To develop this image, you can build the image locally by running the build -script from project root: +To develop this image, you can build the image locally by running the build script from project root: ``` ./docker/local/build.sh diff --git a/MCP.md b/MCP.md index a380fb890..8f8834943 100644 --- a/MCP.md +++ b/MCP.md @@ -38,21 +38,34 @@ The MCP server uses the **Streamable HTTP** transport with Bearer token authentication. In the examples below, replace `` with your instance URL (e.g. `http://localhost:8080`). +### Install with the CLI (recommended) + +This asks for a personal access key or an organization API key with hidden +input, checks it, and adds the server to Claude Code, Codex, Cursor and VS Code. +The key stays out of your shell history and agent chats. + +```bash +npx @hyperdx/cli mcp install --app-url +``` + ### Claude Code +`read -rs` waits for you to paste the key and press Enter, without echoing it, +so the key isn't saved in your shell history: + ```bash -claude mcp add --transport http clickstack /api/mcp \ - --header "Authorization: Bearer " +read -rs CLICKSTACK_ACCESS_KEY +claude mcp add --scope user --transport http clickstack /api/mcp \ + --header "Authorization: Bearer $CLICKSTACK_ACCESS_KEY" ``` ### Codex CLI The Codex CLI reads the bearer token from an environment variable rather than a -`--header` flag. Export your personal access key, then register the server with -`--bearer-token-env-var`: +`--header` flag, so the variable must be set wherever Codex runs: ```bash -export CLICKSTACK_ACCESS_KEY="" +read -rs CLICKSTACK_ACCESS_KEY && export CLICKSTACK_ACCESS_KEY codex mcp add clickstack --url /api/mcp \ --bearer-token-env-var CLICKSTACK_ACCESS_KEY ``` @@ -122,6 +135,7 @@ with: | ----------------------------- | -------------------------------------------------------------------------------------------- | | `clickstack_list_sources` | List all data sources and connections as a lightweight catalog (IDs, names, kinds) | | `clickstack_describe_source` | Full column schema, attribute keys, sampled low-cardinality values, and a round-trippable `config` block (the exact shape `clickstack_save_source` accepts, incl. correlation IDs) for a single source; for metric sources also returns a per-kind metric-name sample | +| `clickstack_describe_table` | Inspect a ClickHouse table that is not a registered source: columns, keys, engine, skipping indices, approximate size, and an optional row sample. Without a table, lists the tables in a database (paginated) | | `clickstack_save_source` | Create (omit id) or update (provide id) a data source (log, trace, session, metric, or promql) so shipped telemetry becomes queryable. To clone a source, read its `config` from `clickstack_describe_source`, drop `id`, and pass it here | | `clickstack_delete_source` | Permanently delete a data source by ID | | `clickstack_list_metrics` | Paginated catalog of metric names on a metric source with optional kind / namePattern / time-window filters | @@ -133,7 +147,8 @@ with: | `clickstack_event_patterns` | Discover the most common log messages and event patterns using Drain clustering | | `clickstack_event_deltas` | Compare two row groups and rank properties by how their value distributions differ | | `clickstack_emerging_signals` | Detect NEW or GONE log/event patterns between a baseline and a current window (two-window Drain novelty diff) | -| `clickstack_sql` | Execute raw ClickHouse SQL for advanced queries (JOINs, CTEs, sub-queries) | +| `clickstack_sql` | Execute raw ClickHouse SQL for advanced queries (JOINs, CTEs, sub-queries); pass `queries` to run up to 10 in parallel | +| `clickstack_promql` | Run a PromQL expression (range or instant) against a PromQL source. Only registered when PromQL is enabled | | `clickstack_get_dashboard` | List all dashboards or get full detail for a specific dashboard | | `clickstack_save_dashboard` | Create or update a dashboard with tiles (charts, tables, numbers, search, markdown) | | `clickstack_delete_dashboard` | Permanently delete a dashboard and its attached alerts | @@ -196,3 +211,40 @@ Discovery workflow for metrics: 4. `clickstack_describe_metric` to drill into a specific metric and discover its attribute keys + sampled values before authoring queries. 5. `clickstack_timeseries` / `clickstack_table` to chart the metric. + +### PromQL Sources + +Available when PromQL is enabled for the deployment (self-hosted: the API's +`ENABLE_PROMQL` setting). With it off, PromQL sources, tiles, label filters, +the `clickstack_promql` tool and the PromQL prompt sections are all hidden +from MCP. + +A source with `kind: "promql"` holds Prometheus metrics, either on a +Prometheus-compatible endpoint or in a ClickHouse `TimeSeries` table. The +builder tools do not read it; use PromQL: + +1. `clickstack_list_sources` shows each PromQL source with its `backend` + (`prometheus` or `clickhouse`). +2. `clickstack_describe_source` lists its metric names and label names. +3. `clickstack_promql` runs an expression. A `range` query (default) returns + `{ __hdx_time_bucket, series_name, value }` rows plus `seriesLabels`; an + `instant` query evaluates at `endTime` and returns one row per series with + a column per label. `granularity` sets the step and `$__interval` in the + same `" "` format PromQL tiles use. +4. `clickstack_save_dashboard` with a `configType: "promql"` tile keeps the + chart; `clickstack_query_tile` returns the same rows for the same + expression and granularity. `PROMETHEUS_LABEL` filters give the dashboard + a label dropdown that tiles reference as `{job=~"$job"}`. + +```jsonc +{ + "sourceId": "", + "expression": "sum by (job) (rate(http_requests_total[$__rate_interval]))", + "startTime": "2026-01-01T00:00:00Z", + "endTime": "2026-01-01T01:00:00Z" +} +``` + +The `$__interval`, `$__rate_interval` and `$__range` macros expand as they do +in a PromQL tile. Dashboard variables do not resolve in `clickstack_promql`; +write the value inline. diff --git a/Makefile b/Makefile index 91896878e..c682bacfc 100644 --- a/Makefile +++ b/Makefile @@ -283,6 +283,7 @@ build-app: --build-context app=./packages/app \ --build-arg CODE_VERSION=${CODE_VERSION} \ -t ${IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \ + -t ${NEXT_IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION}${IMAGE_VERSION_SUB_TAG} \ --target prod .PHONY: build-otel-collector-nightly @@ -300,6 +301,7 @@ build-app-nightly: --build-context app=./packages/app \ --build-arg CODE_VERSION=${CODE_VERSION} \ -t ${IMAGE_NAME_DOCKERHUB}:${IMAGE_NIGHTLY_TAG} \ + -t ${NEXT_IMAGE_NAME_DOCKERHUB}:${IMAGE_NIGHTLY_TAG} \ --target prod .PHONY: build-local-nightly diff --git a/agent_docs/README.md b/agent_docs/README.md index 2e3c1de63..58ff6241a 100644 --- a/agent_docs/README.md +++ b/agent_docs/README.md @@ -1,6 +1,6 @@ # Agent Documentation Directory -This directory contains detailed documentation for AI coding agents working on the HyperDX codebase. These files use **progressive disclosure** - they're referenced from `AGENTS.md` but only read when needed. +This directory contains detailed documentation for AI coding agents working on the ClickStack codebase. These files use **progressive disclosure** - they're referenced from `AGENTS.md` but only read when needed. ## Purpose @@ -19,7 +19,7 @@ Instead of stuffing all instructions into `AGENTS.md` (which goes into every con - **`page_layout.md`** - PageHeader, PageLayout, and consistent page chrome (titles, actions, tool pages) - **`naming_objects.md`** - How users name and rename objects (dashboards, saved searches, tiles) with `InlineNameInput`. Read before adding or changing any place where something gets a name. - **`data_viz_colors.md`** - Chart, heatmap, and semantic status colors. Read before adding or changing any color in a chart, sparkline, heatmap, legend, or status pill. -- **`themes.md`** - How the brand theme system (HyperDX vs ClickStack) and color mode (light/dark/system) work. Read before changing anything in `packages/app/src/theme/`, adding semantic CSS variables, or touching brand-conditional UI. +- **`themes.md`** - ClickStack appearance and color mode (light/dark/system). Read before changing anything in `packages/app/src/theme/`, adding semantic CSS variables, or hard-coding a color, logo, or favicon. - **`observability.md`** - Instrumentation standards (tracing, metrics, context) and the shared helpers. Read when adding or changing a feature. - **`evals.md`** - MCP eval framework: dual-slot setup, running A/B comparisons between branches, interpreting results. Read before running evals or benchmarking MCP changes. diff --git a/agent_docs/architecture.md b/agent_docs/architecture.md index 30dfce452..b42eaebe5 100644 --- a/agent_docs/architecture.md +++ b/agent_docs/architecture.md @@ -1,9 +1,9 @@ -# HyperDX Architecture +# ClickStack Architecture ## Core Services -- **HyperDX UI (`packages/app`)**: Next.js frontend serving the user interface -- **HyperDX API (`packages/api`)**: Node.js/Express backend handling queries and business logic +- **ClickStack UI (`packages/app`)**: Next.js frontend serving the user interface +- **ClickStack API (`packages/api`)**: Node.js/Express backend handling queries and business logic - **OpenTelemetry Collector**: Receives and processes telemetry data - **ClickHouse**: Primary data store for all telemetry (logs, metrics, traces) - **MongoDB**: Metadata storage (users, dashboards, alerts, saved searches) diff --git a/agent_docs/code_style.md b/agent_docs/code_style.md index cc4b5ff14..16b4836eb 100644 --- a/agent_docs/code_style.md +++ b/agent_docs/code_style.md @@ -177,14 +177,14 @@ This pattern cannot be enforced by ESLint and requires manual code review. ### Semantic component variants (Alert / Text / danger controls) -We ship **themed semantic variants** for `Alert`, `Text`, `Button`, and `ActionIcon` so callouts and status text are token-driven and consistent across the HyperDX and ClickStack brands (and light/dark). **Prefer these over raw Mantine palette colors** (`color="yellow"`, `color="red"`, `c="green"`, etc.). +We ship **semantic variants** for `Alert`, `Text`, `Button`, and `ActionIcon` so callouts and status text are token-driven in both light and dark. **Prefer these over raw Mantine palette colors** (`color="yellow"`, `color="red"`, `c="green"`, etc.). -The variant → token mapping is centralized in `packages/app/src/theme/themes/semanticVariants.ts` (the single source of truth, consumed by both brand themes' `mantineTheme.ts`). See the Storybook stories `Components/Alert` (interactive `Playground`) and `Design tokens/Semantic variants` for the full visual matrix. +The variant → token mapping is centralized in `packages/app/src/theme/semanticVariants.ts` (the single source of truth, consumed by `theme/mantineTheme.ts`). See the Storybook stories `Components/Alert` (interactive `Playground`) and `Design tokens/Semantic variants` for the full visual matrix. **`Alert`** — `info` | `success` | `warning` | `danger`. Renders a tinted `-subtle` background with the title, icon, **and body text** in the semantic color token: ```tsx -// ✅ token-driven, works in both brands + light/dark, meets WCAG AA +// ✅ token-driven, works in light and dark, meets WCAG AA This may take a while. Could not save the alert. @@ -398,11 +398,11 @@ render those verbatim. ## Semantic design tokens (prefer over raw Mantine colors) -The UI is built with **Mantine components**, but **colors and surfaces** should follow the **semantic CSS custom properties** in our themes (`--color-*`, etc.), not ad-hoc Mantine palette values. Those tokens are defined in `packages/app/src/theme/themes/**/_tokens.scss`, align with a **Click UI**–style system, and keep HyperDX and ClickStack visually consistent. They are the path toward a shared design system even while Mantine remains the component layer. +The UI is built with **Mantine components**, but **colors and surfaces** should follow the **semantic CSS custom properties** in our themes (`--color-*`, etc.), not ad-hoc Mantine palette values. Those tokens are defined in `packages/app/src/theme/_tokens.scss`, align with a **Click UI**–style system, and are shared by every deployment. They are the path toward a shared design system even while Mantine remains the component layer. - **Do**: Use Mantine for layout, components, and spacing; use **semantic tokens** for themed backgrounds, text colors, borders, and states (e.g. `style={{ color: 'var(--color-text-muted)' }}` or `style={{ border: '1px solid var(--color-border)' }}`). - **Do not**: Rely on raw Mantine color props for app chrome and content when a semantic token exists — e.g. `c="gray.5"`, `bg="dark.7"`, or arbitrary `color="blue.4"` for surfaces that should match the rest of the product. -- **Reference**: `packages/app/src/theme/semanticColorsGrouped.ts` (token names), theme SCSS under `packages/app/src/theme/themes/`, and Storybook (`SemanticColors` and related theme stories) for a visual map. +- **Reference**: `packages/app/src/theme/semanticColorsGrouped.ts` (token names), `packages/app/src/theme/_tokens.scss`, and Storybook (`SemanticColors` and related theme stories) for a visual map. Mantine theme overrides in `packages/app/src/theme/**` may map Mantine’s scale to our palette; that does not replace using **`var(--color-...)`** in new styling where you need explicit color control. @@ -410,7 +410,7 @@ Mantine theme overrides in `packages/app/src/theme/**` may map Mantine’s scale `@clickhouse/click-ui` is a dependency of `packages/app`. `ThemeWrapper` mounts `ClickUIProvider` inside `MantineProvider` with `persistTheme={false}`, so it -follows the HyperDX color mode and never writes its own theme to localStorage. +follows the app color mode and never writes its own theme to localStorage. Storybook and `renderWithMantine` in tests get the provider for free. - **Do**: Prefer a click-ui component over a new Mantine one when click-ui has diff --git a/agent_docs/data_viz_colors.md b/agent_docs/data_viz_colors.md index 53fec0618..bc7209e2f 100644 --- a/agent_docs/data_viz_colors.md +++ b/agent_docs/data_viz_colors.md @@ -1,6 +1,6 @@ # Data Visualization Colors -> Single source of truth for chart and visualization colors in HyperDX. Read +> Single source of truth for chart and visualization colors in ClickStack. Read > this before adding, changing, or hard-coding a color in any chart, sparkline, > heatmap, legend, status pill, or other data display. @@ -51,13 +51,12 @@ and ClickStack: | `chart-gray` | `#9498a0` | **Source of truth for categorical hues lives in JS.** The matching -`--color-chart-{hue}` CSS vars in both -`packages/app/src/theme/themes/hyperdx/_tokens.scss` and -`packages/app/src/theme/themes/clickstack/_tokens.scss` are a stylesheet-author +`--color-chart-{hue}` CSS vars, included from +`packages/app/src/theme/_tokens.scss`, are a stylesheet-author affordance only — `getColorFromCSSVariable` and `getColorFromCSSToken` skip `getComputedStyle` for categorical tokens and return values straight from -`CATEGORICAL_HEX_BY_TOKEN` in `utils.ts`. The palette is the same on every theme -today, so a DOM round-trip per series buys nothing. +`CATEGORICAL_HEX_BY_TOKEN` in `utils.ts`. A DOM round-trip per series buys +nothing. The CSS vars exist for: @@ -69,21 +68,20 @@ The CSS vars exist for: add per-brand entries to `CATEGORICAL_HEX_BY_TOKEN`. The categorical hues and semantic chart colors live in a single shared partial, -`packages/app/src/theme/themes/_chart-categorical-tokens.scss` (`chart-categorical-tokens` -and `chart-semantic-tokens` mixins). Both brand themes `@use` it and `@include` -both mixins inside their per-theme `chart-tokens` mixin. Each theme's -`chart-tokens` mixin is then `@include`'d inside both `[data-mantine-color-scheme]` -selectors. Sass inlines the bodies at each call site, so the emitted CSS has the -same per-scheme specificity as a hand-duplicated block would — but the source -lives in **one place** for both layers. **If you change a categorical hex in the -shared partial, change it in `CATEGORICAL_HEX_BY_TOKEN` in `utils.ts` too. If -you change a semantic hex, update `SEMANTIC_CHART_PALETTE` in `utils.ts` too — -the SCSS and JS sources are intentionally mirrored.** - -Brand identity for charts is carried by non-chart UI chrome (Mantine accent, -sidebar gradient, Click UI globals), not by per-brand chart semantic colors — -`success` and `info` reuse categorical `chart-green` and `chart-blue` on both -brands. +`packages/app/src/theme/_chart-categorical-tokens.scss` (`chart-categorical-tokens` +and `chart-semantic-tokens` mixins). `theme/_tokens.scss` `@use`s it and +`@include`s both mixins inside its `chart-tokens` mixin, which is then +`@include`'d inside both `[data-mantine-color-scheme]` selectors. Sass inlines +the bodies at each call site, so the emitted CSS has the same per-scheme +specificity as a hand-duplicated block would — but the source lives in **one +place**. **If you change a categorical hex in the shared partial, change it in +`CATEGORICAL_HEX_BY_TOKEN` in `utils.ts` too. If you change a semantic hex, +update `SEMANTIC_CHART_PALETTE` in `utils.ts` too — the SCSS and JS sources are +intentionally mirrored.** + +Chart series colors are not the brand accent. `success` and `info` reuse +categorical `chart-green` and `chart-blue`. The yellow ClickStack accent stays +in non-chart chrome (Mantine accent, sidebar, Click UI globals). ### Semantic chart colors (`--color-chart-{success|warning|error|info}`) @@ -97,23 +95,22 @@ brands. --color-chart-error-highlight ``` -Defined in both `_tokens.scss` files. **Unified on both brands**: `success` -reuses categorical `chart-green` (`#3ca951`); `info` reuses categorical -`chart-blue` (`#437eef`). Warning and error use the same Observable hexes across -themes. +Defined in the shared `chart-semantic-tokens` mixin. `success` reuses +categorical `chart-green` (`#3ca951`); `info` reuses categorical `chart-blue` +(`#437eef`). Warning and error use the same Observable hexes. Unlike the categorical hues, **the semantic CSS vars are read at runtime** via `getComputedStyle` (see `getSemanticChartColor` in `utils.ts`). That keeps -inline `var(--color-chart-warning)` consumers like `LogLevel.tsx` reacting to -theme switches without a React re-render, and it lets JS callers like -`getChartColorSuccess()` return the correct hex for the active theme. +inline `var(--color-chart-warning)` consumers like `LogLevel.tsx` in sync with +the stylesheet, and it lets JS callers like `getChartColorSuccess()` return the +same hex. ### Single source of truth in TS (`packages/app/src/utils.ts`) ```text CATEGORICAL_HEX_BY_TOKEN # { 'chart-blue': '#437eef', ... } — file-private, # authoritative for categorical hues -SEMANTIC_CHART_PALETTE # { hyperdx: {...}, clickstack: {...} } — file-private, +SEMANTIC_CHART_PALETTE # { success, warning, error, info, …highlight } — file-private, # SSR/fallback for the semantic CSS vars COLORS # ordered hex array, derived from CATEGORICAL_PALETTE_TOKENS ``` @@ -153,14 +150,12 @@ Internals worth knowing: `CATEGORICAL_HEX_BY_TOKEN` — same shortcut, no `getComputedStyle`. - Semantic tokens (`chart-success`, `-warning`, `-error`) read `--color-{token}` from `documentElement` via `getComputedStyle` and fall - back to the active theme's `SEMANTIC_CHART_PALETTE` entry when running - server-side or when the DOM read fails. + back to `SEMANTIC_CHART_PALETTE` when running server-side or when the DOM + read fails. - `getSemanticChartColor(varName, key)` is the shared helper that backs the - `getChartColor{Success,Warning,Error,Info}()` readers. It uses - `detectActiveTheme()` (checks for the `theme-clickstack` class on ``) to - pick the correct per-brand fallback. -- During SSR, semantic readers return the **HyperDX** default — the hydration - mismatch window is tiny because charts render after data fetch on the client. + `getChartColor{Success,Warning,Error,Info}()` readers. SSR and DOM-read + failures use `SEMANTIC_CHART_PALETTE`. Charts usually render after data + fetch on the client, so that fallback rarely reaches the DOM. ### Legacy `chart-1` … `chart-10` tokens @@ -361,38 +356,21 @@ const slices = sorted.map((d, i) => ({ `ChartUtils.tsx → buildPieChartData` already does this. -## Per-theme considerations - -The categorical palette is identical on both themes — Observable 10. Semantic -`success` and `info` also reuse categorical hues on both brands. - -### HyperDX +## Color mode - `--color-chart-success` uses categorical `chart-green` (`#3ca951`). -- `--color-chart-info` uses categorical `chart-blue` (`#437eef`), so info-level - logs and `getChartColorInfo()` render the same blue as multi-series slot 0. -- Multi-series charts start at brand blue (slot 0, `#437eef`) and proceed - through the canonical palette — brand identity is preserved via the Mantine - green accent and sidebar gradient, not via chart semantic colors. - -### ClickStack - +- `--color-chart-info` uses categorical `chart-blue` (`#437eef`, same as + `--click-global-color-text-link-default`), so info-level logs and + `getChartColorInfo()` render that blue. - The brand accent is **yellow** (`--palette-brand-300: #faff69`). It is **not** in the chart palette and should not be added — yellow on a light background fails contrast, and yellow as a series color reads as "warning" in most contexts. -- `--color-chart-success` uses categorical `chart-green` (`#3ca951`). -- `--color-chart-info` uses categorical `chart-blue` (`#437eef`, same as - `--click-global-color-text-link-default`), so info-level logs and - `getChartColorInfo()` render the brand blue. - -### Both themes - - The dark/light scheme split is handled by CSS (the same vars get redefined inside each scheme selector). React code does not need to branch on scheme except for the heatmap palette. -- The chart vars in `_tokens.scss` are intentionally duplicated across the dark - and light blocks. If you change one, change the other. +- The chart vars are intentionally included in both the dark and light blocks. + Change the shared mixin, not one selector. ## Adding new entries @@ -406,8 +384,8 @@ preference: 1. **Group small categories** into "Other" before charting. 2. **Reuse slots** with patterns/strokes/labels for disambiguation. 3. If you really must extend: add `--color-chart-{newhue}` to the shared - `_chart-categorical-tokens.scss` partial — one edit covers both brands and - both schemes via the existing `@include` chain. Then append + `_chart-categorical-tokens.scss` partial — one edit covers both schemes via + the existing `@include` chain. Then append `'chart-{newhue}'` to `CHART_PALETTE_TOKENS` in `common-utils/src/types.ts`, add the hex to `CATEGORICAL_HEX_BY_TOKEN` in `utils.ts`, and add a label entry in `ColorSwatchInput.tsx` → `TOKEN_LABELS` and @@ -415,15 +393,14 @@ preference: ### A new semantic color (e.g. `--color-chart-pending`) -1. Pick the hex (unified across brands unless you have a deliberate per-brand split). +1. Pick the hex. 2. Add `--color-chart-pending` and (if needed) `--color-chart-pending-highlight` to the `@mixin chart-semantic-tokens` block in - `_chart-categorical-tokens.scss`. The mixin is `@include`'d in each theme's - `chart-tokens` mixin, which is `@include`'d in each scheme selector — one edit - covers dark and light for both brands. For a per-brand override only, declare - the var in that brand's `chart-tokens` mixin after the shared `@include`. -3. Add `pending` (and optionally `pendingHighlight`) to - `SEMANTIC_CHART_PALETTE.hyperdx` and `.clickstack` in `utils.ts`. + `_chart-categorical-tokens.scss`. The mixin is `@include`'d from + `theme/_tokens.scss` inside each scheme selector — one edit covers dark + and light. +3. Add `pending` (and optionally `pendingHighlight`) to `SEMANTIC_CHART_PALETTE` + in `utils.ts`. 4. Append `'chart-pending'` to `CHART_PALETTE_TOKENS` (and `SEMANTIC_PALETTE_TOKENS` slice will pick it up automatically) in `common-utils/src/types.ts`. @@ -470,8 +447,6 @@ Why each is wrong: ## Pre-merge checklist for chart-touching PRs -- [ ] Toggled HyperDX ↔ ClickStack theme — semantic success and info stay - unified (chart-green / chart-blue); categorical palette stays identical. - [ ] Toggled dark ↔ light — categorical and semantic colors stay legible on both backgrounds; heatmap gradient flips palettes. - [ ] Status indicators use `getChartColor*()` / `var(--color-chart-*)`, not raw @@ -483,15 +458,15 @@ Why each is wrong: `CATEGORICAL_HEX_BY_TOKEN` in `utils.ts`). - [ ] If you added or changed a semantic hex, changed it in **both** places (`chart-semantic-tokens` mixin in `_chart-categorical-tokens.scss`, - `SEMANTIC_CHART_PALETTE.{theme}` in `utils.ts`). + `SEMANTIC_CHART_PALETTE` in `utils.ts`). - [ ] Storybook `Design tokens / Chart colors` still renders correctly. ## File reference summary | What | Where | | --------------------------------------------------- | -------------------------------------------------------------------------------- | -| Shared chart vars (10 categorical hues + semantics) | `packages/app/src/theme/themes/_chart-categorical-tokens.scss` | -| Per-theme `chart-tokens` mixin (`@include` chain) | `packages/app/src/theme/themes/hyperdx/_tokens.scss`, `clickstack/_tokens.scss` | +| Shared chart vars (10 categorical hues + semantics) | `packages/app/src/theme/_chart-categorical-tokens.scss` | +| `chart-tokens` mixin (`@include` chain) | `packages/app/src/theme/_tokens.scss` | | JS palette objects + reader functions | `packages/app/src/utils.ts` | | Palette token enum + legacy migration | `packages/common-utils/src/types.ts` | | Multi-series wiring (`setLineColors` etc.) | `packages/app/src/ChartUtils.tsx` | diff --git a/agent_docs/evals.md b/agent_docs/evals.md index ff918e3df..d7e091aa3 100644 --- a/agent_docs/evals.md +++ b/agent_docs/evals.md @@ -41,7 +41,7 @@ This is the standard workflow for comparing a feature branch against main. ### Architecture Evals run from **one worktree** (the branch being tested). The eval harness -talks to **two separate HyperDX API instances** running on different slots: +talks to **two separate ClickStack API instances** running on different slots: ``` ┌──────────────────────┐ @@ -68,7 +68,7 @@ talks to **two separate HyperDX API instances** running on different slots: ``` Each slot runs its own ClickHouse instance. `setup-hyperdx` (step 2) creates -the HyperDX account, Connection, and Sources on each instance, but does **not** +the ClickStack account, Connection, and Sources on each instance, but does **not** seed telemetry data. The `run` command auto-seeds on first run, but only into the single ClickHouse specified in the top-level `clickhouse` config — so for dual-slot comparisons you must seed each instance explicitly (step 4b). @@ -106,7 +106,7 @@ curl -s -o /dev/null -w "Slot 99 CH: %{http_code}\n" http://localhost:30599/ > branch under test). This registers an eval account, creates a ClickHouse Connection, and creates -per-scenario Sources on each HyperDX instance. The command is **idempotent** — +per-scenario Sources on each ClickStack instance. The command is **idempotent** — it skips anything that already exists, so it's safe to run every time. **Skip this step** if `eval.config.branch.json` and `eval.config.main.json` @@ -189,7 +189,7 @@ curl -s -o /dev/null -w "Main MCP: %{http_code}\n" \ ### 5. Seed both ClickHouse instances -`setup-hyperdx` creates the HyperDX account and Sources but does **not** seed +`setup-hyperdx` creates the ClickStack account and Sources but does **not** seed telemetry data. The `run` command's auto-seed only writes to the single ClickHouse in the top-level `clickhouse` config, so you must seed each instance explicitly: @@ -267,10 +267,10 @@ yarn workspace @hyperdx/hdx-eval dev run error-root-cause \ --mcp hyperdx --model claude-opus-4-6 --runs 3 ``` -### Non-HyperDX MCP (e.g. raw ClickHouse) +### Non-ClickStack MCP (e.g. raw ClickHouse) The framework works with any MCP. The `clickhouse` stdio MCP is included by -default in `eval.config.json` after setup. Use it to compare HyperDX's MCP +default in `eval.config.json` after setup. Use it to compare ClickStack's MCP against querying ClickHouse directly. ```bash diff --git a/agent_docs/observability.md b/agent_docs/observability.md index a814e3643..1de5356b4 100644 --- a/agent_docs/observability.md +++ b/agent_docs/observability.md @@ -1,6 +1,6 @@ # Observability & Instrumentation -HyperDX is an observability product, so our own code should be a shining example +ClickStack is an observability product, so our own code should be a shining example of well-instrumented software. When you add or change a feature, instrument it as part of the change - not as an afterthought. @@ -30,7 +30,7 @@ aligned with the already in flight, and put point-in-time / gauge-style values (sizes, counts, depths, current state) there rather than in a gauge. This is an internal engineering preference, not a rule against metrics — counters and histograms - remain first-class, feed alerts and SLOs, and many HyperDX deployments depend + remain first-class, feed alerts and SLOs, and many ClickStack deployments depend heavily on them. See [Wide events over gauges](#wide-events-over-gauges). 5. **Use the shared helpers** in [`packages/api/src/utils/instrumentation.ts`](../packages/api/src/utils/instrumentation.ts). @@ -47,7 +47,7 @@ All manual instrumentation in `packages/api` goes through | Helper | Purpose | | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | `withSpan(name, fn, opts?)` | Run an async unit of work in an active span. Records exceptions, sets OK/ERROR status, always ends the span. | -| `setBusinessContext({ teamId, userId, email, ...extra })` | Attach standardized incident-remediation context to the trace + active span. | +| `setBusinessContext({ teamId, userId, email, ...extra })` | Attach standardized incident-remediation context to the active span and the request's HTTP server span. | | `getStaticFeatureFlags()` | Returns the static (env/compile-time) feature-flag states as `feature_flag.*` attributes. | | `getCounter(name, opts?)` / `getHistogram(name, opts?)` | Memoized OTel instrument accessors. Always use these instead of `meter.create*`. | | `recordDuration(histogram, fn, attrs?)` | Run `fn`, recording its wall-clock duration on a histogram (even on throw). | @@ -57,10 +57,10 @@ types, so a single import is usually enough. ### Tracing -Rely on the HyperDX SDK auto-instrumentation (HTTP, Express, Mongo, etc.) for -the common path. Add a **manual span only for a meaningful unit of work** that -auto-instrumentation can't see - a background job step, a fan-out, an expensive -computation, an external tool invocation. +Rely on the ClickStack SDK (`@clickhouse/clickstack-node`) auto-instrumentation +(HTTP, Express, Mongo, etc.) for the common path. Add a **manual span only for a +meaningful unit of work** that auto-instrumentation can't see - a background job +step, a fan-out, an expensive computation, an external tool invocation. ```ts import { withSpan } from '@/utils/instrumentation'; @@ -91,8 +91,10 @@ Span rules to follow (from the Instrumentation Score spec): ### Business context Attach team/user context as early as possible (at the auth boundary or the top -of a job). `setBusinessContext` writes both to the whole trace (via the HyperDX -SDK, requires `HDX_NODE_BETA_MODE=1`) and to the active span. +of a job). `setBusinessContext` writes to the active span and, inside an HTTP +request, to the request's HTTP server span, so the context stays on the request +even when the active span is a short Express middleware span. Other spans in the +trace do not get it. ```ts import { @@ -120,9 +122,9 @@ Standard attribute keys: ### Wide events over gauges -> **Scope:** this is HyperDX's _internal_ instrumentation philosophy for the +> **Scope:** this is ClickStack's _internal_ instrumentation philosophy for the > code in this repo — not a recommendation that users pick wide events over -> metrics. Metrics are a first-class HyperDX signal that many operators rely on; +> metrics. Metrics are a first-class ClickStack signal that many operators rely on; > nothing here discourages them. What follows is simply how _we_ prefer to > instrument our own services. @@ -237,7 +239,7 @@ auto-instrumentation and error middleware already cover. ## Query attribution -Every ClickHouse query HyperDX runs is tagged with what asked for it, so a row +Every ClickHouse query ClickStack runs is tagged with what asked for it, so a row in the customer's `system.query_log` points back to a dashboard tile, a saved search, an alert, or an MCP tool. This is the one piece of our instrumentation that lands in *their* data rather than ours, so it stays small, carries no @@ -303,9 +305,10 @@ calls `/api/v1/prometheus/query{,_range}`, and `/labels` and (`QUERY_ATTRIBUTION_HEADER`), and the router parses it with `parseLogComment` into a `withQueryAttribution` scope layered over the auth middleware's `api` scope. The browser's surface and ids win; `trace` and `label` stay the -server's. Queries the route runs through a ClickHouse client (label lookups, -and the `prometheusQuery()`/`prometheusQueryRange()` fallback) pick the scope -up as usual. Requests proxied to ClickHouse's Prometheus HTTP API on 26.6+ are tagged +server's. Queries the route runs through a ClickHouse client (label lookups +before 26.9, and the `prometheusQuery()`/`prometheusQueryRange()` fallback) +pick the scope up as usual. Requests proxied to ClickHouse's Prometheus HTTP +API (queries on 26.6+, label lookups on 26.9+) are tagged by `clickhousePrometheusRequest`: `log_comment` as a URL setting, `query_id` as the `X-ClickHouse-Query-Id` header, because the handler rejects `query_id` as an unknown setting in the URL. diff --git a/agent_docs/page_layout.md b/agent_docs/page_layout.md index c1ca24476..cde50f3c0 100644 --- a/agent_docs/page_layout.md +++ b/agent_docs/page_layout.md @@ -1,6 +1,6 @@ # Page layout and headers -HyperDX app pages share a sticky top header bar and a scrollable content region below it. Use the shared layout primitives so titles, controls, and spacing stay consistent across Search, list pages, and tool pages (Service Map, Kubernetes, Chart Explorer). +ClickStack app pages share a sticky top header bar and a scrollable content region below it. Use the shared layout primitives so titles, controls, and spacing stay consistent across Search, list pages, and tool pages (Service Map, Kubernetes, Chart Explorer). ## Components diff --git a/agent_docs/tech_stack.md b/agent_docs/tech_stack.md index 330cd238c..dab5aac5c 100644 --- a/agent_docs/tech_stack.md +++ b/agent_docs/tech_stack.md @@ -1,4 +1,4 @@ -# HyperDX Technology Stack +# ClickStack Technology Stack ## Frontend (`packages/app`) @@ -20,7 +20,7 @@ Mantine primitives → Custom SCSS modules as last resort - **Database**: ClickHouse (telemetry data), MongoDB via Mongoose (metadata) - **Authentication**: Passport.js with local strategy - **Validation**: Zod schemas -- **Telemetry**: Self-instrumented with `@hyperdx/node-opentelemetry` +- **Telemetry**: Self-instrumented with `@clickhouse/clickstack-node` (API and Next.js server) and `@clickhouse/clickstack-browser` (frontend) ## Common Utilities (`packages/common-utils`) diff --git a/agent_docs/themes.md b/agent_docs/themes.md index e162f9c9a..c32265080 100644 --- a/agent_docs/themes.md +++ b/agent_docs/themes.md @@ -1,179 +1,94 @@ -# Themes (HyperDX & ClickStack) +# Appearance (ClickStack + color mode) -> How the brand theme system works, how it interacts with light/dark color -> mode, and where to make changes safely. Read this before touching anything -> in `packages/app/src/theme/`, before adding a new brand, or before -> hard-coding any color, logo, or favicon path in the app. +> How colors, logos, and light/dark mode work. Read this before changing +> anything in `packages/app/src/theme/`, adding a semantic CSS variable, or +> hard-coding a color, logo, or favicon path. > -> For **chart colors specifically** (categorical palette, heatmap gradient, -> semantic success/warn/error chart colors) see -> [`data_viz_colors.md`](data_viz_colors.md) — it covers the chart-specific -> rules in more depth. This doc covers everything else. +> For chart colors see [`data_viz_colors.md`](data_viz_colors.md). ## TL;DR -The app has **two independent theming concepts**: - -| Concept | Values | Who controls it | Stored in | What it affects | -| ------------------ | ------------------------------ | --------------------------- | ------------------------------------------ | ----------------------------------------------------- | -| **Brand theme** | `hyperdx` \| `clickstack` | Deployment (build/env) | `NEXT_PUBLIC_THEME` + html class | Branding: logos, favicons, accent colors, fonts | -| **Color mode** | `light` \| `dark` \| `system` | End user (preferences UI) | `localStorage: hdx-user-preferences` | Light/dark appearance: backgrounds, text, borders | - -Each deployment ships **one** brand theme. Users can flip between light and -dark inside that brand but cannot switch brands in production. In dev you -can override the brand via `window.__HDX_THEME.set('clickstack')`. - -The runtime wiring is: - -1. Server-side (`pages/_document.tsx`) puts `theme-hyperdx` or - `theme-clickstack` on `` based on `NEXT_PUBLIC_THEME`. -2. An inline script (`SystemColorSchemeScript`) sets - `data-mantine-color-scheme="light|dark"` on `` from - `localStorage.hdx-user-preferences.colorMode` before React hydrates. -3. SCSS in `packages/app/src/theme/themes/{brand}/_tokens.scss` defines all - semantic CSS variables (`--color-bg-body`, `--color-text-primary`, …) - inside `.theme-{brand}[data-mantine-color-scheme='{mode}']` selectors — - one block per (brand × mode) combination, four blocks total. -4. Mantine config (`{brand}/mantineTheme.ts`) sets `primaryColor`, - font, spacing, and per-component overrides — most colors come back out - via CSS vars rather than Mantine palette entries. -5. React reads the active brand via `useAppTheme()` (rarely needed — - prefer CSS vars). +The product is ClickStack. There is no brand switch, no `NEXT_PUBLIC_THEME`, +and no second palette. -**Hard rules**: +| Concept | Values | Who controls it | Stored in | What it affects | +| -------------- | ----------------------------- | ------------------------- | ------------------------------------ | ------------------------------------------------- | +| **Color mode** | `light` \| `dark` \| `system` | End user (preferences) | `localStorage: hdx-user-preferences` | Backgrounds, text, borders | -- **Never** hard-code a hex/named color in a component. Use a semantic CSS - var (`var(--color-bg-surface)`, `var(--color-text-primary)`, …). -- **Never** branch on `themeName` to choose colors. The CSS var already - resolves to the right value per brand. Branching is OK for *layout* or - *content* differences (different copy, different logo placement) — not - colors. -- **Never** confuse `IS_CLICKHOUSE_BUILD` with the theme. That flag gates - *features* (e.g. embedded mode, ClickHouse Cloud onboarding) and is - unrelated to brand colors. A `clickstack`-themed build can have - `IS_CLICKHOUSE_BUILD=false` and vice versa. +The UI font is Inter. Mono faces (IBM Plex Mono, Roboto Mono) stay available +for logs and code. The preferences modal does not offer a font picker. -## Brand theme +Color mode: -### Where the themes are defined +- Values: `'system' | 'light' | 'dark'`. Default `'system'`. +- `'system'` follows `window.matchMedia('(prefers-color-scheme: dark)')`. +- `SystemColorSchemeScript` sets `data-mantine-color-scheme` on `` + before React hydrates. +- `useResolvedColorScheme()` returns `'light' | 'dark'` for `ThemeWrapper`, + which passes it to `MantineProvider` as `forceColorScheme`. -Everything lives under `packages/app/src/theme/`: +Older stored preferences used a `theme` key for light/dark. Migration in +`useUserPreferences.tsx` rewrites that to `colorMode`. Don't reintroduce +the old name. -```text -theme/ -├── index.ts # Registry, validation, DEFAULT_THEME, getDevThemeName -├── types.ts # ThemeName, ThemeConfig, FaviconConfig types -├── ThemeProvider.tsx # AppThemeProvider + useAppTheme/useWordmark/useLogomark hooks -├── semanticColorsGrouped.ts # Grouping metadata for the storybook -├── ChartColors.stories.tsx # Visual reference for chart palette -├── SemanticColors.stories.tsx# Visual reference for semantic vars -├── themes/ -│ ├── _base-tokens.scss # Fallback vars when no theme class is applied (SSR safety) -│ ├── components.module.scss# Shared component overrides (slider marks, etc.) -│ ├── hyperdx/ -│ │ ├── index.ts # ThemeConfig export: name, displayName, logos, favicon, mantineTheme -│ │ ├── _tokens.scss # All semantic CSS vars (dark + light), scoped to .theme-hyperdx -│ │ ├── mantineTheme.ts # Mantine palette + component overrides -│ │ ├── Logomark.tsx # Icon-only logo (used in collapsed sidenav, favicons context) -│ │ └── Wordmark.tsx # Full "HyperDX" wordmark -│ └── clickstack/ -│ ├── index.ts # Same shape as hyperdx/index.ts -│ ├── _tokens.scss # Same shape — adds Click UI palette + yellow brand -│ ├── mantineTheme.ts # Same shape — yellow primaryColor -│ ├── Logomark.tsx -│ └── Wordmark.tsx -└── __tests__/ # ThemeProvider + theme validation tests -``` - -Favicons live under `packages/app/public/favicons/{brand}/`. The -`FaviconConfig` type in `types.ts` enforces the directory/filename -convention via Zod. - -### Each `ThemeConfig` ships: - -```ts -type ThemeConfig = { - name: 'hyperdx' | 'clickstack'; - displayName: string; // 'HyperDX' | 'ClickStack' — used in UI copy - cssClass: string; // 'theme-hyperdx' | 'theme-clickstack' - mantineTheme: MantineThemeOverride; - Wordmark: React.ComponentType; - Logomark: React.ComponentType<{ size?: number }>; - favicon: { svg, png32, png16, appleTouchIcon, themeColor }; -}; +```html + ``` -The registry in `theme/index.ts` validates both themes against a Zod -schema at module load time. In production, a failed validation throws; -in development it logs and falls back to `hyperdx`. +Tokens live in `packages/app/src/theme/_tokens.scss`, scoped to +`[data-mantine-color-scheme='dark']` and +`[data-mantine-color-scheme='light']`. +`packages/app/src/theme/_base-tokens.scss` imports that file. +Mantine component overrides are in `packages/app/src/theme/mantineTheme.ts`. -### How brand resolution works at runtime - -| Phase | Source of truth | Notes | -| --------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------- | -| SSR (`_document.tsx`) | `process.env.NEXT_PUBLIC_THEME` | Adds `theme-{name}` class to `` so SCSS vars resolve on the first paint. | -| Initial React render | `propsThemeName ?? DEFAULT_THEME` in provider | Matches SSR — never reads localStorage during render to avoid hydration mismatch. | -| Post-hydration (dev only) | `localStorage.hdx-dev-theme` via `getDevThemeName` | Updates state in a `useEffect`. Causes a one-frame flash; intentional for dev UX. | -| Post-hydration (prod) | Stable — no reads from storage | `setTheme`/`toggleTheme` are no-ops in production. Confirmed by the `IS_DEV` gate. | - -`IS_DEV` is true when `NODE_ENV === 'development'` **or** -`NEXT_PUBLIC_IS_LOCAL_MODE === 'true'` — so the OSS local-mode build also -exposes the dev theme switcher in `UserPreferencesModal`. - -### Dev-mode theme switching - -Three ways to flip brand in dev: - -1. **UI**: open the user preferences modal — there's a "Brand theme" - select gated on `isDev`. -2. **Console**: `window.__HDX_THEME.set('clickstack')`, - `window.__HDX_THEME.toggle()`, `window.__HDX_THEME.clear()`. -3. **Storage**: set `localStorage.setItem('hdx-dev-theme', 'clickstack')` - and reload. +**Hard rules**: -`clear()` removes the override and reverts to `NEXT_PUBLIC_THEME` (or -`hyperdx` if unset). +- Don't hard-code a hex or named color in a component. Use a semantic CSS + var (`var(--color-bg-surface)`, `var(--color-text-primary)`, …). +- Don't branch on color mode to pick a semantic color. The var already + resolves. Branch only when a component truly needs a different asset + (for example the heatmap palette). +- Don't confuse `IS_CLICKHOUSE_BUILD` with appearance. That flag gates + features (embedded mode, ClickHouse Cloud onboarding). -## Color mode (light / dark / system) +## Brand -Color mode is **per-user**, persisted to -`localStorage.hdx-user-preferences` under the `colorMode` key. Defined in -`packages/app/src/useUserPreferences.tsx`: +Product name, page titles, and logos come from `packages/app/src/brand/`. +`useBrandDisplayName()` and `usePageTitle()` return ClickStack (plus +`INSTANCE_TITLE_SUFFIX` on titles). `useWordmark()` and `useLogomark()` +return the marks in that folder. Call sites use those hooks. A downstream +build replaces `brand/` and keeps the same call sites. The color tokens +stay shared. -- Values: `'system' | 'light' | 'dark'`. Default `'system'`. -- `'system'` follows `window.matchMedia('(prefers-color-scheme: dark)')` - and reacts to changes. -- The inline `SystemColorSchemeScript` (rendered very early) sets - `data-mantine-color-scheme` before React hydrates so there's no flash. -- `useResolvedColorScheme()` returns the resolved `'light' | 'dark'` for - consumption by `ThemeWrapper` (which forwards it to `MantineProvider` - as `forceColorScheme`). - -The user preferences storage also handles **migration from the legacy -`theme` key** — older versions used `theme: 'light'|'dark'|'system'`; -the migration code in `useUserPreferences.tsx` rewrites it to -`colorMode` so existing users don't lose their preference. Don't -re-introduce the old name. - -### Why two attributes (`class` + `data-attr`)? +```tsx +import { useLogomark, useWordmark } from '@/brand'; -```html - +function TopBar() { + const logo = useLogomark({ size: 24 }); + const wordmark = useWordmark(); + return ( + + {logo} + {wordmark} + + ); +} ``` -The combined selector `.theme-clickstack[data-mantine-color-scheme='dark']` -in `_tokens.scss` lets a single SCSS file define **all four** variants -(2 brands × 2 modes) without duplication at the call site. Each block -redefines `--color-bg-body`, `--color-text`, etc. for that specific -combination. There is no JS branching on brand/mode for color -resolution — CSS handles it. +Favicons are static links in `packages/app/pages/_document.tsx`, under +`packages/app/public/favicons/clickstack/`. -## How to consume themes in code +ClickStack specifics: -### From CSS / SCSS +- Mantine `primaryColor: 'yellow'`. The yellow ramp is the Click UI brand + palette (`--palette-brand-*`) from `theme/_tokens.scss`. +- Accent `#faff69` (`--palette-brand-300`) is for links and outlines, not + chart series. +- Warning tokens use Mantine `orange`, because yellow is the brand gold. +- Most semantic vars reference Click UI globals (`--click-global-color-*`). +- Tabler icons use `stroke-width: 1.5`. -Just use the semantic vars. They resolve automatically based on the -brand + mode classes on ``: +## How to consume colors ```scss .sidenav { @@ -181,339 +96,57 @@ brand + mode classes on ``: color: var(--color-text-sidenav-link); border-right: 1px solid var(--color-border); } - -.sidenav__link[data-active='true'] { - background: var(--color-bg-sidenav-link-active); - color: var(--color-text-sidenav-link-active); -} -``` - -The full list of semantic vars is in -`packages/app/src/theme/semanticColorsGrouped.ts` (used to build the -storybook story). Categories: backgrounds, borders, text, icons, -overlay, states, json (syntax highlight), charts. - -### From React (inline style, when CSS won't reach) - -Use the var string directly in `style={}` — `MantineProvider` doesn't -need to know about it: - -```tsx - ``` -Use **`useMantineColorScheme()`** when you genuinely need to branch on -`light` vs `dark` (e.g. picking a heatmap palette). Don't branch on it -to pick a semantic color — the var does that for you. +The list of semantic vars is in +`packages/app/src/theme/semanticColorsGrouped.ts`. In React, use the var +string in `style={{}}`. Use `useMantineColorScheme()` only when you must +branch on light vs dark. -### From React (reading the active brand) +### Semantic component variants -```tsx -import { useAppTheme, useThemeName, useBrandDisplayName } from '@/theme/ThemeProvider'; +Prefer these over raw Mantine palette props (`color="yellow"`, `c="green"`): -function Header() { - const { theme } = useAppTheme(); // full ThemeConfig - const themeName = useThemeName(); // 'hyperdx' | 'clickstack' - const brand = useBrandDisplayName(); // 'HyperDX' | 'ClickStack' — use in UI copy - // … -} -``` +- `` +- `` +- `` — soft tint, not a solid red fill -Use these only for: +The mapping is `packages/app/src/theme/semanticVariants.ts` +(`SEMANTIC_ALERT_VARS`, `SEMANTIC_TEXT_COLORS`, `SEMANTIC_CONTROL_COLORS`), +consumed by `theme/mantineTheme.ts`. Tokens only, never raw +`--mantine-color-*`. -- **Logo / wordmark rendering** — but prefer `useWordmark()` / - `useLogomark()`, which return memoized JSX. -- **Brand-specific UI copy** — e.g. "Connect ClickStack" vs "Connect HyperDX". -- **Rare layout differences** — e.g. ClickStack hides the font picker - because it's locked to Inter (see `_app.tsx`). +Semantic text (`--color-text-{danger,warning,success,info}`) clears WCAG AA +(4.5:1) on its `-subtle` background in both schemes. Keep the light-mode +`color-mix` darkening on success and warning. -**Don't use `themeName` to pick colors.** Bad: +Storybook: `Components/Alert` and `Design tokens/Semantic variants`. Use the +light/dark toolbar. -```tsx -// ❌ bypasses the whole CSS var system, breaks dark mode, breaks future themes -const accent = themeName === 'clickstack' ? '#faff69' : '#00c28a'; -``` +## Adding a semantic CSS variable -Good: +1. Name it `--color-{category}-{role}[-{state}]`. +2. Add it to both scheme blocks in `theme/_tokens.scss` (dark and light). +3. Add it to the matching group in `theme/semanticColorsGrouped.ts`. +4. Consume it with `var(--color-…)`. -```tsx -// ✅ resolves correctly for both brands and both color modes - -``` +If it backs an Alert, Text, or danger control, wire it through +`semanticVariants.ts` and check the Semantic variants story in both schemes. -### Logos +Chart vars (`--color-chart-*`) have extra steps in `data_viz_colors.md`. +The chart mixins are included inside both scheme selectors so specificity +stays the same when Mantine swaps `data-mantine-color-scheme`. Keep that +duplication. -```tsx -import { useWordmark, useLogomark } from '@/theme/ThemeProvider'; +## Where things live -function TopBar() { - const wordmark = useWordmark(); - const logo = useLogomark({ size: 24 }); - return {logo}{wordmark}; -} -``` - -Both hooks return memoized JSX elements so component identity stays -stable across renders. - -## Semantic component variants (Alert / Text / danger controls) - -On top of the raw `--color-*` vars, we expose **semantic component -variants** so callouts and status text stay token-driven and consistent -across brands and color modes. Reach for these instead of raw Mantine -palette props (`color="yellow"`, `color="red"`, `c="green"`, …). - -- **``** — tinted `-subtle` - background with the title, icon, and **body text** in the semantic - color. -- **``** — semantic inline status - text. -- **``** — a *soft* tinted control - (`--color-bg-danger-subtle` + hover), not a solid red fill. - `warning`/`success` are intentionally not control variants. - -The variant → token mapping is centralized in -**`packages/app/src/theme/themes/semanticVariants.ts`** (single source of -truth: `SEMANTIC_ALERT_VARS`, `SEMANTIC_TEXT_COLORS`, -`SEMANTIC_CONTROL_COLORS`), consumed by both brands' `mantineTheme.ts` -(`Alert.extend`, `Text.extend`, `Button.extend`, `ActionIcon.extend`). It -references only `--color-*` design tokens — never raw -`--mantine-color-*`. - -### Semantic token families - -- **Semantic text**: `--color-text-{danger,warning,success,info}` - (+ `--color-text-success-hover`). Used by `Text` and `Alert` - foregrounds. -- **Subtle backgrounds**: `--color-bg-{danger,warning,success,info}-subtle` - (+ `-subtle-hover`). Scheme-aware — pale tints in **light** (Mantine - `-0`/`-1`), deep tints in **dark** (inlined hex, since the numbered - scale's darkest green/yellow shades are mid-tone and can't hit AA). - Consumed by `Alert` and the `danger` soft control. - -**Accessibility**: every semantic text token clears **WCAG AA (4.5:1)** -on its `-subtle` tint (including hover) in both schemes. In light mode -`success`/`warning` text is darkened past the palette with a small -`color-mix` because `green-9`/`yellow-9`/`orange-9` are mid-tone — -preserve these `color-mix` adjustments when editing. - -**ClickStack `warning` is orange-based**: ClickStack remaps the `yellow` -palette to its brand gold, so its warning tokens use Mantine `orange` -(unremapped) for a true orange warning; HyperDX stays yellow-based. - -Storybook: `Components/Alert` (interactive `Playground`) and -`Design tokens/Semantic variants` — use the Brand and Theme toolbar -toggles to review all combinations. - -## Per-brand differences - -### HyperDX (default, green-first) - -- Mantine `primaryColor: 'green'`, `primaryShade: 8`. -- Brand palette: custom green ramp in `hyperdx/mantineTheme.ts` (peaks - at `#00c28a`). -- Fonts: user-selectable via `useUserPreferences().font` (IBM Plex Sans - default). The font picker is visible in the preferences modal. -- Semantic success **uses the brand green**; that's intentional. A - green chart series next to a green success pill is expected, not a - bug. -- Sidenav background = body background (`--mantine-color-dark-9` in - dark mode). -- Logo: HyperDX wordmark + logomark (SVG, currentColor for theming). - -### ClickStack (yellow-first, Click UI tokens) - -- Mantine `primaryColor: 'yellow'`. The yellow palette is overridden - by the Click UI brand palette (`--palette-brand-50` … - `--palette-brand-900`) in `clickstack/_tokens.scss`. -- Brand accent: `#faff69` (yellow `--palette-brand-300`). Used for - links, primary outlines, accent indicators — but **never for - chart series**, because yellow on a light background fails - contrast and reads as "warning". -- Fonts: locked to Inter. `_app.tsx` overrides - `userPreferences.font` to `'Inter'` when `themeName === 'clickstack'`, - and `UserPreferencesModal.tsx` hides the font picker entirely. Don't - add brand-conditional font logic anywhere else. -- Uses Click UI design tokens (`--click-global-color-*`) as an - intermediate layer. Most semantic vars in `clickstack/_tokens.scss` - reference Click UI globals rather than Mantine palette entries — keep - this layering when extending. -- Sidenav background = body background but uses Click UI neutrals. -- Tabler icons get `stroke-width: 1.5` by default (HyperDX uses the - Mantine default of 2). Defined as a nested rule inside the dark-mode - selector. - -### Shared between both brands - -- Both define **the same set of semantic CSS vars** (see - `semanticColorsGrouped.ts`). Adding a new var means adding it to - **all four** SCSS blocks: hyperdx-dark, hyperdx-light, - clickstack-dark, clickstack-light. -- The semantic chart highlight colors - (`--color-chart-success-highlight`, `-warning-`, `-error-`) are - **identical** across both brands. See `data_viz_colors.md` for the - reasoning. -- The categorical chart palette has the **same hue families** in both - brands; only slot 1 differs (green for HyperDX, blue for ClickStack). - -## SSR / hydration safety - -A few things that look like bugs but are intentional: - -- **`_base-tokens.scss`** defines the same vars as `hyperdx/_tokens.scss` - but **unscoped** (i.e. inside bare `[data-mantine-color-scheme='dark']` - / `[data-mantine-color-scheme='light']` selectors). This is the - fallback for the brief window where the theme class hasn't been added - yet, e.g. during error boundaries or pre-hydration paints. It always - uses HyperDX tokens. **Don't** swap it for ClickStack tokens — it's a - "safe default" not a "guess". -- The chart CSS vars are **duplicated** inside the dark and light - selector blocks (not factored into a shared `.theme-{brand}` block). - This is called out in both `_tokens.scss` files. CSS specificity - requires it: a `.theme-clickstack` rule has lower specificity than - `.theme-clickstack[data-mantine-color-scheme='dark']`, so when - Mantine swaps the data attribute, the unscoped chart vars would be - *overridden by* the scheme-scoped block of the *other* mode. - Keep them duplicated. -- `themeColor` in each favicon config is the **browser chrome color** - (Android address bar, iOS status bar), not a semantic UI color. -- `_document.tsx` re-derives the theme class from - `process.env.NEXT_PUBLIC_THEME` rather than importing - `DEFAULT_THEME`. This is deliberate: `_document.tsx` runs in Node and - importing the full theme module pulls in React components. Keep the - resolution duplicated and minimal. -- `AppThemeProvider` updates `resolvedThemeName` in a `useEffect` - rather than `useSyncExternalStore`. This means in dev there is a - one-frame flash when localStorage overrides the SSR default. That's - the agreed-on trade-off for hydration safety; don't "fix" it by - reading localStorage during render. - -## Adding things - -### Adding a new semantic CSS variable - -1. Pick a name following the existing convention: - `--color-{category}-{role}[-{state}]`, e.g. - `--color-text-link-hover`. -2. Add it to **all four** SCSS blocks: - - `hyperdx/_tokens.scss` → `.theme-hyperdx[data-mantine-color-scheme='dark']` - - `hyperdx/_tokens.scss` → `.theme-hyperdx[data-mantine-color-scheme='light']` - - `clickstack/_tokens.scss` → `.theme-clickstack[data-mantine-color-scheme='dark']` - - `clickstack/_tokens.scss` → `.theme-clickstack[data-mantine-color-scheme='light']` -3. If it should also work pre-hydration, add it to the matching mixin - in `hyperdx/_tokens.scss` (`@mixin dark-mode-tokens` / - `@mixin light-mode-tokens`) so it gets picked up by - `_base-tokens.scss`. -4. Add it to the relevant group in - `theme/semanticColorsGrouped.ts` so the storybook renders it. -5. Consume it via `var(--color-…)` in your component. - -If the token backs a **semantic component variant** (Alert / Text / -danger control), wire it through `theme/themes/semanticVariants.ts` -rather than referencing it directly in each brand's `mantineTheme.ts`, -and verify it in the `Design tokens/Semantic variants` story across both -brands and schemes. - -For chart-specific vars (`--color-chart-*`) there are additional steps — -see `data_viz_colors.md`. - -### Adding a new brand theme (rare) - -If you're adding a third brand: - -1. Add the new name to the `ThemeName` union in `theme/types.ts` and the - `name` enum inside `themeConfigSchema` in `theme/index.ts`. -2. Create `theme/themes/{newbrand}/` with the same five files - (`index.ts`, `_tokens.scss`, `mantineTheme.ts`, `Wordmark.tsx`, - `Logomark.tsx`). -3. Add `@use './newbrand/tokens' as newbrand-tokens;` to - `_base-tokens.scss` if you want it to be the fallback (you almost - certainly don't — keep HyperDX as fallback). -4. Register it in the `themes` map in `theme/index.ts`. -5. Add favicon assets under `public/favicons/{newbrand}/` matching the - `FaviconConfig` regex (`/^\/favicons\/[a-z]+\/[a-z0-9-]+\.{svg,png}$/`). -6. Update `pages/_document.tsx` `getThemeClass()` so the new name is - accepted (the validation list is duplicated there — keep it in sync). -7. Verify both storybook stories (`SemanticColors.stories.tsx` and - `ChartColors.stories.tsx`) render for the new theme. -8. Update this doc and `data_viz_colors.md` with the new brand's - conventions. - -The runtime validation will refuse to load a broken `ThemeConfig` — -prefer to start by copying the hyperdx folder and tweaking incrementally. - -### Adding a new color mode (e.g. high-contrast) - -We don't support this today, and adding it is invasive — every SCSS -block in every theme would need to be duplicated. Don't do this without -a design owner. - -## Anti-patterns - -```tsx - // ❌ raw Mantine palette index - // ❌ hex literal - // ❌ branching on brand for color -const c = useMantineTheme().colors.green[5]; // ❌ reading Mantine palette for theming -import { theme as hyperdxTheme } from '@/theme/themes/hyperdx/mantineTheme'; // ❌ bypassing the registry +```text +packages/app/src/brand/ # display name, page titles, logos +packages/app/src/ThemeWrapper.tsx # MantineProvider + color mode +packages/app/src/theme/_tokens.scss # light and dark color tokens +packages/app/src/theme/_base-tokens.scss +packages/app/src/theme/mantineTheme.ts +packages/app/src/theme/semanticVariants.ts +packages/app/src/theme/semanticColorsGrouped.ts +packages/app/public/favicons/clickstack/ ``` - -Why each is wrong: - -- **Raw Mantine palette**: `dark.9` resolves differently per brand because - ClickStack overrides `--mantine-color-dark-*` to point at its slate - neutrals. The result *might* look right, but it skips the semantic - layer and breaks the moment we tweak the brand mapping. -- **Hex literal**: bypasses light/dark and brand. ClickStack light users - will see a black box on white. -- **Branching on `themeName`**: leaks brand assumptions into every - component. If a third brand appears, every branch needs to be - audited. -- **Reading Mantine palette directly**: same as raw Mantine palette, plus - it forces a re-render on theme change. -- **Importing a brand's `mantineTheme` directly**: skips validation and - the registry. Always go through `useAppTheme()`. - -## Pre-merge checklist for theme-touching PRs - -- [ ] No new hex/named colors in components — everything uses - `var(--color-*)` or, for charts, the helpers from - `data_viz_colors.md`. -- [ ] If a new semantic var was added, it exists in **all four** SCSS - blocks (HyperDX dark + light, ClickStack dark + light) and the - shared mixins where appropriate. -- [ ] Toggled HyperDX ↔ ClickStack (`window.__HDX_THEME.toggle()` in - dev) — the change looks correct in both brands. -- [ ] Toggled light ↔ dark via preferences modal — change looks correct - in both modes. -- [ ] Storybook `Design tokens / Semantic colors` and - `Design tokens / Chart colors` still render and look correct. -- [ ] No new `themeName === 'clickstack'` branches for *colors*; brand - branches are only for *content*, *layout*, or *feature-locked - preferences* (e.g. font picker). -- [ ] No new `IS_CLICKHOUSE_BUILD` checks added in service of branding - — that flag is for features, not appearance. -- [ ] `make ci-lint` and the theme tests in - `packages/app/src/theme/__tests__/` pass. - -## File reference summary - -| What | Where | -| ------------------------------------------- | ---------------------------------------------------------------------------------- | -| Theme registry + validation | `packages/app/src/theme/index.ts` | -| Theme types | `packages/app/src/theme/types.ts` | -| Provider + hooks (`useAppTheme`, etc.) | `packages/app/src/theme/ThemeProvider.tsx` | -| Mantine wrapper (color scheme + fontFamily) | `packages/app/src/ThemeWrapper.tsx` | -| SSR theme class application | `packages/app/pages/_document.tsx` (`getThemeClass`) | -| Color-mode preference + system follow | `packages/app/src/useUserPreferences.tsx` | -| Brand + font selection UI (dev gated) | `packages/app/src/UserPreferencesModal.tsx` | -| Brand-conditional font wiring | `packages/app/pages/_app.tsx` (`AppContent`) | -| HyperDX brand definition | `packages/app/src/theme/themes/hyperdx/{index.ts,_tokens.scss,mantineTheme.ts,…}` | -| ClickStack brand definition | `packages/app/src/theme/themes/clickstack/{index.ts,_tokens.scss,mantineTheme.ts,…}` | -| SSR fallback CSS vars | `packages/app/src/theme/themes/_base-tokens.scss` | -| Semantic var groups (storybook source) | `packages/app/src/theme/semanticColorsGrouped.ts` | -| Semantic component variants (source of truth)| `packages/app/src/theme/themes/semanticVariants.ts` | -| Storybook visual references | `packages/app/src/theme/{SemanticColors,SemanticVariants,ChartColors}.stories.tsx` + `packages/app/src/components/Alert.stories.tsx` | -| Favicon assets | `packages/app/public/favicons/{hyperdx,clickstack}/` | -| Provider tests | `packages/app/src/theme/__tests__/ThemeProvider.test.tsx` | -| Theme validation tests | `packages/app/src/theme/__tests__/index.test.ts` | diff --git a/docker-compose.ci.yml b/docker-compose.ci.yml index c31d84cbc..e080f9340 100644 --- a/docker-compose.ci.yml +++ b/docker-compose.ci.yml @@ -22,7 +22,7 @@ services: depends_on: - ch-server ch-server: - image: clickhouse/clickhouse-server:26.8.36.3-alpine@sha256:f5443f9ffa48f0154cdd50cab39fed732201762574a27f04f1f564bbba81832d + image: clickhouse/clickhouse-server:26.10.3.7-alpine@sha256:1b09f476eb1109522cfc0e8e4ddf6a4305263e7cdd310f7bd1d3fd29dfcb8b33 environment: # default settings CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 01ff8e455..335054d47 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -112,7 +112,7 @@ services: hdx.dev.service: clickhouse hdx.dev.port: '${HDX_DEV_CH_HTTP_PORT:-8123}' hdx.dev.url: 'http://localhost:${HDX_DEV_CH_HTTP_PORT:-8123}' - image: clickhouse/clickhouse-server:26.8.36.3-alpine + image: clickhouse/clickhouse-server:26.10.3.7-alpine ports: - '${HDX_DEV_CH_HTTP_PORT:-8123}:8123' # http api - '${HDX_DEV_CH_NATIVE_PORT:-9000}:9000' # native diff --git a/docker-compose.yml b/docker-compose.yml index 8de2decf0..4e9530d0c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,7 +56,7 @@ services: depends_on: - ch-server app: - image: ${HDX_IMAGE_REPO}/${IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION} + image: ${CH_IMAGE_REPO}/${NEXT_IMAGE_NAME_DOCKERHUB}:${IMAGE_VERSION} ports: - ${HYPERDX_API_PORT}:${HYPERDX_API_PORT} - ${HYPERDX_APP_PORT}:${HYPERDX_APP_PORT} @@ -109,7 +109,7 @@ services: - ch-server - db ch-server: - image: clickhouse/clickhouse-server:26.8.36.3-alpine + image: clickhouse/clickhouse-server:26.10.3.7-alpine # WARNING: Exposing the database port will make it accessible from outside the container, # potentially allowing unauthorized access. If you uncomment the ports below, # ensure to secure your database (e.g., with strong authentication, proper network rules, and firewalls). diff --git a/docker/clickhouse/local/config.xml b/docker/clickhouse/local/config.xml index 9257ef6b0..df7570cb4 100644 --- a/docker/clickhouse/local/config.xml +++ b/docker/clickhouse/local/config.xml @@ -90,6 +90,7 @@ system query_log
+ event_date + INTERVAL 3 DAY DELETE 7500
@@ -98,6 +99,7 @@ system metric_log
+ event_date + INTERVAL 3 DAY DELETE 7500 1000
@@ -109,6 +111,7 @@ system asynchronous_metric_log
+ event_date + INTERVAL 3 DAY DELETE -# This is NOT the Next.js you know +## This is NOT the Next.js you know This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index a35ddcee8..1a610b3dd 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,241 @@ # @hyperdx/app +## 2.45.0 + +### Minor Changes + +- b3cbd0260: feat: split the service map by up to 3 extra group-by SQL expressions (for + example `ResourceAttributes['k8s.pod.name']`), so a node is a service plus + those values and a slow or failing pod is no longer averaged into its service. + +### Patch Changes + +- ac913ceb3: feat: Choose how a PromQL source on ClickHouse is evaluated (the Prometheus HTTP API or the `prometheusQuery` table functions) instead of probing the server on every query. Without a choice the server is still probed, but the answer is now kept for 5 minutes. A source set to the HTTP API against a server that does not serve it fails with a clear error. Onboarding pins a PromQL source it detects to the HTTP API when the server serves it. +- Updated dependencies [c17fc16a2] +- Updated dependencies [1fba1c381] +- Updated dependencies [7b03880eb] +- Updated dependencies [2d17de5d7] +- Updated dependencies [ac913ceb3] +- Updated dependencies [7cfd333ea] +- Updated dependencies [db4e7ba67] + - @hyperdx/api@2.45.0 + - @hyperdx/common-utils@0.35.0 + +## 2.44.0 + +### Minor Changes + +- 142c9cc87: feat: narrow ad hoc dashboard filter suggestions with a condition + + An ad hoc filter on SQL sources can now carry a SQL or Lucene "Keys and values + filter", like a queried filter's dropdown values filter, that limits the rows + its keys and values are suggested from. It can reference the dashboard's other + variables. While it references a required filter with nothing selected, the ad + hoc filter can't add or edit conditions and names the filter it is waiting on. + Failed suggestions now show the database's error message. + +- cd0e9edfa: feat: add optional `titleEmoji` webhook option; `false` removes the emoji prefix from notification titles sent through that webhook +- 5b0d07441: feat: self-instrument with `@clickhouse/clickstack-node` and + `@clickhouse/clickstack-browser` instead of `@hyperdx/node-opentelemetry` and + `@hyperdx/browser` + + HyperDX's own telemetry changes shape. HTTP spans use the stable semantic + convention keys (`http.request.method`, `http.response.status_code`, + `url.full`). pino records come from the `@opentelemetry/instrumentation-pino` + scope with real severity numbers instead of the `node-logger` scope with + severity number 0. Console capture covers every `console` call in the API, and + browser console output is recorded as log records instead of spans. Uncaught + exceptions are recorded as FATAL log records, and API errors as an exception + event on the Express span instead of a separate error span. + + Browser telemetry records the user as `user.id`, `user.email` and `user.name` + instead of `userEmail` and `userName`, keeps the team name as `teamName`, and no + longer records a `user navigated` action. Browser fetch and XHR spans no longer + record request and response headers or bodies. Browser sessions restart once + after the upgrade. The per-signal browser endpoints and + `NEXT_PUBLIC_OTEL_RESOURCE_ATTRIBUTES` work as before. Browser traces and logs + are now sent gzip-compressed every 5 seconds. If the browser sends to a + collector other than ClickStack's, its CORS `allowed_headers` must be `"*"` or + include `content-type` and `content-encoding` (and `authorization`), and a proxy + in front of it must forward `Content-Encoding` unchanged. + + The Next.js server now sends its own telemetry in production builds too, not + only under `next dev`, when `HYPERDX_API_KEY` or `OTEL_EXPORTER_OTLP_HEADERS` is + set. `HDX_EXPORTER_ENABLED=false` turns it off along with browser telemetry. It + reports under its own service name, the configured one plus `-next` + (`hdx-oss-app-next` in the docker-compose `app` service and when no name is + set), so its spans stay apart from the API's and the browser's. The HyperDX + images now default `OTEL_SERVICE_NAME` to `hdx-oss-app`. Each `/api` request + adds Next.js server spans for the proxy hop. Requests for build and `public/` + assets, such as `/_next/static/*`, `/__ENV.js` and `/pyodide/*`, are not traced. + + `HYPERDX_API_KEY` still enables self-instrumentation. Without + `OTEL_EXPORTER_OTLP_ENDPOINT`, server-side self-telemetry now goes to + `http://localhost:4318` instead of `https://in-otel.hyperdx.io`, so set the + endpoint explicitly. `HDX_NODE_*` variables are no longer read. For request + headers and bodies set `OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_*` and + `CLICKSTACK_CAPTURE_HTTP_BODY`. + +- 0b7926d1d: feat: Team members can create team-owned API keys with a description and expiry that keep working after their creator leaves. +- af17e8ff8: The app always uses ClickStack branding. Brand selection, the HyperDX palette, and the font picker are removed. Light, dark, and system color mode stay in Preferences. +- dd8c2e4b6: feat: Pick a time zone for the search and dashboard pages from the time picker, overriding the time zone in User Preferences. The picker shows the zone it uses, and the choice is kept in the URL and in links from charts and tables + +### Patch Changes + +- 7de661b6a: feat: Row side panel summarizes clicks, navigations and console messages from OpenTelemetry browser SDKs, and navigation rows no longer show an HTTP Request section +- df737d8aa: refactor: use the click-ui `Separator` instead of the Mantine `Divider` in the + chart display, heatmap, number format, and on-click drawers, and in the ad hoc + and query expression dashboard filter forms. +- 4b8df6d8a: fix: show a neutral spinner while charts load + + Chart tiles now show a spinner with "Loading Chart Data..." while a query is in + flight, including when the previous result was empty. Before, they kept showing + "No data found within time range." until the new query finished. Loaders now + default to a neutral gray instead of yellow. + +- ab36d4e13: feat: publish the HyperDX image as `clickhouse/clickstack` alongside + `hyperdx/hyperdx`, matching the other `clickhouse/clickstack-*` images. Release + workflows no longer log into ghcr.io, which received no pushes. +- f56d4ad5b: fix(app): use the ClickStack hexagon and bolt mark in the logo, the collapsed nav, and the favicon. +- d7df729e6: chore: GitHub links (changelog, support, package metadata) now point at `ClickHouse/ClickStack`, and `docker-compose.yml` pulls the app image as `clickhouse/clickstack` +- f56d4ad5b: fix(app): open the full nav over the page on compact viewports. On narrow screens the sidebar toggle now opens the full nav as an overlay instead of doing nothing. +- 513b23796: fix: start the trace waterfall higher in the side panel + + Trace spans no longer repeat their name in a box under the panel title, or the + service as a chip next to the metadata row that already shows it. The + "⌘/Ctrl + scroll to zoom" hint moves into the timeline's top-left corner + instead of taking its own row. Long span names that the title truncates keep + the box. Log panels keep their body box and service chip. + +- 9269f7784: fix: "Denoise results" now removes noise on typical data. A pattern now counts as noisy above 5% of sampled events instead of 10%, which often matched nothing. Patterns that include error or warning lines are never hidden. The MCP `denoise` option uses the same 5% threshold. Denoise also mines the source's body column instead of the last table column, removes ANSI-colored rows that match a noisy pattern, says when results can't be denoised, and shows hidden patterns as a short summary with a shortened, expandable list. +- e2754d203: fix: use SHA256 instead of MD5 for JSON row lookup WHERE clauses so row + details and drill-down work on FIPS-enabled ClickHouse deployments +- 5abf27ed3: Saving a search no longer reloads the page: the new saved search is opened with + a client-side navigation, which also fixes the 404 this caused on the static + ClickStack build. +- ba7d0066f: fix: heatmap hover tooltip no longer adds scrollbars or shifts the tile; it now + sits above the chart instead of inside it +- 04f55d12c: feat: Exception panel parses JavaScript stack traces from OpenTelemetry SDKs into frames, with a section per `Caused by:` error +- d0dd06fe8: fix: count legacy STATUS_CODE_ERROR spans as errors on the service map and trace + waterfall +- 7935c64bc: feat: add `hdx mcp install` to connect AI agents without pasting a key + + `npx @hyperdx/cli mcp install` asks for a personal access key or an + organization API key with hidden input, checks it, and adds the ClickStack MCP + server to Claude Code, Codex, Cursor, and VS Code. Team Settings now leads with + this command, so the key no longer has to go into a copied command or an agent + chat. The per-agent snippets remain for setting up one agent by hand. + +- 41b2b742a: feat: fall back to server MergeTree settings to detect persisted `_block_number` and `_block_offset` columns when the table's CREATE query omits them +- 442d6dfd9: fix: refresh cached table columns after 5 minutes + + The shared metadata cache kept each table's `DESCRIBE` result for the life of + the process, so the API did not see columns added with `ALTER TABLE`, such as + new MATERIALIZED columns, until it restarted. Cached columns now expire after 5 + minutes. Other cached metadata is unchanged. + +- eb2439ed0: fix: leave metric points with no recorded value out of charts and alerts + + When a scraped series goes away or a scrape fails, the collector's `prometheus` + receiver sends a point flagged "no recorded value" (a Prometheus staleness + marker), and the ClickHouse exporter stores it as zeros. Metric charts and + alerts read it as a real value: a gauge's `min` and `avg` dropped and `count` + included the series that went away, and a counter or histogram that came back + after the marker counted its whole total again. Metric queries now skip points + with this flag. + +- 81b6b605e: refactor: use the click-ui `Separator` instead of the Mantine `Divider` in the + keyboard shortcuts modal, What's new drawer, filter settings popover, metric + explorer, chart explorer, time picker, and Service Map tooltip. +- 9df8b8d47: fix: bump next to 16.4.3 so builds no longer fail intermittently when Google Fonts returns extensionless font URLs +- ec0db7ac9: fix: Creating an alert from the search page asks for one name, not two. An unsaved search is named once in the alert modal's header and the alert inherits that name and its tags; on a saved search the alert's own name field is labelled "Alert name" and shows the inherited name as its placeholder instead of pre-filling a duplicate. +- 467c16792: feat: A pinned filter collapsed in the search sidebar stays collapsed the next + time the source loads, instead of always opening +- 6468dadcf: fix: keep session replay events from different page loads apart + + Browser SDKs up to `@clickhouse/clickstack-browser` 1.2.0 number replay events + from 1 again on every page load. When a page closed before all chunks of a large + event were sent, its leftover chunk could be joined with a later page's event of + the same number. That page's snapshot then failed to parse and did not render. + Chunks are now grouped by event number and full-precision timestamp, and replay + rows are ordered by the full-precision timestamp, so rows of two page loads in + the same second no longer interleave. + + The app's own browser telemetry now uses `@clickhouse/clickstack-browser` 1.2.1, + whose replay event numbers no longer repeat across page loads. + +- 86cd38b7e: fix: only use the key-only row details lookup when the table persists both `_block_number` and `_block_offset`. A lone block column (e.g. a server-wide `enable_block_offset_column`) is not unique with a second-precision primary key and could open the wrong row; it is now only added as a tiebreaker to the full-row lookup. +- 82b2104bb: fix: show a loader while row details load + + Expanded search rows and the trace viewer's span details showed "Empty" or "No + body for this event." while the row was still loading. They now show a loader + until the row arrives. + +- 3a412e4f8: fix: run the row details query once when opening a row + + The side panel ran the same `SELECT *` row query twice: once for the panel, and + again when its Overview or Column Values tab mounted. A row that was found is + now reused from the cache, so the tab and later tab switches do not query it + again. A different row or source still runs the query, and a row that was not + found is looked up again. + +- 78143c81a: feat: on ClickHouse Cloud, read `system.shared_merge_tree_settings` when detecting `_block_number` and `_block_offset` columns, falling back to `system.merge_tree_settings` per key +- 4e93ae500: fix(app): render the ClickStack name as text in the expanded sidebar, 8px from the logo symbol. +- 38f58cff2: refactor: use the click-ui `Separator` instead of the Mantine `Divider` in the + source form and the sources list. +- 2bad9af17: refactor: use the click-ui `Separator` instead of the Mantine `Divider` in the + Team Settings sections. +- af75b2b59: feat: Trace waterfall shows OpenTelemetry browser SDK request timings as dots on fetch and XHR spans, and the click that triggered a browser trace +- 4e93ae500: fix(app): use the new favicon set, including an SVG, in the browser tab, bookmarks, and touch icon. +- dc58efde2: fix: The app no longer crashes on load in browsers that report a POSIX-style language such as `en-US@posix` +- Updated dependencies [142c9cc87] +- Updated dependencies [30b1494d8] +- Updated dependencies [0453aa134] +- Updated dependencies [cd0e9edfa] +- Updated dependencies [5b0d07441] +- Updated dependencies [5b0d07441] +- Updated dependencies [769c0def3] +- Updated dependencies [9269f7784] +- Updated dependencies [48c83790a] +- Updated dependencies [e2754d203] +- Updated dependencies [22f824c6e] +- Updated dependencies [642533255] +- Updated dependencies [d0dd06fe8] +- Updated dependencies [349fc2141] +- Updated dependencies [631002374] +- Updated dependencies [5584f84bb] +- Updated dependencies [253a690d4] +- Updated dependencies [66e394136] +- Updated dependencies [7e8522914] +- Updated dependencies [9093282e5] +- Updated dependencies [53bf54096] +- Updated dependencies [0eec5e140] +- Updated dependencies [917c9ca49] +- Updated dependencies [95fa36412] +- Updated dependencies [d08b2fa73] +- Updated dependencies [a13c80efe] +- Updated dependencies [0262822da] +- Updated dependencies [41b2b742a] +- Updated dependencies [442d6dfd9] +- Updated dependencies [eb2439ed0] +- Updated dependencies [0b7926d1d] +- Updated dependencies [0eec5e140] +- Updated dependencies [0a5237e6c] +- Updated dependencies [78143c81a] +- Updated dependencies [b7b4d9579] +- Updated dependencies [b1d4e60f8] +- Updated dependencies [ef56bd726] +- Updated dependencies [c792850fd] +- Updated dependencies [90302c773] + - @hyperdx/common-utils@0.34.0 + - @hyperdx/api@2.44.0 + +## 2.43.1 + +### Patch Changes + +- @hyperdx/api@2.43.1 + ## 2.43.0 ### Minor Changes diff --git a/packages/app/Dockerfile b/packages/app/Dockerfile index 93409ba94..8f371d86c 100644 --- a/packages/app/Dockerfile +++ b/packages/app/Dockerfile @@ -60,6 +60,8 @@ COPY ./packages/app/pages ./packages/app/pages COPY ./packages/app/public ./packages/app/public COPY ./packages/app/styles ./packages/app/styles COPY ./packages/app/types ./packages/app/types +# next build finds instrumentation.ts only next to pages/, not under src/ +COPY ./packages/app/instrumentation.ts ./packages/app/instrumentation-client.ts ./packages/app/ # Build inputs for public/whats-new.json, generated by next.config.mjs for the # in-app "What's new" section: the root changelog it parses (next.config resolves # it as /app/packages/app/../../CHANGELOG.md) and the parser itself. The build @@ -77,7 +79,7 @@ FROM node:22.23.4-alpine AS prod LABEL org.opencontainers.image.vendor="HyperDX" \ org.opencontainers.image.title="HyperDX App" \ org.opencontainers.image.description="HyperDX frontend application for observability platform" \ - org.opencontainers.image.source="https://github.com/hyperdxio/hyperdx" \ + org.opencontainers.image.source="https://github.com/ClickHouse/ClickStack" \ org.opencontainers.image.licenses="MIT" WORKDIR /app diff --git a/packages/app/instrumentation-client.ts b/packages/app/instrumentation-client.ts new file mode 100644 index 000000000..180d51fcb --- /dev/null +++ b/packages/app/instrumentation-client.ts @@ -0,0 +1,33 @@ +import { env } from 'next-runtime-env'; +import { init } from '@clickhouse/clickstack-browser'; + +import { IS_LOCAL_MODE } from '@/config'; +import type { NextApiConfigResponseData } from '@/types'; +import { getBrowserInitOptions } from '@/utils/browserTelemetry'; + +// Next.js runs this file once per page load, before hydration. The collector +// settings come from /api/config at request time so they can change without a +// rebuild, which is why init waits for the fetch. +function startBrowserTelemetry(config: NextApiConfigResponseData | undefined) { + if (!config?.apiKey) { + console.warn('No API key found to enable OTEL exporter'); + return; + } + + init( + getBrowserInitOptions({ + config, + resourceAttributes: env('NEXT_PUBLIC_OTEL_RESOURCE_ATTRIBUTES') ?? '', + serviceVersion: process.env.NEXT_PUBLIC_APP_VERSION, + }), + ); +} + +if (!IS_LOCAL_MODE) { + fetch('/api/config') + .then(res => res.json()) + .then(startBrowserTelemetry) + .catch(() => { + // Telemetry is optional, so a failed config fetch must not surface + }); +} diff --git a/packages/app/instrumentation.ts b/packages/app/instrumentation.ts new file mode 100644 index 000000000..4b4848315 --- /dev/null +++ b/packages/app/instrumentation.ts @@ -0,0 +1,11 @@ +// This file sits next to pages/ because next build looks for it only there, +// not in src/. The Dockerfiles copy it (and instrumentation-client.ts) by name. +export async function register() { + // The edge build drops this branch, so it never bundles the Node.js SDK + if (process.env.NEXT_RUNTIME === 'nodejs') { + const { startNextServerTelemetry } = await import( + '@/utils/nextServerTelemetry' + ); + await startNextServerTelemetry(); + } +} diff --git a/packages/app/jest.config.js b/packages/app/jest.config.js index c9b6a4a56..4ef891f96 100644 --- a/packages/app/jest.config.js +++ b/packages/app/jest.config.js @@ -27,6 +27,8 @@ module.exports = { '^remark-gfm$': '/src/__mocks__/remark-gfm.ts', '^react-syntax-highlighter$': '/src/__mocks__/react-syntax-highlighter.tsx', + '^@clickhouse/clickstack-browser$': + '/src/__mocks__/clickstack-browser.ts', // @clickhouse/click-ui depends on ESM-only lodash-es; lodash has the same API. '^lodash-es$': 'lodash', '^lodash-es/(.*)$': 'lodash/$1', diff --git a/packages/app/jest.dfe.setup.js b/packages/app/jest.dfe.setup.js index cc5ff43bc..e93505a32 100644 --- a/packages/app/jest.dfe.setup.js +++ b/packages/app/jest.dfe.setup.js @@ -1,13 +1,13 @@ // DFE: run the app's unit tests under upstream's branding. // -// `theme/index.ts` resolves NEXT_PUBLIC_THEME at module load and falls back to -// 'dfe', so unset it renders "DFE" where upstream's tests assert "HyperDX". -// Pinning it here keeps upstream's suite passing unchanged, instead of editing -// their test files and owning that conflict surface forever. +// `src/dfe/brand.tsx` resolves the brand at module load and gives "DFE" unless +// this is set, where upstream's tests assert "ClickStack". Pinning it here keeps +// upstream's suite passing unchanged, instead of editing their test files and +// owning that conflict surface forever. // -// DFE branding is covered by `src/dfe/__tests__/dfeTheme.test.ts`, which imports -// the theme directly and is unaffected. -process.env.NEXT_PUBLIC_THEME = 'hyperdx'; +// DFE branding is covered by `src/dfe/__tests__/dfeTheme.test.ts`, which reloads +// the brand module with the pin cleared. +process.env.DFE_UPSTREAM_BRAND = 'true'; // Same reason: OnboardingModal renders upstream's manual source setup only // behind this flag, and upstream's OnboardingModal.test.tsx asserts that step. diff --git a/packages/app/next.config.mjs b/packages/app/next.config.mjs index b7a6a7c05..a816b2990 100644 --- a/packages/app/next.config.mjs +++ b/packages/app/next.config.mjs @@ -112,8 +112,7 @@ const nextConfig = { '@opentelemetry/instrumentation', '@opentelemetry/sdk-node', '@opentelemetry/auto-instrumentations-node', - '@hyperdx/node-opentelemetry', - '@hyperdx/instrumentation-sentry-node', + '@clickhouse/clickstack-node', // Outside of Vercel preview deployments, the `/api/[...all]` catch-all // proxies to a separately-deployed API service and never imports the // `@hyperdx/api` package at runtime. Mark it (and its subpaths) as a diff --git a/packages/app/package.json b/packages/app/package.json index 64be75b5d..8dd2d946b 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@hyperdx/app", - "version": "2.43.0", + "version": "2.45.0", "private": true, "license": "MIT", "engines": { @@ -11,7 +11,7 @@ "dev": "npx dotenv -e .env.development -- next dev --turbopack", "dev:local": "NEXT_PUBLIC_IS_LOCAL_MODE=true npx dotenv -e .env.development -- next dev --turbopack", "build": "next build --webpack", - "build:clickhouse": "NEXT_PUBLIC_THEME=clickstack NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", + "build:clickhouse": "NEXT_PUBLIC_IS_LOCAL_MODE=true NEXT_PUBLIC_CLICKHOUSE_BUILD=true next build --webpack && node scripts/prepare-clickhouse-build-export.js", "run:clickhouse": "test -d out && npx rimraf tmp && mkdir tmp && cp -r out tmp/clickstack && echo 'visit http://localhost:3000/clickstack to start' && npx serve tmp -l 3000 || echo 'run build:clickhouse first'", "start": "next start", "lint": "npx eslint . --ext .ts,.tsx --max-warnings 568", @@ -28,6 +28,8 @@ }, "dependencies": { "@clickhouse/click-ui": "^0.12.0", + "@clickhouse/clickstack-browser": "^1.2.1", + "@clickhouse/clickstack-node": "^1.0.2", "@codemirror/autocomplete": "^6.0.0", "@codemirror/lang-json": "^6.0.1", "@codemirror/lang-sql": "^6.7.0", @@ -39,9 +41,7 @@ "@dnd-kit/utilities": "^3.2.2", "@hookform/resolvers": "^3.9.0", "@hyperdx/api": "workspace:*", - "@hyperdx/browser": "^0.22.1", - "@hyperdx/common-utils": "^0.33.0", - "@hyperdx/node-opentelemetry": "^0.9.0", + "@hyperdx/common-utils": "^0.35.0", "@mantine/core": "^9.0.0", "@mantine/dates": "^9.0.0", "@mantine/dropzone": "^9.0.0", @@ -49,6 +49,8 @@ "@mantine/hooks": "^9.0.0", "@mantine/notifications": "^9.0.0", "@mantine/spotlight": "^9.0.0", + "@opentelemetry/api": "~1.9.1", + "@opentelemetry/browser-sdk": "^0.6.0", "@prometheus-io/codemirror-promql": "^0.311.3", "@rrweb/replay": "2.1.1", "@tabler/icons-react": "^3.39.0", @@ -73,7 +75,7 @@ "ky-universal": "^0.10.1", "lodash": "^4.18.1", "ms": "^2.1.3", - "next": "^16.4.2", + "next": "^16.4.3", "next-runtime-env": "1", "next-seo": "^4.28.1", "numbro": "^2.4.0", @@ -99,7 +101,7 @@ "store2": "^2.14.3", "strip-ansi": "^6.0.1", "timestamp-nano": "^1.0.1", - "uplot": "^1.6.31", + "uplot": "patch:uplot@npm%3A1.6.32#~/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch", "uplot-react": "^1.2.2", "zod": "3.25" }, diff --git a/packages/app/pages/_app.tsx b/packages/app/pages/_app.tsx index 623b27518..8b2e16ac3 100644 --- a/packages/app/pages/_app.tsx +++ b/packages/app/pages/_app.tsx @@ -3,10 +3,8 @@ import type { NextPage } from 'next'; import type { AppProps } from 'next/app'; import Head from 'next/head'; import { useRouter } from 'next/router'; -import { env } from 'next-runtime-env'; import randomUUID from 'crypto-randomuuid'; import { enableMapSet } from 'immer'; -import HyperDX from '@hyperdx/browser'; import { MutationCache, QueryCache, @@ -14,30 +12,18 @@ import { QueryClientProvider, } from '@tanstack/react-query'; -import { DynamicFavicon } from '@/components/DynamicFavicon'; -import { IS_LOCAL_MODE, parseResourceAttributes } from '@/config'; -import { - DEFAULT_FONT_VAR, - FONT_VAR_MAP, - MANTINE_FONT_MAP, -} from '@/config/fonts'; +import { usePageTitle } from '@/brand'; +import { MANTINE_FONT_MAP } from '@/config/fonts'; import { isBlockedRoute } from '@/dfe/embedFeatures'; import { useEmbedColorScheme } from '@/dfe/EmbedThemeSync'; import { ibmPlexMono, inter, roboto, robotoMono } from '@/fonts'; import { fetchServerVersion, installHdxDebug } from '@/hdxDebug'; -import { - AppThemeProvider, - useAppTheme, - usePageTitle, -} from '@/theme/ThemeProvider'; import { ThemeWrapper } from '@/ThemeWrapper'; -import { NextApiConfigResponseData } from '@/types'; import { ConfirmProvider } from '@/useConfirm'; import { SystemColorSchemeScript, useContentFontSize, useResolvedColorScheme, - useUserPreferences, } from '@/useUserPreferences'; import '@mantine/core/styles.css'; @@ -74,8 +60,6 @@ type AppPropsWithLayout = AppProps & { Component: NextPageWithLayout; }; -// Component that renders Head content requiring user preferences -// Must be rendered inside AppThemeProvider to avoid hydration mismatch function AppHeadContent() { const title = usePageTitle(); @@ -89,8 +73,6 @@ function AppHeadContent() { ); } -// Component that uses user preferences for theme wrapper -// Must be rendered inside AppThemeProvider to avoid hydration mismatch function AppContent({ Component, pageProps, @@ -98,11 +80,9 @@ function AppContent({ Component: NextPageWithLayout; pageProps: AppProps['pageProps']; }) { - const { userPreferences } = useUserPreferences(); const resolvedColorScheme = useResolvedColorScheme(); // In embed mode, dfe-ui owns light/dark; otherwise use hyperdx's own resolution. const colorScheme = useEmbedColorScheme(resolvedColorScheme); - const { themeName } = useAppTheme(); const { base: contentFontSize, compact: compactContentFontSize } = useContentFontSize(); @@ -119,27 +99,6 @@ function AppContent({ } }, [router, router.asPath]); - // ClickStack theme always uses Inter font - user preference is ignored - // HyperDX theme allows user to select font preference - // DFE: fixed data-UI font (Inter - tabular numerals, dense-table legible). - // Martel Sans is brand/marketing only, not the console. TODO: source the - // family from the shared @dfe/design-tokens package (hyperi-graphics SSoT). - const isDFETheme = themeName === 'dfe'; - const isClickStackTheme = themeName === 'clickstack'; - const effectiveFont = - isDFETheme || isClickStackTheme ? 'Inter' : userPreferences.font; - const selectedMantineFont = effectiveFont - ? MANTINE_FONT_MAP[effectiveFont] || undefined - : undefined; - - useEffect(() => { - // Update CSS variable for global font cascading - if (typeof document !== 'undefined') { - const fontVar = FONT_VAR_MAP[effectiveFont] || DEFAULT_FONT_VAR; - document.documentElement.style.setProperty('--app-font-family', fontVar); - } - }, [effectiveFont]); - useEffect(() => { // Single write point for the content font size preference; tables and // chart CSS read these vars (see styles/app.scss for the defaults). @@ -158,7 +117,7 @@ function AppContent({ const getLayout = Component.getLayout ?? (page => page); return ( - + {getLayout()} @@ -175,50 +134,10 @@ export default function MyApp({ Component, pageProps }: AppPropsWithLayout) { fetchServerVersion(); }, []); - // port to react query ? (needs to wrap with QueryClientProvider) - useEffect(() => { - if (IS_LOCAL_MODE) { - return; - } - fetch('/api/config') - .then(res => res.json()) - .then((_jsonData?: NextApiConfigResponseData) => { - if (_jsonData?.apiKey) { - const frontendAttrs = parseResourceAttributes( - env('NEXT_PUBLIC_OTEL_RESOURCE_ATTRIBUTES') ?? '', - ); - HyperDX.init({ - apiKey: _jsonData.apiKey, - consoleCapture: true, - maskAllInputs: true, - maskAllText: true, - // service.version is applied last so it always reflects the - // NEXT_PUBLIC_APP_VERSION and cannot be overridden by - // NEXT_PUBLIC_OTEL_RESOURCE_ATTRIBUTES. - otelResourceAttributes: { - ...frontendAttrs, - 'service.version': process.env.NEXT_PUBLIC_APP_VERSION, - }, - service: _jsonData.serviceName, - // tracePropagationTargets: [new RegExp(hostname ?? 'localhost', 'i')], - url: _jsonData.collectorUrl, - tracesUrl: _jsonData.collectorTracesUrl, - logsUrl: _jsonData.collectorLogsUrl, - }); - } else { - console.warn('No API key found to enable OTEL exporter'); - } - }) - .catch(() => { - // ignore - }); - }, []); - useEffect(() => { - // Apply font classes to html element for CSS variable resolution. - // Although _document.tsx sets these server-side, they must be re-applied client-side - // during hydration to ensure CSS variables are available for dynamic font switching. - // This is critical for the --app-font-family CSS variable to work across all components. + // Apply font classes to html so next/font CSS variables resolve. + // _document.tsx sets these server-side; re-apply on the client so + // portaled overlays inherit the same families. if (typeof document !== 'undefined') { const fontClasses = [ ibmPlexMono.variable, @@ -232,13 +151,10 @@ export default function MyApp({ Component, pageProps }: AppPropsWithLayout) { return ( - - - - - - - + + + + ); } diff --git a/packages/app/pages/_document.tsx b/packages/app/pages/_document.tsx index 5c196cd3c..20ad7b95d 100644 --- a/packages/app/pages/_document.tsx +++ b/packages/app/pages/_document.tsx @@ -2,25 +2,6 @@ import { Head, Html, Main, NextScript } from 'next/document'; import { IS_CLICKHOUSE_BUILD, IS_NOINDEX } from '@/config'; import { ibmPlexMono, inter, roboto, robotoMono } from '@/fonts'; -import { themes } from '@/theme'; - -// Applied before React hydrates to prevent a flash of the wrong theme. -// Reads the runtime value from window.__ENV (set by __ENV.js) and swaps -// the theme class on so CSS variables are correct on first paint. -const validThemes = Object.keys(themes); -const themeClasses = validThemes.map(t => `theme-${t}`); -const THEME_INIT_SCRIPT = ` -(function () { - var theme = window.__ENV && window.__ENV.NEXT_PUBLIC_THEME; - var valid = ${JSON.stringify(validThemes)}; - if (valid.indexOf(theme) !== -1) { - var html = document.documentElement; - var remove = ${JSON.stringify(themeClasses)}; - for (var i = 0; i < remove.length; i++) html.classList.remove(remove[i]); - html.classList.add('theme-' + theme); - } -})(); -`; // Applied before React hydrates when embedded in dfe-ui (?embed=1): adds // html.dfe-embed (globals.css hides .dfe-appnav-slot, no chrome-sidebar flash) @@ -55,13 +36,36 @@ export default function Document() { ].join(' '); return ( - + {IS_NOINDEX && } {/* eslint-disable-next-line @next/next/no-sync-scripts */} ')).toBe( - DEFAULT_THEME_COLOR, - ); - - // Event handler injection - expect(sanitizeThemeColor('#000000" onload="alert(1)"')).toBe( - DEFAULT_THEME_COLOR, - ); - - // JavaScript protocol - expect(sanitizeThemeColor("javascript:alert('xss')")).toBe( - DEFAULT_THEME_COLOR, - ); - - // Data URI - expect( - sanitizeThemeColor('data:text/html,'), - ).toBe(DEFAULT_THEME_COLOR); - - // CSS injection - expect(sanitizeThemeColor('#000000; background: url(evil.com)')).toBe( - DEFAULT_THEME_COLOR, - ); - }); - - it('should handle edge cases', () => { - // @ts-expect-error Testing runtime behavior with null - expect(sanitizeThemeColor(null)).toBe(DEFAULT_THEME_COLOR); - - // @ts-expect-error Testing runtime behavior with undefined - expect(sanitizeThemeColor(undefined)).toBe(DEFAULT_THEME_COLOR); - - // @ts-expect-error Testing runtime behavior with number - expect(sanitizeThemeColor(123)).toBe(DEFAULT_THEME_COLOR); - - // @ts-expect-error Testing runtime behavior with object - expect(sanitizeThemeColor({})).toBe(DEFAULT_THEME_COLOR); - }); - }); - - describe('DEFAULT_THEME_COLOR', () => { - it('should be a valid hex color', () => { - expect(HEX_COLOR_PATTERN.test(DEFAULT_THEME_COLOR)).toBe(true); - }); - - it('should be the expected value', () => { - expect(DEFAULT_THEME_COLOR).toBe('#25292e'); - }); - }); -}); diff --git a/packages/app/src/components/__tests__/ExceptionSubpanel.test.tsx b/packages/app/src/components/__tests__/ExceptionSubpanel.test.tsx index 3b90aafde..38d1c2f54 100644 --- a/packages/app/src/components/__tests__/ExceptionSubpanel.test.tsx +++ b/packages/app/src/components/__tests__/ExceptionSubpanel.test.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { screen } from '@testing-library/react'; +import { screen, within } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; import { ExceptionSubpanel } from '@/components/ExceptionSubpanel'; @@ -76,3 +77,371 @@ describe('ExceptionSubpanel breadcrumbs', () => { expect(badgeStates()).toEqual([[level, state]]); }); }); + +const APP = 'https://example.clickhouse.com/assets/app.js'; +const FRAMEWORK = + 'https://example.clickhouse.com/_next/static/chunks/framework-2c79e2a64abdb08b.js'; +const RAW_STACK = [ + 'Error: Checkout failed', + ` at checkout (${APP}:120:11)`, + ` at Object.Ub (${FRAMEWORK}:9:16994)`, + 'Caused by: TypeError: Failed to fetch', + ` at fetchCart (${APP}:42:9)`, +].join('\n'); + +const PARSED_EXCEPTION_VALUES = [ + { + type: 'Error', + value: 'Checkout failed', + rawStacktrace: RAW_STACK, + stacktrace: { + frames: [ + { + filename: FRAMEWORK, + function: 'Object.Ub', + lineno: 9, + colno: 16994, + in_app: false, + }, + { + filename: APP, + function: 'checkout', + lineno: 120, + colno: 11, + in_app: true, + }, + ], + }, + }, + { + type: 'TypeError', + value: 'Failed to fetch', + stacktrace: { + frames: [ + { + filename: APP, + function: 'fetchCart', + lineno: 42, + colno: 9, + in_app: true, + }, + ], + }, + }, +]; + +const rowTexts = () => + screen.getAllByRole('row').map(row => row.textContent?.trim()); + +describe('ExceptionSubpanel stack frames', () => { + it('renders the thrown exception with its frames, newest first', () => { + renderWithMantine( + , + ); + + expect(rowTexts()).toEqual([ + `${APP}:120:11 in checkout`, + `${FRAMEWORK}:9:16994 in Object.Ub`, + ]); + expect( + screen + .getAllByLabelText('Library or framework code') + .map(icon => icon.closest('tr')?.textContent?.trim()), + ).toEqual([`${FRAMEWORK}:9:16994 in Object.Ub`]); + expect(screen.getByText('Error').closest('div')?.textContent).toBe( + 'Error: Checkout failed', + ); + expect(screen.getByText('Error').closest('button')).toBeNull(); + }); + + it('collapses each cause to its title until expanded', async () => { + renderWithMantine( + , + ); + const causes = () => + screen + .getAllByRole('button', { name: /^Caused by: / }) + .map(cause => [cause.textContent, cause.getAttribute('aria-expanded')]); + + expect(causes()).toEqual([ + ['Caused by: TypeError: Failed to fetch', 'false'], + ['Caused by: Error: Socket closed', 'false'], + ]); + expect(rowTexts()).toEqual([ + `${APP}:120:11 in checkout`, + `${FRAMEWORK}:9:16994 in Object.Ub`, + ]); + + await userEvent.click( + screen.getByRole('button', { name: /Failed to fetch/ }), + ); + + expect(causes()).toEqual([ + ['Caused by: TypeError: Failed to fetch', 'true'], + ['Caused by: Error: Socket closed', 'false'], + ]); + expect(rowTexts()).toEqual([ + `${APP}:120:11 in checkout`, + `${FRAMEWORK}:9:16994 in Object.Ub`, + `${APP}:42:9 in fetchCart`, + ]); + + await userEvent.click( + screen.getByRole('button', { name: /Failed to fetch/ }), + ); + + expect(rowTexts()).not.toContain(`${APP}:42:9 in fetchCart`); + }); + + it('renders a section without frames as its title alone', () => { + const { container } = renderWithMantine( + , + ); + + // A cause's unparsed text is not shown. Causes only come from a parsed + // stack, whose full text is in "Raw stack trace". + expect( + Array.from(container.querySelectorAll('.panelSectionWrapper'), section => + Array.from(section.children, child => child.textContent), + ), + ).toEqual([ + ['Error: Checkout failed'], + ['Caused by: TypeError: Failed to fetch'], + ['Caused by: Error: Socket closed'], + ]); + expect( + screen.queryByRole('button', { name: /Caused by:/ }), + ).not.toBeInTheDocument(); + }); + + it('keeps the mechanism of a section without frames', () => { + renderWithMantine( + , + ); + + expect(screen.getByText('onerror')).toBeInTheDocument(); + expect(screen.getByText('false')).toBeInTheDocument(); + }); + + it('does not render the frames of a collapsed cause', () => { + renderWithMantine( + , + ); + + // `hidden` also counts rows mounted but hidden by CSS, which would still + // run their source map lookups. + expect(screen.queryAllByRole('row', { hidden: true })).toHaveLength(0); + }); + + it('puts a collapsed cause on one line and its full message on hover', async () => { + renderWithMantine( + , + ); + const cause = screen.getByRole('button', { name: /^Caused by: / }); + const title = () => within(cause).getByText('Error').parentElement; + + expect(cause.textContent).toBe( + 'Caused by: Error: Row 12 is invalid: price must be a number', + ); + expect(title()).toHaveAttribute('data-truncate'); + expect(title()).toHaveAttribute( + 'title', + 'Error: Row 12 is invalid:\r\n price must be a number', + ); + + await userEvent.click(cause); + + expect(cause.textContent).toBe( + 'Caused by: Error: Row 12 is invalid:\r\n price must be a number', + ); + expect(title()).not.toHaveAttribute('data-truncate'); + expect(title()).not.toHaveAttribute('title'); + expect(title()?.style.whiteSpace).toBe('pre-wrap'); + }); + + it('shows the message of an open section with its line breaks', () => { + const longToken = `https://react.dev/errors/418?args[]=${'x'.repeat(400)}`; + renderWithMantine( + , + ); + const title = (type: string) => screen.getByText(type).parentElement; + + expect(screen.getByText('Error').closest('div')?.textContent).toBe( + 'Error: Checkout failed\nfor cart 42', + ); + expect(screen.getByText('TypeError').closest('div')?.textContent).toBe( + `Caused by: TypeError: Failed to fetch\n${longToken}`, + ); + for (const type of ['Error', 'TypeError']) { + expect(title(type)?.style.whiteSpace).toBe('pre-wrap'); + expect(title(type)?.style.overflowWrap).toBe('anywhere'); + expect(title(type)).not.toHaveAttribute('data-truncate'); + expect(title(type)).not.toHaveAttribute('data-line-clamp'); + } + }); + + it('keeps the raw stack trace behind a collapsed section', async () => { + renderWithMantine( + , + ); + const rawText = () => screen.queryByText(/Caused by: TypeError/); + + expect(rawText()).not.toBeInTheDocument(); + await userEvent.click(screen.getByText('Raw stack trace')); + expect(rawText()?.textContent).toBe(RAW_STACK); + }); + + it('omits the line and column of a frame that has none', () => { + renderWithMantine( + , + ); + + expect(rowTexts()).toEqual([ + `${APP}:37 in checkout`, + '[native code] in forEach', + ]); + }); + + it.each(['', '?'])( + 'omits "in" for a frame whose function is %p', + functionName => { + renderWithMantine( + , + ); + + expect(screen.getByRole('row').textContent).toBe(`${APP}:5:10`); + }, + ); + + it('shows an unparsed stack as text', () => { + renderWithMantine( + , + ); + + expect(screen.getByText(/Caused by: TypeError/).textContent).toBe( + RAW_STACK, + ); + expect(screen.queryByRole('row')).not.toBeInTheDocument(); + expect(screen.queryByText('Raw stack trace')).not.toBeInTheDocument(); + }); +}); diff --git a/packages/app/src/components/__tests__/MetricTableModelForm.test.tsx b/packages/app/src/components/__tests__/MetricTableModelForm.test.tsx index 2f1ce9aba..7e34cdd87 100644 --- a/packages/app/src/components/__tests__/MetricTableModelForm.test.tsx +++ b/packages/app/src/components/__tests__/MetricTableModelForm.test.tsx @@ -51,8 +51,8 @@ jest.mock('@/source', () => ({ }), })); -jest.mock('@/theme/ThemeProvider', () => ({ - useBrandDisplayName: () => 'HyperDX', +jest.mock('@/brand', () => ({ + useBrandDisplayName: () => 'ClickStack', })); jest.mock('@mantine/notifications', () => ({ diff --git a/packages/app/src/components/__tests__/OnboardingModal.test.tsx b/packages/app/src/components/__tests__/OnboardingModal.test.tsx index ac54701a4..8bb64b199 100644 --- a/packages/app/src/components/__tests__/OnboardingModal.test.tsx +++ b/packages/app/src/components/__tests__/OnboardingModal.test.tsx @@ -39,7 +39,10 @@ const mockConnectionsResult = { data: [{ id: 'conn-1', name: 'Default', host: 'http://localhost:8123' }], }; const mockUpdateConnectionMutation = { mutateAsync: jest.fn() }; +const mockFetchHttpApiSupport = jest.fn(); jest.mock('@/connection', () => ({ + fetchPrometheusHttpApiSupport: (...args: unknown[]) => + mockFetchHttpApiSupport(...args), useConnections: () => mockConnectionsResult, useCreateConnection: () => ({ mutate: jest.fn() }), useUpdateConnection: () => mockUpdateConnectionMutation, @@ -53,8 +56,8 @@ jest.mock('@/hooks/useMetadata', () => ({ useMetadataWithSettings: () => mockMetadata, })); -jest.mock('@/theme/ThemeProvider', () => ({ - useBrandDisplayName: () => 'HyperDX', +jest.mock('@/brand', () => ({ + useBrandDisplayName: () => 'ClickStack', })); jest.mock('@/components/ConnectionForm', () => ({ ConnectionForm: () => null, @@ -93,6 +96,7 @@ describe('OnboardingModal auto-detection', () => { }), ); mockUpdateSource.mockResolvedValue(undefined); + mockFetchHttpApiSupport.mockResolvedValue(false); mockMetadata.getOtelTables.mockResolvedValue(OTEL_LOGS_ONLY); mockMetadata.getTimeSeriesTables.mockResolvedValue([ { databaseName: 'default', tableName: 'metrics_ts' }, @@ -118,6 +122,29 @@ describe('OnboardingModal auto-detection', () => { }); }); + it('pins the PromQL source to the HTTP API when the server serves it', async () => { + mockFetchHttpApiSupport.mockResolvedValue(true); + + renderWithMantine(); + + await screen.findByText('Automatically detected and created 2 sources.'); + expect(mockFetchHttpApiSupport).toHaveBeenCalledWith('conn-1'); + expect(mockCreateSource).toHaveBeenLastCalledWith({ + source: expect.objectContaining({ + kind: SourceKind.Promql, + promqlBackend: 'clickhouse-http', + }), + }); + }); + + it('leaves the PromQL backend unset when the server does not serve the HTTP API', async () => { + renderWithMantine(); + + await screen.findByText('Automatically detected and created 2 sources.'); + const [{ source }] = mockCreateSource.mock.lastCall; + expect(source).not.toHaveProperty('promqlBackend'); + }); + it('skips PromQL detection when PromQL is disabled', async () => { mockConfig.IS_PROMQL_ENABLED = false; @@ -125,6 +152,7 @@ describe('OnboardingModal auto-detection', () => { await screen.findByText('Automatically detected and created 1 source.'); expect(mockMetadata.getTimeSeriesTables).not.toHaveBeenCalled(); + expect(mockFetchHttpApiSupport).not.toHaveBeenCalled(); expect(createdKinds()).toEqual([SourceKind.Log]); }); diff --git a/packages/app/src/components/__tests__/PromqlTableModelForm.test.tsx b/packages/app/src/components/__tests__/PromqlTableModelForm.test.tsx new file mode 100644 index 000000000..c9de0976b --- /dev/null +++ b/packages/app/src/components/__tests__/PromqlTableModelForm.test.tsx @@ -0,0 +1,95 @@ +import { useForm, useWatch } from 'react-hook-form'; +import { + PromqlSourceBackend, + SourceKind, + TSource, +} from '@hyperdx/common-utils/dist/types'; +import { screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; + +import { PromqlTableModelForm } from '@/components/Sources/SourceForm/PromqlTableModelForm'; + +// Mantine's Combobox calls scrollIntoView when its dropdown opens; jsdom lacks it. +window.HTMLElement.prototype.scrollIntoView = jest.fn(); + +function Harness({ + promqlBackend, + isPrometheusEndpoint, +}: { + promqlBackend?: PromqlSourceBackend; + isPrometheusEndpoint?: boolean; +}) { + const { control, setValue } = useForm({ + defaultValues: { + kind: SourceKind.Promql, + name: 'PromQL', + connection: 'conn-1', + from: { databaseName: 'default', tableName: 'metrics_ts' }, + timestampValueExpression: 'timestamp', + promqlBackend, + }, + }); + const backend = useWatch({ control, name: 'promqlBackend' }); + return ( + <> + +
{backend ?? 'unset'}
+ + ); +} + +const backendSelect = () => screen.getByTestId('promql-backend-select'); + +describe('PromqlTableModelForm', () => { + it('shows Auto for a source that has no backend set', () => { + renderWithMantine(); + + expect(backendSelect()).toHaveAttribute( + 'placeholder', + 'Auto (detect from server)', + ); + expect(backendSelect()).toHaveValue(''); + expect(screen.getByTestId('backend-value')).toHaveTextContent('unset'); + }); + + it('shows the backend a source has set', () => { + renderWithMantine(); + + expect(backendSelect()).toHaveValue('Prometheus HTTP API'); + }); + + it('sets the backend from the option picked', async () => { + const user = userEvent.setup(); + renderWithMantine(); + + await user.click(backendSelect()); + await user.click(await screen.findByText('Table functions')); + + expect(screen.getByTestId('backend-value')).toHaveTextContent( + 'table-function', + ); + }); + + it('can go back to Auto after another backend was picked', async () => { + const user = userEvent.setup(); + renderWithMantine(); + + await user.click(backendSelect()); + await user.click(await screen.findByText('Auto (detect from server)')); + + expect(screen.getByTestId('backend-value')).toHaveTextContent('auto'); + }); + + it('hides the backend for a Prometheus endpoint, which is always queried through its own API', () => { + renderWithMantine(); + + expect(screen.queryByTestId('promql-backend-select')).toBeNull(); + expect(screen.queryByText('PromQL backend')).toBeNull(); + // The rest of the form is unaffected. + expect(screen.getByText('Minimum auto granularity')).toBeInTheDocument(); + }); +}); diff --git a/packages/app/src/components/__tests__/TimeZoneSelect.test.tsx b/packages/app/src/components/__tests__/TimeZoneSelect.test.tsx index d7b71e5c7..d7afd9547 100644 --- a/packages/app/src/components/__tests__/TimeZoneSelect.test.tsx +++ b/packages/app/src/components/__tests__/TimeZoneSelect.test.tsx @@ -20,11 +20,23 @@ const optionNames = () => .getAllByRole('option', { hidden: true }) .map(option => option.textContent); +const LOCAL_LABEL = /^Local \(America\/New York\) UTC-[45]$/; + +const LOCAL_DEFAULT_LABEL = /^Default \(Local\) UTC-[45]$/; + +const inputValue = () => + screen.getByTestId('time-zone-select').value; + describe('TimeZoneSelect', () => { - it('shows the local zone for the local setting', () => { + it('shows the local zone and its offset for the local setting', () => { renderSelect('local'); + expect(inputValue()).toMatch(LOCAL_LABEL); + }); + + it('shows a selected zone with its offset', () => { + renderSelect('Asia/Tokyo'); expect(screen.getByTestId('time-zone-select')).toHaveValue( - 'Local (America/New York)', + 'Asia/Tokyo UTC+9', ); }); @@ -33,11 +45,9 @@ describe('TimeZoneSelect', () => { await userEvent.click(screen.getByTestId('time-zone-select')); const names = optionNames(); - expect(names[0]).toMatch( - /^Local \(America\/New York\)E[SD]T · UTC-0[45]:00$/, - ); - expect(names[1]).toBe('UTCUTC+00:00'); - expect(names.slice(2)).toContain('Asia/TokyoUTC+09:00'); + expect(names[0]).toMatch(/^Local \(America\/New York\)UTC-[45]$/); + expect(names[1]).toBe('UTC'); + expect(names.slice(2)).toContain('Asia/TokyoUTC+9'); expect(names.filter(name => name?.startsWith('UTC'))).toHaveLength(1); }); @@ -57,10 +67,38 @@ describe('TimeZoneSelect', () => { expect(onChange).toHaveBeenCalledWith('America/Los_Angeles'); }); + it('finds zones by offset', async () => { + renderSelect('local'); + + const input = screen.getByTestId('time-zone-select'); + await userEvent.clear(input); + await userEvent.type(input, 'utc+9'); + + expect(optionNames()).toContain('Asia/TokyoUTC+9'); + expect(optionNames()).not.toContain('Europe/BerlinUTC+1'); + }); + + it.each([ + ['local', LOCAL_DEFAULT_LABEL], + ['Asia/Tokyo', /^Default \(Asia\/Tokyo\) UTC\+9$/], + ['Etc/UTC', /^Default \(UTC\)$/], + ])( + 'names the default option after %s with its offset', + (defaultTimeZone, label) => { + renderWithMantine( + , + ); + expect(inputValue()).toMatch(label); + }, + ); + it('shows local for a zone the browser does not recognise', () => { renderSelect('Mars/Olympus_Mons'); - expect(screen.getByTestId('time-zone-select')).toHaveValue( - 'Local (America/New York)', - ); + expect(inputValue()).toMatch(LOCAL_LABEL); }); }); diff --git a/packages/app/src/components/alerts/AlertRowMenu.tsx b/packages/app/src/components/alerts/AlertRowMenu.tsx index b8560c320..f18ae76bf 100644 --- a/packages/app/src/components/alerts/AlertRowMenu.tsx +++ b/packages/app/src/components/alerts/AlertRowMenu.tsx @@ -14,12 +14,12 @@ import { import { useQueryClient } from '@tanstack/react-query'; import api from '@/api'; +import { useBrandDisplayName } from '@/brand'; import { EditAlertModal } from '@/components/alerts/EditAlertModal'; import { EditInlineAlertModal } from '@/components/alerts/EditInlineAlertModal'; import { TerraformHelperPanel } from '@/components/Iac/TerraformHelperPanel'; import { useTerraformSnippets } from '@/components/Iac/useTerraformSnippets'; import { IS_IAC_EXPORT_ENABLED } from '@/config'; -import { useBrandDisplayName } from '@/theme/ThemeProvider'; import type { AlertsPageItem } from '@/types'; import { useConfirm } from '@/useConfirm'; import { intervalToDateRange } from '@/utils/alerts'; diff --git a/packages/app/src/components/alerts/EditAlertModal.tsx b/packages/app/src/components/alerts/EditAlertModal.tsx index 2d670aa2c..c0864bbe0 100644 --- a/packages/app/src/components/alerts/EditAlertModal.tsx +++ b/packages/app/src/components/alerts/EditAlertModal.tsx @@ -34,6 +34,7 @@ import { IconChartLine, IconInfoCircleFilled } from '@tabler/icons-react'; import { useQueryClient } from '@tanstack/react-query'; import api from '@/api'; +import { useBrandDisplayName } from '@/brand'; import { AlertDisplayFields } from '@/components/AlertDisplayFields'; import { AlertNoteField } from '@/components/AlertNoteField'; import { AlertChannelForm } from '@/components/Alerts'; @@ -42,7 +43,6 @@ import { AlertScheduleFields } from '@/components/AlertScheduleFields'; import { SQLInlineEditorControlled } from '@/components/SQLEditor/SQLInlineEditor'; import { useSavedSearch } from '@/savedSearch'; import { useSource } from '@/source'; -import { useBrandDisplayName } from '@/theme/ThemeProvider'; import type { AlertsPageItem } from '@/types'; import { optionsToSelectData } from '@/utils'; import { diff --git a/packages/app/src/components/alerts/EditInlineAlertModal.tsx b/packages/app/src/components/alerts/EditInlineAlertModal.tsx index 12aecdd0c..98dbc9590 100644 --- a/packages/app/src/components/alerts/EditInlineAlertModal.tsx +++ b/packages/app/src/components/alerts/EditInlineAlertModal.tsx @@ -8,9 +8,9 @@ import { notifications } from '@mantine/notifications'; import { useQueryClient } from '@tanstack/react-query'; import api from '@/api'; +import { useBrandDisplayName } from '@/brand'; import EditTimeChartForm from '@/components/DBEditTimeChartForm'; import EmptyState from '@/components/EmptyState'; -import { useBrandDisplayName } from '@/theme/ThemeProvider'; import type { AlertsPageItem } from '@/types'; import { useConfirm } from '@/useConfirm'; import { diff --git a/packages/app/src/components/alerts/__tests__/AlertRowMenu.test.tsx b/packages/app/src/components/alerts/__tests__/AlertRowMenu.test.tsx index babbfd219..31291afee 100644 --- a/packages/app/src/components/alerts/__tests__/AlertRowMenu.test.tsx +++ b/packages/app/src/components/alerts/__tests__/AlertRowMenu.test.tsx @@ -45,8 +45,8 @@ jest.mock('@/components/alerts/EditInlineAlertModal', () => ({ const confirm = jest.fn().mockResolvedValue(true); jest.mock('@/useConfirm', () => ({ useConfirm: () => confirm })); -jest.mock('@/theme/ThemeProvider', () => ({ - useBrandDisplayName: () => 'HyperDX', +jest.mock('@/brand', () => ({ + useBrandDisplayName: () => 'ClickStack', })); // ObjectId hex: buildImportBlock refuses to emit Terraform for anything else, diff --git a/packages/app/src/components/alerts/__tests__/EditAlertModal.test.tsx b/packages/app/src/components/alerts/__tests__/EditAlertModal.test.tsx index c7054865f..72d302904 100644 --- a/packages/app/src/components/alerts/__tests__/EditAlertModal.test.tsx +++ b/packages/app/src/components/alerts/__tests__/EditAlertModal.test.tsx @@ -41,9 +41,9 @@ jest.mock('@/source', () => ({ useSource: () => ({ data: undefined }), })); -jest.mock('@/theme/ThemeProvider', () => ({ +jest.mock('@/brand', () => ({ __esModule: true, - useBrandDisplayName: () => 'HyperDX', + useBrandDisplayName: () => 'ClickStack', })); // Heavy / visual child components are stubbed so the form still renders and diff --git a/packages/app/src/components/alerts/__tests__/EditInlineAlertModal.test.tsx b/packages/app/src/components/alerts/__tests__/EditInlineAlertModal.test.tsx index 6eba1b42b..b18a9e8f2 100644 --- a/packages/app/src/components/alerts/__tests__/EditInlineAlertModal.test.tsx +++ b/packages/app/src/components/alerts/__tests__/EditInlineAlertModal.test.tsx @@ -31,9 +31,9 @@ jest.mock('@/api', () => ({ })); jest.mock('@/useConfirm', () => ({ useConfirm: () => jest.fn() })); -jest.mock('@/theme/ThemeProvider', () => ({ +jest.mock('@/brand', () => ({ __esModule: true, - useBrandDisplayName: () => 'HyperDX', + useBrandDisplayName: () => 'ClickStack', })); // The chart editor has its own suite; here it is stubbed to a "save what I was diff --git a/packages/app/src/components/charts/ChartEmptyState.tsx b/packages/app/src/components/charts/ChartEmptyState.tsx new file mode 100644 index 000000000..83916b759 --- /dev/null +++ b/packages/app/src/components/charts/ChartEmptyState.tsx @@ -0,0 +1,14 @@ +import { Loader } from '@mantine/core'; + +export default function ChartEmptyState({ + isLoading = false, +}: { + isLoading?: boolean; +}) { + return ( +
+ {isLoading && } + {isLoading ? 'Loading Chart Data...' : 'No data found within time range.'} +
+ ); +} diff --git a/packages/app/src/config/fonts.ts b/packages/app/src/config/fonts.ts index 015dee834..5b7229c85 100644 --- a/packages/app/src/config/fonts.ts +++ b/packages/app/src/config/fonts.ts @@ -1,55 +1,7 @@ -type FontConfig = { - variable: string; - fallback: string; -}; - -const FONT_CONFIG: Record = { - 'IBM Plex Mono': { - variable: 'var(--font-ibm-plex-mono)', - fallback: 'monospace', - }, - 'Roboto Mono': { - variable: 'var(--font-roboto-mono)', - fallback: 'monospace', - }, - Inter: { - variable: 'var(--font-inter)', - fallback: 'sans-serif', - }, - Roboto: { - variable: 'var(--font-roboto)', - fallback: 'sans-serif', - }, -}; - -const DEFAULT_FONT_CONFIG = FONT_CONFIG.Inter; - -// Derived maps for convenience -export const FONT_VAR_MAP = Object.entries(FONT_CONFIG).reduce( - (acc, [name, config]) => { - acc[name] = config.variable; - return acc; - }, - {} as Record, -); - -export const MANTINE_FONT_MAP = Object.entries(FONT_CONFIG).reduce( - (acc, [name, config]) => { - acc[name] = `${config.variable}, ${config.fallback}`; - return acc; - }, - {} as Record, -); - -export const DEFAULT_FONT_VAR = DEFAULT_FONT_CONFIG.variable; - -// UI options for font selection -export const OPTIONS_FONTS = [ - 'IBM Plex Mono', - 'Roboto Mono', - 'Inter', - 'Roboto', -]; +/** UI font. The app does not offer a font picker. */ +export const MANTINE_FONT_MAP = { + Inter: 'var(--font-inter), sans-serif', +} as const; export type ContentFontSize = 'sm' | 'md' | 'lg'; diff --git a/packages/app/src/connection.ts b/packages/app/src/connection.ts index 3ed38168b..97a933c14 100644 --- a/packages/app/src/connection.ts +++ b/packages/app/src/connection.ts @@ -53,6 +53,26 @@ export function useConnections() { }); } +/** + * Whether the server behind a connection answers PromQL over ClickHouse's + * Prometheus HTTP API. False when it does not, and also when it could not be + * asked, so a caller pins to the HTTP API only on a definitive yes. + */ +export async function fetchPrometheusHttpApiSupport( + connectionId: string, +): Promise { + // A local-mode connection lives in the browser; the API has no record of it. + if (IS_LOCAL_MODE) return false; + try { + const { supported } = await hdxServer( + `connections/${connectionId}/prometheus-http-api`, + ).json<{ supported: boolean }>(); + return supported === true; + } catch { + return false; + } +} + export function useCreateConnection() { const queryClient = useQueryClient(); diff --git a/packages/app/src/dfe/__tests__/dfeTheme.test.ts b/packages/app/src/dfe/__tests__/dfeTheme.test.ts index 64804c88c..03cad45a7 100644 --- a/packages/app/src/dfe/__tests__/dfeTheme.test.ts +++ b/packages/app/src/dfe/__tests__/dfeTheme.test.ts @@ -1,23 +1,23 @@ /** - * Fork-local coverage for the DFE brand theme. + * Fork-local coverage for the DFE brand. * - * The theme registry validates SHAPE at import; these tests pin the brand - * IDENTITY - the values a well-meaning upstream refactor of the shared theme - * scaffolding could quietly reset. The primary scale is anchored on the brand - * tokens in `_tokens.scss`, so those two anchors are asserted against the - * stylesheet rather than duplicated as loose constants. + * Upstream ships one brand and one palette, and takes ours through three + * swapped references. These tests pin the brand IDENTITY and that wiring. The + * primary scale is anchored on the brand tokens in `_tokens.scss`, so those two + * anchors are asserted against the stylesheet rather than duplicated as + * constants. */ import { readFileSync } from 'fs'; import { join } from 'path'; -import { FONT_VAR_MAP, MANTINE_FONT_MAP } from '@/config/fonts'; -import { dfeTheme } from '@/theme/themes/dfe'; -import { makeTheme } from '@/theme/themes/dfe/mantineTheme'; +import { MANTINE_FONT_MAP } from '@/config/fonts'; +import { makeTheme, theme } from '@/theme/themes/dfe/mantineTheme'; -const tokensScss = readFileSync( - join(__dirname, '../../theme/themes/dfe/_tokens.scss'), - 'utf-8', -); +const APP_ROOT = join(__dirname, '../../..'); +const read = (relative: string) => + readFileSync(join(APP_ROOT, relative), 'utf-8'); + +const tokensScss = read('src/theme/themes/dfe/_tokens.scss'); const cssToken = (name: string): string => { const match = tokensScss.match( @@ -29,51 +29,89 @@ const cssToken = (name: string): string => { return match[1].toLowerCase(); }; -describe('dfeTheme registration', () => { - it('registers under the dfe name with the DFE display name', () => { - expect(dfeTheme.name).toBe('dfe'); - expect(dfeTheme.displayName).toBe('DFE'); +type Brand = typeof import('@/dfe/brand'); + +function loadBrand(upstream: boolean): Brand { + const pinned = process.env.DFE_UPSTREAM_BRAND; + if (upstream) { + process.env.DFE_UPSTREAM_BRAND = 'true'; + } else { + delete process.env.DFE_UPSTREAM_BRAND; + } + try { + let brand: Brand | undefined; + jest.isolateModules(() => { + brand = jest.requireActual('@/dfe/brand'); + }); + if (!brand) { + throw new Error('@/dfe/brand did not load'); + } + return brand; + } finally { + process.env.DFE_UPSTREAM_BRAND = pinned; + } +} + +// The DFE logomark's viewBox, which upstream's ClickStack mark does not share. +const DFE_LOGOMARK_VIEWBOX = '0 0 113.77 78.052'; + +describe('the DFE brand', () => { + it('names the console DFE with the DFE marks and theme', () => { + const brand = loadBrand(false); + + expect(brand.dfeBrandName('ClickStack')).toBe('DFE'); + expect(brand.theme.primaryColor).toBe(theme.primaryColor); + expect(brand.Logomark({}).props.viewBox).toBe(DFE_LOGOMARK_VIEWBOX); + expect(brand.Wordmark({ name: 'DFE' }).type).toBe('div'); + }); + + it('gives upstream its own brand under the test pin', () => { + const brand = loadBrand(true); + + expect(brand.dfeBrandName('ClickStack')).toBe('ClickStack'); + expect(brand.theme.primaryColor).not.toBe(theme.primaryColor); + expect(brand.Logomark({}).props.viewBox).not.toBe(DFE_LOGOMARK_VIEWBOX); + expect(brand.Wordmark({ name: 'ClickStack' }).type).not.toBe('div'); }); +}); - it('scopes its CSS custom properties with the theme-dfe class', () => { - // ThemeProvider swaps exactly one class on , so the token blocks must - // be scoped to the class this theme declares. - expect(dfeTheme.cssClass).toBe('theme-dfe'); - expect(tokensScss).toContain( - ".theme-dfe[data-mantine-color-scheme='dark']", +describe('upstream files take the DFE brand', () => { + it('reads the name and marks in brand/index.tsx', () => { + const index = read('src/brand/index.tsx'); + expect(index).toContain( + "import { dfeBrandName, Logomark, Wordmark } from '@/dfe/brand';", ); - expect(tokensScss).toContain( - ".theme-dfe[data-mantine-color-scheme='light']", + expect(index).toMatch(/BRAND_DISPLAY_NAME = dfeBrandName\(/); + }); + + it('reads the Mantine theme in ThemeWrapper.tsx', () => { + expect(read('src/ThemeWrapper.tsx')).toContain( + "import { theme as baseTheme } from '@/dfe/brand';", ); }); - it('does not scope its tokens onto another theme class', () => { - // These blocks began life as a copy of the hyperdx theme. Left pointing at - // `.theme-hyperdx` they emit AFTER hyperdx's own block (both are @used from - // _base-tokens.scss, dfe second), so equal specificity hands the win to us - // and the hyperdx theme silently renders DFE brand colours. - expect(tokensScss).not.toContain('.theme-hyperdx['); - expect(tokensScss).not.toContain('.theme-clickstack['); + it('reads the CSS tokens in theme/_base-tokens.scss', () => { + const baseTokens = read('src/theme/_base-tokens.scss'); + expect(baseTokens).toContain("@use './themes/dfe/tokens';"); + expect(baseTokens).not.toContain("@use './tokens';"); }); - it('ships its own favicon set rather than upstream hyperdx branding', () => { - expect(dfeTheme.favicon.svg).toBe('/favicons/dfe/favicon.svg'); - expect(dfeTheme.favicon.png32).toBe('/favicons/dfe/favicon-32x32.png'); - expect(dfeTheme.favicon.png16).toBe('/favicons/dfe/favicon-16x16.png'); - expect(dfeTheme.favicon.appleTouchIcon).toBe( - '/favicons/dfe/apple-touch-icon.png', - ); + it('emits its tokens for both colour schemes, unscoped', () => { + // Nothing puts a theme class on any more, so a scoped block would + // never match. + expect(tokensScss).toContain("\n[data-mantine-color-scheme='dark'] {"); + expect(tokensScss).toContain("\n[data-mantine-color-scheme='light'] {"); + expect(tokensScss).not.toMatch(/\.theme-[a-z]+\[/); }); - it('supplies a Wordmark and a Logomark', () => { - expect(dfeTheme.Wordmark).toBeDefined(); - expect(dfeTheme.Logomark).toBeDefined(); + it('links the DFE favicon set in _document.tsx', () => { + const document = read('pages/_document.tsx'); + expect(document).toContain('/favicons/dfe/favicon.svg'); + expect(document).not.toContain('/favicons/clickstack/'); }); }); describe('DFE mantine theme', () => { - const theme = dfeTheme.mantineTheme; - it('uses the brand blue as primary, not the inherited olive yellow', () => { expect(theme.primaryColor).toBe('brand'); expect(theme.primaryShade).toBe(6); @@ -98,19 +136,10 @@ describe('DFE mantine theme', () => { }); }); -describe('DFE work-UI fonts', () => { - // The DFE console is pinned to Inter (tabular numerals, legible in dense - // tables) with IBM Plex Mono for code. Both must stay resolvable, because - // _app.tsx maps the DFE theme onto them by NAME. +describe('DFE work-UI font', () => { + // The console is pinned to Inter (tabular numerals, legible in dense tables), + // and _app.tsx hands it to the theme wrapper by NAME. it('resolves Inter', () => { - expect(FONT_VAR_MAP['Inter']).toBe('var(--font-inter)'); expect(MANTINE_FONT_MAP['Inter']).toBe('var(--font-inter), sans-serif'); }); - - it('resolves IBM Plex Mono', () => { - expect(FONT_VAR_MAP['IBM Plex Mono']).toBe('var(--font-ibm-plex-mono)'); - expect(MANTINE_FONT_MAP['IBM Plex Mono']).toBe( - 'var(--font-ibm-plex-mono), monospace', - ); - }); }); diff --git a/packages/app/src/dfe/__tests__/forkDeltas.test.ts b/packages/app/src/dfe/__tests__/forkDeltas.test.ts index 6a522a4f9..7c9a22224 100644 --- a/packages/app/src/dfe/__tests__/forkDeltas.test.ts +++ b/packages/app/src/dfe/__tests__/forkDeltas.test.ts @@ -83,7 +83,7 @@ describe('_app.tsx - route guard and font pin', () => { }); it('pins the DFE console font to Inter regardless of user preference', () => { - expect(app).toMatch(/isDFETheme\s*\|\|\s*isClickStackTheme\s*\?\s*'Inter'/); + expect(app).toContain('fontFamily={MANTINE_FONT_MAP.Inter}'); }); }); diff --git a/packages/app/src/dfe/__tests__/spotlightPresets.test.ts b/packages/app/src/dfe/__tests__/spotlightPresets.test.ts index 9396e5acc..d9419405e 100644 --- a/packages/app/src/dfe/__tests__/spotlightPresets.test.ts +++ b/packages/app/src/dfe/__tests__/spotlightPresets.test.ts @@ -10,7 +10,7 @@ jest.mock('next/router', () => ({ useRouter: () => ({ push: jest.fn() }), })); -jest.mock('@/theme/ThemeProvider', () => ({ +jest.mock('@/brand', () => ({ useBrandDisplayName: () => 'DFE', useLogomark: () => null, })); diff --git a/packages/app/src/dfe/__tests__/themeFallback.test.ts b/packages/app/src/dfe/__tests__/themeFallback.test.ts deleted file mode 100644 index 1c0a76ca6..000000000 --- a/packages/app/src/dfe/__tests__/themeFallback.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * A DFE deployment resolves an unmatched brand to dfe. - * - * getTheme and the chart palette fall back to the configured DEFAULT_THEME. The - * app suite runs under NEXT_PUBLIC_THEME=hyperdx (jest.dfe.setup.js), so each - * case reloads the real modules under a brand a DFE deployment runs with. - */ - -const DFE_SUCCESS = '#00c28a'; - -type Loaded = { - theme: typeof import('@/theme'); - utils: typeof import('@/utils'); -}; - -function loadWith(brand: string | undefined): Loaded { - if (brand === undefined) { - delete process.env.NEXT_PUBLIC_THEME; - } else { - process.env.NEXT_PUBLIC_THEME = brand; - } - jest.resetModules(); - return { - theme: jest.requireActual('@/theme'), - utils: jest.requireActual('@/utils'), - }; -} - -describe('the brand an unmatched theme resolves to', () => { - const pinned = process.env.NEXT_PUBLIC_THEME; - - afterEach(() => { - process.env.NEXT_PUBLIC_THEME = pinned; - jest.resetModules(); - document.documentElement.className = ''; - }); - - it.each([ - ['unset', undefined], - ['dfe', 'dfe'], - ])('is dfe when NEXT_PUBLIC_THEME is %s', (_label, brand) => { - const { theme } = loadWith(brand); - - expect(theme.DEFAULT_THEME).toBe('dfe'); - // @ts-expect-error an unknown name is the input under test - expect(theme.getTheme('no-such-theme').name).toBe('dfe'); - }); - - it('gives a document with no theme class the DFE chart palette', () => { - const { utils } = loadWith(undefined); - - expect(utils.getColorFromCSSToken('chart-success')).toBe(DFE_SUCCESS); - }); - - it('follows the hyperdx class on a DFE deployment', () => { - const { utils } = loadWith(undefined); - document.documentElement.classList.add('theme-hyperdx'); - - expect(utils.getColorFromCSSToken('chart-success')).not.toBe(DFE_SUCCESS); - }); - - it('follows the configured brand on a hyperdx deployment', () => { - const { theme } = loadWith('hyperdx'); - - // @ts-expect-error an unknown name is the input under test - expect(theme.getTheme('no-such-theme').name).toBe('hyperdx'); - }); -}); diff --git a/packages/app/src/dfe/__tests__/useRowWhere.nativeJson.test.ts b/packages/app/src/dfe/__tests__/useRowWhere.nativeJson.test.ts index c30b1ee44..d56fb2be8 100644 --- a/packages/app/src/dfe/__tests__/useRowWhere.nativeJson.test.ts +++ b/packages/app/src/dfe/__tests__/useRowWhere.nativeJson.test.ts @@ -2,7 +2,7 @@ * A JSON column that ClickHouse returns already parsed must still hash. * * With a native JSON column the driver hands back an object, not the JSON text - * upstream's row-identity path assumed. Passing the object straight to MD5 + * upstream's row-identity path assumed. Passing the object straight to SHA256 * hashes "[object Object]", so every row in the table shares one identity and * the row side panel opens the wrong row. `useRowWhere.tsx` stringifies first - * this pins that. @@ -11,20 +11,20 @@ * upstream's. */ /* eslint-disable @typescript-eslint/no-unsafe-type-assertion -- - * The MD5 double returns only the `toString` the code under test calls, which - * is narrower than WordArray. The assertion IS the double. + * The SHA256 double returns only the `toString` the code under test calls, + * which is narrower than WordArray. The assertion IS the double. */ -import MD5 from 'crypto-js/md5'; +import SHA256 from 'crypto-js/sha256'; import { JSDataType } from '@hyperdx/common-utils/dist/clickhouse'; import { processRowToWhereClause } from '@/hooks/useRowWhere'; -jest.mock('crypto-js/md5'); +jest.mock('crypto-js/sha256'); beforeEach(() => { jest.clearAllMocks(); - (MD5 as jest.Mock).mockImplementation((value: string) => ({ - toString: () => `md5_${value}`, + (SHA256 as jest.Mock).mockImplementation((value: string) => ({ + toString: () => `sha256_${value}`, })); }); @@ -44,6 +44,6 @@ describe('processRowToWhereClause', () => { processRowToWhereClause({ data: { key: 'value' } }, columnMap); - expect(MD5).toHaveBeenCalledWith('{"key":"value"}'); + expect(SHA256).toHaveBeenCalledWith('{"key":"value"}'); }); }); diff --git a/packages/app/src/dfe/brand.tsx b/packages/app/src/dfe/brand.tsx new file mode 100644 index 000000000..74c2649df --- /dev/null +++ b/packages/app/src/dfe/brand.tsx @@ -0,0 +1,26 @@ +// The DFE name, marks and Mantine theme, read by upstream's brand/index.tsx and ThemeWrapper.tsx. +import UpstreamLogomark from '@/brand/Logomark'; +import UpstreamWordmark from '@/brand/Wordmark'; +import { theme as upstreamTheme } from '@/theme/mantineTheme'; +import DfeLogomark from '@/theme/themes/dfe/Logomark'; +import { theme as dfeTheme } from '@/theme/themes/dfe/mantineTheme'; +import DfeWordmark from '@/theme/themes/dfe/Wordmark'; + +// jest.dfe.setup.js sets this, so upstream's tests see the brand they assert. +const UPSTREAM_BRAND = process.env.DFE_UPSTREAM_BRAND === 'true'; + +const DFE_BRAND_DISPLAY_NAME = 'DFE'; + +export function dfeBrandName(upstreamName: string): string { + return UPSTREAM_BRAND ? upstreamName : DFE_BRAND_DISPLAY_NAME; +} + +export const Logomark: typeof UpstreamLogomark = UPSTREAM_BRAND + ? UpstreamLogomark + : DfeLogomark; + +export const Wordmark: typeof UpstreamWordmark = UPSTREAM_BRAND + ? UpstreamWordmark + : DfeWordmark; + +export const theme = UPSTREAM_BRAND ? upstreamTheme : dfeTheme; diff --git a/packages/app/src/hdxDebug.ts b/packages/app/src/hdxDebug.ts index c5d5981e7..d2d3c5e5c 100644 --- a/packages/app/src/hdxDebug.ts +++ b/packages/app/src/hdxDebug.ts @@ -1,5 +1,5 @@ import { z } from 'zod'; -import HyperDX from '@hyperdx/browser'; +import { getSessionId } from '@clickhouse/clickstack-browser'; import { APP_VERSION, @@ -134,14 +134,10 @@ export function setHdxIdentity(next: { dynamicFeatures = next.features ?? {}; } -// The RUM SDK only initializes in non-local mode and after /api/config resolves, -// so this accessor must tolerate it being absent. -function safeSessionId(): string | undefined { - try { - return HyperDX.getSessionId(); - } catch { - return undefined; - } +// Null until the RUM SDK has started, which needs /api/config and never happens +// in local mode. +function sessionId(): string | undefined { + return getSessionId() ?? undefined; } function getDevice(): HdxDevice { @@ -195,7 +191,7 @@ function buildReport(): string { `platform: ${device.platform}`, `language: ${device.language}`, `ua: ${device.userAgent}`, - `session: ${safeSessionId() || 'N/A'}`, + `session: ${sessionId() || 'N/A'}`, ]; return lines.join('\n'); } @@ -236,7 +232,7 @@ export function installHdxDebug(): void { get device() { return getDevice(); }, - sessionId: safeSessionId, + sessionId, report: buildReport, copy: async () => { const text = buildReport(); diff --git a/packages/app/src/hooks/__fixtures__/browserTraceEvents.ts b/packages/app/src/hooks/__fixtures__/browserTraceEvents.ts new file mode 100644 index 000000000..72d88ccd6 --- /dev/null +++ b/packages/app/src/hooks/__fixtures__/browserTraceEvents.ts @@ -0,0 +1,90 @@ +import { SourceKind } from '@hyperdx/common-utils/dist/types'; + +import type { BrowserEventLogSource } from '@/utils/browserTraceContext'; + +export const logSource: BrowserEventLogSource = { + id: 'logs', + kind: SourceKind.Log, + name: 'Logs', + connection: 'conn', + from: { databaseName: 'default', tableName: 'otel_logs' }, + timestampValueExpression: 'Timestamp', + defaultTableSelectExpression: 'Timestamp, Body', + implicitColumnExpression: 'Body', + serviceNameExpression: 'ServiceName', + eventNameExpression: 'EventName', + eventAttributesExpression: 'LogAttributes', + traceIdExpression: 'TraceId', + spanIdExpression: 'SpanId', +}; + +export const PAGE_URL = 'http://localhost:5173/'; +export const SPAN_START = '2026-10-22T04:52:37.818000000Z'; +export const SPAN_START_MS = Date.parse('2026-10-22T04:52:37.818Z'); +export const TIMING_TIMESTAMP = '2026-10-22T04:52:37.838000000Z'; +export const CLICK_TIMESTAMP = '2026-10-22T04:52:37.815000000Z'; + +export const browserSpan = { + Timestamp: SPAN_START, + Duration: 0.012, + SpanId: 'span-1', + ServiceName: 'web', + SpanAttributes: { + 'browser.document.url.full': PAGE_URL, + 'session.id': 's1', + }, +}; +export const legacySpan = { + ...browserSpan, + SpanAttributes: { 'http.url': 'http://localhost:5173/api' }, +}; + +const timingLogRow = { + id: 'timing-row', + Timestamp: TIMING_TIMESTAMP, + SpanId: 'span-1', + Body: '', +}; +export const consoleLogRow = { + id: 'console-row', + Timestamp: '2026-10-22T04:52:37.825000000Z', + SpanId: 'span-1', + Body: 'loading cart', +}; +export const logRows = [timingLogRow, consoleLogRow]; + +export const timingResult = { + data: [ + { + span_id: 'span-1', + timestamp: TIMING_TIMESTAMP, + attributes: { + 'browser.resource_timing.fetch_start': '1000.5', + 'browser.resource_timing.response_end': '1011.5', + }, + }, + ], + meta: [{ name: 'timestamp', type: 'DateTime64(9)' }], +}; + +export const clickResult = { + data: [ + { + timestamp: CLICK_TIMESTAMP, + event_name: 'browser.user_action.click', + session_id: 's1', + body: '', + attributes: { + 'browser.tag_name': 'BUTTON', + 'browser.element.attributes.testid': 'checkout', + }, + }, + ], + meta: [ + { name: 'timestamp', type: 'DateTime64(9)' }, + { name: 'event_name', type: 'String' }, + { name: 'session_id', type: 'String' }, + { name: 'body', type: 'String' }, + { name: 'attributes', type: 'Map(LowCardinality(String), String)' }, + ], +}; diff --git a/packages/app/src/hooks/__tests__/useBrowserTraceEvents.test.tsx b/packages/app/src/hooks/__tests__/useBrowserTraceEvents.test.tsx new file mode 100644 index 000000000..2a4874a62 --- /dev/null +++ b/packages/app/src/hooks/__tests__/useBrowserTraceEvents.test.tsx @@ -0,0 +1,275 @@ +import { SourceKind, TLogSource } from '@hyperdx/common-utils/dist/types'; +import { renderHook } from '@testing-library/react'; + +import { + browserSpan, + CLICK_TIMESTAMP, + clickResult, + consoleLogRow, + legacySpan, + logRows, + logSource, + TIMING_TIMESTAMP, + timingResult, +} from '@/hooks/__fixtures__/browserTraceEvents'; +import { useBrowserTraceEvents } from '@/hooks/useBrowserTraceEvents'; + +const mockUseQueriedChartConfig = jest.fn(); +const mockUseFieldExpressionGenerator = jest.fn(); + +jest.mock('@/hooks/useChartConfig', () => ({ + useQueriedChartConfig: (...args: unknown[]) => + mockUseQueriedChartConfig(...args), +})); +jest.mock('@/hooks/useFieldExpressionGenerator', () => ({ + __esModule: true, + default: (source?: TLogSource) => { + mockUseFieldExpressionGenerator(source); + return { + isLoading: false, + getFieldExpression: source + ? (column: string, key: string) => `${column}['${key}']` + : undefined, + }; + }, +})); + +const TIMING = 'TraceResourceTiming'; +const TRIGGER = 'TraceTriggerClick'; + +type Props = Parameters[0]; +type QueryState = { data?: unknown; isError?: boolean }; + +function setup( + props: Partial = {}, + queries: { [TIMING]?: QueryState; [TRIGGER]?: QueryState } = {}, +) { + const states: Record = { + [TIMING]: { data: timingResult, ...queries[TIMING] }, + [TRIGGER]: { data: clickResult, ...queries[TRIGGER] }, + }; + mockUseQueriedChartConfig.mockImplementation( + (_config: unknown, { queryKeyPrefix }: { queryKeyPrefix: string }) => ({ + isError: false, + ...states[queryKeyPrefix], + }), + ); + const initialProps: Props = { + traceRows: [browserSpan], + logRows, + logSource, + traceId: 't1', + foldTimingRows: true, + enabled: true, + ...props, + }; + const hook = renderHook((p: Props) => useBrowserTraceEvents(p), { + initialProps, + }); + return { ...hook, initialProps }; +} + +const lastQuery = (prefix: string) => + mockUseQueriedChartConfig.mock.calls.findLast( + ([, options]) => options.queryKeyPrefix === prefix, + ); +const queriesEnabled = () => ({ + timing: lastQuery(TIMING)?.[1].enabled, + trigger: lastQuery(TRIGGER)?.[1].enabled, +}); + +describe('useBrowserTraceEvents', () => { + beforeEach(() => { + mockUseQueriedChartConfig.mockReset(); + mockUseFieldExpressionGenerator.mockReset(); + }); + + it.each([ + ['legacy SDK spans', { traceRows: [legacySpan] }], + [ + 'a log source without an event name', + { logSource: { ...logSource, eventNameExpression: undefined } }, + ], + ['no log source', { logSource: null }], + ])('sends nothing and returns the rows as given for %s', (_name, props) => { + const { result, rerender, initialProps } = setup(props); + + expect(queriesEnabled()).toEqual({ timing: false, trigger: false }); + expect(mockUseFieldExpressionGenerator).toHaveBeenLastCalledWith(undefined); + expect(result.current.triggerRow).toBeUndefined(); + expect(result.current.logRows).toBe(logRows); + const markers = result.current.resourceTimingBySpanId; + expect(markers.size).toBe(0); + + rerender({ ...initialProps, traceRows: [...initialProps.traceRows] }); + expect(result.current.resourceTimingBySpanId).toBe(markers); + }); + + it('holds both queries while the trace fetches', () => { + setup({ enabled: false }); + + expect(queriesEnabled()).toEqual({ timing: false, trigger: false }); + }); + + it('queries the trace timing logs from the browser spans', () => { + setup(); + + expect(lastQuery(TIMING)).toEqual([ + expect.objectContaining({ + source: 'logs', + where: "TraceId = 't1'", + dateRange: [ + new Date('2026-10-22T04:52:37.000Z'), + new Date('2026-10-22T04:57:37.830Z'), + ], + }), + { enabled: true, queryKeyPrefix: TIMING, staleTime: Infinity }, + ]); + }); + + it("queries the clicks before the first browser span in the span's session", () => { + setup(); + + expect(mockUseFieldExpressionGenerator).toHaveBeenLastCalledWith(logSource); + expect(lastQuery(TRIGGER)).toEqual([ + expect.objectContaining({ + source: 'logs', + dateRange: [ + new Date('2026-10-22T04:52:37.000Z'), + new Date('2026-10-22T04:52:37.818Z'), + ], + filters: expect.arrayContaining([ + { type: 'lucene', condition: 'LogAttributes.session.id:"s1"' }, + ]), + }), + { enabled: true, queryKeyPrefix: TRIGGER, staleTime: Infinity }, + ]); + }); + + it('shows the click as a row with its log row id', () => { + const { result } = setup(); + + expect(result.current.triggerRow).toEqual({ + Timestamp: CLICK_TIMESTAMP, + Body: '', + SpanId: '', + type: SourceKind.Log, + id: `Timestamp=parseDateTime64BestEffort('${CLICK_TIMESTAMP}', 9) AND toString(EventName)='browser.user_action.click' AND LogAttributes['session.id']='s1' AND Body=''`, + aliasWith: [], + __hdx_hidden: false, + triggeredBy: 'Triggered by: Clicked testid=checkout · 3ms before', + }); + }); + + it('hides the click row with the span it anchors on', () => { + const { result } = setup({ + traceRows: [{ ...browserSpan, __hdx_hidden: true }], + }); + + expect(result.current.triggerRow?.__hdx_hidden).toBe(true); + }); + + it('skips the click lookup, metadata included, when the span has no session id', () => { + const { result } = setup({ + traceRows: [ + { + ...browserSpan, + SpanAttributes: { + 'browser.document.url.full': 'http://localhost:5173/', + }, + }, + ], + }); + + expect(mockUseFieldExpressionGenerator).toHaveBeenLastCalledWith(undefined); + expect(queriesEnabled()).toEqual({ timing: true, trigger: false }); + expect(result.current.triggerRow).toBeUndefined(); + }); + + it('shows no click row when the row id cannot be built', () => { + const consoleError = jest + .spyOn(console, 'error') + .mockImplementation(() => {}); + const { result } = setup( + {}, + { + [TRIGGER]: { + data: { ...clickResult, meta: clickResult.meta.slice(0, 1) }, + }, + }, + ); + + expect(result.current.triggerRow).toBeUndefined(); + expect(consoleError).toHaveBeenCalled(); + consoleError.mockRestore(); + }); + + it('draws the timing log as dots and folds its row, keeping another log on the span', () => { + const { result } = setup(); + + expect( + result.current.resourceTimingBySpanId.get('span-1')?.map(m => m.name), + ).toEqual(['fetchStart', 'responseEnd']); + expect(result.current.logRows).toEqual([consoleLogRow]); + }); + + it("keeps a log in the timing log's millisecond on its span, and the timing row", () => { + const errorRow = { + ...consoleLogRow, + id: 'error-row', + Timestamp: TIMING_TIMESTAMP, + Body: '', + }; + const { result } = setup({ logRows: [...logRows, errorRow] }); + + expect(result.current.resourceTimingBySpanId.has('span-1')).toBe(true); + expect(result.current.logRows).toEqual([...logRows, errorRow]); + }); + + it('keeps the timing row while its dots are off screen', () => { + const { result, rerender, initialProps } = setup({ + foldTimingRows: false, + }); + + expect(result.current.resourceTimingBySpanId.has('span-1')).toBe(true); + expect(result.current.logRows).toBe(logRows); + + rerender({ ...initialProps, foldTimingRows: true }); + expect(result.current.logRows).toEqual([consoleLogRow]); + }); + + it('changes nothing when the queries fail', () => { + const { result } = setup( + {}, + { [TIMING]: { isError: true }, [TRIGGER]: { isError: true } }, + ); + + expect(result.current.logRows).toBe(logRows); + expect(result.current.resourceTimingBySpanId.size).toBe(0); + expect(result.current.triggerRow).toBeUndefined(); + }); + + it('keeps the selected timing row until another row is selected', () => { + const { result, rerender, initialProps } = setup({ + highlightedRowWhere: 'timing-row', + }); + + expect(result.current.logRows).toEqual(logRows); + expect(result.current.resourceTimingBySpanId.has('span-1')).toBe(true); + + rerender({ ...initialProps, highlightedRowWhere: 'console-row' }); + expect(result.current.logRows).toEqual([consoleLogRow]); + }); + + it('keeps the timing row the panel was opened from', () => { + const { result } = setup({ + initialRowHighlightHint: { + timestamp: TIMING_TIMESTAMP, + spanId: 'span-1', + body: '', + }, + }); + + expect(result.current.logRows).toEqual(logRows); + }); +}); diff --git a/packages/app/src/hooks/__tests__/useDenoisedRows.test.tsx b/packages/app/src/hooks/__tests__/useDenoisedRows.test.tsx new file mode 100644 index 000000000..252fe5f71 --- /dev/null +++ b/packages/app/src/hooks/__tests__/useDenoisedRows.test.tsx @@ -0,0 +1,176 @@ +import { + BuilderChartConfigWithDateRange, + SourceKind, + TSource, +} from '@hyperdx/common-utils/dist/types'; +import { renderHook } from '@testing-library/react'; + +import { findBodyResultColumn, useDenoisedRows } from '@/hooks/useDenoisedRows'; +import { useGroupedPatterns } from '@/hooks/usePatterns'; + +jest.mock('@/hooks/usePatterns', () => ({ + LEVEL_COLUMN_ALIAS: '__hdx_level', + DRAIN_EXTRA_DELIMITERS: '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'.split(''), + useGroupedPatterns: jest.fn(), +})); + +const mockUseGroupedPatterns = jest.mocked(useGroupedPatterns); + +const source = { + id: 'logs', + kind: SourceKind.Log, + bodyExpression: 'Body', + severityTextExpression: 'SeverityText', +} as unknown as TSource; + +const config = (select: string): BuilderChartConfigWithDateRange => ({ + select, + from: { databaseName: 'default', tableName: 'otel_logs' }, + where: '', + timestampValueExpression: 'Timestamp', + connection: 'local', + dateRange: [new Date('2026-01-01'), new Date('2026-01-02')], +}); + +describe('findBodyResultColumn', () => { + it('finds the body by its position in the select list', () => { + expect( + findBodyResultColumn( + "Timestamp, Body AS msg, LogAttributes['k'] AS k", + ['Timestamp', 'msg', 'k'], + 'Body', + ), + ).toBe('msg'); + }); + + it('falls back to the column name for SELECT *', () => { + expect(findBodyResultColumn('*', ['Timestamp', 'Body'], 'Body')).toBe( + 'Body', + ); + }); + + it('returns undefined when the body is not selected', () => { + expect( + findBodyResultColumn( + 'Timestamp, ServiceName', + ['Timestamp', 'ServiceName'], + 'Body', + ), + ).toBeUndefined(); + }); +}); + +const patternQueryState = { + isLoading: false, + error: null, + miner: undefined, + patternQueryConfig: undefined, +}; + +describe('useDenoisedRows', () => { + beforeEach(() => { + mockUseGroupedPatterns.mockReturnValue({ + data: { + '1': { + id: '1', + pattern: 'info cache refreshed for <*>', + count: 80, + samples: [{ __hdx_level: 'info' }], + }, + '2': { + id: '2', + pattern: 'user <*> logged in', + count: 5, + samples: [{ __hdx_level: 'info' }], + }, + }, + sampledRowCount: 100, + clusterTemplates: { + '1': 'info cache refreshed for <*>', + '2': 'user <*> logged in', + }, + ...patternQueryState, + }); + }); + + it('removes noisy rows by the body column, not the last column', () => { + const rows = [ + { Body: '\x1b[32minfo\x1b[39m: cache refreshed for ab12', k: 'x' }, + { Body: 'user bob logged in', k: 'y' }, + { Body: null, k: 'z' }, + ]; + const { result } = renderHook(() => + useDenoisedRows({ + config: config("Timestamp, Body, LogAttributes['k'] AS k"), + source, + columns: ['Timestamp', 'Body', 'k'], + rows, + enabled: true, + }), + ); + expect(mockUseGroupedPatterns).toHaveBeenLastCalledWith( + expect.objectContaining({ bodyValueExpression: 'Body', enabled: true }), + ); + expect(result.current.skipped).toBeUndefined(); + expect(result.current.noisyPatterns.map(p => p.id)).toEqual(['1']); + expect(result.current.rows).toEqual([rows[1], rows[2]]); + }); + + it('never hides a pattern with error or warning samples', () => { + mockUseGroupedPatterns.mockReturnValue({ + ...patternQueryState, + sampledRowCount: 100, + data: { + '1': { + id: '1', + pattern: 'connection refused to <*>', + count: 80, + samples: [{ __hdx_level: 'INFO' }, { __hdx_level: 'ERROR' }], + }, + '2': { + id: '2', + pattern: 'user <*> logged in', + count: 20, + samples: [{ __hdx_level: 'info' }], + }, + }, + clusterTemplates: { + '1': 'connection refused to <*>', + '2': 'user <*> logged in', + }, + }); + const rows = [ + { Body: 'connection refused to db1' }, + { Body: 'user bob logged in' }, + ]; + const { result } = renderHook(() => + useDenoisedRows({ + config: config('Timestamp, Body'), + source, + columns: ['Timestamp', 'Body'], + rows, + enabled: true, + }), + ); + expect(result.current.noisyPatterns.map(p => p.id)).toEqual(['2']); + expect(result.current.rows).toEqual([rows[0]]); + }); + + it('skips denoising when the body is not in the results', () => { + const rows = [{ ServiceName: 'api' }]; + const { result } = renderHook(() => + useDenoisedRows({ + config: config('Timestamp, ServiceName'), + source, + columns: ['Timestamp', 'ServiceName'], + rows, + enabled: true, + }), + ); + expect(mockUseGroupedPatterns).toHaveBeenLastCalledWith( + expect.objectContaining({ enabled: false }), + ); + expect(result.current.skipped).toBe('body_not_in_results'); + expect(result.current.rows).toBe(rows); + }); +}); diff --git a/packages/app/src/hooks/__tests__/useMetadata.test.tsx b/packages/app/src/hooks/__tests__/useMetadata.test.tsx index 1078a8320..58fd549a0 100644 --- a/packages/app/src/hooks/__tests__/useMetadata.test.tsx +++ b/packages/app/src/hooks/__tests__/useMetadata.test.tsx @@ -18,6 +18,7 @@ import { deduplicate2dArray, intersect2dArray, useGetKeyValues, + useMergeTreeSettings, useMultipleAllFields, useMultipleGetKeyValues, } from '@/hooks/useMetadata'; @@ -948,6 +949,62 @@ describe('useMultipleAllFields', () => { }); }); +describe('useMergeTreeSettings', () => { + let wrapper: React.ComponentType<{ children: any }>; + let mockMetadata: Metadata; + const settings = new Map([['enable_block_number_column', '1']]); + + beforeEach(() => { + jest.clearAllMocks(); + mockMetadata = createMockMetadata(); + jest.spyOn(metadataModule, 'getMetadata').mockReturnValue(mockMetadata); + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false } }, + }); + wrapper = ({ children }) => ( + {children} + ); + }); + + it('keeps a successful result fresh across mounts', async () => { + const spy = jest + .spyOn(mockMetadata, 'getMergeTreeSettings') + .mockResolvedValue(settings); + + const first = renderHook(() => useMergeTreeSettings('conn1'), { wrapper }); + await waitFor(() => expect(first.result.current.data).toEqual(settings)); + first.unmount(); + + const second = renderHook(() => useMergeTreeSettings('conn1'), { wrapper }); + expect(second.result.current.data).toEqual(settings); + expect(spy).toHaveBeenCalledTimes(1); + }); + + it('returns null on failure and refetches on the next mount', async () => { + const spy = jest + .spyOn(mockMetadata, 'getMergeTreeSettings') + .mockResolvedValueOnce(undefined) + .mockResolvedValueOnce(settings); + + const first = renderHook(() => useMergeTreeSettings('conn1'), { wrapper }); + await waitFor(() => expect(first.result.current.data).toBeNull()); + first.unmount(); + + const second = renderHook(() => useMergeTreeSettings('conn1'), { wrapper }); + await waitFor(() => expect(second.result.current.data).toEqual(settings)); + expect(spy).toHaveBeenCalledTimes(2); + }); + + it('does not query without a connection', () => { + const spy = jest.spyOn(mockMetadata, 'getMergeTreeSettings'); + + const { result } = renderHook(() => useMergeTreeSettings(''), { wrapper }); + + expect(result.current.isLoading).toBe(false); + expect(spy).not.toHaveBeenCalled(); + }); +}); + describe('deduplicate2dArray', () => { // Test basic deduplication it('should remove duplicate objects across 2D array', () => { diff --git a/packages/app/src/hooks/__tests__/useOnClickLinkBuilder.test.tsx b/packages/app/src/hooks/__tests__/useOnClickLinkBuilder.test.tsx index 9ab42e0d1..fa78feda9 100644 --- a/packages/app/src/hooks/__tests__/useOnClickLinkBuilder.test.tsx +++ b/packages/app/src/hooks/__tests__/useOnClickLinkBuilder.test.tsx @@ -9,6 +9,13 @@ import { renderHook } from '@testing-library/react'; import { useDashboards } from '@/dashboard'; import { useOnClickLinkBuilder } from '@/hooks/useOnClickLinkBuilder'; import { useSources } from '@/source'; +import { TimeZoneOverrideProvider } from '@/timeZoneOverride'; + +let mockTz: string | null = null; +jest.mock('nuqs', () => ({ + parseAsString: {}, + useQueryState: () => [mockTz, jest.fn()], +})); jest.mock('@/source', () => ({ useSources: jest.fn(), @@ -86,6 +93,37 @@ describe('useOnClickLinkBuilder', () => { expect(action.url!.startsWith('/dashboards/dash_1?')).toBe(true); }); + it("adds the page's time zone override to search and dashboard links", () => { + mockTz = 'Asia/Tokyo'; + const wrapper = ({ children }: { children: React.ReactNode }) => ( + {children} + ); + const tzOf = (onClick: OnClickSearch | OnClickDashboard) => { + const { result } = renderHook( + () => useOnClickLinkBuilder({ onClick, dateRange }), + { wrapper }, + ); + const url = result.current!({}).url!; + return new URLSearchParams(url.split('?')[1]).get('tz'); + }; + + expect( + tzOf({ + type: 'search', + target: { mode: 'id', id: 'src_1' }, + whereLanguage: 'sql', + }), + ).toBe('Asia/Tokyo'); + expect( + tzOf({ + type: 'dashboard', + target: { mode: 'id', id: 'dash_1' }, + whereLanguage: 'sql', + }), + ).toBe('Asia/Tokyo'); + mockTz = null; + }); + it('resolves an external link to an absolute URL marked external', () => { const onClick: OnClickExternal = { type: 'external', diff --git a/packages/app/src/hooks/__tests__/useRowWhere.test.tsx b/packages/app/src/hooks/__tests__/useRowWhere.test.tsx index 90b1aed0f..8def46be7 100644 --- a/packages/app/src/hooks/__tests__/useRowWhere.test.tsx +++ b/packages/app/src/hooks/__tests__/useRowWhere.test.tsx @@ -1,14 +1,103 @@ -import MD5 from 'crypto-js/md5'; +import SHA256 from 'crypto-js/sha256'; import { ColumnMetaType, JSDataType, } from '@hyperdx/common-utils/dist/clickhouse'; +import { + LEFT_UTF8_HASH_CODE_POINTS, + leftUtf8Prefix, +} from '@hyperdx/common-utils/dist/core/utils'; import { renderHook } from '@testing-library/react'; import useRowWhere, { processRowToWhereClause } from '@/hooks/useRowWhere'; -// Mock crypto-js/md5 -jest.mock('crypto-js/md5'); +type Sha256WhereKind = 'json' | 'leftUtf8'; + +type Sha256TestCase = { + /** ClickHouse expression this hash was verified against. */ + clickHouse: string; + columnMeta: ColumnMetaType[]; + input: string; + expected: string; + whereKind: Sha256WhereKind; +}; + +const SHA256_TEST_CASES: Record = { + 'simple JSON object': { + clickHouse: 'lower(hex(SHA256(toString(\'{"key": "value"}\'))))', + columnMeta: [{ name: 'data', type: 'JSON' }], + input: '{"key": "value"}', + expected: + '9724c1e20e6e3e4d7f57ed25f9d4efb006e508590d528c90da597f6a775c13e5', + whereKind: 'json', + }, + 'actual log line': { + clickHouse: 'lower(hex(SHA256()))', + columnMeta: [{ name: 'Body', type: 'JSON' }], + input: + '{"caller":"github.com/cloudzero/cloudzero-agent/app/domain/shipper/shipper.go:289","level":"info","message":"Successfully ran the shipper cycle","time":"2026-10-18T00:00:03Z","version":"5d05872b1f292e4bf481c61b187494b9bafff6a8.1.2.10-2026-03-24_02:00:46PM"}', + expected: + '9bf1e18eb79cfe32fa7abb7c2b5370085a73eb299ffaaa526393084c8681c0b8', + whereKind: 'json', + }, + '600-char string': { + clickHouse: "lower(hex(SHA256(repeat('a', 600))))", + columnMeta: [{ name: 'description', type: 'String' }], + input: 'a'.repeat(600), + expected: + 'ba35c170729417f1499e0886e7e12fcdb4ab00ad411110ae1e888c766d4ed70d', + whereKind: 'leftUtf8', + }, + '2000-char string truncated to 1000 code points': { + clickHouse: "lower(hex(SHA256(leftUTF8(repeat('a', 2000), 1000))))", + columnMeta: [{ name: 'description', type: 'String' }], + input: 'a'.repeat(2000), + expected: + '41edece42d63e8d9bf515a9ba6932e1c20cbc9f5a5d134645adb5db1b9737ea3', + whereKind: 'leftUtf8', + }, + '600 emoji code points': { + clickHouse: "lower(hex(SHA256(leftUTF8(repeat('😀', 600), 1000))))", + columnMeta: [{ name: 'description', type: 'String' }], + input: '😀'.repeat(600), + expected: + '7f22fd88b289648f5f2a8f290d1010a0cefcf260777d613f34f9fb7948db3e43', + whereKind: 'leftUtf8', + }, +}; + +function sha256RowWhere( + columnName: string, + whereKind: Sha256WhereKind, + hash: string, +): string { + if (whereKind === 'json') { + return `lower(hex(SHA256(toString(${columnName}))))='${hash}'`; + } + return `lower(hex(SHA256(leftUTF8(${columnName}, 1000))))='${hash}'`; +} + +function jsTypeForSha256Column(chType: string): JSDataType { + if (chType === 'JSON') { + return JSDataType.JSON; + } + return JSDataType.String; +} + +function columnMapForSha256TestCase(testCase: Sha256TestCase) { + const { name, type } = testCase.columnMeta[0]!; + return new Map([ + [ + name, + { + name, + type, + valueExpr: name, + jsType: jsTypeForSha256Column(type), + }, + ], + ]); +} // Mock convertCHDataTypeToJSType jest.mock('@hyperdx/common-utils/dist/clickhouse', () => ({ @@ -28,14 +117,20 @@ jest.mock('@hyperdx/common-utils/dist/clickhouse', () => ({ }), })); -describe('processRowToWhereClause', () => { - beforeEach(() => { - jest.clearAllMocks(); - (MD5 as jest.Mock).mockImplementation((value: string) => ({ - toString: () => `md5_${value}`, - })); - }); +describe('SHA256 matches ClickHouse lower(hex(SHA256(...)))', () => { + it.each(Object.entries(SHA256_TEST_CASES))( + 'matches ClickHouse for %s', + (_label, testCase) => { + const inputForHash = + testCase.whereKind === 'leftUtf8' + ? leftUtf8Prefix(testCase.input, LEFT_UTF8_HASH_CODE_POINTS) + : testCase.input; + expect(SHA256(inputForHash).toString()).toBe(testCase.expected); + }, + ); +}); +describe('processRowToWhereClause', () => { it('should handle string columns', () => { const columnMap = new Map([ [ @@ -116,27 +211,20 @@ describe('processRowToWhereClause', () => { ); }); - it('should handle JSON columns with MD5', () => { - const columnMap = new Map([ - [ - 'data', - { - name: 'data', - type: 'JSON', - valueExpr: 'data', - jsType: JSDataType.JSON, - }, - ], - ]); + it.each(Object.entries(SHA256_TEST_CASES))( + 'SHA256 row WHERE matches ClickHouse for %s', + (_label, testCase) => { + const columnName = testCase.columnMeta[0]!.name; + const result = processRowToWhereClause( + { [columnName]: testCase.input }, + columnMapForSha256TestCase(testCase), + ); - const row = { data: '{"key": "value"}' }; - const result = processRowToWhereClause(row, columnMap); - - expect(result).toBe( - 'lower(hex(MD5(toString(data))))=\'md5_{\\"key\\": \\"value\\"}\'', - ); - expect(MD5).toHaveBeenCalledWith('{"key": "value"}'); - }); + expect(result).toBe( + sha256RowWhere(columnName, testCase.whereKind, testCase.expected), + ); + }, + ); it('should handle Dynamic columns with null value', () => { const columnMap = new Map([ @@ -266,29 +354,6 @@ describe('processRowToWhereClause', () => { ); }); - it('should handle long strings with MD5', () => { - const columnMap = new Map([ - [ - 'description', - { - name: 'description', - type: 'String', - valueExpr: 'description', - jsType: JSDataType.String, - }, - ], - ]); - - const longString = 'a'.repeat(600); - const row = { description: longString }; - const result = processRowToWhereClause(row, columnMap); - - expect(result).toBe( - `lower(hex(MD5(leftUTF8(description, 1000))))='md5_${'a'.repeat(600)}'`, - ); - expect(MD5).toHaveBeenCalledWith('a'.repeat(600)); - }); - it('should handle multiple columns with AND', () => { const columnMap = new Map([ [ @@ -446,13 +511,6 @@ describe('processRowToWhereClause', () => { }); describe('useRowWhere', () => { - beforeEach(() => { - jest.clearAllMocks(); - (MD5 as jest.Mock).mockImplementation((value: string) => ({ - toString: () => `md5_${value}`, - })); - }); - it('should return a function that processes rows', () => { const meta: ColumnMetaType[] = [ { name: 'id', type: 'String' }, diff --git a/packages/app/src/hooks/__tests__/useServiceMap.test.ts b/packages/app/src/hooks/__tests__/useServiceMap.test.ts index 9c66e1d03..0308cef71 100644 --- a/packages/app/src/hooks/__tests__/useServiceMap.test.ts +++ b/packages/app/src/hooks/__tests__/useServiceMap.test.ts @@ -1,8 +1,28 @@ +import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig'; +import { SourceKind, TTraceSource } from '@hyperdx/common-utils/dist/types'; + import { aggregateServiceMapData, + getServiceMapQuery, + serviceMapErrorCountSql, + serviceMapNodeKey, SpanAggregationRow, } from '@/hooks/useServiceMap'; +// The two CTEs are rendered by renderChartConfig; the shape of the outer join +// and grouping query is what these tests pin down. +jest.mock('@hyperdx/common-utils/dist/core/renderChartConfig', () => ({ + renderChartConfig: jest.fn(), +})); + +describe('serviceMapErrorCountSql', () => { + it('counts short and legacy error statuses, not only Error', () => { + expect(serviceMapErrorCountSql()).toBe( + "countIf(lower(ServerSpans.statusCode) IN ('error', 'status_code_error'))", + ); + }); +}); + // Convenience builders for the GROUPING SETS row shapes. function nodeRow( serverServiceName: string, @@ -12,6 +32,7 @@ function nodeRow( ): SpanAggregationRow { return { serverServiceName, + serverDimensions: [], isNodeLevel: true, requestCount, errorCount, @@ -28,6 +49,7 @@ function edgeRow( ): SpanAggregationRow { return { serverServiceName, + serverDimensions: [], clientServiceName, isNodeLevel: false, requestCount, @@ -223,6 +245,7 @@ describe('aggregateServiceMapData', () => { const result = aggregateServiceMapData([ { serverServiceName: 'api', + serverDimensions: [], isNodeLevel: true, requestCount: 10, errorCount: 0, @@ -250,6 +273,131 @@ describe('aggregateServiceMapData', () => { }); }); + describe('extra group-by dimensions', () => { + // Rows as the query returns them when grouped by one extra expression. + function dimNodeRow( + serverServiceName: string, + serverDimensions: string[], + requestCount: number, + ): SpanAggregationRow { + return { + serverServiceName, + serverDimensions, + isNodeLevel: true, + requestCount, + errorCount: 0, + }; + } + + function dimEdgeRow( + serverServiceName: string, + serverDimensions: string[], + clientServiceName: string, + clientDimensions: string[], + requestCount: number, + ): SpanAggregationRow { + return { + serverServiceName, + serverDimensions, + clientServiceName, + clientDimensions, + isNodeLevel: false, + requestCount, + errorCount: 0, + }; + } + + it('keys nodes by the (serviceName, ...dimensions) tuple', () => { + const result = aggregateServiceMapData([ + dimNodeRow('api', ['api-pod-0'], 60), + dimNodeRow('api', ['api-pod-1'], 40), + ]); + + const pod0 = serviceMapNodeKey('api', ['api-pod-0']); + const pod1 = serviceMapNodeKey('api', ['api-pod-1']); + expect(new Set(result.keys())).toEqual(new Set([pod0, pod1])); + expect(result.get(pod0)).toMatchObject({ + key: pod0, + serviceName: 'api', + dimensions: ['api-pod-0'], + }); + expect(result.get(pod0)!.incomingRequests.totalRequests).toBe(60); + expect(result.get(pod1)!.incomingRequests.totalRequests).toBe(40); + }); + + it('keeps a caller node whose dimensions match no server node', () => { + // A span-level expression is evaluated on the client span, i.e. with the + // callee's value, so the caller side of an edge can name a node that + // receives no traffic itself. It is still drawn so the edge has a source. + const result = aggregateServiceMapData([ + dimNodeRow('web', ['/home'], 20), + dimNodeRow('api', ['GetUser'], 5), + dimEdgeRow('api', ['GetUser'], 'web', ['GetUser'], 5), + ]); + + const caller = result.get(serviceMapNodeKey('web', ['GetUser']))!; + expect(caller.incomingRequests.totalRequests).toBe(0); + expect(caller.outgoingRequests).toBe(5); + expect( + result.get(serviceMapNodeKey('web', ['/home']))!.outgoingRequests, + ).toBe(0); + }); + + it('draws an edge between two pods of the same service', () => { + const result = aggregateServiceMapData([ + dimNodeRow('api', ['api-pod-1'], 10), + dimEdgeRow('api', ['api-pod-1'], 'api', ['api-pod-0'], 10), + ]); + + const pod0 = serviceMapNodeKey('api', ['api-pod-0']); + const pod1 = serviceMapNodeKey('api', ['api-pod-1']); + expect(result.size).toBe(2); + expect( + result.get(pod1)!.incomingRequestsByClient.get(pod0), + ).toMatchObject({ totalRequests: 10 }); + expect(result.get(pod0)!.outgoingRequests).toBe(10); + }); + + it('keys edges by the client tuple, so clients with different dimensions stay distinct', () => { + const result = aggregateServiceMapData([ + dimNodeRow('api', ['api-pod-0'], 30), + dimEdgeRow('api', ['api-pod-0'], 'web', ['web-pod-0'], 10), + dimEdgeRow('api', ['api-pod-0'], 'web', ['web-pod-1'], 20), + ]); + + const api = result.get(serviceMapNodeKey('api', ['api-pod-0']))!; + expect(api.incomingRequestsByClient.size).toBe(2); + expect( + result.get(serviceMapNodeKey('web', ['web-pod-1']))!.outgoingRequests, + ).toBe(20); + }); + + it('treats an empty dimension value as its own node', () => { + const result = aggregateServiceMapData([ + dimNodeRow('api', [''], 5), + dimNodeRow('api', ['api-pod-0'], 7), + ]); + + const none = result.get(serviceMapNodeKey('api', ['']))!; + expect(none.dimensions).toEqual(['']); + expect(none.incomingRequests.totalRequests).toBe(5); + expect(result.size).toBe(2); + }); + + it('keys by service name alone when there are no dimensions', () => { + expect(serviceMapNodeKey('api', [])).toBe('api'); + const result = aggregateServiceMapData([ + nodeRow('api', 1, 0), + edgeRow('api', 'web', 1, 0), + ]); + expect(result.get('api')).toMatchObject({ + key: 'api', + dimensions: [], + }); + expect(result.get('api')!.incomingRequestsByClient.has('web')).toBe(true); + }); + }); + describe('data structure integrity', () => { it('does not mutate the input rows', () => { const data: SpanAggregationRow[] = [ @@ -262,3 +410,112 @@ describe('aggregateServiceMapData', () => { }); }); }); + +describe('getServiceMapQuery', () => { + const source: TTraceSource = { + id: 'src', + name: 'Traces', + kind: SourceKind.Trace, + connection: 'conn', + from: { databaseName: 'default', tableName: 'otel_traces' }, + timestampValueExpression: 'Timestamp', + defaultTableSelectExpression: 'Timestamp', + traceIdExpression: 'TraceId', + spanIdExpression: 'SpanId', + parentSpanIdExpression: 'ParentSpanId', + serviceNameExpression: 'ServiceName', + spanKindExpression: 'SpanKind', + statusCodeExpression: 'StatusCode', + durationExpression: 'Duration', + durationPrecision: 9, + } as TTraceSource; + + const dateRange: [Date, Date] = [ + new Date('2024-01-01T00:00:00Z'), + new Date('2024-01-01T01:00:00Z'), + ]; + + const normalize = (sql: string) => sql.replace(/\s+/g, ' ').trim(); + + async function render(groupBy?: string[]) { + jest + .mocked(renderChartConfig) + .mockResolvedValueOnce({ sql: 'SERVER_CTE', params: {} }) + .mockResolvedValueOnce({ sql: 'CLIENT_CTE', params: {} }); + const query = await getServiceMapQuery({ + source, + dateRange, + metadata: {} as any, + samplingFactor: 1, + groupBy, + }); + return normalize(query.sql); + } + + beforeEach(() => { + jest.mocked(renderChartConfig).mockReset(); + }); + + it('groups by service name only when no dimensions are given', async () => { + const sql = await render([]); + + expect(sql).toContain( + 'WHERE (ClientSpans.serviceName IS NULL OR tuple(ServerSpans.serviceName) != tuple(ClientSpans.serviceName))', + ); + expect(sql).toContain( + 'GROUP BY GROUPING SETS ( (ServerSpans.serviceName, ClientSpans.serviceName), (ServerSpans.serviceName) )', + ); + expect(sql).toContain( + 'SELECT ServerSpans.serviceName AS server_serviceName, ClientSpans.serviceName AS client_serviceName, GROUPING(ClientSpans.serviceName) AS isNodeLevel', + ); + expect(sql).toContain( + 'ORDER BY server_serviceName, isNodeLevel, client_serviceName', + ); + expect(sql).not.toContain('dim0'); + + const [serverConfig] = jest.mocked(renderChartConfig).mock.calls[0]; + expect(serverConfig).not.toMatchObject({ + select: expect.arrayContaining([ + expect.objectContaining({ alias: 'dim0' }), + ]), + }); + }); + + it('selects each dimension as a non-nullable string and keys both sides of the join by it', async () => { + const sql = await render([ + "ResourceAttributes['k8s.pod.name']", + "SpanAttributes['http.route']", + ]); + + expect(jest.mocked(renderChartConfig).mock.calls).toHaveLength(2); + for (const [config] of jest.mocked(renderChartConfig).mock.calls) { + expect(config).toMatchObject({ + select: expect.arrayContaining([ + { + valueExpression: + "ifNull(toString(ResourceAttributes['k8s.pod.name']), '')", + alias: 'dim0', + }, + { + valueExpression: + "ifNull(toString(SpanAttributes['http.route']), '')", + alias: 'dim1', + }, + ]), + }); + } + + expect(sql).toContain( + 'SELECT ServerSpans.serviceName AS server_serviceName, ClientSpans.serviceName AS client_serviceName, ServerSpans.dim0 AS server_dim0, ClientSpans.dim0 AS client_dim0, ServerSpans.dim1 AS server_dim1, ClientSpans.dim1 AS client_dim1, GROUPING(ClientSpans.serviceName) AS isNodeLevel', + ); + expect(sql).toContain( + 'tuple(ServerSpans.serviceName, ServerSpans.dim0, ServerSpans.dim1) != tuple(ClientSpans.serviceName, ClientSpans.dim0, ClientSpans.dim1)', + ); + expect(sql).toContain( + 'GROUP BY GROUPING SETS ( (ServerSpans.serviceName, ServerSpans.dim0, ServerSpans.dim1, ClientSpans.serviceName, ClientSpans.dim0, ClientSpans.dim1), (ServerSpans.serviceName, ServerSpans.dim0, ServerSpans.dim1) )', + ); + expect(sql).toContain( + 'ORDER BY server_serviceName, server_dim0, server_dim1, isNodeLevel, client_serviceName, client_dim0, client_dim1', + ); + }); +}); diff --git a/packages/app/src/hooks/useBrowserTraceEvents.ts b/packages/app/src/hooks/useBrowserTraceEvents.ts new file mode 100644 index 000000000..0f72b6c29 --- /dev/null +++ b/packages/app/src/hooks/useBrowserTraceEvents.ts @@ -0,0 +1,220 @@ +import { useMemo } from 'react'; +import { SourceKind, TLogSource } from '@hyperdx/common-utils/dist/types'; + +import { useQueriedChartConfig } from '@/hooks/useChartConfig'; +import useFieldExpressionGenerator from '@/hooks/useFieldExpressionGenerator'; +import { + matchesRowHighlightHint, + RowHighlightHint, +} from '@/hooks/useRowHighlightHint'; +import useRowWhere, { WithClause } from '@/hooks/useRowWhere'; +import { PLACEHOLDER_CONFIG } from '@/hooks/useSessionLogEvents'; +import { formatDurationMs } from '@/utils'; +import { getBrowserEventLabel } from '@/utils/browserEvents'; +import { + BrowserTraceRow, + getBrowserTraceContext, + isBrowserEventLogSource, +} from '@/utils/browserTraceContext'; +import { + buildResourceTimingQuery, + getFoldedRowKeys, + getResourceTimingMarkers, + ResourceTimingMarker, + resourceTimingRowKey, +} from '@/utils/resourceTimingMarkers'; +import { SESSION_LOG_EVENT_KEY_COLUMNS } from '@/utils/sessionLogEvents'; +import { + buildTriggerClickQuery, + pickTriggerClick, +} from '@/utils/traceTriggerClick'; + +type TraceRow = BrowserTraceRow & { SpanId?: unknown }; + +type LogRow = { + id: string; + Timestamp: string; + SpanId?: unknown; + Body?: unknown; +}; + +/** The click that triggered the trace, as a waterfall log row. */ +export type TraceTriggerRow = { + Timestamp: string; + Body: string; + SpanId: string; + type: SourceKind.Log; + id: string; + aliasWith: WithClause[]; + __hdx_hidden: boolean; + triggeredBy: string; +}; + +// Stable, so the waterfall's row memos don't rerun while there is nothing. +const NO_RESOURCE_TIMING: ReturnType = { + markersBySpanId: new Map(), + drawnRowCounts: new Map(), +}; + +/** + * Traces without an OTel browser span send no queries. The queries never hold + * the waterfall, and a failed one changes nothing. + */ +export function useBrowserTraceEvents({ + traceRows, + logRows, + logSource, + traceId, + highlightedRowWhere, + initialRowHighlightHint, + foldTimingRows, + enabled, +}: { + traceRows: readonly TraceRow[]; + logRows: T[]; + logSource: TLogSource | null; + traceId: string; + highlightedRowWhere?: string | null; + initialRowHighlightHint?: RowHighlightHint; + /** Whether the dots are on screen to replace the rows. */ + foldTimingRows: boolean; + /** False while the trace rows fetch, so the anchor can't move mid-flight. */ + enabled: boolean; +}): { + logRows: T[]; + resourceTimingBySpanId: ReadonlyMap; + triggerRow: TraceTriggerRow | undefined; +} { + const context = useMemo(() => getBrowserTraceContext(traceRows), [traceRows]); + const source = + context != null && isBrowserEventLogSource(logSource) + ? logSource + : undefined; + + const timingQuery = useMemo( + () => + source != null && context != null + ? buildResourceTimingQuery({ logSource: source, context, traceId }) + : null, + [source, context, traceId], + ); + // Never stale, like the waterfall's own queries: another window is another + // key. Otherwise each trace refetch would rerun both. + const timing = useQueriedChartConfig(timingQuery ?? PLACEHOLDER_CONFIG, { + enabled: enabled && timingQuery != null, + queryKeyPrefix: 'TraceResourceTiming', + staleTime: Infinity, + }); + const timingResult = + timingQuery != null && !timing.isError ? timing.data : undefined; + const { markersBySpanId, drawnRowCounts } = useMemo( + () => + timingResult?.data.length + ? getResourceTimingMarkers(timingResult, traceRows) + : NO_RESOURCE_TIMING, + [timingResult, traceRows], + ); + + // The selected row and the row the panel opened from stay: folding them + // would leave the detail panel showing a row the waterfall lacks, and the + // hint would find nothing to select. + const keptLogRows = useMemo(() => { + if (!foldTimingRows || drawnRowCounts.size === 0) { + return logRows; + } + const foldedRowKeys = getFoldedRowKeys(logRows, drawnRowCounts); + if (foldedRowKeys.size === 0) { + return logRows; + } + return logRows.filter( + row => + !foldedRowKeys.has(resourceTimingRowKey(row.SpanId, row.Timestamp)) || + row.id === highlightedRowWhere || + matchesRowHighlightHint(row, initialRowHighlightHint), + ); + }, [ + logRows, + foldTimingRows, + drawnRowCounts, + highlightedRowWhere, + initialRowHighlightHint, + ]); + + // Only the trigger query reads a single attribute, so only it needs the + // JSON column lookup. + const triggerSource = context?.sessionId != null ? source : undefined; + const { getFieldExpression } = useFieldExpressionGenerator(triggerSource); + // A string, not the generator: the generator is a new function each render. + const sessionIdExpression = + triggerSource && + getFieldExpression?.(triggerSource.eventAttributesExpression, 'session.id'); + const triggerQuery = useMemo( + () => + triggerSource != null && context?.sessionId != null && sessionIdExpression + ? buildTriggerClickQuery({ + logSource: triggerSource, + context, + sessionId: context.sessionId, + sessionIdExpression, + }) + : null, + [triggerSource, context, sessionIdExpression], + ); + const trigger = useQueriedChartConfig( + triggerQuery?.config ?? PLACEHOLDER_CONFIG, + { + enabled: enabled && triggerQuery != null, + queryKeyPrefix: 'TraceTriggerClick', + staleTime: Infinity, + }, + ); + const triggerResult = + triggerQuery != null && !trigger.isError ? trigger.data : undefined; + const getRowWhere = useRowWhere({ + meta: triggerResult?.meta, + aliasMap: triggerQuery?.aliasMap, + primaryKeyColumns: SESSION_LOG_EVENT_KEY_COLUMNS, + }); + const anchorMs = context?.anchorMs; + const anchorHidden = context?.anchorHidden ?? false; + const triggerRow = useMemo((): TraceTriggerRow | undefined => { + const picked = + anchorMs != null && triggerResult?.data.length + ? pickTriggerClick(triggerResult, anchorMs) + : undefined; + if (picked == null) { + return undefined; + } + // useRowWhere throws on a column without meta, which must not take down + // the waterfall. + let id: string; + try { + id = getRowWhere(picked.row).where; + } catch (e) { + console.error(e); + return undefined; + } + const { timelineText } = getBrowserEventLabel({ + eventName: String(picked.row.event_name ?? ''), + body: picked.row.body, + attributes: picked.row.attributes, + }); + return { + Timestamp: String(picked.row.timestamp), + Body: '', + SpanId: '', + type: SourceKind.Log, + id, + // The row id is made of raw expressions, so it needs no WITH clauses. + aliasWith: [], + __hdx_hidden: anchorHidden, + triggeredBy: `Triggered by: ${timelineText} · ${formatDurationMs(picked.gapMs)} before`, + }; + }, [triggerResult, anchorMs, anchorHidden, getRowWhere]); + + return { + logRows: keptLogRows, + resourceTimingBySpanId: markersBySpanId, + triggerRow, + }; +} diff --git a/packages/app/src/hooks/useDenoisedRows.ts b/packages/app/src/hooks/useDenoisedRows.ts new file mode 100644 index 000000000..7ba421cc5 --- /dev/null +++ b/packages/app/src/hooks/useDenoisedRows.ts @@ -0,0 +1,148 @@ +import { useMemo } from 'react'; +import stripAnsi from 'strip-ansi'; +import { splitAndTrimWithBracket } from '@hyperdx/common-utils/dist/core/utils'; +import { + buildNoisyBodyMatcher, + DENOISE_SAMPLE_SIZE, + selectNoisyPatterns, +} from '@hyperdx/common-utils/dist/drain'; +import { + BuilderChartConfigWithDateRange, + TSource, +} from '@hyperdx/common-utils/dist/types'; + +import { + DRAIN_EXTRA_DELIMITERS, + LEVEL_COLUMN_ALIAS, + useGroupedPatterns, +} from '@/hooks/usePatterns'; +import { getEventBody, getLevelExpression } from '@/source'; +import { getLogLevelClass, selectItemExpression } from '@/utils'; + +function isErrorOrWarning(row: Record) { + const level = row[LEVEL_COLUMN_ALIAS]; + if (typeof level !== 'string') return false; + const levelClass = getLogLevelClass(level); + return levelClass === 'error' || levelClass === 'warn'; +} + +export type DenoiseSkipReason = + | 'no_body_expression' + | 'body_not_in_results' + | 'patterns_failed'; + +/** + * The result column holding the source's body. `columns` follow the order of + * the SELECT items, and ClickHouse may rename a column, so the body is located + * by its position in the SELECT list, then by name (e.g. for `SELECT *`). + */ +export function findBodyResultColumn( + select: BuilderChartConfigWithDateRange['select'], + columns: string[], + bodyExpression: string | undefined, +): string | undefined { + if (!bodyExpression) return undefined; + if (typeof select === 'string') { + const index = splitAndTrimWithBracket(select).findIndex( + item => selectItemExpression(item) === bodyExpression, + ); + if (index !== -1 && index < columns.length) return columns[index]; + } + return columns.includes(bodyExpression) ? bodyExpression : undefined; +} + +export function useDenoisedRows>({ + config, + source, + columns, + rows, + enabled, +}: { + config: BuilderChartConfigWithDateRange; + source: TSource | undefined; + columns: string[]; + rows: TRow[]; + enabled: boolean; +}) { + const bodyExpression = source ? getEventBody(source) : undefined; + const bodyColumn = findBodyResultColumn( + config.select, + columns, + bodyExpression, + ); + const groupedPatterns = useGroupedPatterns({ + config, + samples: DENOISE_SAMPLE_SIZE, + bodyValueExpression: bodyExpression ?? '', + levelExpression: getLevelExpression(source), + totalCount: undefined, + enabled: enabled && bodyColumn != null, + }); + + const { + data: patternGroups, + sampledRowCount, + clusterTemplates, + } = groupedPatterns; + + let skipped: DenoiseSkipReason | undefined; + if (!enabled) { + // Not denoising, nothing to skip + } else if (!bodyExpression) { + skipped = 'no_body_expression'; + } else if (columns.length > 0 && bodyColumn == null) { + // Columns are unknown until the first page arrives + skipped = 'body_not_in_results'; + } else if (groupedPatterns.error != null) { + skipped = 'patterns_failed'; + } + + // Frequency is not importance: a flood of errors during an incident must + // stay visible, so patterns with any error or warning sample are kept. + const noisyPatterns = useMemo( + () => + selectNoisyPatterns( + Object.values(patternGroups).filter( + p => !p.samples.some(isErrorOrWarning), + ), + p => p.count, + sampledRowCount ?? 0, + ), + [patternGroups, sampledRowCount], + ); + + const isNoisy = useMemo(() => { + if (clusterTemplates == null) return undefined; + const noisyTemplates = new Set( + noisyPatterns + .map(p => clusterTemplates[p.id]) + .filter((t): t is string => t != null), + ); + return buildNoisyBodyMatcher( + Object.values(clusterTemplates), + noisyTemplates, + { extraDelimiters: DRAIN_EXTRA_DELIMITERS }, + ); + }, [clusterTemplates, noisyPatterns]); + + const denoisedRows = useMemo(() => { + if (!enabled) return rows; + if (skipped != null) return rows; + if (isNoisy == null || bodyColumn == null) return []; + if (noisyPatterns.length === 0) return rows; + return rows.filter(row => { + const body = row[bodyColumn]; + if (body == null) return true; + return !isNoisy(stripAnsi(String(body))); + }); + }, [enabled, skipped, isNoisy, bodyColumn, noisyPatterns, rows]); + + return { + rows: denoisedRows, + bodyExpression, + noisyPatterns, + sampledRowCount: sampledRowCount ?? 0, + skipped, + isLoading: enabled && skipped == null && clusterTemplates == null, + }; +} diff --git a/packages/app/src/hooks/useMetadata.tsx b/packages/app/src/hooks/useMetadata.tsx index 7ca8d7236..9a61524c3 100644 --- a/packages/app/src/hooks/useMetadata.tsx +++ b/packages/app/src/hooks/useMetadata.tsx @@ -8,6 +8,7 @@ import { } from '@hyperdx/common-utils/dist/clickhouse'; import { Field, + FieldsCondition, MetricNames, parseKeyPath, TableConnection, @@ -248,6 +249,7 @@ type MultipleAllFieldsOptions = { // would offer fields that exist in one table but not another. intersect?: boolean; enabled?: boolean; + conditions?: (FieldsCondition | undefined)[]; }; /** @@ -270,6 +272,7 @@ export function useMultipleAllFields( timestampValueExpression, intersect, enabled = true, + conditions, }: MultipleAllFieldsOptions = {}, ) { const metadata = useMetadataWithSettings(); @@ -286,10 +289,11 @@ export function useMultipleAllFields( dateRange ? [dateRange[0].getTime(), dateRange[1].getTime()] : undefined, timestampValueExpression, isFieldMetadataDisabled, + conditions, ], queryFn: () => Promise.all( - tableConnections.map(async (tc): Promise => { + tableConnections.map(async (tc, i): Promise => { let columns: ColumnMeta[] = []; try { columns = await metadata.getColumns({ @@ -304,6 +308,7 @@ export function useMultipleAllFields( dateRange, timestampValueExpression: timestampValueExpression ?? tc.timestampValueExpression, + condition: conditions?.[i], }); return { fields, columns }; } catch (error) { @@ -419,6 +424,27 @@ export function useTableMetadata( }); } +/** Fetches server MergeTree settings; null on failure. */ +export function useMergeTreeSettings( + connectionId: string, + options?: Omit< + UseQueryOptions | null, Error>, + 'queryKey' | 'queryFn' + >, +) { + const metadata = useMetadataWithSettings(); + return useQuery | null>({ + queryKey: ['useMetadata.useMergeTreeSettings', { connectionId }], + // react-query rejects undefined + queryFn: async () => + (await metadata.getMergeTreeSettings({ connectionId })) ?? null, + // Keep failures stale to refetch on next mount. + staleTime: query => (query.state.data ? 1000 * 60 * 5 : 0), + enabled: !!connectionId, + ...options, + }); +} + /** How many keys a filter values query reads, per the team's setting. */ export function useFilterKeysFetchLimit() { const { data: me } = api.useMe(); diff --git a/packages/app/src/hooks/useOffsetPaginatedQuery.tsx b/packages/app/src/hooks/useOffsetPaginatedQuery.tsx index e8b5b573f..9492d435d 100644 --- a/packages/app/src/hooks/useOffsetPaginatedQuery.tsx +++ b/packages/app/src/hooks/useOffsetPaginatedQuery.tsx @@ -17,6 +17,7 @@ import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartCo import { isFirstOrderByAscending, isTimestampExpressionInFirstOrderBy, + MAX_TABLE_ROWS, } from '@hyperdx/common-utils/dist/core/utils'; import { isBuilderChartConfig, @@ -36,7 +37,6 @@ import { import api from '@/api'; import { getClickhouseClient } from '@/clickhouse'; -import { MAX_TABLE_ROWS } from '@/HDXMultiSeriesTableChart'; import { useMetadataWithSettings } from '@/hooks/useMetadata'; import { useMVOptimizationExplanation } from '@/hooks/useMVOptimizationExplanation'; import { useQueryAttribution } from '@/queryAttribution'; diff --git a/packages/app/src/hooks/useOnClickLinkBuilder.ts b/packages/app/src/hooks/useOnClickLinkBuilder.ts index dd3dbe13a..5b58d8a5b 100644 --- a/packages/app/src/hooks/useOnClickLinkBuilder.ts +++ b/packages/app/src/hooks/useOnClickLinkBuilder.ts @@ -10,6 +10,7 @@ import { notifications } from '@mantine/notifications'; import { useDashboards } from '@/dashboard'; import { useSources } from '@/source'; +import { useTimeZoneLinkParam } from '@/timeZoneOverride'; /** * The action a row click should take. `url` is set when the row's @@ -54,6 +55,7 @@ export function useOnClickLinkBuilder({ }): ((row: Record) => RowAction) | null { const { data: sources } = useSources(); const { data: dashboards } = useDashboards(); + const addTimeZone = useTimeZoneLinkParam(); const [sourceIdsByName, sourceIds, sourceNamesById] = useMemo(() => { const idsByName = new Map(); @@ -124,7 +126,8 @@ export function useOnClickLinkBuilder({ if (renderResult.ok) { return { - url: renderResult.url, + // Search and dashboards take the same override; other sites don't. + url: isExternal ? renderResult.url : addTimeZone(renderResult.url), description: isExternal ? renderResult.url : description, external: isExternal, }; @@ -154,6 +157,7 @@ export function useOnClickLinkBuilder({ return result; }; }, [ + addTimeZone, onClick, sourceIds, sourceIdsByName, diff --git a/packages/app/src/hooks/usePatterns.tsx b/packages/app/src/hooks/usePatterns.tsx index ece24e70c..57a42e726 100644 --- a/packages/app/src/hooks/usePatterns.tsx +++ b/packages/app/src/hooks/usePatterns.tsx @@ -43,6 +43,11 @@ function usePyodide(options: { enabled: boolean }) { }); } +// Python's string.punctuation. Shared with the denoise matcher, which must +// split bodies into the same tokens the miner built its templates from. +export const DRAIN_EXTRA_DELIMITERS = + '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'.split(''); + class Miner { private minerVariableName; private id; @@ -55,12 +60,11 @@ class Miner { await this.pyodide.runPythonAsync(` import js import json -import string from drain3 import TemplateMiner from drain3.template_miner_config import TemplateMinerConfig _config = TemplateMinerConfig() -_config.drain_extra_delimiters = list(string.punctuation) +_config.drain_extra_delimiters = json.loads(${JSON.stringify(JSON.stringify(DRAIN_EXTRA_DELIMITERS))}) ${this.minerVariableName} = TemplateMiner(None, _config) `); @@ -80,18 +84,11 @@ ${this.minerVariableName} = TemplateMiner(None, _config) ); } - async matchLogs(logs: string[]) { - const tempLogs = `temp_logs_${this.id}`; - const tempResults = `temp_results_${this.id}`; - this.pyodide.globals.set(tempLogs, logs); - + /** Final template of every cluster, keyed by cluster id. */ + async getTemplates(): Promise> { return JSON.parse( await this.pyodide.runPythonAsync(` - ${tempResults} = [] - for log in ${tempLogs}: - match = ${this.minerVariableName}.match(log) - ${tempResults}.append(match.cluster_id if match else None) - json.dumps(${tempResults}) + json.dumps({str(c.cluster_id): c.get_template() for c in ${this.minerVariableName}.drain.clusters}) `), ); } @@ -100,9 +97,11 @@ ${this.minerVariableName} = TemplateMiner(None, _config) async function mineEventPatterns(logs: string[], pyodide: any) { const miner = new Miner(pyodide); await miner.init(); + const patterns = await miner.minePatterns(logs); return { miner, - patterns: await miner.minePatterns(logs), + patterns, + templates: await miner.getTemplates(), }; } @@ -205,6 +204,7 @@ function usePatterns({ additionalKeysLength: configWithPrimaryAndPartitionKey.additionalKeysLength, miner: response.miner, + clusterTemplates: response.templates, }; }); }, @@ -335,6 +335,7 @@ export function useGroupedPatterns({ isLoading, error, miner: results?.miner, + clusterTemplates: results?.clusterTemplates, sampledRowCount, patternQueryConfig, }; diff --git a/packages/app/src/hooks/useRowHighlightHint.ts b/packages/app/src/hooks/useRowHighlightHint.ts index 3a1031163..b54e7bcc1 100644 --- a/packages/app/src/hooks/useRowHighlightHint.ts +++ b/packages/app/src/hooks/useRowHighlightHint.ts @@ -8,6 +8,18 @@ export type RowHighlightHint = { body: string; }; +export function matchesRowHighlightHint( + row: { Timestamp?: unknown; SpanId?: unknown; Body?: unknown }, + hint: RowHighlightHint | undefined, +): boolean { + return ( + hint != null && + row.Timestamp === hint.timestamp && + row.SpanId === hint.spanId && + row.Body === hint.body + ); +} + type HighlightRow = { id: string; type?: string; @@ -63,13 +75,9 @@ export function useRowHighlightHint({ return; } - const initialRowHighlightIndex = rows.findIndex(row => { - return ( - row.Timestamp === initialRowHighlightHint.timestamp && - row.SpanId === initialRowHighlightHint.spanId && - row.Body === initialRowHighlightHint.body - ); - }); + const initialRowHighlightIndex = rows.findIndex(row => + matchesRowHighlightHint(row, initialRowHighlightHint), + ); if (initialRowHighlightIndex !== -1) { appliedHighlightHintRef.current = hintKey; diff --git a/packages/app/src/hooks/useRowWhere.tsx b/packages/app/src/hooks/useRowWhere.tsx index 9ee4d51b4..6ab2106a0 100644 --- a/packages/app/src/hooks/useRowWhere.tsx +++ b/packages/app/src/hooks/useRowWhere.tsx @@ -1,5 +1,5 @@ import { useCallback, useMemo } from 'react'; -import MD5 from 'crypto-js/md5'; +import SHA256 from 'crypto-js/sha256'; import SqlString from 'sqlstring'; import z from 'zod'; import { @@ -8,7 +8,11 @@ import { JSDataType, } from '@hyperdx/common-utils/dist/clickhouse'; import { quoteResultColumnNameIfNeeded } from '@hyperdx/common-utils/dist/core/metadata'; -import { aliasMapToWithClauses } from '@hyperdx/common-utils/dist/core/utils'; +import { + aliasMapToWithClauses, + LEFT_UTF8_HASH_CODE_POINTS, + leftUtf8Prefix, +} from '@hyperdx/common-utils/dist/core/utils'; import { WithClauseSchema } from '@hyperdx/common-utils/dist/types'; const MAX_STRING_LENGTH = 512; @@ -88,9 +92,9 @@ export function processRowToWhereClause( typeof value === 'string' ? value : (JSON.stringify(value) ?? 'null').replace(/\//g, '\\/'); - return SqlString.format(`lower(hex(MD5(toString(?))))=?`, [ + return SqlString.format(`lower(hex(SHA256(toString(?))))=?`, [ SqlString.raw(valueExpr), - MD5(normalized).toString(), + SHA256(normalized).toString(), ]); } case JSDataType.Dynamic: { @@ -133,13 +137,13 @@ export function processRowToWhereClause( // Handle the case when string is too long if (typeof val === 'string' && val.length > MAX_STRING_LENGTH) { return SqlString.format( - // We need to slice since md5 can be slow on big payloads - // which will block the main thread on search table render - // UTF8 since js only slices in utf8 points, not bytes - `lower(hex(MD5(leftUTF8(?, 1000))))=?`, + // Hash only a prefix so huge payloads do not block the main thread. + `lower(hex(SHA256(leftUTF8(?, ${LEFT_UTF8_HASH_CODE_POINTS}))))=?`, [ SqlString.raw(valueExpr), - MD5(val.substring(0, 1000)).toString(), + SHA256( + leftUtf8Prefix(val, LEFT_UTF8_HASH_CODE_POINTS), + ).toString(), ], ); } diff --git a/packages/app/src/hooks/useServiceMap.tsx b/packages/app/src/hooks/useServiceMap.tsx index a220e340f..810488dbb 100644 --- a/packages/app/src/hooks/useServiceMap.tsx +++ b/packages/app/src/hooks/useServiceMap.tsx @@ -2,6 +2,7 @@ import SqlString from 'sqlstring'; import { chSql } from '@hyperdx/common-utils/dist/clickhouse'; import { Metadata } from '@hyperdx/common-utils/dist/core/metadata'; import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig'; +import { errorStatusPredicateSql } from '@hyperdx/common-utils/dist/core/spanPredicates'; import { TTraceSource } from '@hyperdx/common-utils/dist/types'; import { useQuery } from '@tanstack/react-query'; @@ -9,9 +10,20 @@ import { useClickhouseClient } from '@/clickhouse'; import { useMetadataWithSettings } from './useMetadata'; +// Upper bound on the extra group-by expressions a map can be split by, beyond +// the implicit ServiceName key. Enforced where the URL param is parsed and in +// the editor's validation, so a hand-edited URL cannot exceed it. +export const MAX_SERVICE_MAP_GROUP_BY = 3; + export type SpanAggregationRow = { serverServiceName: string; + // Values of the extra group-by expressions, in groupBy order. Empty when the + // map is grouped by service name only. + serverDimensions: string[]; clientServiceName?: string; + // Undefined when there is no client (node-level rows and uninstrumented + // callers); otherwise the same length as serverDimensions. + clientDimensions?: string[]; // True for node-level (rolled-up across all callers) rows, false for // edge-level (a specific client→server call) rows. Derived from GROUPING() // over the client service in the GROUPING SETS query. @@ -25,7 +37,22 @@ export type SpanAggregationRow = { p99?: number; }; -async function getServiceMapQuery({ +export function serviceMapErrorCountSql(): string { + return `countIf(${errorStatusPredicateSql('ServerSpans.statusCode')})`; +} + +const dimensionAlias = (index: number) => `dim${index}`; + +/** + * SQL for one group-by expression as the map compares and displays it: a + * non-nullable String, so a NULL or missing attribute reads as ''. The search + * links reuse it so a node's pinned value matches what the map grouped on. + */ +export function dimensionValueSql(expression: string): string { + return `ifNull(toString(${expression}), '')`; +} + +export async function getServiceMapQuery({ source, dateRange, traceId, @@ -34,6 +61,7 @@ async function getServiceMapQuery({ where, whereLanguage, serviceNames, + groupBy = [], }: { source: TTraceSource; dateRange: [Date, Date]; @@ -43,9 +71,11 @@ async function getServiceMapQuery({ where?: string; whereLanguage?: 'sql' | 'lucene'; serviceNames?: string[]; + groupBy?: string[]; }) { // Don't sample if we're looking for a specific trace const effectiveSamplingLevel = traceId ? 1 : samplingFactor; + const dimensionAliases = groupBy.map((_, i) => dimensionAlias(i)); const baseCTEConfig = { from: source.from, @@ -97,6 +127,13 @@ async function getServiceMapQuery({ valueExpression: source.statusCodeExpression ?? 'StatusCode', alias: 'statusCode', }, + // Extra group-by keys, as non-nullable Strings so both sides of the LEFT + // JOIN below compare as '' (never NULL) for an unmatched client or a + // missing attribute, matching how serviceName behaves. + ...groupBy.map((expression, i) => ({ + valueExpression: dimensionValueSql(expression), + alias: dimensionAlias(i), + })), // Carry the raw span duration through so we can aggregate latency. // Only available when the source defines a duration expression. ...(source.durationExpression @@ -161,32 +198,50 @@ async function getServiceMapQuery({ quantiles(0.5, 0.95, 0.99)(ServerSpans.duration) as quantiles` : chSql``; + // A node is the tuple (serviceName, dim0, dim1, ...). Each key column is + // selected for both sides of the join as server_ / client_. + const keyColumns = ['serviceName', ...dimensionAliases]; + const serverKey = keyColumns.map(col => `ServerSpans.${col}`).join(', '); + const clientKey = keyColumns.map(col => `ClientSpans.${col}`).join(', '); + const keySelect = keyColumns + .map( + col => + `ServerSpans.${col} AS server_${col}, ClientSpans.${col} AS client_${col}`, + ) + .join(',\n '); + const keyOrderBy = [ + ...keyColumns.map(col => `server_${col}`), + 'isNodeLevel', + ...keyColumns.map(col => `client_${col}`), + ].join(', '); + // Left join to support services which receive requests from clients that are // not instrumented. GROUPING SETS emits, in one pass, both a per-edge row - // (server + client) and a rolled-up per-service node row (server only); - // GROUPING() flags which is which so node and edge percentiles are each - // computed over the right set of spans. Ordering helps stable graph layout. + // (server + client) and a rolled-up per-node row (server only); GROUPING() + // flags which is which so node and edge percentiles are each computed over + // the right set of spans. A node calling itself is not an edge, but two nodes + // of the same service (e.g. two pods) are, so the self-call exclusion compares + // the full key tuples. Ordering helps stable graph layout. return chSql` WITH ServerSpans AS (${serverCTE}), ClientSpans AS (${clientCTE}) SELECT - ServerSpans.serviceName AS serverServiceName, - ClientSpans.serviceName AS clientServiceName, + ${{ UNSAFE_RAW_SQL: keySelect }}, GROUPING(ClientSpans.serviceName) AS isNodeLevel, count(*) * ${{ Int64: effectiveSamplingLevel }} as requestCount, - countIf(ServerSpans.statusCode = 'Error') * ${{ Int64: effectiveSamplingLevel }} as errorCount${latencySelect} + ${serviceMapErrorCountSql()} * ${{ Int64: effectiveSamplingLevel }} as errorCount${latencySelect} FROM ServerSpans LEFT JOIN ClientSpans ON ServerSpans.traceId = ClientSpans.traceId AND ServerSpans.parentSpanId = ClientSpans.spanId - WHERE (ClientSpans.serviceName IS NULL OR ServerSpans.serviceName != ClientSpans.serviceName) + WHERE (ClientSpans.serviceName IS NULL OR tuple(${{ UNSAFE_RAW_SQL: serverKey }}) != tuple(${{ UNSAFE_RAW_SQL: clientKey }})) ${serviceNameFilter} GROUP BY GROUPING SETS ( - (ServerSpans.serviceName, ClientSpans.serviceName), - (ServerSpans.serviceName) + (${{ UNSAFE_RAW_SQL: serverKey }}, ${{ UNSAFE_RAW_SQL: clientKey }}), + (${{ UNSAFE_RAW_SQL: serverKey }}) ) - ORDER BY serverServiceName, isNodeLevel, clientServiceName + ORDER BY ${{ UNSAFE_RAW_SQL: keyOrderBy }} `; } @@ -204,8 +259,15 @@ export type IncomingRequestStats = { }; export type ServiceAggregation = { + // Identifies the node: the service name alone when the map has no extra + // dimensions, otherwise the (serviceName, ...dimensions) tuple. Keys the + // returned map and incomingRequestsByClient. + key: string; serviceName: string; + // Values of the extra group-by expressions, in groupBy order. + dimensions: string[]; incomingRequests: IncomingRequestStats; + // Per-caller stats keyed by the caller node's key. incomingRequestsByClient: Map; // Total requests this service makes to others (sum of edges where it is the // client). Combined with incoming traffic to size the node by total @@ -213,6 +275,15 @@ export type ServiceAggregation = { outgoingRequests: number; }; +export function serviceMapNodeKey( + serviceName: string, + dimensions: string[], +): string { + return dimensions.length === 0 + ? serviceName + : JSON.stringify([serviceName, ...dimensions]); +} + function emptyStats(): IncomingRequestStats { return { totalRequests: 0, @@ -241,33 +312,39 @@ function statsFromRow(row: SpanAggregationRow): IncomingRequestStats { export function aggregateServiceMapData(data: SpanAggregationRow[]) { const services = new Map(); - const ensureService = (name: string): ServiceAggregation => { - let service = services.get(name); + const ensureService = ( + serviceName: string, + dimensions: string[], + ): ServiceAggregation => { + const key = serviceMapNodeKey(serviceName, dimensions); + let service = services.get(key); if (!service) { service = { - serviceName: name, + key, + serviceName, + dimensions, incomingRequests: emptyStats(), incomingRequestsByClient: new Map(), outgoingRequests: 0, }; - services.set(name, service); + services.set(key, service); } return service; }; for (const row of data) { - const service = ensureService(row.serverServiceName); + const service = ensureService(row.serverServiceName, row.serverDimensions); if (row.isNodeLevel) { - // Rolled-up totals across all callers for this service. + // Rolled-up totals across all callers for this node. service.incomingRequests = statsFromRow(row); } else if (row.clientServiceName) { // Per-caller (edge) stats. Ensure the caller exists as a node too. - ensureService(row.clientServiceName); - service.incomingRequestsByClient.set( + const client = ensureService( row.clientServiceName, - statsFromRow(row), + row.clientDimensions ?? [], ); + service.incomingRequestsByClient.set(client.key, statsFromRow(row)); } // Edge-level rows with no client service come from uninstrumented callers; // they're already included in the node-level totals, so no edge is drawn. @@ -275,8 +352,8 @@ export function aggregateServiceMapData(data: SpanAggregationRow[]) { // Roll each edge's volume up to its caller's outgoing total. for (const service of services.values()) { - for (const [clientName, stats] of service.incomingRequestsByClient) { - const client = services.get(clientName); + for (const [clientKey, stats] of service.incomingRequestsByClient) { + const client = services.get(clientKey); if (client) { client.outgoingRequests += stats.totalRequests; } @@ -294,6 +371,7 @@ export default function useServiceMap({ where, whereLanguage, serviceNames, + groupBy, }: { source: TTraceSource; dateRange: [Date, Date]; @@ -302,9 +380,12 @@ export default function useServiceMap({ where?: string; whereLanguage?: 'sql' | 'lucene'; serviceNames?: string[]; + // Extra group-by SQL expressions; ServiceName is always the first key. + groupBy?: string[]; }) { const client = useClickhouseClient(); const metadata = useMetadataWithSettings(); + const dimensions = groupBy ?? []; return useQuery({ queryKey: [ @@ -316,6 +397,7 @@ export default function useServiceMap({ where, whereLanguage, serviceNames, + dimensions, ], queryFn: async ({ signal }) => { const query = await getServiceMapQuery({ @@ -327,6 +409,7 @@ export default function useServiceMap({ where, whereLanguage, serviceNames, + groupBy: dimensions, }); const data = await client @@ -349,12 +432,22 @@ export default function useServiceMap({ const quantiles = Array.isArray(row.quantiles) ? (row.quantiles as unknown[]) : undefined; + // serviceName is a non-nullable LowCardinality(String), so + // rolled-up node-level rows and unmatched LEFT JOINs come back as + // '' rather than null — normalize those to undefined (no edge). + const clientServiceName = + (row.client_serviceName as string) || undefined; + const dimensionValues = (side: 'server' | 'client') => + dimensions.map((_, i) => + String(row[`${side}_${dimensionAlias(i)}`] ?? ''), + ); return { - serverServiceName: row.serverServiceName as string, - // serviceName is a non-nullable LowCardinality(String), so - // rolled-up node-level rows and unmatched LEFT JOINs come back as - // '' rather than null — normalize those to undefined (no edge). - clientServiceName: (row.clientServiceName as string) || undefined, + serverServiceName: row.server_serviceName as string, + serverDimensions: dimensionValues('server'), + clientServiceName, + clientDimensions: clientServiceName + ? dimensionValues('client') + : undefined, isNodeLevel: Number(row.isNodeLevel) === 1, requestCount: Number.parseInt(row.requestCount as string, 10), errorCount: Number.parseInt(row.errorCount as string, 10), diff --git a/packages/app/src/hooks/useSessionLogEvents.ts b/packages/app/src/hooks/useSessionLogEvents.ts index 7247e2f61..6869fc787 100644 --- a/packages/app/src/hooks/useSessionLogEvents.ts +++ b/packages/app/src/hooks/useSessionLogEvents.ts @@ -29,7 +29,7 @@ const NO_LOG_EVENTS: SessionLogEvent[] = []; // Twin of linkedSpans' usePlaceholderConfig, without a source because the log // source may not resolve. Never fetched: the query is disabled while it is used. -const PLACEHOLDER_CONFIG: BuilderChartConfigWithDateRange = { +export const PLACEHOLDER_CONFIG: BuilderChartConfigWithDateRange = { connection: '', from: { databaseName: '', tableName: '' }, select: [{ valueExpression: '1' }], diff --git a/packages/app/src/instrumentation.ts b/packages/app/src/instrumentation.ts deleted file mode 100644 index c25e36eb2..000000000 --- a/packages/app/src/instrumentation.ts +++ /dev/null @@ -1,9 +0,0 @@ -export async function register() { - if (process.env.NEXT_RUNTIME === 'nodejs') { - const { init } = await import('@hyperdx/node-opentelemetry'); - init({ - apiKey: process.env.HYPERDX_API_KEY, - additionalInstrumentations: [], // optional, default: [] - }); - } -} diff --git a/packages/app/src/layout.tsx b/packages/app/src/layout.tsx index 66883df94..740cd0e4d 100644 --- a/packages/app/src/layout.tsx +++ b/packages/app/src/layout.tsx @@ -6,10 +6,7 @@ import { Button, Center, Group, Text } from '@mantine/core'; import { useIsomorphicEffect } from '@mantine/hooks'; import { IconX } from '@tabler/icons-react'; -// INTERIM (2.29 merge): use upstream's AppNav. The DFE nav (@/dfe/components/AppNav -// + SidebarMenu/HyperDxNavItems) drifted hard against 2.29 (use-query-params->nuqs, -// removed @/types SavedSearch/ServerDashboard, Mantine Collapse) and is being -// replaced by the config-driven condensed embed nav. Re-point once that lands. +import { useBrandDisplayName } from '@/brand'; import AppNav from '@/components/AppNav'; import { IS_CLICKHOUSE_BUILD } from '@/config'; import { isEmbedChrome } from '@/dfe/embedFeatures'; @@ -36,6 +33,7 @@ export const APP_CONTENT_SCROLL_CONTAINER_ID = 'app-content-scroll-container'; */ function PageWrapper({ children }: { children: React.ReactNode }) { const router = useRouter(); + const brandName = useBrandDisplayName(); const [bannerState, setBannerState] = useLocalStorage( 'clickstack-banner-state', 'opened', @@ -72,8 +70,8 @@ function PageWrapper({ children }: { children: React.ReactNode }) {
- This is not recommended for production use and is lacking core - ClickStack features such as alerts and saved searches. For a + This is not recommended for production use and is lacking core{' '} + {brandName} features such as alerts and saved searches. For a proper experience, visit the{' '} - ClickStack Docs + {brandName} docs diff --git a/packages/app/src/llm/dashboard/LLMDashboardPage.tsx b/packages/app/src/llm/dashboard/LLMDashboardPage.tsx index 06f4bb7d2..2cdb54d16 100644 --- a/packages/app/src/llm/dashboard/LLMDashboardPage.tsx +++ b/packages/app/src/llm/dashboard/LLMDashboardPage.tsx @@ -26,6 +26,7 @@ import { } from '@mantine/core'; import { IconInfoCircle } from '@tabler/icons-react'; +import { usePageTitle } from '@/brand'; import OnboardingModal from '@/components/OnboardingModal'; import SearchWhereInput, { getStoredLanguage, @@ -39,7 +40,6 @@ import { } from '@/llm/hooks/useLLMDashboardExpressions'; import { getEffectiveTraceSourceId } from '@/ServicesDashboardPage'; import { useSource, useSources } from '@/source'; -import { usePageTitle } from '@/theme/ThemeProvider'; import { useDefaultTimeRange, useNewTimeQuery } from '@/timeQuery'; import { AgentToolCharts } from './AgentToolCharts'; diff --git a/packages/app/src/searchFilters.tsx b/packages/app/src/searchFilters.tsx index e9f1e5025..c84c1079f 100644 --- a/packages/app/src/searchFilters.tsx +++ b/packages/app/src/searchFilters.tsx @@ -446,6 +446,55 @@ function usePersonalPinnedFilters(sourceId: string | null) { return { filters, fields, setFilters, setFields }; } +/** + * Pinned fields the user collapsed, per source, so they stay collapsed on the + * next load instead of always opening. Personal (localStorage), like the + * other expanded/collapsed states of the filters sidebar. + */ +export function useCollapsedPinnedFields(sourceId: string | null) { + const [collapsed, setCollapsed] = useLocalStorage<{ + [sourceId: string]: string[]; + }>('hdx-collapsed-pinned-fields', {}); + + const isPinnedFieldCollapsed = useCallback( + (field: string) => + sourceId != null && (collapsed[sourceId] ?? []).includes(field), + [collapsed, sourceId], + ); + + const setPinnedFieldCollapsed = useCallback( + (field: string, isCollapsed: boolean) => { + if (!sourceId) return; + setCollapsed(prev => { + const fields = (prev[sourceId] ?? []).filter(f => f !== field); + return { + ...prev, + [sourceId]: isCollapsed ? [...fields, field] : fields, + }; + }); + }, + [sourceId, setCollapsed], + ); + + /** Keep only the collapsed fields for which `keep` is true (e.g. after a pin reset). */ + const pruneCollapsedPinnedFields = useCallback( + (keep: (field: string) => boolean) => { + if (!sourceId) return; + setCollapsed(prev => ({ + ...prev, + [sourceId]: (prev[sourceId] ?? []).filter(keep), + })); + }, + [sourceId, setCollapsed], + ); + + return { + isPinnedFieldCollapsed, + setPinnedFieldCollapsed, + pruneCollapsedPinnedFields, + }; +} + export function usePinnedFilters(sourceId: string | null) { // Personal pins: localStorage (per-user, per-browser) const personal = usePersonalPinnedFilters(sourceId); diff --git a/packages/app/src/sessions.ts b/packages/app/src/sessions.ts index edc552586..5b7051a53 100644 --- a/packages/app/src/sessions.ts +++ b/packages/app/src/sessions.ts @@ -485,6 +485,45 @@ function isAbortError(e: unknown): boolean { ); } +/** + * Session sources map no precise timestamp, and the player already assumes + * the OTel log columns (Body, LogAttributes, ServiceName). Their `Timestamp` + * is DateTime64(9); the default `TimestampTime` has only seconds. + */ +const SESSION_PRECISE_TIMESTAMP_COLUMN = 'Timestamp'; + +/** + * `Timestamp` when the session table has it, else the source's own + * timestamp. With the fallback, chunks are grouped at that precision, which + * still tells apart page loads in different seconds. The columns are + * usually cached already: the player's field expressions read them. + */ +export async function getRRWebTimestampExpression( + source: { + from: TSessionSource['from']; + timestampValueExpression: string; + connection: string; + }, + metadata: Metadata, +): Promise { + const fallback = getFirstTimestampValueExpression( + source.timestampValueExpression, + ); + try { + const column = await metadata.getColumn({ + databaseName: source.from.databaseName, + tableName: source.from.tableName, + column: SESSION_PRECISE_TIMESTAMP_COLUMN, + connectionId: source.connection, + }); + return column != null ? SESSION_PRECISE_TIMESTAMP_COLUMN : fallback; + } catch (error) { + // Don't fail the replay over a lookup that only sharpens chunk grouping + console.warn('Failed to read session table columns', error); + return fallback; + } +} + // OPTIMIZATION STRATEGY // // 1. Write a clickhouse query to divide a session into different chunks, where each chunk has a start time. Maybe each chunk contains 100 events. @@ -497,11 +536,18 @@ function isAbortError(e: unknown): boolean { * Large rrweb events are split by the recorder into multiple log records * ("chunks") that all share the same event timestamp, so ordering by the * timestamp alone lets ClickHouse return chunks of one event in arbitrary - * order, scrambling reassembly. `rr-web.offset` is a monotonically increasing - * counter stamped on every record, and `rr-web.chunk` is the 1-based chunk - * index within an event — ordering by both (numerically — the attributes are - * stored as strings) makes the stream order deterministic. - * https://github.com/hyperdxio/hyperdx/issues/2569 + * order, scrambling reassembly. `rr-web.offset` is a counter stamped on every + * record, and `rr-web.chunk` is the 1-based chunk index within an event — + * ordering by both (numerically — the attributes are stored as strings) makes + * the stream order deterministic. + * https://github.com/ClickHouse/ClickStack/issues/2569 + * + * SDKs up to clickstack-browser 1.2.0 restart `rr-web.offset` on every page + * load, so the full-precision timestamp (see getRRWebTimestampExpression) + * sorts ahead of it: at second precision, rows of two page loads in the same + * second interleave. The source's own timestamp stays first to match the + * table's sort key; in the default schema it is `toDateTime(Timestamp)`, so + * `Timestamp` only breaks its ties. */ export function buildRRWebStreamChartConfig({ source, @@ -513,6 +559,7 @@ export function buildRRWebStreamChartConfig({ limit, offset, getSessionSourceFieldExpression, + preciseTimestampExpression, }: { source: { from: TSessionSource['from']; @@ -527,6 +574,7 @@ export function buildRRWebStreamChartConfig({ limit: number; offset: number; getSessionSourceFieldExpression: FieldExpressionGenerator; + preciseTimestampExpression: string; }) { const eventAttributeExpression = (key: string) => getSessionSourceFieldExpression( @@ -557,6 +605,11 @@ export function buildRRWebStreamChartConfig({ valueExpression: `${eventAttributeExpression('rr-web.event')}`, alias: 'ev', }, + // Tells apart events of different page loads that share an `ev` + { + valueExpression: preciseTimestampExpression, + alias: 'ts', + }, ], dateRange: [startDate, endDate] as [Date, Date], from: source.from, @@ -566,7 +619,13 @@ export function buildRRWebStreamChartConfig({ implicitColumnExpression: SESSION_TABLE_EXPRESSIONS.implicitColumnExpression, connection: source.connection, - orderBy: `${source.timestampValueExpression} ASC, toUInt64OrZero(${eventAttributeExpression('rr-web.offset')}) ASC, toUInt64OrZero(${eventAttributeExpression('rr-web.chunk')}) ASC`, + orderBy: [ + ...new Set([source.timestampValueExpression, preciseTimestampExpression]), + `toUInt64OrZero(${eventAttributeExpression('rr-web.offset')})`, + `toUInt64OrZero(${eventAttributeExpression('rr-web.chunk')})`, + ] + .map(expression => `${expression} ASC`) + .join(', '), limit: { limit, offset, @@ -649,6 +708,10 @@ export function useRRWebEventStream( const MAX_LIMIT = 1e6; + const preciseTimestampExpression = await getRRWebTimestampExpression( + source, + metadata, + ); const query = await renderChartConfig( buildRRWebStreamChartConfig({ source, @@ -660,6 +723,7 @@ export function useRRWebEventStream( limit: Math.min(MAX_LIMIT, parseInt(queryLimit)), offset: parseInt(offset), getSessionSourceFieldExpression, + preciseTimestampExpression, }), metadata, source.querySettings, diff --git a/packages/app/src/stories/Brand.stories.tsx b/packages/app/src/stories/Brand.stories.tsx index c8cf5b766..86dc860f6 100644 --- a/packages/app/src/stories/Brand.stories.tsx +++ b/packages/app/src/stories/Brand.stories.tsx @@ -1,12 +1,7 @@ -import { Group, Paper, Stack, Text } from '@mantine/core'; +import { Group, Stack, Text } from '@mantine/core'; +import { BRAND_DISPLAY_NAME, useLogomark, useWordmark } from '@/brand'; import { CopySnippet } from '@/components/ClickStackOnboarding/CopySnippet'; -import { - useBrandDisplayName, - useLogomark, - useThemeName, - useWordmark, -} from '@/theme/ThemeProvider'; import { AssetCard } from './AssetCard'; @@ -18,7 +13,7 @@ const story = { }; export default story; -const USAGE = `import { useWordmark, useLogomark } from '@/theme/ThemeProvider'; +const USAGE = `import { useLogomark, useWordmark } from '@/brand'; function TopBar() { const logo = useLogomark({ size: 24 }); @@ -32,32 +27,28 @@ function TopBar() { }`; export const Logos = () => { - const brand = useBrandDisplayName(); - const themeName = useThemeName(); const logomark16 = useLogomark({ size: 16 }); const logomark24 = useLogomark({ size: 24 }); const logomark48 = useLogomark({ size: 48 }); const logomarkDownload = useLogomark({ size: 48 }); const wordmark = useWordmark(); - const wordmarkIsSvg = themeName === 'clickstack'; return (
- {brand} logo + {BRAND_DISPLAY_NAME} logo - Use the Brand toolbar to switch HyperDX and ClickStack, and the Theme - toolbar for light and dark. Prefer{' '} + Use the Theme toolbar for light and dark. Read the marks from{' '} useLogomark {' '} and{' '} useWordmark - {' '} - so the active brand is used automatically. + + .
@@ -90,9 +81,9 @@ export const Logos = () => {
{logomarkDownload} @@ -103,22 +94,14 @@ export const Logos = () => { Wordmark - {wordmarkIsSvg - ? 'Full brand lockup as a single SVG.' - : 'Logomark plus the HyperDX label in UI type. Download the logomark SVG above; the wordmark is not a standalone SVG.'} + Full brand lockup as a single SVG. - {wordmarkIsSvg ? ( - - {wordmark} - - ) : ( - - {wordmark} - - )} + + {wordmark} +
diff --git a/packages/app/src/theme/ChartColors.stories.tsx b/packages/app/src/theme/ChartColors.stories.tsx index 946b8caee..6e57c9cc1 100644 --- a/packages/app/src/theme/ChartColors.stories.tsx +++ b/packages/app/src/theme/ChartColors.stories.tsx @@ -142,10 +142,9 @@ export const AllChartColors = () => ( fontSize: 13, }} > - Semantic chart colors are unified across HyperDX and ClickStack — - `success` aliases categorical `chart-green` and `info` aliases - `chart-blue`. Brand identity for charts is carried by non-chart UI chrome - (Mantine accent, sidebar gradient), not by these tokens. + Semantic chart colors alias the categorical palette: `success` uses + `chart-green` and `info` uses `chart-blue`. The yellow accent stays in + non-chart chrome (Mantine accent, sidebar), not in these tokens.

{SEMANTIC_CHART_COLORS.map(({ name, hex, label }) => ( diff --git a/packages/app/src/theme/SemanticVariants.stories.tsx b/packages/app/src/theme/SemanticVariants.stories.tsx index 736d4b4da..37c233677 100644 --- a/packages/app/src/theme/SemanticVariants.stories.tsx +++ b/packages/app/src/theme/SemanticVariants.stories.tsx @@ -10,8 +10,8 @@ import { /** * Showcases the semantic component variants wired to the `--color-text-*` - * design tokens. Use the Brand (HyperDX / ClickStack) and Theme (Light / Dark) - * toolbar toggles to verify each variant across all four combinations. + * design tokens. Use the Theme (Light / Dark) toolbar toggle to verify each + * variant in both color modes. */ const story = { title: 'Design tokens/Semantic variants', diff --git a/packages/app/src/theme/ThemeProvider.tsx b/packages/app/src/theme/ThemeProvider.tsx deleted file mode 100644 index 56c8a9657..000000000 --- a/packages/app/src/theme/ThemeProvider.tsx +++ /dev/null @@ -1,256 +0,0 @@ -import React, { - createContext, - use, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; - -import { INSTANCE_TITLE_SUFFIX } from '@/config'; - -import { - DEFAULT_THEME, - getDevThemeName, - getTheme, - IS_DEV, - safeLocalStorageRemove, - safeLocalStorageSet, - THEME_STORAGE_KEY, - themes, -} from './index'; -import { ThemeConfig, ThemeName } from './types'; - -// Type declaration for window namespace (avoids conflicts) -declare global { - interface Window { - __HDX_THEME?: { - current: ThemeName; - set: (name: ThemeName) => void; - toggle: () => void; - clear: () => void; - }; - } -} - -interface ThemeContextValue { - theme: ThemeConfig; - themeName: ThemeName; - availableThemes: ThemeName[]; - // Dev-only functions - setTheme: (name: ThemeName) => void; - toggleTheme: () => void; - clearThemeOverride: () => void; - isDev: boolean; -} - -const ThemeContext = createContext(null); - -export function AppThemeProvider({ - themeName: propsThemeName, - children, -}: { - themeName?: ThemeName; - children: React.ReactNode; -}) { - // SSR/initial render: Always use props or DEFAULT_THEME for hydration consistency. - // The server cannot read localStorage, so we must start with a deterministic value. - // - // HYDRATION NOTE: In dev mode, the useEffect below may update the theme after hydration - // if localStorage contains a different theme. This is intentional for dev testing - // and will cause a brief flash. In production (IS_DEV=false), theme is stable and - // matches server render. To avoid any flash in production, pass themeName prop explicitly. - const [resolvedThemeName, setResolvedThemeName] = useState( - () => propsThemeName ?? DEFAULT_THEME, - ); - - // After hydration, read from localStorage in dev mode only. - // Uses consolidated getDevThemeName() from index.ts as single source of truth. - // This effect only changes state in dev mode, so production has no hydration mismatch. - useEffect(() => { - // If theme is explicitly passed via props, use that (no dev override) - if (propsThemeName) { - setResolvedThemeName(propsThemeName); - return; - } - - // In dev mode only, allow localStorage override for testing themes - if (IS_DEV) { - const devTheme = getDevThemeName(); - setResolvedThemeName(devTheme); - } - }, [propsThemeName]); - - const theme = useMemo(() => { - return getTheme(resolvedThemeName); - }, [resolvedThemeName]); - - // Theme control functions - DEV MODE ONLY - // Brand theme is deployment-configured in production (via NEXT_PUBLIC_THEME). - // These functions are intentionally disabled in production - users should not - // be able to switch brand themes; each deployment is branded for one product. - const setTheme = useCallback((name: ThemeName) => { - if (!IS_DEV) { - console.warn( - 'setTheme only works in development mode. Brand theme is deployment-configured in production.', - ); - return; - } - if (themes[name]) { - safeLocalStorageSet(THEME_STORAGE_KEY, name); - setResolvedThemeName(name); - } - }, []); - - const toggleTheme = useCallback(() => { - if (!IS_DEV) return; - const themeNames = Object.keys(themes) as ThemeName[]; - setResolvedThemeName(current => { - const currentIndex = themeNames.indexOf(current); - const nextIndex = (currentIndex + 1) % themeNames.length; - const nextTheme = themeNames[nextIndex]; - safeLocalStorageSet(THEME_STORAGE_KEY, nextTheme); - return nextTheme; - }); - }, []); - - const clearThemeOverride = useCallback(() => { - safeLocalStorageRemove(THEME_STORAGE_KEY); - setResolvedThemeName(propsThemeName ?? DEFAULT_THEME); - }, [propsThemeName]); - - const contextValue = useMemo( - () => ({ - theme, - themeName: theme.name, - availableThemes: Object.keys(themes) as ThemeName[], - setTheme, - toggleTheme, - clearThemeOverride, - isDev: IS_DEV, - }), - [theme, setTheme, toggleTheme, clearThemeOverride], - ); - - // Track previous theme class for efficient swap - const prevThemeClassRef = useRef(null); - - // Apply theme CSS class to document (single class swap for performance) - useEffect(() => { - if (typeof document !== 'undefined') { - const html = document.documentElement; - const newClass = theme.cssClass; - - // Remove only the previous theme class (not all themes) - if (prevThemeClassRef.current && prevThemeClassRef.current !== newClass) { - html.classList.remove(prevThemeClassRef.current); - } - - // Add new theme class if not already present - if (!html.classList.contains(newClass)) { - html.classList.add(newClass); - } - - prevThemeClassRef.current = newClass; - } - }, [theme]); - - // Dev mode: expose theme API to window (namespaced to avoid global pollution) - useEffect(() => { - if (!IS_DEV || typeof window === 'undefined') return; - - // eslint-disable-next-line no-console - console.info( - `🎨 Theme: ${theme.displayName} (${theme.name})`, - '\n Set via console: window.__HDX_THEME.set("dfe")', - ); - - // Expose namespaced helper object to window for console access - window.__HDX_THEME = { - current: theme.name, - set: setTheme, - toggle: toggleTheme, - clear: clearThemeOverride, - }; - - // Cleanup on unmount - return () => { - delete window.__HDX_THEME; - }; - }, [theme, setTheme, toggleTheme, clearThemeOverride]); - - return {children}; -} - -export function useAppTheme(): ThemeContextValue { - const context = use(ThemeContext); - if (!context) { - // Fallback for when used outside provider - always use default to avoid hydration issues - const theme = getTheme(DEFAULT_THEME); - return { - theme, - themeName: theme.name, - availableThemes: Object.keys(themes) as ThemeName[], - // No-op functions when outside provider context - setTheme: () => { - console.warn( - 'useAppTheme: setTheme called outside of AppThemeProvider', - ); - }, - toggleTheme: () => { - console.warn( - 'useAppTheme: toggleTheme called outside of AppThemeProvider', - ); - }, - clearThemeOverride: () => { - console.warn( - 'useAppTheme: clearThemeOverride called outside of AppThemeProvider', - ); - }, - isDev: IS_DEV, - }; - } - return context; -} - -// Convenience hooks -// NOTE: These hooks return JSX elements, not component references, to avoid -// creating components during render (which would violate react-hooks/static-components) -export function useWordmark() { - const { theme } = useAppTheme(); - const WordmarkComponent = theme.Wordmark; - return useMemo(() => , [WordmarkComponent]); -} - -export function useLogomark(props?: { size?: number }) { - const { theme } = useAppTheme(); - const LogomarkComponent = theme.Logomark; - return useMemo( - () => , - [LogomarkComponent, props], - ); -} - -// Hook to get current theme name (useful for conditional rendering) -export function useThemeName(): ThemeName { - const { themeName } = useAppTheme(); - return themeName; -} - -/** Hook to get the current theme's display name for UI copy (e.g. "HyperDX" or "ClickStack"). */ -export function useBrandDisplayName(): string { - const { theme } = useAppTheme(); - return theme.displayName; -} - -/** - * Hook to build a ``/`<NextSeo title>` value: brand name plus the - * configured instance label, with an optional page name prepended. - * e.g. usePageTitle('Search') => "Search - HyperDX USA" - */ -export function usePageTitle(page?: string): string { - const brandName = useBrandDisplayName(); - const brandTitle = `${brandName}${INSTANCE_TITLE_SUFFIX}`; - return page ? `${page} - ${brandTitle}` : brandTitle; -} diff --git a/packages/app/src/theme/__tests__/ThemeProvider.test.tsx b/packages/app/src/theme/__tests__/ThemeProvider.test.tsx deleted file mode 100644 index 008239a8f..000000000 --- a/packages/app/src/theme/__tests__/ThemeProvider.test.tsx +++ /dev/null @@ -1,229 +0,0 @@ -/** - * Unit tests for ThemeProvider - * - * Tests cover: - * - Context provides correct theme data - * - useAppTheme hook functionality - * - useWordmark and useLogomark hooks - * - Fallback behavior outside provider - * - Theme CSS class application - */ - -import React from 'react'; -import { renderHook } from '@testing-library/react'; - -import { DEFAULT_THEME, themes } from '@/theme/index'; -import { - AppThemeProvider, - useAppTheme, - useLogomark, - usePageTitle, - useThemeName, - useWordmark, -} from '@/theme/ThemeProvider'; - -jest.mock('@/config', () => ({ INSTANCE_TITLE_SUFFIX: ' UK' })); - -// Mock localStorage -let localStorageMock: jest.Mocked<Storage>; - -beforeEach(() => { - localStorageMock = { - getItem: jest.fn().mockReturnValue(null), - setItem: jest.fn(), - removeItem: jest.fn(), - clear: jest.fn(), - key: jest.fn(), - length: 0, - }; - - Object.defineProperty(window, 'localStorage', { - value: localStorageMock, - writable: true, - }); - - // Reset document classList - document.documentElement.className = ''; -}); - -afterEach(() => { - jest.clearAllMocks(); -}); - -describe('ThemeProvider', () => { - describe('AppThemeProvider', () => { - const wrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider>{children}</AppThemeProvider> - ); - - it('should provide default theme when no props passed', () => { - const { result } = renderHook(() => useAppTheme(), { wrapper }); - - expect(result.current.theme).toBeDefined(); - expect(result.current.themeName).toBe(DEFAULT_THEME); - }); - - it('should use themeName prop when provided', () => { - const customWrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider themeName="clickstack">{children}</AppThemeProvider> - ); - - const { result } = renderHook(() => useAppTheme(), { - wrapper: customWrapper, - }); - - expect(result.current.themeName).toBe('clickstack'); - expect(result.current.theme.name).toBe('clickstack'); - }); - - it('should provide list of available themes', () => { - const { result } = renderHook(() => useAppTheme(), { wrapper }); - - expect(result.current.availableThemes).toEqual( - expect.arrayContaining(['hyperdx', 'clickstack']), - ); - }); - - it('should provide isDev flag', () => { - const { result } = renderHook(() => useAppTheme(), { wrapper }); - - expect(typeof result.current.isDev).toBe('boolean'); - }); - - it('should apply theme CSS class to document', () => { - renderHook(() => useAppTheme(), { wrapper }); - - // Check that exactly one theme class is applied - const appliedThemeClasses = Object.values(themes) - .map(t => t.cssClass) - .filter(cls => document.documentElement.classList.contains(cls)); - - expect(appliedThemeClasses.length).toBe(1); - }); - }); - - describe('useAppTheme outside provider', () => { - it('should return fallback values without crashing', () => { - // Mock console.warn to avoid noise - const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {}); - - const { result } = renderHook(() => useAppTheme()); - - expect(result.current.theme).toBeDefined(); - expect(result.current.themeName).toBe(DEFAULT_THEME); - expect(result.current.availableThemes).toBeDefined(); - - // Calling setTheme outside provider should warn - result.current.setTheme('clickstack'); - expect(warnSpy).toHaveBeenCalled(); - - warnSpy.mockRestore(); - }); - }); - - describe('useWordmark', () => { - const wrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider>{children}</AppThemeProvider> - ); - - it('should return a component', () => { - const { result } = renderHook(() => useWordmark(), { wrapper }); - - expect(result.current).toBeDefined(); - expect(typeof result.current).toBe('object'); - }); - }); - - describe('useLogomark', () => { - const wrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider>{children}</AppThemeProvider> - ); - - it('should return a component', () => { - const { result } = renderHook(() => useLogomark(), { wrapper }); - - expect(result.current).toBeDefined(); - expect(typeof result.current).toBe('object'); - }); - }); - - describe('usePageTitle', () => { - const wrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider>{children}</AppThemeProvider> - ); - - it('appends the brand name and instance suffix with no page name', () => { - const { result } = renderHook(() => usePageTitle(), { wrapper }); - - expect(result.current).toBe('HyperDX UK'); - }); - - it('prepends the page name when given one', () => { - const { result } = renderHook(() => usePageTitle('Search'), { wrapper }); - - expect(result.current).toBe('Search - HyperDX UK'); - }); - }); - - describe('useThemeName', () => { - it('should return current theme name', () => { - const wrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider themeName="clickstack">{children}</AppThemeProvider> - ); - - const { result } = renderHook(() => useThemeName(), { wrapper }); - - expect(result.current).toBe('clickstack'); - }); - }); - - describe('theme switching (dev mode)', () => { - const wrapper = ({ children }: { children: React.ReactNode }) => ( - <AppThemeProvider>{children}</AppThemeProvider> - ); - - it('should have setTheme function', () => { - const { result } = renderHook(() => useAppTheme(), { wrapper }); - - expect(typeof result.current.setTheme).toBe('function'); - }); - - it('should have toggleTheme function', () => { - const { result } = renderHook(() => useAppTheme(), { wrapper }); - - expect(typeof result.current.toggleTheme).toBe('function'); - }); - - it('should have clearThemeOverride function', () => { - const { result } = renderHook(() => useAppTheme(), { wrapper }); - - expect(typeof result.current.clearThemeOverride).toBe('function'); - }); - }); - - describe('hydration safety', () => { - it('should start with deterministic theme for SSR consistency', () => { - // Initial render should use DEFAULT_THEME or props, not localStorage - // This ensures server and client render the same initially - const { result } = renderHook(() => useAppTheme(), { - wrapper: ({ children }) => ( - <AppThemeProvider>{children}</AppThemeProvider> - ), - }); - - // Should be deterministic (props or DEFAULT_THEME) - expect(result.current.themeName).toBe(DEFAULT_THEME); - }); - - it('should use props theme for consistent hydration', () => { - const { result } = renderHook(() => useAppTheme(), { - wrapper: ({ children }) => ( - <AppThemeProvider themeName="clickstack">{children}</AppThemeProvider> - ), - }); - - // Props should take precedence for hydration consistency - expect(result.current.themeName).toBe('clickstack'); - }); - }); -}); diff --git a/packages/app/src/theme/__tests__/index.test.ts b/packages/app/src/theme/__tests__/index.test.ts deleted file mode 100644 index 202a7cb31..000000000 --- a/packages/app/src/theme/__tests__/index.test.ts +++ /dev/null @@ -1,213 +0,0 @@ -/** - * Unit tests for theme utilities - * - * Tests cover: - * - Theme registry and validation - * - getTheme() function - * - getDevThemeName() function (localStorage-based) - * - Safe localStorage helpers - * - THEME_STORAGE_KEY constant - */ - -import { - DEFAULT_THEME, - getDevThemeName, - getTheme, - safeLocalStorageGet, - safeLocalStorageRemove, - safeLocalStorageSet, - THEME_STORAGE_KEY, - themes, -} from '@/theme/index'; - -describe('theme/index', () => { - beforeEach(() => { - // Clear localStorage before each test - window.localStorage.clear(); - }); - - afterEach(() => { - jest.clearAllMocks(); - window.localStorage.clear(); - }); - - describe('themes registry', () => { - it('should contain hyperdx theme', () => { - expect(themes.hyperdx).toBeDefined(); - expect(themes.hyperdx.name).toBe('hyperdx'); - expect(themes.hyperdx.displayName).toBe('HyperDX'); - }); - - it('should contain clickstack theme', () => { - expect(themes.clickstack).toBeDefined(); - expect(themes.clickstack.name).toBe('clickstack'); - expect(themes.clickstack.displayName).toBe('ClickStack'); - }); - - it('should have required properties for each theme', () => { - Object.values(themes).forEach(theme => { - expect(theme.name).toBeDefined(); - expect(theme.displayName).toBeDefined(); - expect(theme.mantineTheme).toBeDefined(); - expect(theme.Wordmark).toBeDefined(); - expect(theme.Logomark).toBeDefined(); - expect(theme.cssClass).toBeDefined(); - expect(theme.favicon).toBeDefined(); - }); - }); - - it('should have valid favicon config for each theme', () => { - Object.values(themes).forEach(theme => { - expect(theme.favicon.svg).toBeDefined(); - expect(theme.favicon.png32).toBeDefined(); - expect(theme.favicon.png16).toBeDefined(); - expect(theme.favicon.appleTouchIcon).toBeDefined(); - expect(theme.favicon.themeColor).toMatch(/^#[0-9A-Fa-f]{6}$/); - }); - }); - - it('should have unique cssClass for each theme', () => { - const cssClasses = Object.values(themes).map(t => t.cssClass); - const uniqueClasses = new Set(cssClasses); - expect(uniqueClasses.size).toBe(cssClasses.length); - }); - }); - - describe('DEFAULT_THEME', () => { - it('should be a valid theme name', () => { - expect(['hyperdx', 'clickstack']).toContain(DEFAULT_THEME); - }); - - it('should exist in themes registry', () => { - expect(themes[DEFAULT_THEME]).toBeDefined(); - }); - }); - - describe('getTheme', () => { - it('should return hyperdx theme for "hyperdx"', () => { - const theme = getTheme('hyperdx'); - expect(theme.name).toBe('hyperdx'); - }); - - it('should return clickstack theme for "clickstack"', () => { - const theme = getTheme('clickstack'); - expect(theme.name).toBe('clickstack'); - }); - - it('should return default theme when called without arguments', () => { - const theme = getTheme(); - expect(theme).toBeDefined(); - expect(theme.name).toBe(DEFAULT_THEME); - }); - - it('should fallback to hyperdx for invalid theme name', () => { - // @ts-expect-error Testing invalid input - const theme = getTheme('invalid-theme'); - expect(theme.name).toBe('hyperdx'); - }); - - it('should return theme with all required properties', () => { - const theme = getTheme('hyperdx'); - expect(theme.name).toBeDefined(); - expect(theme.displayName).toBeDefined(); - expect(theme.mantineTheme).toBeDefined(); - expect(theme.Wordmark).toBeDefined(); - expect(theme.Logomark).toBeDefined(); - expect(theme.cssClass).toBeDefined(); - expect(theme.favicon).toBeDefined(); - }); - }); - - describe('safeLocalStorageGet', () => { - it('should return value from localStorage', () => { - window.localStorage.setItem(THEME_STORAGE_KEY, 'clickstack'); - const result = safeLocalStorageGet(THEME_STORAGE_KEY); - expect(result).toBe('clickstack'); - }); - - it('should return undefined when localStorage item does not exist', () => { - const result = safeLocalStorageGet('non-existent-key'); - expect(result).toBeUndefined(); - }); - - it('should handle different value types stored as strings', () => { - window.localStorage.setItem('test-key', 'some-value'); - const result = safeLocalStorageGet('test-key'); - expect(result).toBe('some-value'); - }); - }); - - describe('safeLocalStorageSet', () => { - it('should set value in localStorage', () => { - safeLocalStorageSet(THEME_STORAGE_KEY, 'clickstack'); - expect(window.localStorage.getItem(THEME_STORAGE_KEY)).toBe('clickstack'); - }); - - it('should overwrite existing value', () => { - window.localStorage.setItem(THEME_STORAGE_KEY, 'hyperdx'); - safeLocalStorageSet(THEME_STORAGE_KEY, 'clickstack'); - expect(window.localStorage.getItem(THEME_STORAGE_KEY)).toBe('clickstack'); - }); - }); - - describe('safeLocalStorageRemove', () => { - it('should remove item from localStorage', () => { - window.localStorage.setItem(THEME_STORAGE_KEY, 'clickstack'); - safeLocalStorageRemove(THEME_STORAGE_KEY); - expect(window.localStorage.getItem(THEME_STORAGE_KEY)).toBeNull(); - }); - - it('should not throw when removing non-existent key', () => { - expect(() => safeLocalStorageRemove('non-existent-key')).not.toThrow(); - }); - }); - - describe('getDevThemeName', () => { - it('should return DEFAULT_THEME when no localStorage override exists', () => { - // No localStorage override, should use default - const result = getDevThemeName(); - expect(result).toBe(DEFAULT_THEME); - }); - - it('should use localStorage when set', () => { - window.localStorage.setItem(THEME_STORAGE_KEY, 'clickstack'); - const result = getDevThemeName(); - expect(result).toBe('clickstack'); - }); - - it('should ignore invalid localStorage value', () => { - window.localStorage.setItem(THEME_STORAGE_KEY, 'invalid-theme'); - const result = getDevThemeName(); - expect(result).toBe(DEFAULT_THEME); - }); - }); - - describe('THEME_STORAGE_KEY', () => { - it('should be the expected key', () => { - expect(THEME_STORAGE_KEY).toBe('hdx-dev-theme'); - }); - - it('should be a non-empty string', () => { - expect(typeof THEME_STORAGE_KEY).toBe('string'); - expect(THEME_STORAGE_KEY.length).toBeGreaterThan(0); - }); - }); - - describe('theme favicon paths', () => { - it('should have consistent path structure for hyperdx', () => { - const favicon = themes.hyperdx.favicon; - expect(favicon.svg).toContain('/favicons/hyperdx/'); - expect(favicon.png32).toContain('/favicons/hyperdx/'); - expect(favicon.png16).toContain('/favicons/hyperdx/'); - expect(favicon.appleTouchIcon).toContain('/favicons/hyperdx/'); - }); - - it('should have consistent path structure for clickstack', () => { - const favicon = themes.clickstack.favicon; - expect(favicon.svg).toContain('/favicons/clickstack/'); - expect(favicon.png32).toContain('/favicons/clickstack/'); - expect(favicon.png16).toContain('/favicons/clickstack/'); - expect(favicon.appleTouchIcon).toContain('/favicons/clickstack/'); - }); - }); -}); diff --git a/packages/app/src/theme/_base-tokens.scss b/packages/app/src/theme/_base-tokens.scss new file mode 100644 index 000000000..dddc1565c --- /dev/null +++ b/packages/app/src/theme/_base-tokens.scss @@ -0,0 +1,16 @@ +/* Design tokens. ClickStack is the only palette; light and dark are + * selected with data-mantine-color-scheme. Importing the tokens file + * emits those selectors. */ + +@use './themes/dfe/tokens'; + +/* + * Menu.Item + color="red": Mantine inlines --menu-item-color as red-6 while + * --menu-item-hover uses red-light-hover. `Menu.extend` styles do not reach items + * because Popover defaults to withinPortal — the dropdown is outside the Menu + * root, so component-scoped theme CSS never matches. Global rule + !important + * beats inline vars; substring matches Mantine red light hover token. + */ +[data-menu-item][style*='red-light-hover'] { + --menu-item-color: var(--mantine-color-red-light-color) !important; +} diff --git a/packages/app/src/theme/themes/_chart-categorical-tokens.scss b/packages/app/src/theme/_chart-categorical-tokens.scss similarity index 74% rename from packages/app/src/theme/themes/_chart-categorical-tokens.scss rename to packages/app/src/theme/_chart-categorical-tokens.scss index 4c9454bab..9ed075ac8 100644 --- a/packages/app/src/theme/themes/_chart-categorical-tokens.scss +++ b/packages/app/src/theme/_chart-categorical-tokens.scss @@ -1,15 +1,10 @@ -/* Shared Chart Tokens - used by both theme files */ +/* Shared chart tokens */ /* - * Categorical hues and semantic chart colors are unified across HyperDX and - * ClickStack. This file is the SCSS source of truth for both layers; each - * brand theme `@use`s it and `@include`s the mixins inside its per-theme - * `chart-tokens` mixin (categorical first, then semantic — semantics reference - * `var(--color-chart-green)` / `var(--color-chart-blue)`). - * - * Per-brand overrides: if a future brand needs a different semantic hex, - * declare it in that theme's `chart-tokens` mixin *after* the shared - * `@include chart-semantic-tokens` call. + * Categorical hues and semantic chart colors. This file is the SCSS source + * of truth; `_tokens.scss` `@use`s it and `@include`s the mixins + * inside its `chart-tokens` mixin (categorical first, then semantic — + * semantics reference `var(--color-chart-green)` / `var(--color-chart-blue)`). * * Categorical hues — React reads these from `CATEGORICAL_HEX_BY_TOKEN` in * `packages/app/src/utils.ts` directly (`getColorFromCSSVariable` / @@ -41,7 +36,7 @@ } /* - * Semantic chart colors — unified on both brands. All four semantic vars + * Semantic chart colors. All four semantic vars * alias their matching categorical hue var so a future tweak to e.g. * `--color-chart-orange` propagates to `--color-chart-warning` without * a second edit. Must be `@include`d after `chart-categorical-tokens`. diff --git a/packages/app/src/theme/themes/clickstack/_tokens.scss b/packages/app/src/theme/_tokens.scss similarity index 98% rename from packages/app/src/theme/themes/clickstack/_tokens.scss rename to packages/app/src/theme/_tokens.scss index b88e7a86d..c9087ba40 100644 --- a/packages/app/src/theme/themes/clickstack/_tokens.scss +++ b/packages/app/src/theme/_tokens.scss @@ -1,6 +1,6 @@ -/* ClickStack Theme Design Tokens */ +/* Design tokens */ -/* Yellow/Gold accent theme for ClickStack branding */ +/* Yellow/Gold accent */ /* Uses Click UI design tokens */ @@ -14,7 +14,7 @@ * `chart-categorical-tokens` partial (two mixins: hues, then semantics). */ -@use '../chart-categorical-tokens' as shared-chart; +@use './chart-categorical-tokens' as shared-chart; @mixin chart-tokens { @include shared-chart.chart-categorical-tokens; @@ -22,7 +22,7 @@ } /* Dark Mode */ -.theme-clickstack[data-mantine-color-scheme='dark'] { +[data-mantine-color-scheme='dark'] { /* Brand Palette - Yellow/Gold */ --palette-brand-50: #ffffe8; --palette-brand-100: #feffba; @@ -249,7 +249,7 @@ } /* Light Mode */ -.theme-clickstack[data-mantine-color-scheme='light'] { +[data-mantine-color-scheme='light'] { /* Brand Palette - Yellow/Gold */ --palette-brand-50: #ffffe8; --palette-brand-100: #feffc2; @@ -499,8 +499,8 @@ * keeps this independent of Mantine's auto-generated CSS module class * names. `--click-global-color-background-default` is already * scheme-aware: dark in dark mode, white in light mode, so the same - * declaration handles both themes. */ -.theme-clickstack input[role='switch'][data-checked='true'] + * { + * declaration handles both color modes. */ +input[role='switch'][data-checked='true'] + * { --switch-text-color: var(--click-global-color-background-default); --switch-thumb-bg: var(--click-global-color-background-default); } diff --git a/packages/app/src/theme/themes/components.module.scss b/packages/app/src/theme/components.module.scss similarity index 100% rename from packages/app/src/theme/themes/components.module.scss rename to packages/app/src/theme/components.module.scss diff --git a/packages/app/src/theme/index.ts b/packages/app/src/theme/index.ts deleted file mode 100644 index 3fa995947..000000000 --- a/packages/app/src/theme/index.ts +++ /dev/null @@ -1,283 +0,0 @@ -import { env } from 'next-runtime-env'; -import { z } from 'zod'; - -import { clickstackTheme } from './themes/clickstack'; -import { dfeTheme } from './themes/dfe'; -import { hyperdxTheme } from './themes/hyperdx'; -import { ThemeConfig, ThemeName } from './types'; - -/** - * Brand Theme System - * - * DESIGN DECISION: Brand theme (hyperdx/clickstack) is DEPLOYMENT-CONFIGURED, not user-selectable. - * - * - Production: Theme is set via NEXT_PUBLIC_THEME environment variable at build/deploy time. - * Each deployment is branded for a specific product (HyperDX or ClickStack). - * Users cannot and should not change the brand theme. - * - * - Development: Theme switching is enabled for testing via: - * - localStorage: hdx-dev-theme (persisted via dev UI) - * - * This is intentionally different from colorMode (light/dark), which IS user-selectable. - */ - -// Zod schema for validating ThemeConfig structure -// Note: React components and MantineThemeOverride are validated at runtime -// but cannot be fully validated with Zod schemas -const faviconConfigSchema = z.object({ - svg: z - .string() - .regex( - /^\/favicons\/[a-z]+\/[a-z0-9-]+\.svg$/, - 'SVG favicon path must match /favicons/{theme}/{name}.svg', - ), - png32: z - .string() - .regex( - /^\/favicons\/[a-z]+\/[a-z0-9-]+\.png$/, - 'PNG32 favicon path must match /favicons/{theme}/{name}.png', - ), - png16: z - .string() - .regex( - /^\/favicons\/[a-z]+\/[a-z0-9-]+\.png$/, - 'PNG16 favicon path must match /favicons/{theme}/{name}.png', - ), - appleTouchIcon: z - .string() - .regex( - /^\/favicons\/[a-z]+\/[a-z0-9-]+\.png$/, - 'Apple Touch Icon path must match /favicons/{theme}/{name}.png', - ), - themeColor: z.string().regex(/^#[0-9A-F]{6}$/i, 'Must be a valid hex color'), -}); - -const themeConfigSchema = z.object({ - name: z.enum(['hyperdx', 'clickstack', 'dfe']), - displayName: z.string().min(1), - cssClass: z.string().min(1), - favicon: faviconConfigSchema, - // Wordmark and Logomark are React components - validate they exist and are callable - Wordmark: z - .any() - .refine( - val => typeof val === 'function' || (val && typeof val === 'object'), - 'Wordmark must be a React component', - ), - Logomark: z - .any() - .refine( - val => typeof val === 'function' || (val && typeof val === 'object'), - 'Logomark must be a React component', - ), - // mantineTheme is complex - just check it exists - mantineTheme: z - .any() - .refine( - val => val !== null && val !== undefined, - 'mantineTheme must be defined', - ), -}); - -/** - * Validates a theme configuration at runtime. - * Throws an error with details if validation fails. - * - * @param theme - Theme configuration to validate - * @param themeName - Name of the theme (for error messages) - * @throws Error if theme is invalid - */ -function validateThemeConfig( - theme: unknown, - themeName: string, -): asserts theme is ThemeConfig { - try { - themeConfigSchema.parse(theme); - } catch (error) { - if (error instanceof z.ZodError) { - const details = error.errors - .map(e => `${e.path.join('.')}: ${e.message}`) - .join('; '); - throw new Error( - `Invalid theme configuration for "${themeName}": ${details}`, - ); - } - throw error; - } -} - -// Validate themes at module load time -try { - validateThemeConfig(hyperdxTheme, 'hyperdx'); - validateThemeConfig(clickstackTheme, 'clickstack'); - validateThemeConfig(dfeTheme, 'dfe'); -} catch (error) { - // Log error but don't crash - fallback to default theme - console.error( - '[Theme Validation] Failed to validate theme configurations:', - error, - ); - // In production, we might want to throw to prevent deployment with invalid configs - if (process.env.NODE_ENV === 'production') { - throw error; - } -} - -// Theme registry -export const themes: Record<ThemeName, ThemeConfig> = { - hyperdx: hyperdxTheme, - clickstack: clickstackTheme, - dfe: dfeTheme, -}; - -/** When NEXT_PUBLIC_THEME is missing or invalid, and for safe runtime fallbacks. */ -export const FALLBACK_THEME: ThemeName = 'dfe'; - -// Check if we're in development/local mode -export const IS_DEV = - process.env.NODE_ENV === 'development' || - process.env.NEXT_PUBLIC_IS_LOCAL_MODE === 'true'; - -// LocalStorage key for dev theme override (exported for ThemeProvider) -export const THEME_STORAGE_KEY = 'hdx-dev-theme'; - -// Validate that a theme name is valid -export function isValidThemeName( - name: string | null | undefined, -): name is ThemeName { - return name != null && name in themes; -} - -// Safe localStorage access (handles private browsing, SSR, etc.) -export function safeLocalStorageGet(key: string): string | undefined { - try { - if (typeof window === 'undefined') return undefined; - return localStorage.getItem(key) ?? undefined; - } catch { - // localStorage may throw in private browsing or when disabled - return undefined; - } -} - -export function safeLocalStorageSet(key: string, value: string): void { - try { - if (typeof window === 'undefined') return; - localStorage.setItem(key, value); - } catch { - // localStorage may throw in private browsing or when disabled - } -} - -export function safeLocalStorageRemove(key: string): void { - try { - if (typeof window === 'undefined') return; - localStorage.removeItem(key); - } catch { - // localStorage may throw in private browsing or when disabled - } -} - -// Default theme (validated against registry, falls back to FALLBACK_THEME). -// Use runtimeEnv so the theme can be changed at container start-up without -// rebuilding the Next.js bundle. DFE: fall back to FALLBACK_THEME ('dfe'), not -// upstream's 'hyperdx'. -function getEnvTheme(): ThemeName { - const value = env('NEXT_PUBLIC_THEME'); - return isValidThemeName(value) ? value : FALLBACK_THEME; -} - -let resolvedDefaultTheme: ThemeName = getEnvTheme(); - -// Validate that the resolved default theme exists and is valid -if (!themes[resolvedDefaultTheme]) { - console.warn( - `[Theme Validation] Theme "${resolvedDefaultTheme}" from NEXT_PUBLIC_THEME not found in registry. Falling back to "${FALLBACK_THEME}".`, - ); - resolvedDefaultTheme = FALLBACK_THEME; -} else { - // Validate the theme config structure - try { - validateThemeConfig(themes[resolvedDefaultTheme], resolvedDefaultTheme); - } catch (error) { - console.error( - `[Theme Validation] Theme "${resolvedDefaultTheme}" failed validation. Falling back to "${FALLBACK_THEME}".`, - error, - ); - resolvedDefaultTheme = FALLBACK_THEME; - // In production, throw to prevent deployment with invalid configs - if (process.env.NODE_ENV === 'production') { - throw error; - } - } -} - -export const DEFAULT_THEME: ThemeName = resolvedDefaultTheme; - -/** - * Get the theme name from various sources (dev mode only). - * This is the single source of truth for resolving dev theme names. - * - * Priority: - * 1. localStorage: hdx-dev-theme (persisted via explicit UI action) - * 2. Environment variable: NEXT_PUBLIC_THEME - * 3. Default: FALLBACK_THEME (dfe) - */ -export function getDevThemeName(): ThemeName { - if (typeof window === 'undefined') { - return DEFAULT_THEME; - } - - // Check localStorage (set via explicit user action in ThemeProvider) - const storedTheme = safeLocalStorageGet(THEME_STORAGE_KEY); - if (isValidThemeName(storedTheme)) { - return storedTheme; - } - - return DEFAULT_THEME; -} - -// Get theme configuration by name -export function getTheme(name: ThemeName = DEFAULT_THEME): ThemeConfig { - const theme = themes[name] || themes[DEFAULT_THEME]; - - // Runtime validation - ensure theme is valid before returning - // This catches cases where theme config was corrupted after module load - try { - validateThemeConfig(theme, name); - } catch (error) { - console.error( - `[Theme Validation] Theme "${name}" failed runtime validation. Falling back to "${FALLBACK_THEME}".`, - error, - ); - return themes[FALLBACK_THEME]; - } - - return theme; -} - -/** - * IMPORTANT: To get the current theme in React components, use `useAppTheme()` hook - * from `./ThemeProvider` instead of calling these functions directly. - * - * Why? - * - `useAppTheme()` ensures consistency with ThemeProvider context - * - Prevents hydration mismatches between SSR and client-side rendering - * - Properly handles theme switching in dev mode - * - Matches the theme resolution used throughout the app - * - * Example: - * ```tsx - * import { useAppTheme } from '@/theme/ThemeProvider'; - * - * function MyComponent() { - * const { theme, themeName } = useAppTheme(); - * return <div>{theme.displayName}</div>; - * } - * ``` - * - * These utility functions (`getTheme`, `getDevThemeName`) are for internal use - * by ThemeProvider and should not be used directly in components. - */ - -// Re-export types -export type { ThemeConfig, ThemeName } from './types'; diff --git a/packages/app/src/theme/themes/clickstack/mantineTheme.ts b/packages/app/src/theme/mantineTheme.ts similarity index 97% rename from packages/app/src/theme/themes/clickstack/mantineTheme.ts rename to packages/app/src/theme/mantineTheme.ts index ee902c56d..f4c2b68e1 100644 --- a/packages/app/src/theme/themes/clickstack/mantineTheme.ts +++ b/packages/app/src/theme/mantineTheme.ts @@ -4,6 +4,7 @@ import { Button, Checkbox, Code, + Loader, MantineTheme, MantineThemeOverride, Radio, @@ -21,17 +22,14 @@ import { SEMANTIC_ALERT_VARS, SEMANTIC_CONTROL_COLORS, SEMANTIC_TEXT_COLORS, -} from '@/theme/themes/semanticVariants'; +} from '@/theme/semanticVariants'; -import componentClasses from '@/theme/themes/components.module.scss'; +import componentClasses from '@/theme/components.module.scss'; import variantClasses from '@styles/variants.module.scss'; /** - * ClickStack Theme - * - * A distinct visual identity for ClickStack branding. - * Primary color: Yellow/Gold accent - * Style: Modern, professional + * App Mantine theme. + * Primary color: yellow/gold accent. */ const makeTheme = ({ fontFamily = '"Inter", sans-serif', @@ -90,6 +88,11 @@ const makeTheme = ({ }, }), }), + Loader: Loader.extend({ + defaultProps: { + color: 'var(--color-text-muted)', + }, + }), Tooltip: Tooltip.extend({ styles: () => ({ tooltip: { @@ -370,7 +373,7 @@ const makeTheme = ({ }, }), // Note: checked-state track-label color and thumb background are - // overridden globally in `clickstack/_tokens.scss` via an + // overridden globally in `theme/_tokens.scss` via an // attribute selector on the checkbox input, because Mantine // forces those values via a `:checked +` sibling selector that // can't be reached from this Mantine vars/styles API. diff --git a/packages/app/src/theme/themes/semanticVariants.ts b/packages/app/src/theme/semanticVariants.ts similarity index 87% rename from packages/app/src/theme/themes/semanticVariants.ts rename to packages/app/src/theme/semanticVariants.ts index d1c03ab26..567d2189f 100644 --- a/packages/app/src/theme/themes/semanticVariants.ts +++ b/packages/app/src/theme/semanticVariants.ts @@ -1,10 +1,8 @@ /** * Shared semantic component variants (danger / warning / success / info). * - * These map the custom `variant` strings we intercept in each brand theme's - * component overrides onto the semantic design tokens defined in - * `_tokens.scss`. Keeping them here means HyperDX and ClickStack stay in sync - * and there is a single source of truth for what each semantic variant means. + * These map the custom `variant` strings we intercept in the Mantine theme + * onto the semantic design tokens defined in `_tokens.scss`. */ /** `<Text variant="...">` → text color token. */ diff --git a/packages/app/src/theme/themes/_base-tokens.scss b/packages/app/src/theme/themes/_base-tokens.scss deleted file mode 100644 index a5cb0ae71..000000000 --- a/packages/app/src/theme/themes/_base-tokens.scss +++ /dev/null @@ -1,34 +0,0 @@ -/* Base Design Tokens - Fallback values when no theme class is applied */ - -/* - * Uses HyperDX theme as default fallback for SSR and initial render. - * This ensures CSS variables are defined before JavaScript applies the theme class. - * - * The hyperdx/_tokens.scss file defines mixins that are reused here, - * avoiding duplication of token definitions. - */ - -@use './hyperdx/tokens' as hyperdx-tokens; -@use './dfe/tokens' as dfe-tokens; -@use './clickstack/tokens' as clickstack-tokens; - -/* Dark Mode (default fallback) - uses DFE tokens */ -[data-mantine-color-scheme='dark'] { - @include dfe-tokens.dark-mode-tokens; -} - -/* Light Mode (fallback) - uses DFE tokens */ -[data-mantine-color-scheme='light'] { - @include dfe-tokens.light-mode-tokens; -} - -/* - * Menu.Item + color="red": Mantine inlines --menu-item-color as red-6 while - * --menu-item-hover uses red-light-hover. `Menu.extend` styles do not reach items - * because Popover defaults to withinPortal — the dropdown is outside the Menu - * root, so component-scoped theme CSS never matches. Global rule + !important - * beats inline vars; substring matches Mantine red light hover token. - */ -[data-menu-item][style*='red-light-hover'] { - --menu-item-color: var(--mantine-color-red-light-color) !important; -} diff --git a/packages/app/src/theme/themes/clickstack/Logomark.tsx b/packages/app/src/theme/themes/clickstack/Logomark.tsx deleted file mode 100644 index 53678b7c1..000000000 --- a/packages/app/src/theme/themes/clickstack/Logomark.tsx +++ /dev/null @@ -1,50 +0,0 @@ -/** - * ClickStack Logomark - * A stylized database/stack icon with the brand yellow color - */ -export default function Logomark({ size = 16 }: { size?: number }) { - return ( - <svg width={size} height={size} fill="none" viewBox="0 0 24 24"> - <rect - width="2.25" - height="20.249" - x="1.875" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="20.249" - x="6.375" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="20.249" - x="10.875" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="20.249" - x="15.374" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="4.5" - x="19.875" - y="9.75" - fill="currentColor" - rx="0.237" - ></rect> - </svg> - ); -} diff --git a/packages/app/src/theme/themes/clickstack/Wordmark.tsx b/packages/app/src/theme/themes/clickstack/Wordmark.tsx deleted file mode 100644 index 842f7f64b..000000000 --- a/packages/app/src/theme/themes/clickstack/Wordmark.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; - -export default function Wordmark() { - return ( - <div className="align-items-center d-flex"> - <svg - xmlns="http://www.w3.org/2000/svg" - width="121" - height="25" - fill="none" - viewBox="0 0 121 25" - > - <rect - width="2.25" - height="20.249" - x="1.875" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="20.249" - x="6.375" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="20.249" - x="10.875" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="20.249" - x="15.374" - y="1.875" - fill="currentColor" - rx="0.237" - ></rect> - <rect - width="2.25" - height="4.5" - x="19.875" - y="9.75" - fill="currentColor" - rx="0.237" - ></rect> - <path - fill="currentColor" - d="M41.2 7.642q-.954 0-1.71.342-.756.324-1.296.972a4.7 4.7 0 0 0-.81 1.566q-.27.918-.27 2.07 0 1.512.45 2.628.45 1.098 1.35 1.692t2.268.594q.828 0 1.584-.144a16 16 0 0 0 1.566-.414v1.674q-.756.288-1.548.414-.792.144-1.836.144-1.962 0-3.276-.81-1.296-.81-1.944-2.304t-.648-3.492q0-1.458.396-2.664a6.1 6.1 0 0 1 1.188-2.106 5.1 5.1 0 0 1 1.908-1.35q1.152-.486 2.646-.486.972 0 1.908.216a7 7 0 0 1 1.692.576l-.72 1.62q-.63-.288-1.368-.504a5 5 0 0 0-1.53-.234M48.793 19h-1.908V5.32h1.908zm4.904-9.702V19h-1.908V9.298zm-.936-3.69q.432 0 .756.252t.324.846q0 .576-.324.846a1.2 1.2 0 0 1-.756.252 1.25 1.25 0 0 1-.792-.252q-.306-.27-.306-.846 0-.594.306-.846a1.25 1.25 0 0 1 .792-.252m7.838 13.572q-1.332 0-2.34-.522t-1.566-1.62q-.558-1.116-.558-2.826 0-1.8.594-2.916.612-1.116 1.638-1.638 1.044-.54 2.376-.54.81 0 1.512.18.72.162 1.188.378l-.576 1.548a9 9 0 0 0-1.08-.342 4.3 4.3 0 0 0-1.062-.144q-.9 0-1.494.396-.576.378-.864 1.152-.27.756-.27 1.908 0 1.098.288 1.854t.846 1.152q.576.378 1.422.378.81 0 1.422-.18t1.152-.468v1.656a4 4 0 0 1-1.134.45q-.612.144-1.494.144m6.808-7.02q0 .378-.036.864-.018.486-.054.9h.054l.342-.432.432-.54a10 10 0 0 1 .396-.468l2.97-3.186h2.214l-3.906 4.158L73.977 19h-2.25l-3.204-4.338-1.116.936V19h-1.89V5.32h1.89zm15.761 3.366q0 1.152-.558 1.962t-1.602 1.26q-1.044.432-2.484.432a10 10 0 0 1-1.35-.09 9 9 0 0 1-1.206-.216 5 5 0 0 1-.99-.36v-1.836q.72.324 1.692.594a7.9 7.9 0 0 0 1.98.252q.864 0 1.44-.234t.864-.648.288-.972q0-.594-.306-.99-.288-.414-.918-.756-.612-.36-1.656-.756-.72-.27-1.314-.594a5.2 5.2 0 0 1-1.026-.792q-.432-.45-.666-1.044t-.234-1.386q0-1.062.522-1.818.54-.756 1.476-1.152.936-.414 2.178-.414a8 8 0 0 1 1.926.216q.9.198 1.71.558l-.612 1.602q-.738-.306-1.494-.504a6.2 6.2 0 0 0-1.584-.198q-.72 0-1.206.216t-.738.594a1.64 1.64 0 0 0-.234.882q0 .594.27.99t.864.738q.594.324 1.566.72 1.08.414 1.836.9.774.486 1.17 1.17.396.666.396 1.674m5.793 2.106q.378 0 .774-.072t.684-.162v1.44q-.306.144-.828.234a5 5 0 0 1-1.044.108q-.792 0-1.458-.27-.648-.27-1.044-.936t-.396-1.854v-5.364h-1.35v-.864l1.422-.72.666-2.052h1.17v2.178h2.772v1.458h-2.772v5.328q0 .792.378 1.17.396.378 1.026.378m7.16-8.514q1.836 0 2.736.81.9.792.9 2.502V19h-1.35l-.378-1.35h-.072a5 5 0 0 1-.864.864 2.8 2.8 0 0 1-1.008.504q-.558.162-1.368.162a3.9 3.9 0 0 1-1.566-.306 2.5 2.5 0 0 1-1.08-.972q-.396-.666-.396-1.656 0-1.476 1.116-2.25 1.134-.774 3.438-.846l1.656-.054v-.54q0-1.08-.486-1.512t-1.368-.432q-.756 0-1.44.216a9 9 0 0 0-1.296.522l-.612-1.386a7.5 7.5 0 0 1 1.566-.594 7 7 0 0 1 1.872-.252m.45 5.256q-1.656.072-2.304.558-.63.468-.63 1.332 0 .756.45 1.098.468.342 1.17.342 1.134 0 1.872-.63t.738-1.89v-.846zm10.03 4.806q-1.332 0-2.34-.522t-1.566-1.62q-.558-1.116-.558-2.826 0-1.8.594-2.916.612-1.116 1.638-1.638 1.044-.54 2.376-.54.81 0 1.512.18.72.162 1.188.378l-.576 1.548a9 9 0 0 0-1.08-.342 4.3 4.3 0 0 0-1.062-.144q-.9 0-1.494.396-.576.378-.864 1.152-.27.756-.27 1.908 0 1.098.288 1.854t.846 1.152q.576.378 1.422.378.81 0 1.422-.18t1.152-.468v1.656a4 4 0 0 1-1.134.45q-.612.144-1.494.144m6.808-7.02q0 .378-.036.864-.018.486-.054.9h.054l.342-.432.432-.54a10 10 0 0 1 .396-.468l2.97-3.186h2.214l-3.906 4.158L119.979 19h-2.25l-3.204-4.338-1.116.936V19h-1.89V5.32h1.89z" - ></path> - </svg> - </div> - ); -} diff --git a/packages/app/src/theme/themes/clickstack/index.ts b/packages/app/src/theme/themes/clickstack/index.ts deleted file mode 100644 index 4270911b7..000000000 --- a/packages/app/src/theme/themes/clickstack/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ThemeConfig } from '@/theme/types'; - -import Logomark from './Logomark'; -import { theme } from './mantineTheme'; -import Wordmark from './Wordmark'; - -export const clickstackTheme: ThemeConfig = { - name: 'clickstack', - displayName: 'ClickStack', - mantineTheme: theme, - Wordmark, - Logomark, - cssClass: 'theme-clickstack', - favicon: { - svg: '/favicons/clickstack/favicon.svg', - png32: '/favicons/clickstack/favicon-32x32.png', - png16: '/favicons/clickstack/favicon-16x16.png', - appleTouchIcon: '/favicons/clickstack/apple-touch-icon.png', - themeColor: '#1a1a1a', // Dark background for ClickStack - }, -}; diff --git a/packages/app/src/theme/themes/dfe/_tokens.scss b/packages/app/src/theme/themes/dfe/_tokens.scss index 3fdf08a13..6250d0ed5 100644 --- a/packages/app/src/theme/themes/dfe/_tokens.scss +++ b/packages/app/src/theme/themes/dfe/_tokens.scss @@ -2,11 +2,7 @@ /* Default theme with blue accent */ -/* - * These mixins define all design tokens for HyperI theme. - * They are used both here (for .theme-hyperi scoped selectors) and - * in _base-tokens.scss (for unscoped fallback selectors during SSR). - */ +/* The console's only palette: theme/_base-tokens.scss uses this file in place of upstream's. */ @mixin base-tokens { /* hyperi-graphics brand SSoT navy (hyperi.tokens.json); matches the logo SVGs */ @@ -250,12 +246,10 @@ --color-chart-warning-highlight: #f5c94d; } -/* Dark Mode - scoped to .theme-dfe */ -.theme-dfe[data-mantine-color-scheme='dark'] { +[data-mantine-color-scheme='dark'] { @include dark-mode-tokens; } -/* Light Mode - scoped to .theme-dfe */ -.theme-dfe[data-mantine-color-scheme='light'] { +[data-mantine-color-scheme='light'] { @include light-mode-tokens; } diff --git a/packages/app/src/theme/themes/dfe/index.ts b/packages/app/src/theme/themes/dfe/index.ts deleted file mode 100644 index 9c39109a1..000000000 --- a/packages/app/src/theme/themes/dfe/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ThemeConfig } from '@/theme/types'; - -import Logomark from './Logomark'; -import { theme } from './mantineTheme'; -import Wordmark from './Wordmark'; - -export const dfeTheme: ThemeConfig = { - name: 'dfe', - displayName: 'DFE', - mantineTheme: theme, - Wordmark, - Logomark, - cssClass: 'theme-dfe', - favicon: { - svg: '/favicons/dfe/favicon.svg', - png32: '/favicons/dfe/favicon-32x32.png', - png16: '/favicons/dfe/favicon-16x16.png', - appleTouchIcon: '/favicons/dfe/apple-touch-icon.png', - themeColor: '#1a1a1a', // Dark background for DFE - }, -}; diff --git a/packages/app/src/theme/themes/hyperdx/Logomark.tsx b/packages/app/src/theme/themes/hyperdx/Logomark.tsx deleted file mode 100644 index 45803043f..000000000 --- a/packages/app/src/theme/themes/hyperdx/Logomark.tsx +++ /dev/null @@ -1,27 +0,0 @@ -export default function Logomark({ size = 16 }: { size?: number }) { - return ( - <svg - width={size} - height={size} - viewBox="0 0 512 512" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > - <g clipPath="url(#clip0_614_1164)"> - <path - d="M256 0L477.703 128V384L256 512L34.2975 384V128L256 0Z" - fill="#25E2A5" - /> - <path - d="M311.365 84.4663C314.818 86.9946 316.431 92.1862 315.256 96.9926L284.313 223.563H341.409C344.836 223.563 347.936 226.127 349.295 230.086C350.655 234.046 350.014 238.644 347.665 241.786L210.211 425.598C207.472 429.26 203.089 430.062 199.635 427.534C196.182 425.005 194.569 419.814 195.744 415.007L226.686 288.437H169.591C166.164 288.437 163.064 285.873 161.705 281.914C160.345 277.954 160.986 273.356 163.335 270.214L300.789 86.4023C303.528 82.7403 307.911 81.938 311.365 84.4663Z" - fill="#1E1E1E" - /> - </g> - <defs> - <clipPath id="clip0_614_1164"> - <rect width="512" height="512" fill="white" /> - </clipPath> - </defs> - </svg> - ); -} diff --git a/packages/app/src/theme/themes/hyperdx/Wordmark.tsx b/packages/app/src/theme/themes/hyperdx/Wordmark.tsx deleted file mode 100644 index 9a4e0e4c5..000000000 --- a/packages/app/src/theme/themes/hyperdx/Wordmark.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; - -import Logomark from './Logomark'; - -export default function Wordmark() { - return ( - <div className="align-items-center d-flex"> - <div - className="me-2" - style={{ - display: 'inline-flex', - alignItems: 'center', - }} - > - <Logomark size={20} /> - </div> - - <span - className="fw-bold mono" - style={{ - fontSize: 15, - }} - > - HyperDX - </span> - </div> - ); -} diff --git a/packages/app/src/theme/themes/hyperdx/_tokens.scss b/packages/app/src/theme/themes/hyperdx/_tokens.scss deleted file mode 100644 index d18584099..000000000 --- a/packages/app/src/theme/themes/hyperdx/_tokens.scss +++ /dev/null @@ -1,302 +0,0 @@ -/* HyperDX Theme Design Tokens */ - -/* Default theme with green accent */ - -/* - * These mixins define all design tokens for HyperDX theme. - * They are used both here (for .theme-hyperdx scoped selectors) and - * in _base-tokens.scss (for unscoped fallback selectors during SSR). - * - * `chart-tokens` is split out so the chart palette is defined once, - * not duplicated across the dark/light blocks. Both dark and light - * @include it so specificity stays identical to declaring the vars - * inline; Sass inlines the body of the mixin at each call site, so - * the resulting CSS is byte-identical to the previous hand-duplicated - * shape. Categorical and semantic chart tokens come from the shared - * `chart-categorical-tokens` partial (two mixins: hues, then semantics). - */ - -@use '../chart-categorical-tokens' as shared-chart; - -@mixin chart-tokens { - @include shared-chart.chart-categorical-tokens; - @include shared-chart.chart-semantic-tokens; -} - -@mixin dark-mode-tokens { - /* Backgrounds */ - --color-bg-body: var(--mantine-color-dark-9); - --color-bg-surface: var(--mantine-color-dark-5); - --color-bg-inverted: var(--mantine-color-dark-1); - --color-bg-muted: var(--mantine-color-dark-7); - - /* "Sunken" = a recessed backdrop that sits *below* raised content. Use it for - the area behind `--color-bg-body` cards (e.g. dashboard tiles) so the cards - visually pop. It is intentionally darker/greyer than the body itself. */ - --color-bg-sunken: color-mix(in srgb, var(--mantine-color-dark-9), #000 50%); - --color-bg-highlighted: rgb(55 58 64 / 70%); - --color-bg-table-stripe: rgb(255 255 255 / 4%); - --color-bg-sidenav: var(--mantine-color-dark-9); - --color-bg-sidenav-link-active: var(--mantine-color-dark-7); - --color-bg-sidenav-link-active-hover: var(--mantine-color-dark-6); - --color-bg-header: var(--mantine-color-dark-9); - --color-bg-hover: var(--mantine-color-dark-6); - --color-bg-active: var(--mantine-color-dark-5); - - /* Highlight background for an interactive row inside a floating surface - (Select/Combobox options, Menu items, popover/dropdown lists) when it is - hovered or is the currently-selected entry. */ - --color-bg-option-active: var(--mantine-color-dark-5); - --color-bg-field: var(--mantine-color-dark-7); - --color-bg-field-highlighted: var(--mantine-color-dark-6); - --color-bg-field-addon: var(--mantine-color-dark-6); - --color-bg-neutral: var(--mantine-color-dark-4); - --color-bg-brand: var(--mantine-color-green-3); - --color-bg-brand-hover: var(--mantine-color-green-2); - --color-bg-success: var(--mantine-color-green-5); - --color-bg-danger: var(--mantine-color-red-4); - --color-bg-warning: var(--mantine-color-orange-5); - - /* Subtle tinted backgrounds (+ hover) for semantic callouts (Alert, soft - Button/ActionIcon). Deep dark tints inlined as hex — the numbered scale's - darkest shades (`-9`) are mid-tone for green/yellow and can't meet AA with - colored text; these deeper values give ~9-11:1. Hover is one step lighter. */ - --color-bg-danger-subtle: #3d0d0d; - --color-bg-danger-subtle-hover: #651515; - --color-bg-warning-subtle: #3c3310; - --color-bg-warning-subtle-hover: #352d0e; - --color-bg-success-subtle: #0d2913; - --color-bg-success-subtle-hover: #16451f; - --color-bg-info-subtle: #071e34; - --color-bg-info-subtle-hover: #0c3256; - - /* Primary Button - uses brand green colors */ - --color-primary-button-bg: var(--color-bg-brand); - --color-primary-button-bg-hover: var(--color-bg-brand-hover); - --color-primary-button-text: var(--mantine-color-black); - - /* Borders & Dividers */ - --color-border: var(--mantine-color-dark-6); - --color-border-emphasis: var(--mantine-color-dark-4); - --color-border-muted: rgb(255 255 255 / 8%); - - /* Text */ - --color-text: var(--mantine-color-dark-0); - --color-text-inverted: var(--mantine-color-dark-9); - --color-text-primary: var(--mantine-color-green-4); - --color-text-primary-hover: var(--mantine-color-green-3); - --color-text-secondary: var(--mantine-color-dark-2); - --color-text-muted: var(--mantine-color-dark-2); - --color-text-muted-hover: var(--mantine-color-dark-1); - --color-text-brand: var(--mantine-color-green-4); - --color-text-brand-hover: var(--mantine-color-green-3); - --color-text-success: var(--mantine-color-green-4); - --color-text-success-hover: var(--mantine-color-green-3); - --color-text-danger: var(--mantine-color-red-3); - --color-text-warning: var(--mantine-color-yellow-3); - --color-text-info: var(--mantine-color-blue-3); - --color-text-sidenav-link: var(--mantine-color-dark-0); - --color-text-sidenav-link-active: var(--color-text-primary); - - /* Icons */ - --color-icon-primary: var(--mantine-color-dark-1); - --color-icon-muted: var(--mantine-color-dark-4); - - /* Overlay & Backdrop */ - --color-overlay: rgb(0 0 0 / 50%); - --color-backdrop: rgb(0 0 0 / 30%); - - /* States */ - --color-state-hover: var(--mantine-color-dark-6); - --color-state-selected: var(--mantine-color-dark-5); - --color-state-focus: var(--mantine-color-dark-4); - --color-outline-focus: var(--mantine-color-green-4); - - /* Slider */ - --color-slider-bar: var(--mantine-color-green-4); - --color-slider-thumb: var(--mantine-color-green-4); - --color-slider-thumb-border: var(--mantine-color-green-4); - --color-slider-dot: var(--mantine-color-dark-2); - --color-slider-dot-active: var(--mantine-color-green-8); - - /* Code / Misc UI */ - --color-bg-code: var(--mantine-color-dark-7); - --color-border-code: var(--mantine-color-dark-6); - --color-bg-kbd: var(--mantine-color-dark-9); - - /* JSON Syntax Highlighting */ - --color-json-string: var(--mantine-color-green-3); - --color-json-number: var(--mantine-color-orange-3); - --color-json-boolean: var(--mantine-color-orange-3); - --color-json-key: var(--mantine-color-violet-3); - --color-json-object: var(--mantine-color-green-3); - --color-json-array: var(--mantine-color-green-3); - --color-json-punctuation: var(--mantine-color-dark-4); - - @include chart-tokens; - - /* Visualization Range Selector (minimap viewports, brush ranges, etc.) */ - --color-viz-range-handle: var(--mantine-color-dark-2); - --color-viz-range-handle-grip: rgb(255 255 255 / 45%); - --color-viz-range-border: var(--mantine-color-dark-3); - --color-viz-range-overlay: rgb(0 0 0 / 20%); - --color-viz-range-brush: rgb(100 149 237 / 25%); - --color-viz-range-brush-border: rgb(100 149 237 / 60%); - - /* Shadows */ - --shadow-drawer: -4px 0 24px rgb(0 0 0 / 25%); - - /* Mantine Overrides */ - --mantine-color-body: var(--color-bg-body) !important; - --mantine-color-text: var(--color-text); -} - -@mixin light-mode-tokens { - /* Backgrounds - inverted (dark becomes light) */ - --color-bg-body: var(--mantine-color-white); - --color-bg-surface: var(--mantine-color-white); - --color-bg-inverted: var(--mantine-color-dark-3); - --color-bg-muted: #f6f6fa; - - /* "Sunken" = a recessed backdrop that sits *below* raised content. Use it for - the area behind `--color-bg-body` cards (e.g. dashboard tiles) so the cards - visually pop. It is intentionally slightly darker than the body itself. */ - --color-bg-sunken: #fafafc; - --color-bg-highlighted: rgb(230 232 237 / 70%); - --color-bg-table-stripe: rgb(0 0 0 / 3%); - --color-bg-sidenav: var(--mantine-color-white); - --color-bg-sidenav-link-active: #ebebef; - --color-bg-sidenav-link-active-hover: var(--mantine-color-gray-2); - --color-bg-header: var(--mantine-color-gray-1); - --color-bg-modal: var(--mantine-color-white); - --color-bg-hover: var(--mantine-color-gray-1); - --color-bg-active: var(--mantine-color-gray-4); - - /* Highlight background for an interactive row inside a floating surface - (Select/Combobox options, Menu items, popover/dropdown lists) when it is - hovered or is the currently-selected entry. */ - --color-bg-option-active: var(--color-bg-sidenav-link-active); - --color-bg-field: #f9f9fc; - --color-bg-field-highlighted: var(--mantine-color-white); - --color-bg-field-addon: var(--mantine-color-white); - --color-bg-neutral: var(--mantine-color-gray-5); - --color-bg-brand: var(--mantine-color-green-7); - --color-bg-brand-hover: var(--mantine-color-green-8); - --color-bg-success: var(--mantine-color-green-8); - --color-bg-danger: var(--mantine-color-red-8); - --color-bg-warning: var(--mantine-color-yellow-8); - - /* Subtle tinted backgrounds (+ hover) for semantic callouts (Alert, soft - Button/ActionIcon). Light mode uses Mantine's `-0` (bg) / `-1` (hover) - shades. */ - --color-bg-danger-subtle: var(--mantine-color-red-0); - --color-bg-danger-subtle-hover: var(--mantine-color-red-1); - --color-bg-warning-subtle: var(--mantine-color-yellow-0); - --color-bg-warning-subtle-hover: var(--mantine-color-yellow-1); - --color-bg-success-subtle: var(--mantine-color-green-0); - --color-bg-success-subtle-hover: var(--mantine-color-green-1); - --color-bg-info-subtle: var(--mantine-color-blue-0); - --color-bg-info-subtle-hover: var(--mantine-color-blue-1); - - /* Primary Button - uses brand green colors */ - --color-primary-button-bg: var(--color-bg-brand); - --color-primary-button-bg-hover: var(--color-bg-brand-hover); - --color-primary-button-text: var(--mantine-color-white); - - /* Borders & Dividers - inverted */ - --color-border: var(--mantine-color-gray-1); - --color-border-emphasis: var(--mantine-color-gray-2); - --color-border-muted: rgb(0 0 0 / 5%); - - /* Text - inverted */ - --color-text: var(--mantine-color-dark-9); - --color-text-inverted: var(--mantine-color-white); - --color-text-primary: var(--mantine-color-green-8); - --color-text-primary-hover: var(--mantine-color-green-9); - --color-text-secondary: var(--mantine-color-gray-5); - --color-text-muted: var(--mantine-color-dark-6); - --color-text-muted-hover: var(--mantine-color-dark-9); - --color-text-brand: var(--mantine-color-green-8); - --color-text-brand-hover: var(--mantine-color-green-9); - - /* danger/success/warning are darkened past their base shade so semantic text - meets WCAG AA (4.5:1) on the light `-subtle` tints: red-9, green-9 -15%, - yellow-9 -30% (green-9/yellow-9 alone are mid-tone and fall short). */ - --color-text-success: color-mix( - in srgb, - var(--mantine-color-green-9), - #000 15% - ); - --color-text-success-hover: var(--mantine-color-green-9); - --color-text-danger: var(--mantine-color-red-9); - --color-text-warning: color-mix( - in srgb, - var(--mantine-color-yellow-9), - #000 30% - ); - --color-text-info: var(--mantine-color-blue-9); - --color-text-sidenav-link: var(--mantine-color-dark-6); - --color-text-sidenav-link-active: var(--mantine-color-green-9); - - /* Icons - inverted */ - --color-icon-primary: var(--mantine-color-dark-8); - --color-icon-muted: var(--mantine-color-dark-5); - - /* Overlay & Backdrop */ - --color-overlay: rgb(0 0 0 / 30%); - --color-backdrop: rgb(0 0 0 / 10%); - - /* States - inverted */ - --color-state-hover: var(--mantine-color-dark-3); - --color-state-selected: var(--mantine-color-dark-4); - --color-state-focus: var(--mantine-color-dark-5); - --color-outline-focus: var(--mantine-color-green-8); - - /* Slider */ - --color-slider-bar: var(--mantine-color-green-8); - --color-slider-thumb: var(--mantine-color-green-8); - --color-slider-thumb-border: var(--mantine-color-green-8); - --color-slider-dot: var(--mantine-color-gray-6); - --color-slider-dot-active: var(--mantine-color-gray-1); - - /* Code / Misc UI - inverted */ - --color-bg-code: var(--mantine-color-gray-0); - --color-border-code: var(--mantine-color-dark-3); - --color-bg-kbd: var(--mantine-color-dark-0); - - /* JSON Syntax Highlighting */ - --color-json-string: var(--mantine-color-green-9); - --color-json-number: var(--mantine-color-orange-7); - --color-json-boolean: var(--mantine-color-orange-7); - --color-json-key: var(--mantine-color-violet-9); - --color-json-object: var(--mantine-color-green-7); - --color-json-array: var(--mantine-color-green-7); - --color-json-punctuation: var(--mantine-color-dark-5); - - @include chart-tokens; - - /* Visualization Range Selector (minimap viewports, brush ranges, etc.) */ - --color-viz-range-handle: var(--mantine-color-gray-5); - --color-viz-range-handle-grip: rgb(255 255 255 / 80%); - --color-viz-range-border: var(--mantine-color-gray-4); - --color-viz-range-overlay: rgb(0 0 0 / 10%); - --color-viz-range-brush: rgb(66 105 208 / 20%); - --color-viz-range-brush-border: rgb(66 105 208 / 50%); - - /* Shadows */ - --shadow-drawer: -4px 0 24px rgb(0 0 0 / 4%); - - /* Mantine Overrides */ - --mantine-color-body: var(--color-bg-body); - --mantine-color-text: var(--color-text); -} - -/* Dark Mode - scoped to .theme-hyperdx */ -.theme-hyperdx[data-mantine-color-scheme='dark'] { - @include dark-mode-tokens; -} - -/* Light Mode - scoped to .theme-hyperdx */ -.theme-hyperdx[data-mantine-color-scheme='light'] { - @include light-mode-tokens; -} diff --git a/packages/app/src/theme/themes/hyperdx/index.ts b/packages/app/src/theme/themes/hyperdx/index.ts deleted file mode 100644 index 4f2d722f0..000000000 --- a/packages/app/src/theme/themes/hyperdx/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ThemeConfig } from '@/theme/types'; - -import Logomark from './Logomark'; -import { theme } from './mantineTheme'; -import Wordmark from './Wordmark'; - -export const hyperdxTheme: ThemeConfig = { - name: 'hyperdx', - displayName: 'HyperDX', - mantineTheme: theme, - Wordmark, - Logomark, - cssClass: 'theme-hyperdx', - favicon: { - svg: '/favicons/hyperdx/favicon.svg', - png32: '/favicons/hyperdx/favicon-32x32.png', - png16: '/favicons/hyperdx/favicon-16x16.png', - appleTouchIcon: '/favicons/hyperdx/apple-touch-icon.png', - themeColor: '#25292e', // Dark background - }, -}; diff --git a/packages/app/src/theme/themes/hyperdx/mantineTheme.ts b/packages/app/src/theme/themes/hyperdx/mantineTheme.ts deleted file mode 100644 index ad3f31cf0..000000000 --- a/packages/app/src/theme/themes/hyperdx/mantineTheme.ts +++ /dev/null @@ -1,422 +0,0 @@ -import { - ActionIcon, - Alert, - Button, - Code, - MantineTheme, - MantineThemeOverride, - rem, - SegmentedControl, - Select, - Slider, - Tabs, - Text, - Tooltip, -} from '@mantine/core'; - -import { - SEMANTIC_ALERT_VARS, - SEMANTIC_CONTROL_COLORS, - SEMANTIC_TEXT_COLORS, -} from '@/theme/themes/semanticVariants'; - -import componentClasses from '@/theme/themes/components.module.scss'; -import focusClasses from '@styles/focus.module.scss'; -import variantClasses from '@styles/variants.module.scss'; - -const makeTheme = ({ - fontFamily = '"IBM Plex Sans", monospace', -}: { - fontFamily?: string; -}): MantineThemeOverride => ({ - cursorType: 'pointer', - defaultRadius: 'sm', - fontFamily, - focusClassName: focusClasses.focusRing, - primaryColor: 'green', - primaryShade: 8, - autoContrast: true, - white: '#fff', - fontSizes: { - xxs: '11px', - xs: '12px', - sm: '13px', - md: '15px', - lg: '16px', - xl: '18px', - }, - spacing: { - xxxs: 'calc(0.375rem * var(--mantine-scale))', - xxs: 'calc(0.5rem * var(--mantine-scale))', - xs: 'calc(0.625rem * var(--mantine-scale))', - sm: 'calc(0.75rem * var(--mantine-scale))', - md: 'calc(1rem * var(--mantine-scale))', - lg: 'calc(1.25rem * var(--mantine-scale))', - xl: 'calc(2rem * var(--mantine-scale))', - }, - colors: { - green: [ - '#eafff6', - '#cdfee7', - '#a0fad5', - '#63f2bf', - '#25e2a5', - '#00c28a', - '#00a475', - '#008362', - '#00674e', - '#005542', - ], - gray: [ - '#FAFAFA', - '#e6e6ee', - '#D7D8DB', - '#aeaeb7', - '#A1A1AA', - '#868691', - '#7e7e8b', - '#6c6c79', - '#5f5f6e', - '#515264', - ], - dark: [ - '#C1C2C5', - '#A6A7AB', - '#909296', - '#5C5F66', - '#373A40', - '#2C2E33', - '#25262B', - '#1A1B1E', - '#141517', - '#101113', - ], - }, - headings: { - fontFamily, - }, - components: { - Code: Code.extend({ - vars: () => ({ - root: { - '--code-bg': 'var(--color-bg-code)', - }, - }), - }), - Tooltip: Tooltip.extend({ - styles: () => ({ - tooltip: { - fontFamily: 'var(--mantine-font-family)', - }, - }), - }), - Modal: { - styles: { - header: { - fontFamily, - fontWeight: 'bold', - }, - }, - }, - InputWrapper: { - styles: { - label: { - marginBottom: 4, - }, - description: { - marginBottom: 8, - lineHeight: 1.3, - }, - }, - }, - Select: Select.extend({ - styles: { - input: { - border: '1px solid var(--color-border)', - }, - }, - }), - Slider: Slider.extend({ - vars: () => ({ - root: { - '--slider-color': 'var(--color-slider-bar)', - }, - }), - styles: { - thumb: { - backgroundColor: 'var(--color-slider-thumb)', - borderColor: 'var(--color-slider-thumb-border)', - }, - }, - classNames: { - mark: componentClasses.sliderMark, - }, - }), - Input: { - styles: { - input: { - backgroundColor: 'var(--color-bg-field)', - border: '1px solid var(--color-border)', - }, - }, - }, - Card: { - styles: (_theme: MantineTheme, props: { variant?: string }) => { - if (props.variant === 'muted') { - return { - root: { - backgroundColor: 'var(--color-bg-muted)', - border: '1px solid var(--color-border)', - }, - }; - } - return { - root: { - backgroundColor: 'var(--color-bg-body)', - }, - }; - }, - }, - Divider: { - styles: { - root: { - borderColor: 'var(--color-border)', - borderTopColor: 'var(--color-border)', - '--divider-color': 'var(--color-border)', - '--item-border-color': 'var(--color-border)', - }, - }, - }, - Accordion: { - styles: (_theme: MantineTheme, props: { variant?: string }) => { - const base = { - control: { - '--item-border-color': 'var(--color-border)', - }, - item: { - borderColor: 'var(--color-border)', - }, - }; - if (props.variant === 'noPadding') { - return { - ...base, - content: { - paddingInline: 0, - }, - control: { - paddingInlineStart: 0, - }, - }; - } - return base; - }, - }, - UnstyledButton: { - styles: { - root: { - '--item-border-color': 'var(--color-border)', - }, - }, - }, - Paper: { - classNames: (_theme: MantineTheme, props: { variant?: string }) => { - if (props.variant === 'muted') { - return { - root: 'paper-muted', - }; - } - return {}; - }, - styles: (_theme: MantineTheme, props: { variant?: string }) => { - if (props.variant === 'muted') { - return { - root: { - backgroundColor: 'var(--color-bg-muted)', - border: '1px solid var(--color-border)', - }, - }; - } - return { - root: { - border: '1px solid var(--color-border)', - }, - }; - }, - }, - Alert: Alert.extend({ - vars: (_theme, props) => { - if (props.variant && props.variant in SEMANTIC_ALERT_VARS) { - return { root: SEMANTIC_ALERT_VARS[props.variant] }; - } - return { root: {} }; - }, - styles: (_theme, props) => { - // Body text follows the semantic accent color (title/icon already do - // via --alert-color); Mantine otherwise forces the message to - // black/white. - if (props.variant && props.variant in SEMANTIC_ALERT_VARS) { - return { message: { color: 'var(--alert-color)' } }; - } - return {}; - }, - }), - Text: Text.extend({ - styles: (_theme, props) => { - if (props.variant && props.variant in SEMANTIC_TEXT_COLORS) { - return { - root: { - color: SEMANTIC_TEXT_COLORS[props.variant], - }, - }; - } - return {}; - }, - }), - Button: Button.extend({ - defaultProps: { - variant: 'primary', - }, - classNames: (_theme, props) => { - if (props.variant === 'link') { - return { root: variantClasses.buttonLink }; - } - return {}; - }, - vars: (_theme, props) => { - const baseVars: Record<string, string> = {}; - - if (props.size === 'xxs') { - baseVars['--button-height'] = rem(22); - baseVars['--button-padding-x'] = rem(4); - baseVars['--button-fz'] = rem(12); - } - - // Use semantic CSS vars for primary button styling - if (props.variant === 'primary') { - baseVars['--button-bg'] = 'var(--color-primary-button-bg)'; - baseVars['--button-hover'] = 'var(--color-primary-button-bg-hover)'; - baseVars['--button-color'] = 'var(--color-primary-button-text)'; - baseVars['--button-hover-color'] = 'var(--color-primary-button-text)'; - } - - if (props.variant === 'secondary') { - baseVars['--button-bg'] = 'var(--color-bg-body)'; - baseVars['--button-hover'] = 'var(--color-bg-muted)'; - baseVars['--button-color'] = 'var(--color-text)'; - baseVars['--button-bd'] = '1px solid var(--color-border)'; - } - - if (props.variant && props.variant in SEMANTIC_CONTROL_COLORS) { - const c = SEMANTIC_CONTROL_COLORS[props.variant]; - baseVars['--button-bg'] = c.bg; - baseVars['--button-hover'] = c.hover; - baseVars['--button-color'] = c.color; - } - - if (props.variant === 'subtle') { - baseVars['--button-bg'] = 'transparent'; - baseVars['--button-hover'] = 'var(--color-bg-hover)'; - baseVars['--button-color'] = 'var(--color-text)'; - baseVars['--button-bd'] = 'none'; - } - - if (props.variant === 'link') { - baseVars['--button-bg'] = 'transparent'; - baseVars['--button-hover'] = 'transparent'; - baseVars['--button-color'] = 'var(--color-text-secondary)'; - baseVars['--button-bd'] = 'none'; - baseVars['--button-padding-x'] = '0'; - } - - return { root: baseVars }; - }, - }), - SegmentedControl: SegmentedControl.extend({ - styles: () => ({ - root: { - background: 'var(--color-bg-body)', - border: '1px solid var(--color-border)', - }, - indicator: { - background: 'var(--color-bg-option-active)', - borderRadius: '2px', - boxShadow: 'none', - }, - }), - }), - Tabs: Tabs.extend({ - vars: () => ({ - root: { - '--tabs-color': 'var(--color-text-brand)', - '--tab-border-color': 'var(--color-border)', - }, - }), - classNames: { - list: componentClasses.tabsList, - tab: componentClasses.tabsTab, - }, - styles: { - tabLabel: { textAlign: 'left' }, - }, - }), - ActionIcon: ActionIcon.extend({ - defaultProps: { - variant: 'subtle', - color: 'gray', - }, - classNames: (_theme, props) => { - if (props.variant === 'link') { - return { root: variantClasses.actionIconLink }; - } - return {}; - }, - vars: (_theme, props) => { - const baseVars: Record<string, string> = {}; - - if (props.variant === 'subtle') { - baseVars['--ai-bg'] = 'transparent'; - baseVars['--ai-hover'] = 'var(--color-bg-hover)'; - baseVars['--ai-color'] = 'var(--color-text)'; - } - - if (props.variant === 'default') { - baseVars['--ai-bg'] = 'var(--color-bg-hover)'; - baseVars['--ai-hover'] = 'var(--color-bg-muted)'; - baseVars['--ai-color'] = 'var(--color-text)'; - baseVars['--ai-bd'] = 'none'; - } - - if (props.variant === 'primary') { - baseVars['--ai-bg'] = 'var(--color-primary-button-bg)'; - baseVars['--ai-hover'] = 'var(--color-primary-button-bg-hover)'; - baseVars['--ai-color'] = 'var(--color-primary-button-text)'; - } - - if (props.variant === 'secondary') { - baseVars['--ai-bg'] = 'var(--color-bg-surface)'; - baseVars['--ai-hover'] = 'var(--color-bg-hover)'; - baseVars['--ai-color'] = 'var(--color-text)'; - baseVars['--ai-bd'] = '1px solid var(--color-border)'; - } - - if (props.variant && props.variant in SEMANTIC_CONTROL_COLORS) { - const c = SEMANTIC_CONTROL_COLORS[props.variant]; - baseVars['--ai-bg'] = c.bg; - baseVars['--ai-hover'] = c.hover; - baseVars['--ai-color'] = c.color; - } - - if (props.variant === 'link') { - baseVars['--ai-bg'] = 'transparent'; - baseVars['--ai-hover'] = 'transparent'; - baseVars['--ai-color'] = 'var(--color-text-secondary)'; - baseVars['--ai-bd'] = 'none'; - } - - return { root: baseVars }; - }, - }), - }, -}); - -export const theme = makeTheme({}); diff --git a/packages/app/src/theme/types.ts b/packages/app/src/theme/types.ts deleted file mode 100644 index 4e4873c05..000000000 --- a/packages/app/src/theme/types.ts +++ /dev/null @@ -1,65 +0,0 @@ -import React from 'react'; -import { MantineThemeOverride } from '@mantine/core'; - -/** - * ============================================================================ - * THEMING CONCEPTS: Color Mode vs Brand Theme - * ============================================================================ - * - * This codebase has TWO separate theming concepts: - * - * 1. COLOR MODE (light/dark/system) - * - User-selectable preference stored in `useUserPreferences().colorMode` - * - 'system' follows OS prefers-color-scheme; default is 'system' - * - Affects visual appearance: backgrounds, text colors, etc. - * - Managed by Mantine's color scheme system - * - Persisted to localStorage via `hdx-user-preferences` - * - * 2. BRAND THEME (hyperdx/clickstack) - * - Deployment-configured, NOT user-selectable in production - * - Set via `NEXT_PUBLIC_THEME` environment variable - * - Affects branding: logos, accent colors, favicons - * - Each deployment is branded for one specific product - * - Dev mode allows switching via localStorage (set via dev UI) - * - * WHY SEPARATE? - * - Color mode is personal preference (accessibility, comfort) - * - Brand theme is business identity (product differentiation) - * - A ClickStack deployment should never show HyperDX branding, regardless of color mode - * - * @see useUserPreferences - manages colorMode (user preference) - * @see AppThemeProvider - manages brand theme (deployment config) - */ - -/** - * Brand theme identifier. - * This is DEPLOYMENT-CONFIGURED, not user-selectable in production. - */ -export type ThemeName = 'hyperdx' | 'clickstack' | 'dfe'; - -/** - * Favicon configuration for a theme. - * Modern best practice includes multiple formats for broad compatibility. - */ -interface FaviconConfig { - /** SVG favicon - best for modern browsers, scalable */ - svg: string; - /** PNG 32x32 - standard fallback */ - png32: string; - /** PNG 16x16 - for small contexts */ - png16: string; - /** Apple Touch Icon 180x180 - for iOS home screen */ - appleTouchIcon: string; - /** Theme color for browser UI (address bar, etc.) */ - themeColor: string; -} - -export interface ThemeConfig { - name: ThemeName; - displayName: string; - mantineTheme: MantineThemeOverride; - Wordmark: React.ComponentType; - Logomark: React.ComponentType<{ size?: number }>; - cssClass: string; // Applied to html element for CSS variable scoping - favicon: FaviconConfig; -} diff --git a/packages/app/src/timeQuery.ts b/packages/app/src/timeQuery.ts index d13f52576..96a7fa933 100644 --- a/packages/app/src/timeQuery.ts +++ b/packages/app/src/timeQuery.ts @@ -555,3 +555,30 @@ export function useDefaultTimeRange(query: string): [Date, Date] { return state.range; } + +/** + * Text for an editable time range input. It is re-formatted from `range` when + * the display time zone changes, so it never holds clock times from another + * zone that the picker would then read in the new one. + */ +export function useTimeRangeInputText( + range: [Date, Date], +): [string, (text: string) => void] { + const timeZone = useDisplayTimeZone(); + const [state, setState] = useState(() => ({ + text: dateRangeToString(range, timeZone), + timeZone, + })); + const setText = useCallback( + (text: string) => setState(prev => ({ ...prev, text })), + [], + ); + + if (state.timeZone !== timeZone) { + const next = { text: dateRangeToString(range, timeZone), timeZone }; + setState(next); + return [next.text, setText]; + } + + return [state.text, setText]; +} diff --git a/packages/app/src/timeZone.ts b/packages/app/src/timeZone.ts index f4ce61a3c..6a559e141 100644 --- a/packages/app/src/timeZone.ts +++ b/packages/app/src/timeZone.ts @@ -3,6 +3,13 @@ import { UTC_TIME_ZONE } from '@hyperdx/common-utils/dist/core/utils'; /** Time zone setting value that follows the browser's zone. */ export const LOCAL_TIME_ZONE = 'local'; +// For code that needs the time right now, such as a ticking clock or parsing +// "yesterday", rather than the stable NOW from config. +export function currentDate(): Date { + // eslint-disable-next-line no-restricted-syntax + return new Date(); +} + export function isValidTimeZone(timeZone: string): boolean { try { new Intl.DateTimeFormat('en-US', { timeZone }); @@ -12,6 +19,20 @@ export function isValidTimeZone(timeZone: string): boolean { } } +/** Whether `value` is a time zone setting this browser can use. */ +export function isTimeZonePreference(value: string): boolean { + return value === LOCAL_TIME_ZONE || isValidTimeZone(value); +} + +/** "Local", "UTC", or the zone's name, e.g. "Asia/Tokyo". */ +export function getTimeZonePreferenceLabel(preference: string): string { + const timeZone = resolveTimeZonePreference(preference); + if (timeZone == null) { + return 'Local'; + } + return timeZone === UTC_TIME_ZONE ? 'UTC' : formatTimeZoneName(timeZone); +} + /** * The IANA zone a setting refers to, or undefined for the local zone. Zones * the browser doesn't recognise fall back to local. @@ -45,39 +66,49 @@ function gmtToUtc(label: string): string { return label.replace(/^GMT/, 'UTC'); } -/** Offset of `timeZone` at `date`, e.g. "UTC-07:00". */ -export function getTimeZoneOffsetLabel( - timeZone: string, - // eslint-disable-next-line no-restricted-syntax - date: Date = new Date(), -): string { - const offset = - new Intl.DateTimeFormat('en-US', { timeZone, timeZoneName: 'longOffset' }) - .formatToParts(date) - .find(part => part.type === 'timeZoneName')?.value ?? 'GMT'; - // Zero offsets come back as plain "GMT" in some runtimes. - return offset === 'GMT' ? 'UTC+00:00' : gmtToUtc(offset); -} - /** "America/Los_Angeles" as "America/Los Angeles". */ export function formatTimeZoneName(timeZone: string): string { return timeZone.replaceAll('_', ' '); } /** - * Short name of `timeZone` at `date`, e.g. "UTC", "PDT" or "UTC+9". en-US is - * used because it has abbreviations for the most zones. + * Short offset of `timeZone` at `date`, e.g. "UTC-7" or "UTC+5:30", or "UTC" + * for a zero offset. Offsets rather than abbreviations like "PDT", which only + * exist for some zones and are ambiguous. */ export function getTimeZoneShortName( timeZone: string, // eslint-disable-next-line no-restricted-syntax date: Date = new Date(), ): string { - const name = new Intl.DateTimeFormat('en-US', { + const offset = new Intl.DateTimeFormat('en-US', { timeZone, - timeZoneName: 'short', + timeZoneName: 'shortOffset', }) .formatToParts(date) .find(part => part.type === 'timeZoneName')?.value; - return name ? gmtToUtc(name) : timeZone; + if (offset == null) { + return timeZone; + } + // Zero offsets come back as "GMT+0", or plain "GMT" in some runtimes. + const label = gmtToUtc(offset); + return label === 'UTC+0' ? 'UTC' : label; +} + +/** + * Short offset of `timeZone` over `range`. A range across a DST change shows + * both offsets, e.g. "UTC-8/-7"; London's "UTC+0/+1". + */ +export function getTimeZoneRangeShortName( + timeZone: string, + [start, end]: readonly [Date, Date], +): string { + const startName = getTimeZoneShortName(timeZone, start); + const endName = getTimeZoneShortName(timeZone, end); + if (startName === endName) { + return startName; + } + const offsetOf = (name: string) => + name === 'UTC' ? '+0' : name.replace(/^UTC/, ''); + return `UTC${offsetOf(startName)}/${offsetOf(endName)}`; } diff --git a/packages/app/src/timeZoneOverride.tsx b/packages/app/src/timeZoneOverride.tsx new file mode 100644 index 000000000..ddab4adea --- /dev/null +++ b/packages/app/src/timeZoneOverride.tsx @@ -0,0 +1,73 @@ +import { + createContext, + type ReactNode, + use, + useCallback, + useMemo, +} from 'react'; +import { parseAsString, useQueryState } from 'nuqs'; + +import { isTimeZonePreference } from './timeZone'; + +type TimeZoneOverride = { + /** The page's time zone setting, or null to use the user's. */ + timeZone: string | null; + setTimeZone: (timeZone: string | null) => void; +}; + +const TimeZoneOverrideContext = createContext<TimeZoneOverride | null>(null); + +/** + * Lets a page show times in its own zone, kept in the `tz` URL param so links + * keep it. Wrap the page's content, not the app: the sidebar keeps showing + * the user's setting. + */ +export function TimeZoneOverrideProvider({ + children, +}: { + children: ReactNode; +}) { + const [tz, setTz] = useQueryState('tz', parseAsString); + + const timeZone = tz != null && isTimeZonePreference(tz) ? tz : null; + + const value = useMemo<TimeZoneOverride>( + () => ({ timeZone, setTimeZone: setTz }), + [timeZone, setTz], + ); + + return ( + <TimeZoneOverrideContext value={value}>{children}</TimeZoneOverrideContext> + ); +} + +/** The page's time zone override, or null outside `TimeZoneOverrideProvider`. */ +export function useTimeZoneOverride(): TimeZoneOverride | null { + return use(TimeZoneOverrideContext); +} + +/** + * Adds `tz` to an in-app URL. Appends rather than re-encoding the query, whose + * params can carry their own encoding (see buildEventsSearchUrl). + */ +export function withTimeZoneParam( + url: string, + timeZone: string | null | undefined, +): string { + if (timeZone == null) { + return url; + } + const [path, hash] = url.split('#', 2); + const separator = path.includes('?') ? '&' : '?'; + const withParam = `${path}${separator}tz=${encodeURIComponent(timeZone)}`; + return hash == null ? withParam : `${withParam}#${hash}`; +} + +/** + * Adds the page's time zone override to links to pages that support one, so + * they open in the same zone. + */ +export function useTimeZoneLinkParam(): (url: string) => string { + const timeZone = useTimeZoneOverride()?.timeZone; + return useCallback(url => withTimeZoneParam(url, timeZone), [timeZone]); +} diff --git a/packages/app/src/types.ts b/packages/app/src/types.ts index 9c549f77c..f5387c1d3 100644 --- a/packages/app/src/types.ts +++ b/packages/app/src/types.ts @@ -58,8 +58,8 @@ export type StacktraceFrame = { filename: string; function: string; module?: string; - lineno: number; - colno: number; + lineno?: number; + colno?: number; in_app: boolean; context_line?: string; pre_context?: string[]; diff --git a/packages/app/src/useDisplayTimeZone.ts b/packages/app/src/useDisplayTimeZone.ts index ce39ceea2..162552db1 100644 --- a/packages/app/src/useDisplayTimeZone.ts +++ b/packages/app/src/useDisplayTimeZone.ts @@ -1,15 +1,22 @@ import { useMemo } from 'react'; import { resolveTimeZonePreference } from './timeZone'; +import { useTimeZoneOverride } from './timeZoneOverride'; import { useUserPreferences } from './useUserPreferences'; /** * IANA time zone that times are shown and typed in, or undefined for the - * local zone. + * local zone. The page's override wins over the user's setting. */ export function useDisplayTimeZone(): string | undefined { const { userPreferences: { timeZone }, } = useUserPreferences(); - return useMemo(() => resolveTimeZonePreference(timeZone), [timeZone]); + + const override = useTimeZoneOverride()?.timeZone; + + return useMemo( + () => resolveTimeZonePreference(override ?? timeZone), + [override, timeZone], + ); } diff --git a/packages/app/src/useUserPreferences.tsx b/packages/app/src/useUserPreferences.tsx index 88c5ac297..fec956733 100644 --- a/packages/app/src/useUserPreferences.tsx +++ b/packages/app/src/useUserPreferences.tsx @@ -25,8 +25,13 @@ export type UserPreferences = { */ timeZone: string; timeFormat: '12h' | '24h'; - /** Color mode preference (light/dark/system). Separate from brand theme (hyperdx/clickstack). */ + /** Color mode preference (light/dark/system). */ colorMode: ColorModePreference; + /** + * Left in the stored shape so preferences saved before the font picker + * was removed still parse. The UI always uses Inter and does not read this. + * The default stays the historical value so a read does not rewrite storage. + */ font: 'IBM Plex Mono' | 'Roboto Mono' | 'Inter' | 'Roboto'; expandSidebarHeader?: boolean; /** diff --git a/packages/app/src/utils.ts b/packages/app/src/utils.ts index 8e8233b27..7cdbf972c 100644 --- a/packages/app/src/utils.ts +++ b/packages/app/src/utils.ts @@ -20,7 +20,6 @@ import { } from '@hyperdx/common-utils/dist/types'; import { SortingState } from '@tanstack/react-table'; -import { DEFAULT_THEME } from './theme'; import { MetricsDataType, NumberFormat } from './types'; // From: https://usehooks.com/useWindowSize/ @@ -396,9 +395,8 @@ export function getLogSeverityLevel({ * * Keep in sync with `CATEGORICAL_PALETTE_TOKENS` in * `@hyperdx/common-utils/dist/types` and with the `--color-chart-{hue}` - * vars in `packages/app/src/theme/themes/_chart-categorical-tokens.scss` - * (the single shared SCSS source for categorical hues; both brand - * themes `@use` it). + * vars in `packages/app/src/theme/_chart-categorical-tokens.scss` + * (the single shared SCSS source for categorical hues). */ type CategoricalChartPaletteToken = (typeof CATEGORICAL_PALETTE_TOKENS)[number]; @@ -442,45 +440,13 @@ type SemanticChartColorKey = | 'errorHighlight'; /** - * Per-brand semantic chart palette. SSR / `getComputedStyle` fallback - * for `getChartColor{Success,Warning,Error,Info,*Highlight}` helpers. + * Semantic chart palette. SSR / `getComputedStyle` fallback for + * `getChartColor{Success,Warning,Error,Info,*Highlight}` helpers. * Live values come from `--color-chart-{success|warning|error|info}[-highlight]` * in `_chart-categorical-tokens.scss` (`chart-semantic-tokens` mixin). - * - * Kept per-brand (instead of collapsed to one object) so the - * `Record<'hyperdx' | 'clickstack', SemanticChartHexes>` constraint - * forces both brands to declare every semantic key — dropping or - * renaming one in either entry becomes a compile error rather than a - * silent runtime divergence between SSR and client. The two entries - * are byte-identical today; collapse to a flat object if and when a - * brand actually needs to diverge. */ -type SemanticChartHexes = Readonly<Record<SemanticChartColorKey, string>>; - -const SEMANTIC_CHART_PALETTE: Readonly< - Record<'hyperdx' | 'clickstack' | 'dfe', SemanticChartHexes> -> = { - // DFE: brand semantic colours (see theme/themes/dfe/_tokens.scss). TODO: source - // from the shared @dfe/design-tokens package. - dfe: { - success: '#00c28a', - warning: '#efb118', - error: '#ff725c', - info: '#2ea4f6', - successHighlight: '#80d9b3', - warningHighlight: '#f5c94d', - errorHighlight: '#ffa090', - }, - hyperdx: { - success: '#3ca951', - warning: '#efb118', - error: '#ff725c', - info: '#437eef', - successHighlight: '#80d9b3', - warningHighlight: '#f5c94d', - errorHighlight: '#ffa090', - }, - clickstack: { +const SEMANTIC_CHART_PALETTE: Readonly<Record<SemanticChartColorKey, string>> = + { success: '#3ca951', warning: '#efb118', error: '#ff725c', @@ -488,8 +454,7 @@ const SEMANTIC_CHART_PALETTE: Readonly< successHighlight: '#80d9b3', warningHighlight: '#f5c94d', errorHighlight: '#ffa090', - }, -}; + }; /** * Ordered hex array for positional series assignment. @@ -527,36 +492,6 @@ export { } from '@hyperdx/common-utils/dist/types'; export type { ChartPaletteToken }; -/** - * Detects the active theme by checking for theme classes on documentElement. - * Returns theme from documentElement classes, or the configured DEFAULT_THEME when none match. - * Note: classList.contains() is O(1) and fast - no caching needed. - */ -function detectActiveTheme(): 'clickstack' | 'hyperdx' | 'dfe' { - if (typeof window === 'undefined') { - // SSR: default to hyperdx (can't detect theme without DOM) - return DEFAULT_THEME; - } - - try { - const isDFE = document.documentElement.classList.contains('theme-dfe'); - const isHyperDX = - document.documentElement.classList.contains('theme-hyperdx'); - const isClickStack = - document.documentElement.classList.contains('theme-clickstack'); - return isDFE - ? 'dfe' - : isHyperDX - ? 'hyperdx' - : isClickStack - ? 'clickstack' - : DEFAULT_THEME; - } catch { - // Fallback if DOM access fails - return DEFAULT_THEME; - } -} - /** * Returns the Nth categorical chart hex by series index. Index wraps * modulo `CATEGORICAL_PALETTE_TOKENS.length`. @@ -582,10 +517,10 @@ function getColorFromCSSVariable(index: number): string { * always resolve to the same value, and skipping `getComputedStyle` * avoids an unnecessary layout read per series. * - * Semantic tokens (`chart-success`, `-warning`, `-error`) DO vary per - * brand, so they read the matching CSS var (`--color-chart-{name}`) - * via `getComputedStyle` and fall back to the active theme's entry in - * `SEMANTIC_CHART_PALETTE` for SSR / `getComputedStyle` failures. + * Semantic tokens (`chart-success`, `-warning`, `-error`) read the + * matching CSS var (`--color-chart-{name}`) via `getComputedStyle` and + * fall back to `SEMANTIC_CHART_PALETTE` for SSR / `getComputedStyle` + * failures. * * @example * getColorFromCSSToken('chart-blue') // Observable blue (both themes) @@ -633,12 +568,11 @@ function semanticTokenFallback( case 'chart-success': case 'chart-warning': case 'chart-error': { - const theme = detectActiveTheme(); const key = token.slice('chart-'.length) as | 'success' | 'warning' | 'error'; - return SEMANTIC_CHART_PALETTE[theme][key]; + return SEMANTIC_CHART_PALETTE[key]; } default: { // Exhaustiveness assertion: if a new semantic token lands on @@ -746,9 +680,8 @@ export function hashCode(str: string) { } /** - * Theme-aware semantic chart color resolver. Reads `cssVarName` from - * `documentElement` and falls back to the active theme's value from - * `SEMANTIC_CHART_PALETTE` (HyperDX during SSR). + * Semantic chart color resolver. Reads `cssVarName` from + * `documentElement` and falls back to `SEMANTIC_CHART_PALETTE`. * * Charts typically render client-side after data fetching, so hydration * mismatches between the SSR fallback and the live var are rare. @@ -758,7 +691,7 @@ function getSemanticChartColor( key: SemanticChartColorKey, ): string { if (typeof window === 'undefined') { - return SEMANTIC_CHART_PALETTE.hyperdx[key]; + return SEMANTIC_CHART_PALETTE[key]; } try { @@ -771,11 +704,11 @@ function getSemanticChartColor( // Fallback if getComputedStyle fails } - return SEMANTIC_CHART_PALETTE[detectActiveTheme()][key]; + return SEMANTIC_CHART_PALETTE[key]; } -// Semantic chart colors (theme-aware). Read from CSS variables with -// per-theme fallbacks in `SEMANTIC_CHART_PALETTE`. +// Semantic chart colors. Read from CSS variables with fallbacks in +// `SEMANTIC_CHART_PALETTE`. export function getChartColorSuccess(): string { return getSemanticChartColor('--color-chart-success', 'success'); } @@ -789,7 +722,7 @@ export function getChartColorError(): string { } /** Chart blue used for info-level logs and similar "neutral / default" - * series. Same hue as categorical `chart-blue` on both brands. */ + * series. Same hue as categorical `chart-blue`. */ export function getChartColorInfo(): string { return getSemanticChartColor('--color-chart-info', 'info'); } diff --git a/packages/app/src/utils/__tests__/browserEvents.test.ts b/packages/app/src/utils/__tests__/browserEvents.test.ts index 0c5b12a99..3188f5c2a 100644 --- a/packages/app/src/utils/__tests__/browserEvents.test.ts +++ b/packages/app/src/utils/__tests__/browserEvents.test.ts @@ -1,6 +1,8 @@ import { BROWSER_EVENT_NAMES, + getBrowserEventKind, getBrowserEventLabel, + isBrowserEventRow, } from '@/utils/browserEvents'; const { CLICK, NAVIGATION, CONSOLE, EXCEPTION } = BROWSER_EVENT_NAMES; @@ -122,3 +124,32 @@ describe('getBrowserEventLabel', () => { }, ); }); + +describe('getBrowserEventKind', () => { + it.each([ + [CLICK, {}, 'click'], + [NAVIGATION, {}, 'navigation'], + [CONSOLE, {}, 'console'], + [EXCEPTION, { 'exception.type': 'TypeError' }, undefined], + [undefined, { 'browser.tag_name': 'BUTTON' }, 'click'], + ['', { 'browser.console.method': 'log' }, 'console'], + // JSON columns keep the Bool, Map columns hold the string. + [undefined, { 'browser.navigation.same_document': false }, 'navigation'], + [undefined, { 'browser.navigation.same_document': 'false' }, 'navigation'], + [undefined, { 'url.full': 'http://localhost:5173/' }, undefined], + [undefined, undefined, undefined], + ])('reads event %p with %p as %p', (eventName, attributes, kind) => { + expect(getBrowserEventKind({ eventName, attributes })).toBe(kind); + }); +}); + +describe('isBrowserEventRow', () => { + it.each([ + ['browser.web_vital', {}, true], + [EXCEPTION, {}, false], + [undefined, { 'browser.tag_name': 'BUTTON' }, true], + [undefined, { 'service.name': 'api' }, false], + ])('reads event %p with %p as %p', (eventName, attributes, expected) => { + expect(isBrowserEventRow({ eventName, attributes })).toBe(expected); + }); +}); diff --git a/packages/app/src/utils/__tests__/browserTelemetry.test.ts b/packages/app/src/utils/__tests__/browserTelemetry.test.ts new file mode 100644 index 000000000..a7be89fd4 --- /dev/null +++ b/packages/app/src/utils/__tests__/browserTelemetry.test.ts @@ -0,0 +1,71 @@ +import { trace } from '@opentelemetry/api'; + +import { getBrowserInitOptions, recordAction } from '@/utils/browserTelemetry'; + +afterEach(() => { + jest.restoreAllMocks(); +}); + +describe('recordAction', () => { + it('ends a span named after the action with its attributes', () => { + const tracer = trace.getTracer('test'); + const span = tracer.startSpan('probe'); + const end = jest.spyOn(span, 'end'); + const startSpan = jest.spyOn(tracer, 'startSpan').mockReturnValue(span); + const getTracer = jest.spyOn(trace, 'getTracer').mockReturnValue(tracer); + + recordAction('search executed', { latency_ms: 12, source_id: 's1' }); + + expect(getTracer).toHaveBeenCalledWith('custom-action'); + expect(startSpan).toHaveBeenCalledWith('search executed', { + attributes: { latency_ms: 12, source_id: 's1' }, + }); + expect(end).toHaveBeenCalledTimes(1); + }); +}); + +describe('getBrowserInitOptions', () => { + it('maps the app config onto the SDK options', () => { + expect( + getBrowserInitOptions({ + config: { + apiKey: 'key', + serviceName: 'hdx-app', + collectorUrl: 'https://otel.example.com', + collectorTracesUrl: 'https://traces.example.com/v1/traces', + collectorLogsUrl: 'https://logs.example.com/v1/logs', + }, + resourceAttributes: + 'deployment.environment.name=prod,team=core,service.version=9', + serviceVersion: '2.0.0', + }), + ).toEqual({ + endpoint: 'https://otel.example.com', + tracesEndpoint: 'https://traces.example.com/v1/traces', + logsEndpoint: 'https://logs.example.com/v1/logs', + apiKey: 'key', + serviceName: 'hdx-app', + serviceVersion: '2.0.0', + resourceAttributes: { + 'deployment.environment.name': 'prod', + team: 'core', + 'service.version': '9', + }, + console: 'debug', + maskAllText: true, + maskAllInputs: true, + }); + }); + + it('leaves unset per-signal URLs and resource attributes empty', () => { + const options = getBrowserInitOptions({ + config: { serviceName: 'hdx-app', collectorUrl: 'http://localhost:4318' }, + resourceAttributes: '', + serviceVersion: undefined, + }); + + expect(options.tracesEndpoint).toBeUndefined(); + expect(options.logsEndpoint).toBeUndefined(); + expect(options.resourceAttributes).toEqual({}); + }); +}); diff --git a/packages/app/src/utils/__tests__/browserTraceContext.test.ts b/packages/app/src/utils/__tests__/browserTraceContext.test.ts new file mode 100644 index 000000000..4a4608ab0 --- /dev/null +++ b/packages/app/src/utils/__tests__/browserTraceContext.test.ts @@ -0,0 +1,144 @@ +import { + browserSpan, + logSource, + PAGE_URL, + SPAN_START_MS, +} from '@/hooks/__fixtures__/browserTraceEvents'; +import { + getBrowserTraceContext, + hasSubSecondTimestamps, + isBrowserEventLogSource, +} from '@/utils/browserTraceContext'; + +const backendSpan = { + Timestamp: '2026-10-22T04:52:37.000000000Z', + Duration: 5, + ServiceName: 'api', + SpanAttributes: { 'http.route': '/api/checkout' }, +}; + +describe('getBrowserTraceContext', () => { + it.each([ + ['no rows', []], + ['backend spans', [backendSpan]], + [ + 'an AI span with a session id and no page URL', + [{ ...backendSpan, SpanAttributes: { 'session.id': 's1' } }], + ], + [ + 'an empty page URL', + [ + { + ...browserSpan, + SpanAttributes: { 'browser.document.url.full': '' }, + }, + ], + ], + [ + 'an unparsable timestamp', + [{ ...browserSpan, Timestamp: 'not-a-timestamp' }], + ], + ])('is undefined for %s', (_name, rows) => { + expect(getBrowserTraceContext(rows)).toBeUndefined(); + }); + + it('anchors on the earliest browser span, ignoring earlier backend spans', () => { + const laterSpan = { + ...browserSpan, + Timestamp: '2026-10-22T04:52:37.900000000Z', + Duration: 0.2, + ServiceName: 'web-worker', + SpanAttributes: { + 'browser.document.url.full': PAGE_URL, + 'session.id': 's2', + }, + }; + expect( + getBrowserTraceContext([laterSpan, backendSpan, browserSpan]), + ).toEqual({ + serviceNames: ['web', 'web-worker'], + anchorMs: SPAN_START_MS, + endMs: Date.parse('2026-10-22T04:52:38.100Z'), + anchorHidden: false, + sessionId: 's1', + serviceName: 'web', + }); + }); + + it('ends at most an hour after the anchor', () => { + expect( + getBrowserTraceContext([{ ...browserSpan, Duration: 86400 }])?.endMs, + ).toBe(SPAN_START_MS + 60 * 60 * 1000); + }); + + it('reads nested JSON attributes', () => { + const context = getBrowserTraceContext([ + { + ...browserSpan, + SpanAttributes: { + browser: { document: { url: { full: PAGE_URL } } }, + session: { id: 's1' }, + }, + }, + ]); + expect(context).toMatchObject({ + anchorMs: SPAN_START_MS, + sessionId: 's1', + }); + }); + + it('dedupes service names and keeps an unset session id unset', () => { + const context = getBrowserTraceContext([ + { + ...browserSpan, + SpanAttributes: { 'browser.document.url.full': PAGE_URL }, + }, + { ...browserSpan, Timestamp: '2026-10-22T04:52:37.830000000Z' }, + ]); + expect(context).toMatchObject({ + serviceNames: ['web'], + sessionId: undefined, + serviceName: 'web', + }); + }); + + it.each([ + [1, true], + [0, false], + ])('reports a hidden anchor for __hdx_hidden %p', (hidden, expected) => { + expect( + getBrowserTraceContext([{ ...browserSpan, __hdx_hidden: hidden }]) + ?.anchorHidden, + ).toBe(expected); + }); +}); + +describe('hasSubSecondTimestamps', () => { + it.each([ + ["Nullable(DateTime64(9, 'UTC'))", true], + ['DateTime64(0)', false], + ['DateTime', false], + ])('reads a %s timestamp column as %p', (type, expected) => { + expect(hasSubSecondTimestamps([{ name: 'timestamp', type }])).toBe( + expected, + ); + }); + + it('is false without a timestamp column', () => { + expect(hasSubSecondTimestamps(undefined)).toBe(false); + expect( + hasSubSecondTimestamps([{ name: 'ts', type: 'DateTime64(9)' }]), + ).toBe(false); + }); +}); + +describe('isBrowserEventLogSource', () => { + it.each([ + 'eventNameExpression', + 'eventAttributesExpression', + 'traceIdExpression', + 'spanIdExpression', + ] as const)('rejects a source without %s', field => { + expect(isBrowserEventLogSource({ ...logSource, [field]: '' })).toBe(false); + }); +}); diff --git a/packages/app/src/utils/__tests__/javascriptStack.test.ts b/packages/app/src/utils/__tests__/javascriptStack.test.ts new file mode 100644 index 000000000..3340ce5cf --- /dev/null +++ b/packages/app/src/utils/__tests__/javascriptStack.test.ts @@ -0,0 +1,441 @@ +import { + isJavaScriptRuntime, + parseJavaScriptException, +} from '@/utils/javascriptStack'; + +const APP = 'https://app.example.com/assets/app.js'; + +const framesOf = (stack: string) => parseJavaScriptException(stack)?.frames; + +describe('parseJavaScriptException', () => { + it('parses a Chrome stack oldest first, keeping URLs and 1-based columns', () => { + const stack = [ + "TypeError: Cannot read properties of undefined (reading 'id')", + ' at c (https://app.example.com/_next/static/chunks/pages/checkout-3f2a.js:1:2817)', + ' at Object.Ub (https://app.example.com/_next/static/chunks/framework-2c79e2a64abdb08b.js:9:16994)', + ` at ${APP}:5:10`, + ].join('\n'); + + expect(parseJavaScriptException(stack)).toEqual({ + frames: [ + { filename: APP, function: '?', lineno: 5, colno: 10, in_app: true }, + { + filename: + 'https://app.example.com/_next/static/chunks/framework-2c79e2a64abdb08b.js', + function: 'Object.Ub', + lineno: 9, + colno: 16994, + in_app: false, + }, + { + filename: + 'https://app.example.com/_next/static/chunks/pages/checkout-3f2a.js', + function: 'c', + lineno: 1, + colno: 2817, + in_app: true, + }, + ], + causes: [], + }); + }); + + it('parses Chrome eval and async frames', () => { + const stack = [ + 'Error: bad', + ' at eval (eval at aha (http://localhost:5000/app.js:37:5), <anonymous>:1:1)', + ` at async submit (${APP}:130:5)`, + ' at Object.callback (async http://localhost:5000/app.js:25:7)', + ].join('\n'); + + expect(framesOf(stack)).toEqual([ + { + filename: 'http://localhost:5000/app.js', + function: 'Object.callback', + lineno: 25, + colno: 7, + in_app: true, + }, + { + filename: APP, + function: 'async submit', + lineno: 130, + colno: 5, + in_app: true, + }, + { + filename: 'http://localhost:5000/app.js', + function: 'eval', + lineno: 37, + colno: 5, + in_app: true, + }, + ]); + }); + + it('parses a Node stack and marks library and runtime frames', () => { + const stack = [ + 'Error: boom', + ' at handler (/srv/app/dist/server.js:12:9)', + ' at Layer.handle (/srv/app/node_modules/express/lib/router/layer.js:95:5)', + ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)', + ' at async Promise.all (index 0)', + ].join('\n'); + + expect(framesOf(stack)).toEqual([ + { + filename: 'index 0', + function: 'async Promise.all', + in_app: false, + }, + { + filename: 'node:internal/process/task_queues', + function: 'process.processTicksAndRejections', + lineno: 95, + colno: 5, + in_app: false, + }, + { + filename: '/srv/app/node_modules/express/lib/router/layer.js', + function: 'Layer.handle', + lineno: 95, + colno: 5, + in_app: false, + }, + { + filename: '/srv/app/dist/server.js', + function: 'handler', + lineno: 12, + colno: 9, + in_app: true, + }, + ]); + }); + + it('parses a Firefox stack, including async and eval frames', () => { + const stack = [ + 'aha@http://localhost:5000/app.js line 37 > eval:1:1', + `checkout@${APP}:120:11`, + `async*submit@${APP}:130:5`, + `@${APP}:150:1`, + ].join('\n'); + + expect(framesOf(stack)).toEqual([ + { filename: APP, function: '?', lineno: 150, colno: 1, in_app: true }, + { + filename: APP, + function: 'async*submit', + lineno: 130, + colno: 5, + in_app: true, + }, + { + filename: APP, + function: 'checkout', + lineno: 120, + colno: 11, + in_app: true, + }, + { + filename: 'http://localhost:5000/app.js', + function: 'aha', + lineno: 37, + in_app: true, + }, + ]); + }); + + it('parses a Safari stack, dropping eval code frames', () => { + const stack = [ + 'forEach@[native code]', + `checkout@${APP}:120:11`, + 'eval code@', + `global code@${APP}:150:1`, + ].join('\n'); + + expect(framesOf(stack)).toEqual([ + { + filename: APP, + function: 'global code', + lineno: 150, + colno: 1, + in_app: true, + }, + { + filename: APP, + function: 'checkout', + lineno: 120, + colno: 11, + in_app: true, + }, + { filename: '[native code]', function: 'forEach', in_app: false }, + ]); + }); + + it('splits Chrome Caused by sections into causes with their own frames', () => { + const stack = [ + 'Error: Checkout failed', + ` at checkout (${APP}:120:11)`, + 'Caused by: TypeError: Failed to fetch', + ` at fetchCart (${APP}:42:9)`, + 'Caused by: Error', + ` at request (${APP}:10:3)`, + ].join('\n'); + + expect(parseJavaScriptException(stack)).toEqual({ + frames: [ + { + filename: APP, + function: 'checkout', + lineno: 120, + colno: 11, + in_app: true, + }, + ], + causes: [ + { + type: 'TypeError', + value: 'Failed to fetch', + frames: [ + { + filename: APP, + function: 'fetchCart', + lineno: 42, + colno: 9, + in_app: true, + }, + ], + }, + { + type: 'Error', + value: '', + frames: [ + { + filename: APP, + function: 'request', + lineno: 10, + colno: 3, + in_app: true, + }, + ], + }, + ], + }); + }); + + it('splits a Firefox stack whose cause has a Name: message line', () => { + const stack = [ + `checkout@${APP}:120:11`, + 'Caused by: TypeError: NetworkError when attempting to fetch resource.', + `fetchCart@${APP}:42:9`, + ].join('\n'); + + expect(parseJavaScriptException(stack)).toEqual({ + frames: [ + { + filename: APP, + function: 'checkout', + lineno: 120, + colno: 11, + in_app: true, + }, + ], + causes: [ + { + type: 'TypeError', + value: 'NetworkError when attempting to fetch resource.', + frames: [ + { + filename: APP, + function: 'fetchCart', + lineno: 42, + colno: 9, + in_app: true, + }, + ], + }, + ], + }); + }); + + it('titles a cause without a Name: prefix by its whole line', () => { + const stack = [ + ` at checkout (${APP}:120:11)`, + 'Caused by: request timed out after 30s', + ].join('\n'); + + expect(parseJavaScriptException(stack)?.causes).toEqual([ + { type: '', value: 'request timed out after 30s', frames: [] }, + ]); + }); + + it('does not read URLs in a multi-line message as frames', () => { + const stack = [ + 'Error: Checkout failed', + 'https://api.example.com/cart returned 500', + ` at checkout (${APP}:120:11)`, + 'Caused by: Error: Request failed', + 'https://api.example.com/cart/items returned 503', + ` at fetchCart (${APP}:42:9)`, + ].join('\n'); + + const parsed = parseJavaScriptException(stack); + + expect(parsed?.frames.map(frame => frame.function)).toEqual(['checkout']); + expect(parsed?.causes).toEqual([ + expect.objectContaining({ + type: 'Error', + value: + 'Request failed\nhttps://api.example.com/cart/items returned 503', + frames: [expect.objectContaining({ function: 'fetchCart' })], + }), + ]); + }); + + it('does not read URLs in a multi-line Firefox cause message as frames', () => { + const stack = [ + `checkout@${APP}:120:11`, + 'Caused by: GraphQLError: Validation failed:', + ' - field "email" is required', + ' - see https://docs.example.com/errors#validation', + `fetchCart@${APP}:42:9`, + ].join('\n'); + + expect(parseJavaScriptException(stack)?.causes).toEqual([ + { + type: 'GraphQLError', + value: [ + 'Validation failed:', + ' - field "email" is required', + ' - see https://docs.example.com/errors#validation', + ].join('\n'), + frames: [expect.objectContaining({ function: 'fetchCart' })], + }, + ]); + }); + + // V8 prints `new Error('\nRow 12 is invalid:')` as a line of `Error: ` + // followed by the message's lines. + it.each([ + [ + 'a message that starts with a line break', + ['Caused by: Error: ', 'Row 12 is invalid:', ' sku is required'], + { type: 'Error', value: 'Row 12 is invalid:\n sku is required' }, + ], + [ + 'a whitespace-only message', + ['Caused by: Error: ', ''], + { type: 'Error', value: '' }, + ], + [ + 'an empty Caused by line', + ['Caused by: ', 'TypeError: Failed to fetch'], + { type: 'TypeError', value: 'Failed to fetch' }, + ], + [ + 'a message without a Name: prefix', + ['Caused by: request timed out after 30s', ''], + { type: '', value: 'request timed out after 30s' }, + ], + ])('trims the blank lines around %s', (_, causeLines, title) => { + const stack = [ + ` at checkout (${APP}:120:11)`, + ...causeLines, + ` at fetchCart (${APP}:42:9)`, + ].join('\n'); + + expect(parseJavaScriptException(stack)?.causes).toEqual([ + { + ...title, + frames: [expect.objectContaining({ function: 'fetchCart' })], + }, + ]); + }); + + it('keeps a URL line of a frameless Firefox cause in its title', () => { + const stack = [ + `checkout@${APP}:1:2`, + 'Caused by: TypeError: bad', + 'see https://docs.example.com/x', + ].join('\n'); + + expect(parseJavaScriptException(stack)?.causes).toEqual([ + { + type: 'TypeError', + value: 'bad\nsee https://docs.example.com/x', + frames: [], + }, + ]); + }); + + it('skips lines with more than 32 parentheses', () => { + const stack = [ + `checkout@${APP}:120:11`, + `submit${'()'.repeat(17)}@${APP}:130:5`, + ].join('\n'); + + expect(framesOf(stack)).toEqual([ + expect.objectContaining({ function: 'checkout' }), + ]); + }); + + it.each([ + ['an error line alone', 'Error: x'], + [ + 'frameless toString() text with a URL', + 'HttpException: GET https://api.example.com/x failed\nCaused by: {"code":1}', + ], + [ + 'a stack over 64 KB', + `Error: x\n${` at fn (${APP}:1:2)\n`.repeat(2000)}`, + ], + ['empty text', ''], + ['a Caused by without frames', 'Error: x\nCaused by: Error: y'], + ])('returns undefined for %s', (_, stack) => { + expect(parseJavaScriptException(stack)).toBeUndefined(); + }); + + it.each([ + ['/srv/app/node_modules/react-dom/cjs/react-dom.js', false], + ['http://localhost:5173/node_modules/.vite/deps/react-dom.js', false], + ['node:internal/process/task_queues', false], + ['internal/modules/cjs/loader.js', false], + [ + 'https://app.example.com/_next/static/chunks/framework-2c79e2a64abdb08b.js', + false, + ], + [ + 'https://app.example.com/_next/static/chunks/webpack-59c5c889f52620d6.js', + false, + ], + ['https://app.example.com/_next/static/chunks/main-app-5f1c09ab.js', false], + ['webpack:///webpack/bootstrap', false], + ['https://app.example.com/static/js/runtime-main.4c1f2b9d.js', false], + ['https://app.example.com/webpack-runtime-8a2b3c.js', false], + [ + 'https://app.example.com/_next/static/chunks/pages/checkout-3f2a.js', + true, + ], + ['https://app.example.com/_next/static/chunks/main-feature.js', true], + ])('sets in_app for %s to %s', (filename, inApp) => { + expect(framesOf(`Error: x\n at fn (${filename}:1:2)`)).toEqual([ + expect.objectContaining({ filename, in_app: inApp }), + ]); + }); +}); + +describe('isJavaScriptRuntime', () => { + it.each([ + ['webjs', true], + ['nodejs', true], + ['java', false], + ['python', false], + [undefined, false], + ])('treats telemetry.sdk.language %s as %s', (language, expected) => { + expect( + isJavaScriptRuntime( + language == null ? {} : { 'telemetry.sdk.language': language }, + ), + ).toBe(expected); + }); +}); diff --git a/packages/app/src/utils/__tests__/nextServerTelemetry.test.ts b/packages/app/src/utils/__tests__/nextServerTelemetry.test.ts new file mode 100644 index 000000000..c9833046a --- /dev/null +++ b/packages/app/src/utils/__tests__/nextServerTelemetry.test.ts @@ -0,0 +1,200 @@ +import { + getNextServerServiceName, + isStaticAssetRequest, + startNextServerTelemetry, +} from '@/utils/nextServerTelemetry'; + +const mockInit = jest.fn(); +let mockExporterEnabled = true; +let mockBasePath = ''; + +jest.mock('@clickhouse/clickstack-node', () => ({ + init: (...args: unknown[]) => mockInit(...args), +})); +jest.mock('@/config', () => ({ + ...jest.requireActual('@/config'), + get HDX_EXPORTER_ENABLED() { + return mockExporterEnabled; + }, + get BASE_PATH() { + return mockBasePath; + }, +})); + +describe('getNextServerServiceName', () => { + it('suffixes OTEL_SERVICE_NAME', () => { + expect( + getNextServerServiceName({ + OTEL_SERVICE_NAME: 'hdx-oss-dev-app', + OTEL_RESOURCE_ATTRIBUTES: 'service.name=other', + }), + ).toBe('hdx-oss-dev-app-next'); + }); + + it('falls back to service.name in OTEL_RESOURCE_ATTRIBUTES', () => { + expect( + getNextServerServiceName({ + OTEL_SERVICE_NAME: ' ', + OTEL_RESOURCE_ATTRIBUTES: 'service.version=1, service.name = my%20app', + }), + ).toBe('my app-next'); + }); + + it('falls back to hdx-oss-app', () => { + expect( + getNextServerServiceName({ + OTEL_RESOURCE_ATTRIBUTES: 'service.version=1', + }), + ).toBe('hdx-oss-app-next'); + }); + + // The SDK drops the whole variable for any of these, so the API would not + // report the name either + it.each([ + ['a value it cannot decode', 'service.name=%E0'], + ['an unencoded =', 'service.name=acme,k8s.pod.labels=app=web'], + ['an entry without =', 'service.name=acme,region'], + ['an empty key', 'service.name=acme,=web'], + ['a value over 255 characters', `service.name=acme,t=${'a'.repeat(256)}`], + ])('ignores OTEL_RESOURCE_ATTRIBUTES with %s', (_case, attributes) => { + expect( + getNextServerServiceName({ OTEL_RESOURCE_ATTRIBUTES: attributes }), + ).toBe('hdx-oss-app-next'); + }); + + it('suffixes a name that already ends in -next', () => { + expect( + getNextServerServiceName({ OTEL_SERVICE_NAME: 'hyperdx-next' }), + ).toBe('hyperdx-next-next'); + }); +}); + +describe('isStaticAssetRequest', () => { + it.each([ + '/_next/static/chunks/main.js', + '/_next/static/css/app.css?v=1', + '/_next/webpack-hmr?id=1', + '/__nextjs_original-stack-frames', + '/__ENV.js', + '/whats-new.json', + '/favicons/clickstack/favicon.svg', + '/pyodide/pyodide.js', + '/pyodide/pyodide.asm.wasm', + '/drain3-0.9.11-py3-none-any.whl', + ])('skips %s', url => { + expect(isStaticAssetRequest(url, '')).toBe(true); + }); + + it.each([ + '/api/me', + '/search', + '/_next/data/build/search.json', + '/__ENV.js.map', + undefined, + ])('keeps %s', url => { + expect(isStaticAssetRequest(url, '')).toBe(false); + }); + + it('matches below the base path', () => { + expect(isStaticAssetRequest('/hdx/_next/static/a.js', '/hdx')).toBe(true); + expect(isStaticAssetRequest('/hdx/__ENV.js', '/hdx')).toBe(true); + expect(isStaticAssetRequest('/hdx/api/me', '/hdx')).toBe(false); + }); +}); + +describe('startNextServerTelemetry', () => { + const originalEnv = { ...process.env }; + + const start = async (env: Record<string, string>) => { + for (const key of [ + 'HYPERDX_API_KEY', + 'OTEL_EXPORTER_OTLP_HEADERS', + 'OTEL_SERVICE_NAME', + 'OTEL_RESOURCE_ATTRIBUTES', + 'OTEL_LOG_LEVEL', + ]) { + delete process.env[key]; + } + Object.assign(process.env, env); + await startNextServerTelemetry(); + }; + + // The hook reads only the URL of the IncomingMessage it gets + const ignoreHook = (): ((request: { url?: string }) => boolean) => + mockInit.mock.calls[0][0].instrumentations[ + '@opentelemetry/instrumentation-http' + ].ignoreIncomingRequestHook; + + beforeEach(() => { + mockInit.mockClear(); + mockExporterEnabled = true; + mockBasePath = ''; + }); + + afterAll(() => { + process.env = originalEnv; + }); + + it('does not start without a key or OTLP headers', async () => { + await start({ OTEL_SERVICE_NAME: 'hdx-app' }); + + expect(mockInit).not.toHaveBeenCalled(); + expect(process.env.OTEL_SERVICE_NAME).toBe('hdx-app'); + }); + + it('does not start when HDX_EXPORTER_ENABLED is false', async () => { + mockExporterEnabled = false; + + await start({ HYPERDX_API_KEY: 'ingest-key' }); + + expect(mockInit).not.toHaveBeenCalled(); + }); + + it('starts with its own service name and a quieter diag level', async () => { + await start({ + HYPERDX_API_KEY: 'ingest-key', + OTEL_SERVICE_NAME: 'hdx-app', + }); + + expect(mockInit).toHaveBeenCalledWith({ + apiKey: 'ingest-key', + instrumentations: { + '@opentelemetry/instrumentation-http': { + ignoreIncomingRequestHook: expect.any(Function), + }, + }, + }); + expect(process.env.OTEL_SERVICE_NAME).toBe('hdx-app-next'); + expect(process.env.OTEL_LOG_LEVEL).toBe('error'); + }); + + it("keeps the operator's OTEL_LOG_LEVEL", async () => { + await start({ HYPERDX_API_KEY: 'ingest-key', OTEL_LOG_LEVEL: 'debug' }); + + expect(process.env.OTEL_LOG_LEVEL).toBe('debug'); + }); + + it('appends the key to OTLP headers that have no authorization entry', async () => { + await start({ + HYPERDX_API_KEY: 'ingest-key', + OTEL_EXPORTER_OTLP_HEADERS: 'x-scope-orgid=acme', + }); + + expect(process.env.OTEL_EXPORTER_OTLP_HEADERS).toBe( + 'x-scope-orgid=acme,authorization=ingest-key', + ); + expect(mockInit).toHaveBeenCalledWith( + expect.objectContaining({ apiKey: undefined }), + ); + }); + + it('skips static asset requests below the base path', async () => { + mockBasePath = '/hdx'; + + await start({ HYPERDX_API_KEY: 'ingest-key' }); + + const hook = ignoreHook(); + expect(hook({ url: '/hdx/_next/static/a.js' })).toBe(true); + expect(hook({ url: '/hdx/api/me' })).toBe(false); + }); +}); diff --git a/packages/app/src/utils/__tests__/promqlChartQuery.test.ts b/packages/app/src/utils/__tests__/promqlChartQuery.test.ts index 6a1d0c9ac..8556506b1 100644 --- a/packages/app/src/utils/__tests__/promqlChartQuery.test.ts +++ b/packages/app/src/utils/__tests__/promqlChartQuery.test.ts @@ -1,301 +1,12 @@ import { DisplayType } from '@hyperdx/common-utils/dist/types'; import { prometheusApi } from '@/api'; -import { - queryPromqlChartConfig, - toHistogramRows, - toTableRows, -} from '@/utils/promqlChartQuery'; - -// The real module is a Mantine/TanStack table component; only the row cap is -// needed here. -jest.mock('@/HDXMultiSeriesTableChart', () => ({ - MAX_TABLE_ROWS: 10_000, -})); +import { queryPromqlChartConfig } from '@/utils/promqlChartQuery'; jest.mock('@/api', () => ({ prometheusApi: { query: jest.fn(), queryRange: jest.fn() }, })); -const instantResult = ( - metric: Record<string, string>, - ts: number, - value: number, -) => ({ - expression: 'up', - isBucketed: false, - result: [{ metric, values: [[ts, value]] as [number, number][] }], -}); - -describe('toTableRows', () => { - it('projects one row per series for an instant query, with no time column', () => { - const result = toTableRows([ - { - expression: 'up', - isBucketed: false, - result: [ - { - metric: { __name__: 'up', service: 'accounting' }, - values: [[1700000000, 1]], - }, - { - metric: { __name__: 'up', service: 'billing' }, - values: [[1700000000, 0]], - }, - ], - }, - ]); - - expect(result.data).toEqual([ - { __name__: 'up', service: 'accounting', Value: 1 }, - { __name__: 'up', service: 'billing', Value: 0 }, - ]); - expect(result.meta).toEqual([ - { name: '__name__', type: 'String' }, - { name: 'service', type: 'String' }, - { name: 'Value', type: 'Float64' }, - ]); - expect(result.rows).toBe(2); - }); - - it('projects one row per sample for a range query, with a time column first', () => { - const result = toTableRows([ - { - expression: 'up', - isBucketed: true, - result: [ - { - metric: { service: 'accounting' }, - values: [ - [1700000000, 1], - [1700000060, 2], - ], - }, - ], - }, - ]); - - expect(result.data).toEqual([ - { - Timestamp: '2023-11-14T22:13:20.000Z', - service: 'accounting', - Value: 1, - }, - { - Timestamp: '2023-11-14T22:14:20.000Z', - service: 'accounting', - Value: 2, - }, - ]); - expect(Object.keys(result.data[0])).toEqual([ - 'Timestamp', - 'service', - 'Value', - ]); - expect(result.meta?.[0]).toEqual({ - name: 'Timestamp', - type: 'DateTime64(3)', - }); - }); - - it('blanks a label the series does not carry, and orders __name__ first', () => { - const result = toTableRows([ - { - expression: 'up', - isBucketed: false, - result: [ - { metric: { pod: 'a', __name__: 'up' }, values: [[1, 1]] }, - { metric: { service: 'billing' }, values: [[1, 2]] }, - ], - }, - ]); - - expect(result.data).toEqual([ - { __name__: 'up', pod: 'a', service: '', Value: 1 }, - { __name__: '', pod: '', service: 'billing', Value: 2 }, - ]); - }); - - it('renames the reserved columns when a label already uses them', () => { - const result = toTableRows([ - { - expression: 'up', - isBucketed: true, - result: [ - { - metric: { Timestamp: 'noon', Value: 'high' }, - values: [[1700000000, 7]], - }, - ], - }, - ]); - - expect(result.data).toEqual([ - { - Timestamp_1: '2023-11-14T22:13:20.000Z', - Timestamp: 'noon', - Value: 'high', - Value_1: 7, - }, - ]); - expect(result.meta).toEqual([ - { name: 'Timestamp_1', type: 'DateTime64(3)' }, - { name: 'Timestamp', type: 'String' }, - { name: 'Value', type: 'String' }, - { name: 'Value_1', type: 'Float64' }, - ]); - }); - - it('caps the rows it returns', () => { - const result = toTableRows( - [ - { - expression: 'up', - isBucketed: true, - result: [ - { - metric: { service: 'accounting' }, - values: Array.from( - { length: 10 }, - (_, i) => [1700000000 + i, i] as [number, number], - ), - }, - ], - }, - ], - 3, - ); - - expect(result.data).toHaveLength(3); - expect(result.rows).toBe(3); - }); - - it('unions the labels across expressions', () => { - const result = toTableRows([ - instantResult({ service: 'accounting' }, 1, 1), - instantResult({ pod: 'a' }, 1, 2), - ]); - - expect(result.data).toEqual([ - { pod: '', service: 'accounting', Value: 1 }, - { pod: 'a', service: '', Value: 2 }, - ]); - }); - - it('returns only a value column when there are no expressions', () => { - expect(toTableRows([])).toEqual({ - data: [], - meta: [{ name: 'Value', type: 'Float64' }], - rows: 0, - isComplete: true, - }); - }); - - it('returns only a value column for an instant query that matched nothing', () => { - expect( - toTableRows([{ expression: 'up', isBucketed: false, result: [] }]), - ).toEqual({ - data: [], - meta: [{ name: 'Value', type: 'Float64' }], - rows: 0, - isComplete: true, - }); - }); - - // The columns come from the series, not the samples, so an empty range - // result still describes the table it would have filled. - it('keeps the columns of a range series that has no samples', () => { - const result = toTableRows([ - { - expression: 'up', - isBucketed: true, - result: [{ metric: { service: 'web' }, values: [] }], - }, - ]); - - expect(result.data).toEqual([]); - expect(result.rows).toBe(0); - expect(result.meta).toEqual([ - { name: 'Timestamp', type: 'DateTime64(3)' }, - { name: 'service', type: 'String' }, - { name: 'Value', type: 'Float64' }, - ]); - }); - - it('handles label keys that collide with Object.prototype members', () => { - const result = toTableRows([ - instantResult(JSON.parse('{"constructor":"a","__proto__":"b"}'), 1, 1), - instantResult({ pod: 'x' }, 1, 2), - ]); - - expect(result.meta?.map(({ name }) => name)).toEqual([ - '__proto__', - 'constructor', - 'pod', - 'Value', - ]); - expect(Object.entries(result.data[0])).toEqual([ - ['__proto__', 'b'], - ['constructor', 'a'], - ['pod', ''], - ['Value', 1], - ]); - expect(Object.entries(result.data[1])).toEqual([ - ['__proto__', ''], - ['constructor', ''], - ['pod', 'x'], - ['Value', 2], - ]); - }); -}); - -describe('toHistogramRows', () => { - const bucket = (metric: Record<string, string>, value: number) => ({ - metric, - values: [[1700000000, value]] as [number, number][], - }); - const rangeResult = (...result: ReturnType<typeof bucket>[]) => ({ - expression: 'sum by (le) (rate(x_bucket[5m]))', - isBucketed: true, - result, - }); - - it('keys each sample by its le label', () => { - const result = toHistogramRows([ - rangeResult(bucket({ le: '0.5' }, 2), bucket({ le: '+Inf' }, 3)), - ]); - expect(result.data).toEqual([ - { __hdx_time_bucket: '2023-11-14T22:13:20.000Z', le: '0.5', value: 2 }, - { __hdx_time_bucket: '2023-11-14T22:13:20.000Z', le: '+Inf', value: 3 }, - ]); - expect(result.meta?.map(({ name }) => name)).toEqual([ - '__hdx_time_bucket', - 'le', - 'value', - ]); - }); - - it.each<Record<string, string>>([{}, { le: '' }, { le: 'abc' }])( - 'rejects a series without a numeric le: %p', - metric => { - expect(() => toHistogramRows([rangeResult(bucket(metric, 1))])).toThrow( - /need series with an "le" label/, - ); - }, - ); - - it('rejects buckets that were not aggregated by le', () => { - expect(() => - toHistogramRows([ - rangeResult( - bucket({ le: '0.5', instance: 'a' }, 1), - bucket({ le: '0.5', instance: 'b' }, 1), - ), - ]), - ).toThrow('Several series share le="0.5"'); - }); -}); - describe('queryPromqlChartConfig', () => { const dateRange: [Date, Date] = [ new Date('2024-01-01T00:00:00Z'), diff --git a/packages/app/src/utils/__tests__/resourceTimingMarkers.test.ts b/packages/app/src/utils/__tests__/resourceTimingMarkers.test.ts new file mode 100644 index 000000000..28d9e2890 --- /dev/null +++ b/packages/app/src/utils/__tests__/resourceTimingMarkers.test.ts @@ -0,0 +1,326 @@ +import { + logSource, + SPAN_START, + SPAN_START_MS, + TIMING_TIMESTAMP, +} from '@/hooks/__fixtures__/browserTraceEvents'; +import { + buildResourceTimingQuery, + getFoldedRowKeys, + getResourceTimingMarkers, + resourceTimingRowKey, +} from '@/utils/resourceTimingMarkers'; + +const traceRows = [{ SpanId: 'span-1', Timestamp: SPAN_START }]; +const TIMESTAMP_META = [{ name: 'timestamp', type: 'DateTime64(9)' }]; + +const prefixed = (values: Record<string, string>) => + Object.fromEntries( + Object.entries(values).map(([key, value]) => [ + `browser.resource_timing.${key}`, + value, + ]), + ); + +const sameOrigin = prefixed({ + fetch_start: '1000.5', + domain_lookup_start: '1001', + domain_lookup_end: '1001.25', + connect_start: '1001.5', + secure_connection_start: '0', + connect_end: '1002', + request_start: '1002', + response_start: '1009', + response_end: '1011.5', + redirect_start: '0', + duration: '11', + transfer_size: '558', + encoded_body_size: '1536', + decoded_body_size: '20480', + next_hop_protocol: 'http/1.1', + initiator_type: 'fetch', +}); + +const timingRow = (attributes: unknown, overrides: object = {}) => ({ + span_id: 'span-1', + timestamp: TIMING_TIMESTAMP, + attributes, + ...overrides, +}); + +const draw = ( + row: Record<string, unknown>, + spans: Parameters<typeof getResourceTimingMarkers>[1] = traceRows, + meta = TIMESTAMP_META, +) => getResourceTimingMarkers({ data: [row], meta }, spans); + +describe('getResourceTimingMarkers', () => { + it('places dots in sdk-trace-web order relative to the span start', () => { + const { markersBySpanId, drawnRowCounts } = draw(timingRow(sameOrigin)); + + expect(markersBySpanId.get('span-1')).toEqual([ + { name: 'fetchStart', epochMs: SPAN_START_MS, attributes: {} }, + { + name: 'domainLookupStart', + epochMs: SPAN_START_MS + 0.5, + attributes: {}, + }, + { + name: 'domainLookupEnd', + epochMs: SPAN_START_MS + 0.75, + attributes: {}, + }, + { name: 'connectStart', epochMs: SPAN_START_MS + 1, attributes: {} }, + { name: 'connectEnd', epochMs: SPAN_START_MS + 1.5, attributes: {} }, + { name: 'requestStart', epochMs: SPAN_START_MS + 1.5, attributes: {} }, + { name: 'responseStart', epochMs: SPAN_START_MS + 8.5, attributes: {} }, + { + name: 'responseEnd', + epochMs: SPAN_START_MS + 11, + attributes: { + duration: '11ms', + transfer_size: '558 B', + encoded_body_size: '1.5 KB', + decoded_body_size: '20.0 KB', + next_hop_protocol: 'http/1.1', + }, + }, + ]); + expect([...drawnRowCounts]).toEqual([ + [resourceTimingRowKey('span-1', TIMING_TIMESTAMP), 1], + ]); + }); + + it('skips the phases and sizes a cross-origin request leaves at zero, and empty tooltip values', () => { + const crossOrigin = prefixed({ + fetch_start: '1000.5', + domain_lookup_start: '0', + connect_start: '0', + request_start: '0', + response_start: '0', + response_end: '1011.5', + duration: '11', + transfer_size: '0', + encoded_body_size: '0', + decoded_body_size: '0', + next_hop_protocol: '', + }); + + expect(draw(timingRow(crossOrigin)).markersBySpanId.get('span-1')).toEqual([ + { name: 'fetchStart', epochMs: SPAN_START_MS, attributes: {} }, + { + name: 'responseEnd', + epochMs: SPAN_START_MS + 11, + attributes: { duration: '11ms' }, + }, + ]); + }); + + it('keeps a zero transfer size next to a body size, as for a cache hit', () => { + const cached = prefixed({ + fetch_start: '1000.5', + response_end: '1011.5', + transfer_size: '0', + encoded_body_size: '221', + decoded_body_size: '221', + }); + + expect( + draw(timingRow(cached)).markersBySpanId.get('span-1')?.at(-1)?.attributes, + ).toEqual({ + transfer_size: '0 B', + encoded_body_size: '221 B', + decoded_body_size: '221 B', + }); + }); + + it('reads nested JSON numbers and quoted Int64 values', () => { + const json = { + browser: { + resource_timing: { + fetch_start: 1000.5, + response_end: 1011.5, + transfer_size: '558', + }, + }, + }; + + expect(draw(timingRow(json)).markersBySpanId.get('span-1')).toEqual([ + { name: 'fetchStart', epochMs: SPAN_START_MS, attributes: {} }, + { + name: 'responseEnd', + epochMs: SPAN_START_MS + 11, + attributes: { transfer_size: '558 B' }, + }, + ]); + }); + + it.each([ + ['without fetch_start', timingRow(prefixed({ response_end: '1011.5' }))], + ['with a zero fetch_start', timingRow(prefixed({ fetch_start: '0' }))], + [ + 'on a span outside the trace', + timingRow(sameOrigin, { span_id: 'other' }), + ], + ['without a span id', timingRow(sameOrigin, { span_id: '' })], + ['with attributes that are not a map', timingRow('not a map')], + ])('draws nothing and keeps the row for a log %s', (_name, row) => { + const { markersBySpanId, drawnRowCounts } = draw(row); + expect(markersBySpanId.size).toBe(0); + expect(drawnRowCounts.size).toBe(0); + }); + + it.each([ + [ + 'its span is hidden', + [{ ...traceRows[0], __hdx_hidden: true }], + TIMESTAMP_META, + ], + [ + 'the timestamp column is whole seconds', + traceRows, + [{ name: 'timestamp', type: 'DateTime' }], + ], + ])('draws a log but keeps its row when %s', (_name, spans, meta) => { + const { markersBySpanId, drawnRowCounts } = draw( + timingRow(sameOrigin), + spans, + meta, + ); + expect(markersBySpanId.get('span-1')).toHaveLength(8); + expect(drawnRowCounts.size).toBe(0); + }); + + it('counts a timing log ingested twice once per copy', () => { + const row = timingRow(sameOrigin); + const { drawnRowCounts } = getResourceTimingMarkers( + { data: [row, row], meta: TIMESTAMP_META }, + traceRows, + ); + expect([...drawnRowCounts]).toEqual([ + [resourceTimingRowKey('span-1', TIMING_TIMESTAMP), 2], + ]); + }); +}); + +describe('getFoldedRowKeys', () => { + const key = resourceTimingRowKey('span-1', TIMING_TIMESTAMP); + const timingLogRow = { SpanId: 'span-1', Timestamp: TIMING_TIMESTAMP }; + const otherLogRow = { + SpanId: 'span-1', + Timestamp: '2026-10-22T04:52:37.825000000Z', + }; + + it.each([ + ['folds the timing row alone', [timingLogRow, otherLogRow], 1, [key]], + [ + 'keeps an exception in the same millisecond and the timing row', + [timingLogRow, { ...timingLogRow, Body: '', SeverityNumber: 17 }], + 1, + [], + ], + [ + 'keeps a console error in the same millisecond and the timing row', + [timingLogRow, { ...timingLogRow, Body: 'boom', SeverityText: 'error' }], + 1, + [], + ], + [ + 'folds two copies of a timing log drawn twice', + [timingLogRow, timingLogRow], + 2, + [key], + ], + ['ignores rows on other keys', [otherLogRow], 1, []], + ])('%s', (_name, logRows, drawn, expected) => { + expect([...getFoldedRowKeys(logRows, new Map([[key, drawn]]))]).toEqual( + expected, + ); + }); +}); + +describe('buildResourceTimingQuery', () => { + const source = { + ...logSource, + timestampValueExpression: 'TimestampTime', + displayedTimestampValueExpression: 'Timestamp', + }; + const context = { + serviceNames: ['web', 'web-worker'], + anchorMs: SPAN_START_MS, + endMs: Date.parse('2026-10-22T04:52:38.100Z'), + anchorHidden: false, + sessionId: 's1', + serviceName: 'web', + }; + + it('selects the span id, displayed timestamp and attributes of the trace timing logs', () => { + expect( + buildResourceTimingQuery({ logSource: source, context, traceId: "t'1" }), + ).toEqual({ + source: 'logs', + connection: 'conn', + from: { databaseName: 'default', tableName: 'otel_logs' }, + timestampValueExpression: 'TimestampTime', + select: [ + { valueExpression: 'SpanId', alias: 'span_id' }, + { valueExpression: 'Timestamp', alias: 'timestamp' }, + { valueExpression: 'LogAttributes', alias: 'attributes' }, + ], + where: "TraceId = 't\\'1'", + whereLanguage: 'sql', + filters: [ + { + type: 'sql', + condition: "toString(EventName) = 'browser.resource_timing'", + }, + { + type: 'sql', + condition: "toString(ServiceName) IN ('web', 'web-worker')", + }, + ], + dateRange: [ + new Date('2026-10-22T04:52:37.000Z'), + new Date('2026-10-22T04:57:38.100Z'), + ], + limit: { limit: 1000 }, + }); + }); + + it('places a JSON path service name inside toString', () => { + const query = buildResourceTimingQuery({ + logSource: { + ...source, + serviceNameExpression: 'ResourceAttributes.service.name', + }, + context, + traceId: 't1', + }); + expect(query.filters?.[1]).toEqual({ + type: 'sql', + condition: + "toString(ResourceAttributes.service.name) IN ('web', 'web-worker')", + }); + }); + + it.each([ + [ + 'the source has no service name', + { ...source, serviceNameExpression: undefined }, + context, + ], + [ + 'the spans have no service name', + source, + { ...context, serviceNames: [] }, + ], + ])('leaves out the service filter when %s', (_name, querySource, ctx) => { + expect( + buildResourceTimingQuery({ + logSource: querySource, + context: ctx, + traceId: 't1', + }).filters, + ).toHaveLength(1); + }); +}); diff --git a/packages/app/src/utils/__tests__/rrwebChunkAssembler.test.ts b/packages/app/src/utils/__tests__/rrwebChunkAssembler.test.ts index a5ee50605..260c818c1 100644 --- a/packages/app/src/utils/__tests__/rrwebChunkAssembler.test.ts +++ b/packages/app/src/utils/__tests__/rrwebChunkAssembler.test.ts @@ -9,6 +9,7 @@ function chunkRows( event: object, total: number, eventId: number, + ts?: string, ): RRWebStreamRow[] { const body = JSON.stringify(event); const size = Math.ceil(body.length / total); @@ -17,6 +18,7 @@ function chunkRows( ck: String(i + 1), // ClickHouse map values come back as strings tcks: String(total), ev: String(eventId), + ts, })); } @@ -63,7 +65,7 @@ describe('createRrwebChunkAssembler', () => { }); it('reassembles multi-chunk events arriving out of order', () => { - // The regression from hyperdxio/hyperdx#2569: all chunks of an event + // The regression from ClickHouse/ClickStack#2569: all chunks of an event // share one timestamp, so ClickHouse may return them in any order. const { assembler, events, errors } = makeAssembler(); const event = { type: 2, timestamp: 4, data: { text: 'y'.repeat(500) } }; @@ -130,7 +132,8 @@ describe('createRrwebChunkAssembler', () => { }); it('drops a stale incomplete event when its id is reused', () => { - // The rr-web.event counter resets on page reload, so an id can recur. + // Rows without a timestamp only have rr-web.event, which older SDKs reset + // on page reload, so an id can recur. const { assembler, events, errors } = makeAssembler(); const event = { type: 2, timestamp: 10, data: { text: 'c'.repeat(300) } }; const [stale1] = chunkRows({ type: 2, timestamp: 1 }, 2, 5); @@ -146,6 +149,85 @@ describe('createRrwebChunkAssembler', () => { ]); }); + it('keeps an orphaned chunk from completing a later page load event', () => { + // Older SDKs restart rr-web.event per page load. Page A's chunks 1-2 of + // event 2 were lost when it closed; page B's event 2 has 2 chunks. + // Keyed by id alone, A's 3/3 opened an entry expecting 3 chunks that B's + // two chunks then filled, joining B's JSON with A's fragment. + const { assembler, events, errors } = makeAssembler(); + const pageB = { type: 2, timestamp: 20, data: { text: 'f'.repeat(300) } }; + const orphan = chunkRows( + { type: 2, timestamp: 10, data: { text: 'g'.repeat(300) } }, + 3, + 2, + '2026-11-09 10:00:00.100000000', + )[2]; + const pageBRows = chunkRows(pageB, 2, 2, '2026-11-09 10:00:00.900000000'); + for (const row of [orphan, ...pageBRows]) { + assembler.push(row); + } + assembler.end(); + + expect(events).toEqual([pageB]); + expect(errors).toEqual([ + expect.objectContaining({ + reason: 'incomplete-event', + eventId: 2, + timestamp: '2026-11-09 10:00:00.100000000', + chunksReceived: 1, + totalChunks: 3, + }), + ]); + expect(errors).not.toContainEqual( + expect.objectContaining({ reason: 'parse-error' }), + ); + }); + + it('keeps an orphaned last chunk from completing an event of the same size', () => { + // A check that totalChunks differs from the pending entry misses this. + const { assembler, events, errors } = makeAssembler(); + const pageB = { type: 2, timestamp: 20, data: { text: 'h'.repeat(300) } }; + const orphan = chunkRows( + { type: 2, timestamp: 10, data: { text: 'i'.repeat(300) } }, + 2, + 2, + '2026-11-09 10:00:00.100000000', + )[1]; + const pageBRows = chunkRows(pageB, 2, 2, '2026-11-09 10:00:00.900000000'); + for (const row of [orphan, ...pageBRows]) { + assembler.push(row); + } + assembler.end(); + + expect(events).toEqual([pageB]); + expect(errors).toEqual([ + expect.objectContaining({ + reason: 'incomplete-event', + eventId: 2, + chunksReceived: 1, + totalChunks: 2, + }), + ]); + }); + + it('keys large event ids from newer SDKs without losing precision', () => { + // clickstack-browser 1.2.1 starts event numbers at a random value below + // 2^52, which needs more than 32 bits. + const { assembler, events, errors } = makeAssembler(); + const eventA = { type: 2, timestamp: 1, data: { text: 'j'.repeat(300) } }; + const eventB = { type: 3, timestamp: 1, data: { text: 'k'.repeat(300) } }; + const ts = '2026-11-09T10:00:00.100000000Z'; + const [a1, a2] = chunkRows(eventA, 2, 2 ** 52 - 1, ts); + const [b1, b2] = chunkRows(eventB, 2, 2 ** 52, ts); + for (const row of [a1, b1, b2, a2]) { + assembler.push(row); + } + assembler.end(); + + expect(events).toEqual([eventB, eventA]); + expect(errors).toEqual([]); + }); + it('reports incomplete events at end of stream', () => { const { assembler, events, errors } = makeAssembler(); const [first] = chunkRows({ type: 2, timestamp: 11 }, 3, 4); diff --git a/packages/app/src/utils/__tests__/traceTriggerClick.test.ts b/packages/app/src/utils/__tests__/traceTriggerClick.test.ts new file mode 100644 index 000000000..b05eb0347 --- /dev/null +++ b/packages/app/src/utils/__tests__/traceTriggerClick.test.ts @@ -0,0 +1,152 @@ +import { + logSource, + SPAN_START, + SPAN_START_MS, +} from '@/hooks/__fixtures__/browserTraceEvents'; +import type { BrowserTraceContext } from '@/utils/browserTraceContext'; +import { + buildTriggerClickQuery, + pickTriggerClick, +} from '@/utils/traceTriggerClick'; + +const context: BrowserTraceContext = { + serviceNames: ['web'], + anchorMs: SPAN_START_MS, + endMs: SPAN_START_MS + 12, + anchorHidden: false, + sessionId: 's1', + serviceName: 'web', +}; + +const args = { + logSource: { + ...logSource, + timestampValueExpression: 'TimestampTime, Timestamp', + displayedTimestampValueExpression: 'Timestamp', + }, + context, + sessionId: 's1', + sessionIdExpression: "LogAttributes['session.id']", +}; + +const click = (timestamp: string, attributes: object = {}) => ({ + timestamp, + event_name: 'browser.user_action.click', + body: '', + attributes: { 'browser.tag_name': 'BUTTON', ...attributes }, +}); + +const clicks = (...data: ReturnType<typeof click>[]) => ({ + data, + meta: [{ name: 'timestamp', type: 'DateTime64(9)' }], +}); + +describe('buildTriggerClickQuery', () => { + it("looks up the latest clicks of the anchor span's session and service", () => { + const { config, aliasMap } = buildTriggerClickQuery(args); + + expect(aliasMap).toEqual({ + timestamp: 'Timestamp', + timestamp_key: 'TimestampTime', + event_name: 'toString(EventName)', + session_id: "LogAttributes['session.id']", + body: 'Body', + attributes: 'LogAttributes', + }); + expect(config).toMatchObject({ + source: 'logs', + from: logSource.from, + connection: 'conn', + timestampValueExpression: 'TimestampTime, Timestamp', + filters: [ + { type: 'lucene', condition: 'LogAttributes.session.id:"s1"' }, + { + type: 'sql', + condition: "toString(EventName) = 'browser.user_action.click'", + }, + { type: 'sql', condition: "ServiceName = 'web'" }, + ], + orderBy: 'Timestamp DESC', + limit: { limit: 10 }, + }); + }); + + it.each([ + [ + 'the lookback across a second boundary', + Date.parse('2026-10-22T04:52:38.100Z'), + ['2026-10-22T04:52:37.000Z', '2026-10-22T04:52:38.100Z'], + ], + [ + 'an anchor on a whole second', + Date.parse('2026-10-22T04:52:38.000Z'), + ['2026-10-22T04:52:37.000Z', '2026-10-22T04:52:38.000Z'], + ], + ])( + 'floors the window start to the second and ends at the anchor for %s', + (_case, anchorMs, range) => { + expect( + buildTriggerClickQuery({ ...args, context: { ...context, anchorMs } }) + .config.dateRange, + ).toEqual(range.map(iso => new Date(iso))); + }, + ); +}); + +describe('pickTriggerClick', () => { + it('picks the latest click at or before the anchor', () => { + const latest = click('2026-10-22T04:52:37.815000000Z'); + const rows = clicks( + click('2026-10-22T04:52:37.819000000Z'), + latest, + click('2026-10-22T04:52:37.700000000Z'), + ); + + expect(pickTriggerClick(rows, SPAN_START_MS)).toEqual({ + row: latest, + gapMs: 3, + }); + }); + + it.each([ + ['in the same millisecond as the anchor', SPAN_START, 0], + ['at the edge of the lookback', '2026-10-22T04:52:37.568000000Z', 250], + ])('takes a click %s', (_case, timestamp, gapMs) => { + const row = click(timestamp); + + expect(pickTriggerClick(clicks(row), SPAN_START_MS)).toEqual({ + row, + gapMs, + }); + }); + + it.each([ + ['after the anchor in the same second', '2026-10-22T04:52:37.900000000Z'], + ['older than the lookback', '2026-10-22T04:52:37.567000000Z'], + ['with an unparsable timestamp', 'not-a-timestamp'], + ])('ignores a click %s', (_case, timestamp) => { + expect( + pickTriggerClick(clicks(click(timestamp)), SPAN_START_MS), + ).toBeUndefined(); + }); + + it('ignores clicks in a whole-second timestamp column', () => { + expect( + pickTriggerClick( + { + data: [click('2026-10-22T04:52:37Z')], + meta: [{ name: 'timestamp', type: 'DateTime' }], + }, + Date.parse('2026-10-22T04:52:37.100Z'), + ), + ).toBeUndefined(); + }); + + it('matches a click recorded on another page URL', () => { + const row = click('2026-10-22T04:52:37.816000000Z', { + 'browser.document.url.full': 'http://localhost:5173/cart?tab=items', + }); + + expect(pickTriggerClick(clicks(row), SPAN_START_MS)?.row).toBe(row); + }); +}); diff --git a/packages/app/src/utils/browserEvents.ts b/packages/app/src/utils/browserEvents.ts index f60e6a6d2..f023d5804 100644 --- a/packages/app/src/utils/browserEvents.ts +++ b/packages/app/src/utils/browserEvents.ts @@ -16,6 +16,7 @@ export const BROWSER_EVENT_NAMES = { NAVIGATION: 'browser.navigation', CONSOLE: 'browser.console', EXCEPTION: 'exception', + RESOURCE_TIMING: 'browser.resource_timing', } as const; export const CONSOLE_METHOD_ATTRIBUTE = 'browser.console.method'; @@ -37,7 +38,7 @@ function joinWords(...words: Array<string | undefined>): string { return words.filter(Boolean).join(' '); } -function firstLine(text: string): string { +export function firstLine(text: string): string { return text.split('\n', 1)[0].trim(); } @@ -50,7 +51,9 @@ function setPairs(entries: [string, unknown][]): [string, string][] { // The SDK sends data-otel-* attributes, prefix removed, as one map. The // collector flattens it into `browser.element.attributes.<name>` keys; without // that step a Map column holds it as a JSON string. -function getElementAttributes(attributes: Attributes): [string, string][] { +export function getElementAttributes( + attributes: Attributes, +): [string, string][] { const prefix = `${ELEMENT_ATTRIBUTES_KEY}.`; const flatPairs = setPairs( Object.entries(attributes) @@ -152,6 +155,12 @@ function getExceptionLabel( }; } +function toAttributes(attributes: unknown): Attributes { + return isRecord(attributes) + ? flatten<Attributes, Attributes>(attributes) + : {}; +} + export function getBrowserEventLabel({ eventName, body, @@ -162,9 +171,7 @@ export function getBrowserEventLabel({ /** Flat keys from a Map column or nested objects from a JSON column. */ attributes: unknown; }): BrowserEventLabel { - const flat: Attributes = isRecord(attributes) - ? flatten<Attributes, Attributes>(attributes) - : {}; + const flat = toAttributes(attributes); const text = typeof body === 'string' ? body : ''; switch (eventName) { case BROWSER_EVENT_NAMES.CLICK: @@ -185,3 +192,52 @@ export function getBrowserEventLabel({ }; } } + +export type BrowserEventKind = 'click' | 'navigation' | 'console'; + +type BrowserEventRow = { + eventName: unknown; + /** Flat keys from a Map column or nested objects from a JSON column. */ + attributes: unknown; +}; + +const KIND_BY_EVENT_NAME = new Map<string, BrowserEventKind>([ + [BROWSER_EVENT_NAMES.CLICK, 'click'], + [BROWSER_EVENT_NAMES.NAVIGATION, 'navigation'], + [BROWSER_EVENT_NAMES.CONSOLE, 'console'], +]); + +// A row has no event name when its source predates the Event Name Expression +// field, or when its table (or Known Columns List) has no such column. The SDK +// always sends these keys with their kind, and only with it. +const KIND_ATTRIBUTE_KEYS: [BrowserEventKind, string[]][] = [ + ['click', ['browser.tag_name', 'browser.css_selector']], + [ + 'navigation', + [ + 'browser.navigation.same_document', + 'browser.navigation.hash_change', + 'browser.navigation.type', + ], + ], + ['console', [CONSOLE_METHOD_ATTRIBUTE]], +]; + +export function getBrowserEventKind({ + eventName, + attributes, +}: BrowserEventRow): BrowserEventKind | undefined { + if (isSet(eventName)) { + return KIND_BY_EVENT_NAME.get(String(eventName)); + } + const flat = toAttributes(attributes); + return KIND_ATTRIBUTE_KEYS.find(([, keys]) => + keys.some(key => isSet(flat[key])), + )?.[0]; +} + +export function isBrowserEventRow(row: BrowserEventRow): boolean { + return isSet(row.eventName) + ? String(row.eventName).startsWith('browser.') + : getBrowserEventKind(row) != null; +} diff --git a/packages/app/src/utils/browserTelemetry.ts b/packages/app/src/utils/browserTelemetry.ts new file mode 100644 index 000000000..d1df918fa --- /dev/null +++ b/packages/app/src/utils/browserTelemetry.ts @@ -0,0 +1,53 @@ +import type { ClickStackBrowserOptions } from '@clickhouse/clickstack-browser'; +import { type Attributes, trace } from '@opentelemetry/api'; + +import { parseResourceAttributes } from '@/config'; +import type { NextApiConfigResponseData } from '@/types'; + +/** + * Records a user action as a zero-duration span, the replacement for the old + * SDK's addAction. The browser SDK adds session.id and user.* to it. + */ +export function recordAction(name: string, attributes: Attributes): void { + // The scope the old addAction used. The session replay timeline finds + // custom events by it (utils/sessions.ts, SessionEventList.tsx). + trace.getTracer('custom-action').startSpan(name, { attributes }).end(); +} + +type BrowserTelemetryConfig = Pick< + NextApiConfigResponseData, + | 'apiKey' + | 'collectorUrl' + | 'collectorTracesUrl' + | 'collectorLogsUrl' + | 'serviceName' +>; + +/** Maps the app's telemetry settings onto the browser SDK's init options. */ +export function getBrowserInitOptions({ + config, + resourceAttributes, + serviceVersion, +}: { + config: BrowserTelemetryConfig; + /** The raw NEXT_PUBLIC_OTEL_RESOURCE_ATTRIBUTES value. */ + resourceAttributes: string; + serviceVersion: string | undefined; +}): ClickStackBrowserOptions { + return { + endpoint: config.collectorUrl, + // An empty per-signal URL, as from a variable set to '', makes the SDK + // build that signal's URL from endpoint + tracesEndpoint: config.collectorTracesUrl, + logsEndpoint: config.collectorLogsUrl, + apiKey: config.apiKey, + serviceName: config.serviceName, + // Wins over a service.version in resourceAttributes, as before the upgrade + serviceVersion, + resourceAttributes: parseResourceAttributes(resourceAttributes), + // The old SDK's consoleCapture recorded every console level + console: 'debug', + maskAllText: true, + maskAllInputs: true, + }; +} diff --git a/packages/app/src/utils/browserTraceContext.ts b/packages/app/src/utils/browserTraceContext.ts new file mode 100644 index 000000000..40c8cb2ab --- /dev/null +++ b/packages/app/src/utils/browserTraceContext.ts @@ -0,0 +1,140 @@ +import { get } from 'lodash'; +import type { ResponseJSON } from '@hyperdx/common-utils/dist/clickhouse'; +import { classifyTimestampType } from '@hyperdx/common-utils/dist/core/utils'; +import type { TLogSource } from '@hyperdx/common-utils/dist/types'; + +import { parseTimestampToMs } from '@/utils'; +import { + isSessionLogEventSource, + SessionLogEventSource, +} from '@/utils/sessionLogEvents'; +import { isSet } from '@/utils/spanAttributeReaders'; + +// The waterfall reads an hour either side of its focus. One long or broken +// span would otherwise stretch the timing query over its whole duration. +const MAX_TRACE_MS = 60 * 60 * 1000; + +export type BrowserTraceContext = { + serviceNames: string[]; + /** Earliest browser span start. */ + anchorMs: number; + /** Latest browser span end, at most an hour after the anchor. */ + endMs: number; + /** Whether the trace filter hid the anchor span. */ + anchorHidden: boolean; + /** Of the anchor span. */ + sessionId: string | undefined; + /** Of the anchor span. */ + serviceName: string | undefined; +}; + +export type BrowserTraceRow = { + Timestamp?: unknown; + Duration?: unknown; + ServiceName?: unknown; + SpanAttributes?: unknown; + __hdx_hidden?: unknown; +}; + +export type BrowserEventLogSource = SessionLogEventSource & + Required<Pick<TLogSource, 'traceIdExpression' | 'spanIdExpression'>>; + +export function isBrowserEventLogSource( + source: TLogSource | null | undefined, +): source is BrowserEventLogSource { + return ( + isSessionLogEventSource(source) && + !!source.traceIdExpression && + !!source.spanIdExpression + ); +} + +/** + * Twin of the guard in the waterfall's traceExtent: timestamp-nano reads a + * non-date as a finite instant. + */ +export function parseRowTimeMs(timestamp: unknown): number | undefined { + if (typeof timestamp !== 'string' || Number.isNaN(Date.parse(timestamp))) { + return undefined; + } + try { + const ms = parseTimestampToMs(timestamp); + return Number.isFinite(ms) ? ms : undefined; + } catch { + return undefined; + } +} + +export type BrowserEventResult = Pick< + ResponseJSON<Record<string, unknown>>, + 'data' | 'meta' +>; + +export function hasSubSecondTimestamps( + meta: BrowserEventResult['meta'], +): boolean { + const type = meta?.find(column => column.name === 'timestamp')?.type; + return (classifyTimestampType(type)?.precision ?? 0) > 0; +} + +/** + * The start is floored to the second: a DateTime time column compares its + * truncated value and would otherwise lose the start's second. The end is + * inclusive, so a truncated value is never past it. + */ +export function getBrowserEventDateRange( + startMs: number, + endMs: number, +): [Date, Date] { + return [new Date(Math.floor(startMs / 1000) * 1000), new Date(endMs)]; +} + +function optionalString(value: unknown): string | undefined { + return isSet(value) ? String(value) : undefined; +} + +/** + * Undefined unless the trace has a span from an OTel browser SDK, which sets + * the page URL on every span. AI and backend spans can carry `session.id` + * too, and legacy SDK spans have neither. Never anchored on the trace's + * earliest span overall: backend spans run on another clock. + */ +export function getBrowserTraceContext( + traceRows: readonly BrowserTraceRow[], +): BrowserTraceContext | undefined { + let anchor: { row: BrowserTraceRow; startMs: number } | undefined; + let endMs = Number.NEGATIVE_INFINITY; + const serviceNames = new Set<string>(); + for (const row of traceRows) { + if (!isSet(get(row.SpanAttributes, 'browser.document.url.full'))) { + continue; + } + const startMs = parseRowTimeMs(row.Timestamp); + if (startMs == null) { + continue; + } + const durationSec = Number(row.Duration); + endMs = Math.max( + endMs, + startMs + (Number.isFinite(durationSec) ? durationSec : 0) * 1000, + ); + const serviceName = optionalString(row.ServiceName); + if (serviceName != null) { + serviceNames.add(serviceName); + } + if (anchor == null || startMs < anchor.startMs) { + anchor = { row, startMs }; + } + } + if (anchor == null) { + return undefined; + } + return { + serviceNames: [...serviceNames].sort(), + anchorMs: anchor.startMs, + endMs: Math.min(endMs, anchor.startMs + MAX_TRACE_MS), + anchorHidden: !!anchor.row.__hdx_hidden, + sessionId: optionalString(get(anchor.row.SpanAttributes, 'session.id')), + serviceName: optionalString(anchor.row.ServiceName), + }; +} diff --git a/packages/app/src/utils/httpSpanAttributes.ts b/packages/app/src/utils/httpSpanAttributes.ts index ca1acc1b4..f183b03b3 100644 --- a/packages/app/src/utils/httpSpanAttributes.ts +++ b/packages/app/src/utils/httpSpanAttributes.ts @@ -133,7 +133,7 @@ export function getUserAgent(attributes: Attributes): string | undefined { // One decimal above 1 KB, so a body and total of 1536 and 1900 bytes don't // both round to "2 KB". -function formatBytes(bytes: number): string { +export function formatBytes(bytes: number): string { return formatNumber(bytes, { output: 'byte', mantissa: Math.abs(bytes) >= 1024 ? 1 : 0, diff --git a/packages/app/src/utils/javascriptStack.ts b/packages/app/src/utils/javascriptStack.ts new file mode 100644 index 000000000..be1d32ad6 --- /dev/null +++ b/packages/app/src/utils/javascriptStack.ts @@ -0,0 +1,124 @@ +import type { StacktraceFrame } from '@/types'; +import { defaultStackParser } from '@/utils/sentryStackParser'; +import type { Attributes } from '@/utils/spanAttributeReaders'; + +const JAVASCRIPT_SDK_LANGUAGES = new Set(['webjs', 'nodejs']); + +// Parsing runs during render on client-controlled text, and a crafted 1 KB line +// still costs the line parsers ~1.5 ms, so longer stacks are shown as text. +const MAX_PARSED_STACK_LENGTH = 64 * 1024; + +const CAUSED_BY_REGEX = /^\s*Caused by: /; +const V8_FRAME_REGEX = /^\s*at /; +const ERROR_TITLE_REGEX = /^([^\s:]+)(?:: ([\s\S]*))?$/; + +// Library, runtime and bundler frames. The old browser SDK deleted Next.js +// framework chunks outright; marking them keeps the frames, and the panel +// opens on the app's newest in-app frame instead of them. +const NOT_IN_APP_FILENAME_PATTERNS = [ + /node_modules/, + /^(node:|internal\/)/, + /\/framework-[0-9a-f]+\.js/, + /\/_next\/static\/chunks\/(main|main-app|webpack|polyfills)(-[0-9a-f]+)?\.js/, + /(^|\/)webpack\/(runtime|bootstrap)/, + /\/(webpack-runtime|runtime[~-]main)[^/]*\.js/, +]; + +type JavaScriptCause = { + type: string; + value: string; + frames: StacktraceFrame[]; +}; + +export type ParsedJavaScriptException = { + frames: StacktraceFrame[]; + causes: JavaScriptCause[]; +}; + +export function isJavaScriptRuntime(resourceAttributes: Attributes): boolean { + const language = resourceAttributes['telemetry.sdk.language']; + return typeof language === 'string' && JAVASCRIPT_SDK_LANGUAGES.has(language); +} + +// Frames without a line number are native, anonymous or `data:` URI frames: +// never app code, and nothing a source map can resolve. +function isInApp({ filename, lineno }: StacktraceFrame): boolean { + return ( + lineno !== undefined && + !NOT_IN_APP_FILENAME_PATTERNS.some(pattern => pattern.test(filename)) + ); +} + +// The `Name: message` header is every line before the first frame, and a +// multi-line message can contain URL lines the Gecko parser would read as +// frames. V8 frames start with `at `. Firefox and Safari frames always contain +// `@` (`fn@url:1:2`, `@url:1:2`, `fn@[native code]`); their main stack has no +// header, but `Caused by:` sections and frameless `toString()` text do. +function getHeaderLength(lines: string[]): number { + const v8FrameIndex = lines.findIndex(line => V8_FRAME_REGEX.test(line)); + if (v8FrameIndex !== -1) { + return v8FrameIndex; + } + const geckoFrameIndex = lines.findIndex(line => line.includes('@')); + return geckoFrameIndex === -1 ? lines.length : geckoFrameIndex; +} + +function parseSection(lines: string[]) { + const headerLength = getHeaderLength(lines); + const frames = defaultStackParser(lines.join('\n'), headerLength).map( + frame => ({ ...frame, in_app: isInApp(frame) }), + ); + return { header: lines.slice(0, headerLength), frames }; +} + +// The title is the `Caused by:` line joined with the header lines below it, so +// a message that starts with a line break (`Error: \nDetails`) would keep it +// and open with a blank line. Only the start is trimmed before matching: a +// whitespace-only message leaves `Error: `, whose space the regex needs. +function parseCauseTitle( + title: string, +): Pick<JavaScriptCause, 'type' | 'value'> { + const text = title.trimStart(); + const match = ERROR_TITLE_REGEX.exec(text); + return match + ? { type: match[1], value: (match[2] ?? '').trim() } + : { type: '', value: text.trimEnd() }; +} + +/** + * Parses an `Error.stack` string from a JavaScript SDK, which appends each + * error in the `cause` chain as a Java-style `Caused by: Name: message` + * section. Frames are oldest first. Returns undefined when no section has a + * frame or the text is too long to parse, so the caller can show it instead. + */ +export function parseJavaScriptException( + stack: string, +): ParsedJavaScriptException | undefined { + if (stack.length > MAX_PARSED_STACK_LENGTH) { + return undefined; + } + const sections: { title?: string; lines: string[] }[] = [{ lines: [] }]; + for (const line of stack.split('\n')) { + if (CAUSED_BY_REGEX.test(line)) { + sections.push({ title: line.replace(CAUSED_BY_REGEX, ''), lines: [] }); + } else { + sections[sections.length - 1].lines.push(line); + } + } + + const [main, ...causes] = sections.map(({ title, lines }) => ({ + title, + ...parseSection(lines), + })); + if (![main, ...causes].some(section => section.frames.length > 0)) { + return undefined; + } + + return { + frames: main.frames, + causes: causes.map(({ title, header, frames }) => ({ + ...parseCauseTitle([title, ...header].join('\n')), + frames, + })), + }; +} diff --git a/packages/app/src/utils/nextServerTelemetry.ts b/packages/app/src/utils/nextServerTelemetry.ts new file mode 100644 index 000000000..a091c765a --- /dev/null +++ b/packages/app/src/utils/nextServerTelemetry.ts @@ -0,0 +1,140 @@ +import { decideSelfTelemetry } from '@hyperdx/common-utils/dist/selfTelemetry'; + +import { BASE_PATH, HDX_EXPORTER_ENABLED } from '@/config'; + +// Used only when no name is configured, in which case the API reports +// unknown_service:node. It is the name docker-compose gives the API. +const DEFAULT_SERVICE_NAME = 'hdx-oss-app'; +const SERVICE_NAME_SUFFIX = '-next'; + +// Build and public/ assets were half of this server's incoming spans. Pages, +// /api and /_next/data requests keep theirs. A new file in public/ needs an +// entry here. +const STATIC_PATH_PREFIXES = [ + '/_next/static/', + '/_next/webpack-hmr', + // The dev overlay's stack frame and source map requests + '/__nextjs', + '/favicons/', + '/pyodide/', +]; +const STATIC_PATHS = ['/__ENV.js', '/whats-new.json']; +// The Python packages the Patterns view installs from the public/ root +const STATIC_PATH_SUFFIXES = ['.whl']; + +// The SDK's limit for resource attribute keys and values +const MAX_RESOURCE_ATTRIBUTE_LENGTH = 255; + +/** + * A stricter twin of `parseResourceAttributes` in src/config.ts, which splits + * each entry at its first `=` and skips entries without a key. This one + * follows the EnvDetector in `@opentelemetry/resources`, which drops the whole + * variable when any entry is malformed or longer than 255 characters, so the + * Next server picks the same service.name as the SDK and never one the API + * would not report. + */ +function serviceNameFromResourceAttributes(raw: string | undefined) { + let serviceName: string | undefined; + for (const entry of (raw ?? '').split(',')) { + if (entry.trim() === '') { + continue; + } + const parts = entry.split('='); + if (parts.length !== 2 || parts[0].trim() === '') { + return undefined; + } + let key: string; + let value: string; + try { + key = decodeURIComponent(parts[0].trim()); + value = decodeURIComponent(parts[1].trim()); + } catch { + return undefined; + } + if ( + key.length > MAX_RESOURCE_ATTRIBUTE_LENGTH || + value.length > MAX_RESOURCE_ATTRIBUTE_LENGTH + ) { + return undefined; + } + if (key === 'service.name') { + serviceName = value; + } + } + return serviceName || undefined; +} + +/** + * The HyperDX image (the docker-compose app service, which sets hdx-oss-app) + * and the all-in-one image run the API, the check-alerts task and this server + * in one container with one OTEL_SERVICE_NAME, so this server reports as that + * name plus `-next`. + */ +export function getNextServerServiceName( + env: Record<string, string | undefined>, +): string { + const base = + env.OTEL_SERVICE_NAME?.trim() || + serviceNameFromResourceAttributes(env.OTEL_RESOURCE_ATTRIBUTES) || + DEFAULT_SERVICE_NAME; + return `${base}${SERVICE_NAME_SUFFIX}`; +} + +export function isStaticAssetRequest( + url: string | undefined, + basePath: string, +): boolean { + const path = (url ?? '').split('?')[0]; + const appPath = + basePath && path.startsWith(`${basePath}/`) + ? path.slice(basePath.length) + : path; + return ( + STATIC_PATHS.includes(appPath) || + STATIC_PATH_PREFIXES.some(prefix => appPath.startsWith(prefix)) || + STATIC_PATH_SUFFIXES.some(suffix => appPath.endsWith(suffix)) + ); +} + +/** Called from register() in instrumentation.ts in the Node.js runtime. */ +export async function startNextServerTelemetry(): Promise<void> { + // Operators who set HDX_EXPORTER_ENABLED=false to turn off the app's own + // telemetry (it hides the browser key in /api/config) never got Next server + // telemetry either, because production builds did not load + // instrumentation.ts before. + if (!HDX_EXPORTER_ENABLED) { + return; + } + const telemetry = decideSelfTelemetry(process.env); + if (!telemetry.start) { + return; + } + if (telemetry.otlpHeaders !== undefined) { + process.env.OTEL_EXPORTER_OTLP_HEADERS = telemetry.otlpHeaders; + } + + // The variable beats both init's serviceName option and a service.name in + // OTEL_RESOURCE_ATTRIBUTES, so writing it is enough. The browser takes its + // name from NEXT_PUBLIC_OTEL_SERVICE_NAME and is not affected. + process.env.OTEL_SERVICE_NAME = getNextServerServiceName(process.env); + + // Next sets http.route on the outer HTTP server span once the request + // handler settles, and for proxied /api requests that span has already + // ended, so the SDK's default warn level prints a diag line per request. + // Export failures are diag errors and still print. An operator's + // OTEL_LOG_LEVEL wins. + process.env.OTEL_LOG_LEVEL ??= 'error'; + + const { init } = await import('@clickhouse/clickstack-node'); + init({ + apiKey: telemetry.apiKey, + instrumentations: { + // The SDK merges its header capture and body hooks into this entry, so + // they keep working. + '@opentelemetry/instrumentation-http': { + ignoreIncomingRequestHook: request => + isStaticAssetRequest(request.url, BASE_PATH), + }, + }, + }); +} diff --git a/packages/app/src/utils/promqlChartQuery.ts b/packages/app/src/utils/promqlChartQuery.ts index 183d0d926..8468ce79b 100644 --- a/packages/app/src/utils/promqlChartQuery.ts +++ b/packages/app/src/utils/promqlChartQuery.ts @@ -1,310 +1,53 @@ import type { QueryAttribution } from '@hyperdx/common-utils/dist/clickhouse'; import { - displayTypeSupportsInstantQuery, - getQueriedPromqlSeries, - parsePromqlLe, - promqlSeriesQueryType, - promqlStep, - reducePromqlSamples, -} from '@hyperdx/common-utils/dist/core/promql'; -import { renderPromqlSeriesNames } from '@hyperdx/common-utils/dist/core/seriesNameTemplate'; -import { substitutePromqlChartConfigTemplates } from '@hyperdx/common-utils/dist/macros'; + getPromqlChartQueries, + PromqlExpressionSamples, + PromqlQuery, + reducePromqlChartRows, + toPromqlChartResult, + toPromqlSamples, +} from '@hyperdx/common-utils/dist/core/promqlChart'; import { DateRange, - DisplayType, - PrometheusMatrixResult, PromqlChartConfig, PromqlReducer, PromqlSeries, } from '@hyperdx/common-utils/dist/types'; -import { prometheusApi, PrometheusInstantQueryResponse } from '@/api'; -import { MAX_TABLE_ROWS } from '@/HDXMultiSeriesTableChart'; +import { prometheusApi } from '@/api'; import { ChartQueryResult } from '@/types'; -/** One series of a result: its labels, and its `[unix seconds, value]` samples. */ -type SampledSeries = { - metric: Record<string, string>; - values: [number, number][]; -}; - -/** One expression's query result, normalized across the two endpoints. */ -type ExpressionResult = PromqlSeries & { - /** Whether the result is bucketed by time. */ - isBucketed: boolean; - result: SampledSeries[]; -}; - -/** An instant query's response, normalized across response types (scalar, vector, matrix). */ -function normalizeInstantResult(response: PrometheusInstantQueryResponse): { - isBucketed: boolean; - result: SampledSeries[]; -} { - if (response.status !== 'success' || !response.data) { - throw new Error(response.error ?? 'PromQL query failed'); - } - - const { data } = response; - switch (data.resultType) { - case 'vector': - return { - isBucketed: false, - result: data.result.map(({ metric, value }) => ({ - metric, - values: [[value[0], parseFloat(value[1])]], - })), - }; - case 'scalar': - return { - isBucketed: false, - result: [ - { - metric: {}, - values: [[data.result[0], parseFloat(data.result[1])]], - }, - ], - }; - case 'matrix': - return { isBucketed: true, result: toSampledSeries(data.result) }; - default: - throw new Error( - 'A PromQL chart needs numeric samples; this expression returned a string.', - ); - } -} - -/** A matrix result's series, with their samples parsed. */ -const toSampledSeries = (result: PrometheusMatrixResult[]): SampledSeries[] => - result.map(({ metric, values }) => ({ - metric, - values: values.map(([ts, value]) => [ts, parseFloat(value)]), - })); - -/** Evaluate one expression at `evalTime`, at the instant endpoint. */ -async function fetchInstantExpression( +/** Evaluate one expression's query at the instant or range endpoint. */ +async function fetchExpression( config: PromqlChartConfig, - series: PromqlSeries, - evalTime: Date, + { query, ...series }: PromqlSeries & { query: PromqlQuery }, signal: AbortSignal, attribution: QueryAttribution, -): Promise<ExpressionResult> { - const response = await prometheusApi.query({ - query: series.expression, - time: evalTime.getTime() / 1000, - sourceId: config.source, - // A vector is one sample per series, so capping series caps a table's - // rows exactly. Range queries go uncapped: series can be sparse, so no - // series count bounds their samples without dropping rows that would fit. - limit: - config.displayType === DisplayType.Table ? MAX_TABLE_ROWS : undefined, - signal, - attribution, - }); - - return { - ...series, - ...normalizeInstantResult(response), - }; -} - -/** Evaluate one expression over the whole window, at the range endpoint. */ -async function fetchRangeExpression( - config: PromqlChartConfig & Pick<DateRange, 'minGranularitySeconds'>, - series: PromqlSeries, - dateRange: [Date, Date], - signal: AbortSignal, - attribution: QueryAttribution, -): Promise<ExpressionResult> { - const [startDate, endDate] = dateRange; - const response = await prometheusApi.queryRange({ - query: series.expression, - start: startDate.getTime() / 1000, - end: endDate.getTime() / 1000, - step: promqlStep( - config.granularity, - dateRange, - config.minGranularitySeconds, - ), - sourceId: config.source, - signal, - attribution, - }); +): Promise<PromqlExpressionSamples> { + const response = + query.kind === 'instant' + ? await prometheusApi.query({ + query: query.expr, + time: query.timeSec, + sourceId: config.source, + limit: query.limit, + signal, + attribution, + }) + : await prometheusApi.queryRange({ + query: query.expr, + start: query.startSec, + end: query.endSec, + step: `${query.stepSec}s`, + sourceId: config.source, + signal, + attribution, + }); if (response.status !== 'success' || !response.data) { throw new Error(response.error ?? 'PromQL query failed'); } - - // The range endpoint only ever answers with a matrix. - return { - ...series, - isBucketed: true, - result: toSampledSeries(response.data.result), - }; -} - -/** - * Rows for the whole chart, shaped like a ClickHouse response. - * - * Rows carry a `__hdx_time_bucket` if the result of any expression spans time, - * otherwise no `__hdx_time_bucket` is included. Samples keep the timestamps - * Prometheus gave them. - */ -function toChartRows( - expressions: ExpressionResult[], - legendTemplate?: string, -): ChartQueryResult { - const seriesNames = renderPromqlSeriesNames(expressions, legendTemplate); - const isBucketed = expressions.some(result => result.isBucketed); - - const data: Record<string, string | number>[] = []; - const promqlSeriesLabels: Record<string, Record<string, string>> = {}; - expressions.forEach(({ result: series }, expressionIndex) => { - series.forEach(({ values, metric }, seriesIndex) => { - const seriesName = seriesNames[expressionIndex][seriesIndex]; - promqlSeriesLabels[seriesName] = metric; - for (const [ts, value] of values) { - data.push( - isBucketed - ? { - __hdx_time_bucket: new Date(ts * 1000).toISOString(), - value, - series_name: seriesName, - } - : { value, series_name: seriesName }, - ); - } - }); - }); - - return { - data, - meta: [ - ...(isBucketed - ? [{ name: '__hdx_time_bucket', type: 'DateTime64(3)' }] - : []), - { name: 'value', type: 'Float64' }, - { name: 'series_name', type: 'String' }, - ], - rows: data.length, - isComplete: true, - promqlSeriesLabels, - }; -} - -/** `base`, or `base_N` with the lowest N that doesn't collide with a label column. */ -function uniqueColumnName(base: string, taken: Set<string>): string { - if (!taken.has(base)) return base; - let n = 1; - while (taken.has(`${base}_${n}`)) n++; - return `${base}_${n}`; -} - -/** Every label any series carries, `__name__` first and the rest alphabetical. */ -function labelColumns(expressions: ExpressionResult[]): string[] { - const keys = new Set<string>(); - for (const { result } of expressions) { - for (const { metric } of result) { - for (const key of Object.keys(metric)) keys.add(key); - } - } - const hasName = keys.delete('__name__'); - return [...(hasName ? ['__name__'] : []), ...[...keys].sort()]; -} - -/** Every sample of every series, lazily, so a capped caller stops reading early. */ -function* samples(expressions: ExpressionResult[]) { - for (const { result } of expressions) { - for (const { metric, values } of result) { - for (const [ts, value] of values) yield { metric, ts, value }; - } - } -} - -/** - * Rows for a table tile: one per sample, with a column per Prometheus label, - * including __name__, plus Timestamp and Value column. Every row carries the - * same keys in the same order. - */ -export function toTableRows( - expressions: ExpressionResult[], - maxRows: number = MAX_TABLE_ROWS, -): ChartQueryResult { - const labels = labelColumns(expressions); - const taken = new Set(labels); - const timeColumn = expressions.some(({ isBucketed }) => isBucketed) - ? uniqueColumnName('Timestamp', taken) - : undefined; - if (timeColumn) taken.add(timeColumn); - const valueColumn = uniqueColumnName('Value', taken); - - // Cap the total number of rows before the rows end up in the react-query cache. - const data: Record<string, string | number>[] = []; - for (const { metric, ts, value } of samples(expressions)) { - if (data.length >= maxRows) break; - const row: [string, string | number][] = []; - if (timeColumn) row.push([timeColumn, new Date(ts * 1000).toISOString()]); - for (const label of labels) { - row.push([label, Object.hasOwn(metric, label) ? metric[label] : '']); - } - row.push([valueColumn, value]); - data.push(Object.fromEntries(row)); - } - - return { - data, - meta: [ - ...(timeColumn ? [{ name: timeColumn, type: 'DateTime64(3)' }] : []), - ...labels.map(name => ({ name, type: 'String' })), - { name: valueColumn, type: 'Float64' }, - ], - rows: data.length, - isComplete: true, - }; -} - -/** - * Rows for a histogram heatmap: one per sample, grouped by the series' `le` - * bucket. Every series must be a distinct bucket (le). - */ -export function toHistogramRows( - expressions: ExpressionResult[], -): ChartQueryResult { - const seenLe = new Set<string>(); - const data: Record<string, string | number>[] = []; - for (const { result } of expressions) { - for (const { metric, values } of result) { - const le = metric.le; - if (Number.isNaN(parsePromqlLe(le))) { - throw new Error( - 'Histogram heatmaps need series with an "le" label, e.g. sum by (le) (rate(x_bucket[$__rate_interval])).', - ); - } - if (seenLe.has(le)) { - throw new Error( - `Several series share le="${le}". Aggregate them by bucket with sum by (le) (...).`, - ); - } - seenLe.add(le); - for (const [ts, value] of values) { - data.push({ - __hdx_time_bucket: new Date(ts * 1000).toISOString(), - le, - value, - }); - } - } - } - - return { - data, - meta: [ - { name: '__hdx_time_bucket', type: 'DateTime64(3)' }, - { name: 'le', type: 'String' }, - { name: 'value', type: 'Float64' }, - ], - rows: data.length, - isComplete: true, - }; + return { ...series, ...toPromqlSamples(response.data) }; } /** @@ -318,42 +61,12 @@ export async function queryPromqlChartConfig( // Required so a new caller can't forget it and leave its queries untagged. attribution: QueryAttribution, ): Promise<ChartQueryResult> { - // Expand dashboard variables and macros before sending to Prometheus. - const substituted = substitutePromqlChartConfigTemplates({ - ...config, - dateRange, - }); - const results = await Promise.all( - getQueriedPromqlSeries(substituted).map(series => - displayTypeSupportsInstantQuery(substituted) && - promqlSeriesQueryType(series) === 'instant' - ? fetchInstantExpression( - substituted, - series, - dateRange[1], - signal, - attribution, - ) - : fetchRangeExpression( - substituted, - series, - dateRange, - signal, - attribution, - ), + getPromqlChartQueries(config, dateRange).map(query => + fetchExpression(config, query, signal, attribution), ), ); - - // Rows keyed by the series' `le` bucket. Done here so that - // alias and legend templates don't interfere with the le label. - if (substituted.heatmap?.mode === 'histogram') { - return toHistogramRows(results); - } - - return substituted.displayType === DisplayType.Table - ? toTableRows(results) - : toChartRows(results, substituted.legendTemplate?.trim() || undefined); + return { ...toPromqlChartResult(config, results), isComplete: true }; } /** @@ -364,30 +77,8 @@ export function reduceBucketRows( result: ChartQueryResult, reducer: PromqlReducer | undefined, ): ChartQueryResult { - const samplesBySeries = new Map<string, number[]>(); - for (const row of result.data) { - const name = String(row.series_name ?? ''); - const samples = samplesBySeries.get(name); - if (samples) { - samples.push(Number(row.value)); - } else { - samplesBySeries.set(name, [Number(row.value)]); - } - } - - const data: Record<string, string | number>[] = []; - for (const [seriesName, samples] of samplesBySeries) { - const value = reducePromqlSamples(samples, reducer); - if (value != null) data.push({ series_name: seriesName, value }); - } - return { - data, - meta: [ - { name: 'series_name', type: 'String' }, - { name: 'value', type: 'Float64' }, - ], - rows: data.length, + ...reducePromqlChartRows(result, reducer), isComplete: result.isComplete, }; } diff --git a/packages/app/src/utils/resourceTimingMarkers.ts b/packages/app/src/utils/resourceTimingMarkers.ts new file mode 100644 index 000000000..89c695538 --- /dev/null +++ b/packages/app/src/utils/resourceTimingMarkers.ts @@ -0,0 +1,250 @@ +import { countBy, get } from 'lodash'; +import SqlString from 'sqlstring'; +import type { + BuilderChartConfigWithDateRange, + Filter, +} from '@hyperdx/common-utils/dist/types'; + +import type { TTimelineSpanEventMarker } from '@/components/TimelineChart/TimelineSpanEventMarker'; +import { getDisplayedTimestampValueExpression } from '@/source'; +import { formatDurationMs } from '@/utils'; +import { BROWSER_EVENT_NAMES } from '@/utils/browserEvents'; +import { + BrowserEventLogSource, + BrowserEventResult, + BrowserTraceContext, + getBrowserEventDateRange, + hasSubSecondTimestamps, + parseRowTimeMs, +} from '@/utils/browserTraceContext'; +import { formatBytes } from '@/utils/httpSpanAttributes'; +import { isSet, toFiniteNumber } from '@/utils/spanAttributeReaders'; + +const ATTRIBUTE_PREFIX = 'browser.resource_timing.'; + +// Same names and order as the network span events @opentelemetry/sdk-trace-web +// adds to fetch and XHR spans, which the legacy SDK drew as dots. +const PHASES = [ + ['fetch_start', 'fetchStart'], + ['domain_lookup_start', 'domainLookupStart'], + ['domain_lookup_end', 'domainLookupEnd'], + ['connect_start', 'connectStart'], + ['secure_connection_start', 'secureConnectionStart'], + ['connect_end', 'connectEnd'], + ['request_start', 'requestStart'], + ['response_start', 'responseStart'], + ['response_end', 'responseEnd'], +] as const; + +// Five keys with duration and next_hop_protocol: the marker tooltip's limit. +// New SDK spans carry no response size, and the dots replace the timing row. +const SIZE_ATTRIBUTES = [ + 'transfer_size', + 'encoded_body_size', + 'decoded_body_size', +] as const; +const PROTOCOL_ATTRIBUTE = 'next_hop_protocol'; + +// A timing log's timestamp is its emit time, after the request ends. The SDK +// flushes within 1 s; the margin covers slow exports. +const EMIT_LAG_MS = 5 * 60 * 1000; +const RESOURCE_TIMING_LIMIT = 1000; + +export type ResourceTimingMarker = Omit< + TTimelineSpanEventMarker, + 'timestamp' +> & { + attributes: Record<string, string>; +}; + +/** + * Matches a timing log to its waterfall log row: both queries select the same + * timestamp expression. Another log on the span can share the key, so the + * fold goes through getFoldedRowKeys. + */ +export function resourceTimingRowKey(spanId: unknown, timestamp: unknown) { + return `${String(spanId)}|${String(timestamp)}`; +} + +/** + * Log rows carry no event name, and an exception or console error on the span + * in the same millisecond has the timing log's key. A key folds only when the + * dots query drew a timing log for each log row with it. All rows with a key + * share one timestamp, so an uncapped log list holds all of them or none. + */ +export function getFoldedRowKeys( + logRows: readonly { SpanId?: unknown; Timestamp?: unknown }[], + drawnRowCounts: ReadonlyMap<string, number>, +): ReadonlySet<string> { + const rowCounts = countBy(logRows, row => + resourceTimingRowKey(row.SpanId, row.Timestamp), + ); + return new Set( + [...drawnRowCounts] + .filter(([key, drawn]) => rowCounts[key] <= drawn) + .map(([key]) => key), + ); +} + +export function buildResourceTimingQuery({ + logSource, + context, + traceId, +}: { + logSource: BrowserEventLogSource; + context: BrowserTraceContext; + traceId: string; +}): BuilderChartConfigWithDateRange { + // toString: a JSON path is Dynamic, which IN rejects. + const filters: Filter[] = [ + { + type: 'sql', + condition: SqlString.format('? = ?', [ + SqlString.raw(`toString(${logSource.eventNameExpression})`), + BROWSER_EVENT_NAMES.RESOURCE_TIMING, + ]), + }, + ]; + if (logSource.serviceNameExpression && context.serviceNames.length > 0) { + filters.push({ + type: 'sql', + condition: SqlString.format('? IN (?)', [ + SqlString.raw(`toString(${logSource.serviceNameExpression})`), + context.serviceNames, + ]), + }); + } + return { + source: logSource.id, + connection: logSource.connection, + from: logSource.from, + timestampValueExpression: logSource.timestampValueExpression, + select: [ + { valueExpression: logSource.spanIdExpression, alias: 'span_id' }, + { + valueExpression: getDisplayedTimestampValueExpression(logSource), + alias: 'timestamp', + }, + // The whole map: a single key would need a JSON metadata lookup first. + { + valueExpression: logSource.eventAttributesExpression, + alias: 'attributes', + }, + ], + where: `${logSource.traceIdExpression} = ${SqlString.escape(traceId)}`, + whereLanguage: 'sql', + filters, + dateRange: getBrowserEventDateRange( + context.anchorMs, + context.endMs + EMIT_LAG_MS, + ), + limit: { limit: RESOURCE_TIMING_LIMIT }, + }; +} + +function readNumber(attributes: unknown, key: string): number | undefined { + // lodash get reads both a flat Map key and a nested JSON path. Map values + // are strings, and JSON Int64 values come quoted. + return toFiniteNumber(get(attributes, `${ATTRIBUTE_PREFIX}${key}`)); +} + +function getTooltipAttributes(attributes: unknown): Record<string, string> { + const result: Record<string, string> = {}; + const duration = readNumber(attributes, 'duration'); + if (duration != null) { + result.duration = formatDurationMs(duration); + } + // A cross-origin response without Timing-Allow-Origin reports every size as + // 0, which isn't its size. A lone 0 transfer size is a cache hit and stays. + const sizes = SIZE_ATTRIBUTES.map( + key => [key, readNumber(attributes, key)] as const, + ); + if (sizes.some(([, size]) => size)) { + for (const [key, size] of sizes) { + if (size != null) { + result[key] = formatBytes(size); + } + } + } + const protocol: unknown = get( + attributes, + `${ATTRIBUTE_PREFIX}${PROTOCOL_ATTRIBUTE}`, + ); + if (isSet(protocol)) { + result[PROTOCOL_ATTRIBUTE] = String(protocol); + } + return result; +} + +/** + * Phases are milliseconds from the page's time origin, and the log timestamp + * is its emit time, so dots are placed relative to the span start. Zero + * phases weren't measured (a cross-origin request without + * Timing-Allow-Origin) and are skipped, as sdk-trace-web does. + */ +function toMarkers( + attributes: unknown, + spanStartMs: number, + fetchStart: number, +): ResourceTimingMarker[] { + const markers = PHASES.flatMap(([key, name]) => { + const phase = readNumber(attributes, key); + return phase != null && phase !== 0 + ? [{ epochMs: spanStartMs + (phase - fetchStart), name, attributes: {} }] + : []; + }); + markers[markers.length - 1].attributes = getTooltipAttributes(attributes); + return markers; +} + +/** + * A log on a span outside the trace isn't drawn, so its row stays. A drawn + * log's row stays too when the trace filter hides its span, since the dots + * don't show, or when the timestamp column is whole seconds, since the key + * would match every log on the span in that second. + */ +export function getResourceTimingMarkers( + { data, meta }: BrowserEventResult, + traceRows: readonly { + SpanId?: unknown; + Timestamp?: unknown; + __hdx_hidden?: unknown; + }[], +): { + markersBySpanId: ReadonlyMap<string, ResourceTimingMarker[]>; + drawnRowCounts: ReadonlyMap<string, number>; +} { + const spanStarts = new Map<string, number>(); + const shownSpanIds = new Set<string>(); + for (const row of traceRows) { + const startMs = parseRowTimeMs(row.Timestamp); + if (isSet(row.SpanId) && startMs != null) { + const spanId = String(row.SpanId); + spanStarts.set(spanId, startMs); + if (!row.__hdx_hidden) { + shownSpanIds.add(spanId); + } + } + } + + const foldable = hasSubSecondTimestamps(meta); + const markersBySpanId = new Map<string, ResourceTimingMarker[]>(); + const drawnRowCounts = new Map<string, number>(); + for (const row of data) { + const spanId = isSet(row.span_id) ? String(row.span_id) : undefined; + const spanStartMs = spanId != null ? spanStarts.get(spanId) : undefined; + const fetchStart = readNumber(row.attributes, 'fetch_start'); + if (spanId == null || spanStartMs == null || !fetchStart) { + continue; + } + markersBySpanId.set(spanId, [ + ...(markersBySpanId.get(spanId) ?? []), + ...toMarkers(row.attributes, spanStartMs, fetchStart), + ]); + if (foldable && shownSpanIds.has(spanId)) { + const key = resourceTimingRowKey(spanId, row.timestamp); + drawnRowCounts.set(key, (drawnRowCounts.get(key) ?? 0) + 1); + } + } + return { markersBySpanId, drawnRowCounts }; +} diff --git a/packages/app/src/utils/rrwebChunkAssembler.ts b/packages/app/src/utils/rrwebChunkAssembler.ts index 31a59fc88..020dd9ab5 100644 --- a/packages/app/src/utils/rrwebChunkAssembler.ts +++ b/packages/app/src/utils/rrwebChunkAssembler.ts @@ -11,10 +11,17 @@ * * All chunks of one event share the same log timestamp, so the stream order * of chunks is only as reliable as the query's ORDER BY. This assembler - * buffers chunks per event id and joins them sorted by chunk index, so a + * buffers chunks per event and joins them sorted by chunk index, so a * replay can never be corrupted by out-of-order or interleaved chunks — * which previously scrambled the concatenation, made JSON.parse throw, and - * silently dropped the event (https://github.com/hyperdxio/hyperdx/issues/2569). + * silently dropped the event (https://github.com/ClickHouse/ClickStack/issues/2569). + * + * `@hyperdx/browser` and `@clickhouse/clickstack-browser` up to 1.2.0 restart + * `rr-web.event` at 1 on every page load, so one session repeats event ids. + * Events are keyed by id plus full-precision timestamp: keyed by id alone, a + * page's orphaned chunk (the rest lost when the page closed) completes a later + * page's event of the same id and corrupts it. Second precision is not enough, + * since two page loads can start within the same second. * * ClickHouse returns the attributes as strings (or `''` when absent), so all * fields are coerced before use. @@ -31,6 +38,8 @@ export type RRWebStreamRow = { tcks?: number | string; /** rr-web.event — event counter shared by all chunks of an event */ ev?: number | string; + /** Full-precision log timestamp, shared by all chunks of an event */ + ts?: string; }; export type RRWebAssemblerErrorInfo = { @@ -40,19 +49,23 @@ export type RRWebAssemblerErrorInfo = { | 'duplicate-chunk' | 'buffer-overflow'; eventId?: number; + timestamp?: string; chunksReceived: number; totalChunks: number; }; type PendingEvent = { + eventId: number; + timestamp: string; totalChunks: number; parts: Map<number, string>; }; /** * Max number of chunked events buffered concurrently. With a correctly - * ordered stream at most one event is pending at a time; the cap only guards - * against pathological data endlessly growing memory. + * ordered stream at most one event is pending at a time, plus events whose + * remaining chunks were lost; the cap only guards against pathological data + * endlessly growing memory. */ const MAX_PENDING_EVENTS = 20; @@ -70,38 +83,37 @@ export function createRrwebChunkAssembler({ /** Called when an event had to be dropped */ onError: (error: unknown, info: RRWebAssemblerErrorInfo) => void; }) { - // Insertion-ordered by first-seen chunk, used for overflow eviction - const pending = new Map<number, PendingEvent>(); + // Keyed by eventKey; insertion-ordered by first-seen chunk, used for + // overflow eviction + const pending = new Map<string, PendingEvent>(); const parseAndEmit = ( body: string, - eventId: number | undefined, - chunksReceived: number, - totalChunks: number, + info: Omit<RRWebAssemblerErrorInfo, 'reason'>, ) => { try { onEvent(JSON.parse(body)); } catch (error) { - onError(error, { - reason: 'parse-error', - eventId, - chunksReceived, - totalChunks, - }); + onError(error, { reason: 'parse-error', ...info }); } }; + const pendingInfo = (entry: PendingEvent) => ({ + eventId: entry.eventId, + timestamp: entry.timestamp, + chunksReceived: entry.parts.size, + totalChunks: entry.totalChunks, + }); + const dropPending = ( - eventId: number, + key: string, entry: PendingEvent, reason: RRWebAssemblerErrorInfo['reason'], ) => { - pending.delete(eventId); + pending.delete(key); onError(new Error(`rrweb event dropped: ${reason}`), { reason, - eventId, - chunksReceived: entry.parts.size, - totalChunks: entry.totalChunks, + ...pendingInfo(entry), }); }; @@ -110,54 +122,59 @@ export function createRrwebChunkAssembler({ const totalChunks = toNumber(row.tcks); const chunk = toNumber(row.ck); const eventId = toNumber(row.ev); + const timestamp = row.ts ?? ''; // Unchunked event — parse directly. if (totalChunks <= 1 || chunk === 0) { - parseAndEmit(row.b, eventId, 1, 1); + parseAndEmit(row.b, { + eventId, + timestamp, + chunksReceived: 1, + totalChunks: 1, + }); return; } - let entry = pending.get(eventId); + const key = `${eventId}:${timestamp}`; + let entry = pending.get(key); if (entry != null && entry.parts.has(chunk)) { - // The event counter resets on page reload, so a colliding id means a - // new event started before the previous one completed. Drop the - // incomplete one rather than mixing bodies. - dropPending(eventId, entry, 'duplicate-chunk'); + // A chunk index seen twice for one event: a re-sent record, or rows + // without a timestamp whose counter restarted on page reload. Drop + // the incomplete event rather than mix bodies. + dropPending(key, entry, 'duplicate-chunk'); entry = undefined; } if (entry == null) { - entry = { totalChunks, parts: new Map() }; - pending.set(eventId, entry); + entry = { eventId, timestamp, totalChunks, parts: new Map() }; + pending.set(key, entry); } entry.parts.set(chunk, row.b); if (entry.parts.size >= entry.totalChunks) { - pending.delete(eventId); + pending.delete(key); const body = [...entry.parts.entries()] .sort(([a], [b]) => a - b) .map(([, part]) => part) .join(''); - parseAndEmit(body, eventId, entry.parts.size, entry.totalChunks); + parseAndEmit(body, pendingInfo(entry)); return; } if (pending.size > MAX_PENDING_EVENTS) { const oldest = pending.entries().next().value; if (oldest != null) { - const [oldestId, oldestEntry] = oldest; - dropPending(oldestId, oldestEntry, 'buffer-overflow'); + const [oldestKey, oldestEntry] = oldest; + dropPending(oldestKey, oldestEntry, 'buffer-overflow'); } } }, /** Reports any events still incomplete when the stream ends. */ end(): void { - for (const [eventId, entry] of pending) { + for (const entry of pending.values()) { onError(new Error('rrweb event dropped: incomplete-event'), { reason: 'incomplete-event', - eventId, - chunksReceived: entry.parts.size, - totalChunks: entry.totalChunks, + ...pendingInfo(entry), }); } pending.clear(); diff --git a/packages/app/src/utils/sentryStackParser.ts b/packages/app/src/utils/sentryStackParser.ts new file mode 100644 index 000000000..37aad8ab0 --- /dev/null +++ b/packages/app/src/utils/sentryStackParser.ts @@ -0,0 +1,330 @@ +// Parses JavaScript `Error.stack` text into frames: Sentry's Chrome (V8) and +// Gecko (Firefox, Safari) line parsers and `createStackParser`, ported from +// sentry-javascript 11.10.0: +// https://github.com/getsentry/sentry-javascript/blob/11.10.0/packages/browser/src/stack-parsers.ts +// https://github.com/getsentry/sentry-javascript/blob/11.10.0/packages/core/src/utils/stacktrace.ts +// +// Changes from upstream: +// - Typed against HyperDX's `StacktraceFrame`, without upstream's `exec()` +// result casts. +// - Only the Chrome and Gecko line parsers (upstream's +// `defaultStackLineParsers`); WinJS and Opera are dropped. +// - `createStackParser` drops the unused `framesToPop` parameter. +// - The final reverse no longer strips `sentryWrapped` and +// `captureException`/`captureMessage` frames. Those target Sentry's own SDK +// and would drop an app's own `captureException` frame. +// - The `data:` URI frame sets `in_app` like every other frame. +// - `createStackParser` skips lines with more than 32 parentheses. +// +// MIT License +// +// Copyright (c) 2019 Functional Software, Inc. dba Sentry +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// The line parsers were originally forked from https://github.com/csnover/TraceKit, +// and were largely re-written as part of raven-js. Upstream's TraceKit notice: +// +// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files(the 'Software'), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, +// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import type { StacktraceFrame } from '@/types'; + +type StackLineParserFn = (line: string) => StacktraceFrame | undefined; +type StackLineParser = [priority: number, parse: StackLineParserFn]; + +const STACKTRACE_FRAME_LIMIT = 50; +const MAX_LINE_PARENTHESES = 32; +export const UNKNOWN_FUNCTION = '?'; +// Used to sanitize webpack (error: *) wrapped stack errors +const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; + +const CHROME_PRIORITY = 30; +const GECKO_PRIORITY = 50; + +function createFrame( + filename: string, + func: string, + lineno?: number, + colno?: number, +): StacktraceFrame { + const frame: StacktraceFrame = { + filename, + function: func === '<anonymous>' ? UNKNOWN_FUNCTION : func, + in_app: true, // All browser frames are considered in_app + }; + + if (lineno !== undefined) { + frame.lineno = lineno; + } + + if (colno !== undefined) { + frame.colno = colno; + } + + return frame; +} + +// This regex matches frames that have no function name (ie. are at the top level of a module). +// For example "at http://localhost:5000//script.js:1:126" +// Frames _with_ function names usually look as follows: "at commitLayoutEffects (react-dom.development.js:23426:1)" +const chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i; + +// This regex matches all the frames that have a function name. +const chromeRegex = + /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; + +const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/; + +// Matches stack frames with data URIs instead of filename so we can still get the function name +// Example: "at dynamicFn (data:application/javascript,export function dynamicFn() {..." +const chromeDataUriRegex = /at (.+?) ?\(data:(.+?),/; + +// Chromium based browsers: Chrome, Brave, new Opera, new Edge +const chromeStackParserFn: StackLineParserFn = line => { + const dataUriMatch = line.match(chromeDataUriRegex); + if (dataUriMatch) { + return { + filename: `<data:${dataUriMatch[2]}>`, + function: dataUriMatch[1], + in_app: true, + }; + } + + // If the stack line has no function name, we need to parse it differently + const noFnParts = chromeRegexNoFnName.exec(line); + + if (noFnParts) { + const [, filename, line, col] = noFnParts; + return createFrame(filename, UNKNOWN_FUNCTION, +line, +col); + } + + const parts = chromeRegex.exec(line); + + if (parts) { + const isEval = parts[2]?.indexOf('eval') === 0; // start of line + + if (isEval) { + const subMatch = chromeEvalRegex.exec(parts[2]); + + if (subMatch) { + // throw out eval line/column and use top-most line/column number + parts[2] = subMatch[1]; // url + parts[3] = subMatch[2]; // line + parts[4] = subMatch[3]; // column + } + } + + const [func, filename] = extractSafariExtensionDetails( + parts[1] || UNKNOWN_FUNCTION, + parts[2], + ); + + return createFrame( + filename, + func, + parts[3] ? +parts[3] : undefined, + parts[4] ? +parts[4] : undefined, + ); + } + + return; +}; + +const chromeStackLineParser: StackLineParser = [ + CHROME_PRIORITY, + chromeStackParserFn, +]; + +// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it +// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js +// We need this specific case for now because we want no other regex to match. +const geckoREgex = + /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i; +const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + +const gecko: StackLineParserFn = line => { + const parts = geckoREgex.exec(line); + + if (parts) { + const isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval) { + const subMatch = geckoEvalRegex.exec(parts[3]); + + if (subMatch) { + // throw out eval line/column and use top-most line number + parts[1] = parts[1] || 'eval'; + parts[3] = subMatch[1]; + parts[4] = subMatch[2]; + parts[5] = ''; // no column when eval + } + } + + let filename = parts[3]; + let func = parts[1] || UNKNOWN_FUNCTION; + [func, filename] = extractSafariExtensionDetails(func, filename); + + return createFrame( + filename, + func, + parts[4] ? +parts[4] : undefined, + parts[5] ? +parts[5] : undefined, + ); + } + + return; +}; + +const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko]; + +/** + * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces. + * What it means, is that instead of format like: + * + * Error: wat + * at function@url:row:col + * at function@url:row:col + * at function@url:row:col + * + * it produces something like: + * + * function@url:row:col + * function@url:row:col + * function@url:row:col + * + * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch. + * This function is extracted so that we can use it in both places without duplicating the logic. + * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests + * and fix this case seems like an impossible, or at least way too time-consuming task. + */ +const extractSafariExtensionDetails = ( + func: string, + filename: string, +): [string, string] => { + const isSafariExtension = func.indexOf('safari-extension') !== -1; + const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1; + + return isSafariExtension || isSafariWebExtension + ? [ + func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION, + isSafariExtension + ? `safari-extension:${filename}` + : `safari-web-extension:${filename}`, + ] + : [func, filename]; +}; + +function createStackParser(...parsers: StackLineParser[]) { + const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); + + return (stack: string, skipFirstLines: number = 0): StacktraceFrame[] => { + const frames: StacktraceFrame[] = []; + const lines = stack.split('\n'); + + for (let i = skipFirstLines; i < lines.length; i++) { + let line = lines[i]; + // Truncate lines over 1kb because many of the regular expressions use + // backtracking which results in run time that increases exponentially + // with input size. Huge strings can result in hangs/Denial of Service: + // https://github.com/getsentry/sentry-javascript/issues/2286 + if (line.length > 1024) { + line = line.slice(0, 1024); + } + + // Upstream parses the page's own `Error.stack`; this parses stored text + // anyone can send. The Gecko regex backtracks in proportion to the + // number of `(` times `)` in a line, which the 1 KB cut doesn't bound + // (~90 ms for one line). Real frames have a handful. + if (line.replace(/[^()]/g, '').length > MAX_LINE_PARENTHESES) { + continue; + } + + // https://github.com/getsentry/sentry-javascript/issues/5459 + // Remove webpack (error: *) wrappers + const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) + ? line.replace(WEBPACK_ERROR_REGEXP, '$1') + : line; + + // https://github.com/getsentry/sentry-javascript/issues/7813 + // Skip Error: lines + // Using includes() instead of a regex to avoid O(n²) backtracking on long lines + // https://github.com/getsentry/sentry-javascript/issues/20052 + if (cleanedLine.includes('Error: ')) { + continue; + } + + for (const parser of sortedParsers) { + const frame = parser(cleanedLine); + + if (frame) { + frames.push(frame); + break; + } + } + + if (frames.length >= STACKTRACE_FRAME_LIMIT) { + break; + } + } + + return reverseFrames(frames); + }; +} + +/** + * Enforces a limit of max number of frames. Assumes stack input is ordered + * from top to bottom and returns the reverse representation so call site of + * the function that caused the crash is the last frame in the array. + */ +function reverseFrames(stack: ReadonlyArray<StacktraceFrame>) { + if (!stack.length) { + return []; + } + + const localStack = Array.from(stack).reverse(); + const lastFrame = localStack[localStack.length - 1]; + + return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({ + ...frame, + filename: frame.filename || lastFrame.filename, + function: frame.function || UNKNOWN_FUNCTION, + })); +} + +/** Frames oldest first, every frame `in_app: true`, at most 50. */ +export const defaultStackParser = createStackParser( + chromeStackLineParser, + geckoStackLineParser, +); diff --git a/packages/app/src/utils/sessionLogEvents.ts b/packages/app/src/utils/sessionLogEvents.ts index 0d557c1a0..3050b686e 100644 --- a/packages/app/src/utils/sessionLogEvents.ts +++ b/packages/app/src/utils/sessionLogEvents.ts @@ -4,6 +4,7 @@ import SqlString from 'sqlstring'; import type { BuilderChartConfigWithDateRange, Filter, + SelectList, TLogSource, } from '@hyperdx/common-utils/dist/types'; @@ -91,6 +92,86 @@ function eventNameCondition( ]); } +/** A log source with the fields every session log event query reads. */ +export type SessionLogEventSource = TLogSource & + Required< + Pick<TLogSource, 'eventNameExpression' | 'eventAttributesExpression'> + >; + +export function isSessionLogEventSource( + source: TLogSource | null | undefined, +): source is SessionLogEventSource { + return !!source?.eventNameExpression && !!source.eventAttributesExpression; +} + +/** The select and filters every session log event query shares. */ +export function getSessionLogEventQueryParts({ + logSource, + sessionId, + serviceName, + sessionIdExpression, +}: { + logSource: SessionLogEventSource; + sessionId: string; + serviceName: string | undefined; + sessionIdExpression: string; +}): { + aliasMap: Record<string, string>; + select: SelectList; + sessionFilter: Filter; + serviceFilters: Filter[]; +} { + const attrs = logSource.eventAttributesExpression; + // toString: a JSON path is Dynamic, which IN rejects. + const eventName = `toString(${logSource.eventNameExpression})`; + const timestamp = getDisplayedTimestampValueExpression(logSource); + const timestampKey = getFirstTimestampValueExpression( + logSource.timestampValueExpression, + ); + const body = getEventBody(logSource); + const aliasMap: Record<string, string> = { + timestamp, + ...(timestampKey !== timestamp ? { timestamp_key: timestampKey } : {}), + event_name: eventName, + session_id: sessionIdExpression, + ...(body ? { body } : {}), + attributes: attrs, + }; + return { + aliasMap, + select: Object.entries(aliasMap).map(([alias, valueExpression]) => ({ + valueExpression, + alias, + })), + sessionFilter: { + type: 'lucene', + condition: sessionIdFilter( + { + resource: + logSource.resourceAttributesExpression ?? 'ResourceAttributes', + attrs, + }, + sessionId, + 'session.id', + ), + }, + // Matches the replay query, and keeps backend exceptions that carry a + // propagated session.id off the browser timeline. + serviceFilters: + logSource.serviceNameExpression && serviceName + ? [ + { + type: 'sql', + condition: SqlString.format('? = ?', [ + SqlString.raw(logSource.serviceNameExpression), + serviceName, + ]), + }, + ] + : [], + }; +} + /** Null when the session has no browser log events to query. */ export function buildSessionLogEventsQuery({ logSource, @@ -116,83 +197,48 @@ export function buildSessionLogEventsQuery({ config: BuilderChartConfigWithDateRange; aliasMap: Record<string, string>; } | null { - const attrs = logSource?.eventAttributesExpression; // Only OTel browser SDKs write these events, and the search box is written // against trace fields. if ( sessionIdKey !== 'session.id' || searchedQuery !== '' || - !logSource?.eventNameExpression || - !attrs || + !isSessionLogEventSource(logSource) || !sessionIdExpression || !consoleMethodExpression ) { return null; } - // toString: a JSON path is Dynamic, which IN rejects. - const eventName = `toString(${logSource.eventNameExpression})`; - const timestamp = getDisplayedTimestampValueExpression(logSource); - const timestampKey = getFirstTimestampValueExpression( - logSource.timestampValueExpression, - ); - const body = getEventBody(logSource); - const aliasMap: Record<string, string> = { - timestamp, - ...(timestampKey !== timestamp ? { timestamp_key: timestampKey } : {}), - event_name: eventName, - session_id: sessionIdExpression, - ...(body ? { body } : {}), - attributes: attrs, - }; - const filters: Filter[] = [ - { - type: 'lucene', - condition: sessionIdFilter( - { - resource: - logSource.resourceAttributesExpression ?? 'ResourceAttributes', - attrs, - }, - sessionId, - 'session.id', - ), - }, - { - type: 'sql', - condition: eventNameCondition( - eventName, - consoleMethodExpression, - tab === 'highlighted', - ), - }, - ]; - // Matches the replay query, and keeps backend exceptions that carry a - // propagated session.id off the browser timeline. - if (logSource.serviceNameExpression && serviceName) { - filters.push({ - type: 'sql', - condition: SqlString.format('? = ?', [ - SqlString.raw(logSource.serviceNameExpression), - serviceName, - ]), + const { aliasMap, select, sessionFilter, serviceFilters } = + getSessionLogEventQueryParts({ + logSource, + sessionId, + serviceName, + sessionIdExpression, }); - } return { aliasMap, config: { source: logSource.id, - select: Object.entries(aliasMap).map(([alias, valueExpression]) => ({ - valueExpression, - alias, - })), + select, from: logSource.from, connection: logSource.connection, timestampValueExpression: logSource.timestampValueExpression, dateRange, where: '', whereLanguage: 'sql', - filters, - orderBy: `${timestamp} ASC`, + filters: [ + sessionFilter, + { + type: 'sql', + condition: eventNameCondition( + aliasMap.event_name, + consoleMethodExpression, + tab === 'highlighted', + ), + }, + ...serviceFilters, + ], + orderBy: `${aliasMap.timestamp} ASC`, limit: { limit: 4000, offset: 0 }, }, }; diff --git a/packages/app/src/utils/traceTriggerClick.ts b/packages/app/src/utils/traceTriggerClick.ts new file mode 100644 index 000000000..c7bfe717c --- /dev/null +++ b/packages/app/src/utils/traceTriggerClick.ts @@ -0,0 +1,103 @@ +import SqlString from 'sqlstring'; +import type { BuilderChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types'; + +import { BROWSER_EVENT_NAMES } from '@/utils/browserEvents'; +import { + BrowserEventLogSource, + BrowserEventResult, + BrowserTraceContext, + getBrowserEventDateRange, + hasSubSecondTimestamps, + parseRowTimeMs, +} from '@/utils/browserTraceContext'; +import { getSessionLogEventQueryParts } from '@/utils/sessionLogEvents'; + +// Clicks land 0-5 ms before the request they start; the click before that is +// usually several hundred ms earlier. +const TRIGGER_LOOKBACK_MS = 250; +// The floored window holds at most about 2 s of one session's clicks. +const TRIGGER_CLICK_LIMIT = 10; + +export function buildTriggerClickQuery({ + logSource, + context, + sessionId, + sessionIdExpression, +}: { + logSource: BrowserEventLogSource; + context: BrowserTraceContext; + sessionId: string; + sessionIdExpression: string; +}): { + config: BuilderChartConfigWithDateRange; + aliasMap: Record<string, string>; +} { + const { aliasMap, select, sessionFilter, serviceFilters } = + getSessionLogEventQueryParts({ + logSource, + sessionId, + serviceName: context.serviceName, + sessionIdExpression, + }); + return { + aliasMap, + config: { + source: logSource.id, + select, + from: logSource.from, + connection: logSource.connection, + timestampValueExpression: logSource.timestampValueExpression, + // pickTriggerClick clips to the exact window. + dateRange: getBrowserEventDateRange( + context.anchorMs - TRIGGER_LOOKBACK_MS, + context.anchorMs, + ), + where: '', + whereLanguage: 'sql', + filters: [ + sessionFilter, + { + type: 'sql', + condition: SqlString.format('? = ?', [ + SqlString.raw(aliasMap.event_name), + BROWSER_EVENT_NAMES.CLICK, + ]), + }, + ...serviceFilters, + ], + orderBy: `${aliasMap.timestamp} DESC`, + limit: { limit: TRIGGER_CLICK_LIMIT }, + }, + }; +} + +/** + * The latest click in the lookback before the anchor. The page URL isn't + * compared: the SDK records a click's URL before the app's handler runs, and + * the request's after, so a click that changes the route or query string + * would never match. Clicks in a whole-second timestamp column can't be + * placed within the lookback, so none match. + */ +export function pickTriggerClick( + { data, meta }: BrowserEventResult, + anchorMs: number, +): { row: Record<string, unknown>; gapMs: number } | undefined { + if (!hasSubSecondTimestamps(meta)) { + return undefined; + } + let latest: { row: Record<string, unknown>; ms: number } | undefined; + for (const row of data) { + const ms = parseRowTimeMs(row.timestamp); + if ( + ms != null && + ms >= anchorMs - TRIGGER_LOOKBACK_MS && + ms <= anchorMs && + (latest == null || ms > latest.ms) + ) { + latest = { row, ms }; + } + } + return latest != null + ? { row: latest.row, gapMs: anchorMs - latest.ms } + : undefined; +} diff --git a/packages/app/styles/LogSidePanel.module.scss b/packages/app/styles/LogSidePanel.module.scss index 6a3e3d1c4..74c3c6f90 100644 --- a/packages/app/styles/LogSidePanel.module.scss +++ b/packages/app/styles/LogSidePanel.module.scss @@ -64,6 +64,10 @@ .panelSectionWrapperTitle { padding: 18px 24px; border-bottom: 1px solid var(--color-border); + + &:last-child { + border-bottom: none; + } } .kbdShortcuts { diff --git a/packages/app/styles/app.scss b/packages/app/styles/app.scss index 57a4a590e..c24a952e9 100644 --- a/packages/app/styles/app.scss +++ b/packages/app/styles/app.scss @@ -1,7 +1,7 @@ /* stylelint-disable-file */ // stylelint adds '}}' to end of file.. not sure why. Disabled for now. -@use '../src/theme/themes/base-tokens'; +@use '../src/theme/base-tokens'; // Bootstrap utilities only (d-flex, flex-column, m-*, p-*, etc.) @use './_bootstrap-utilities'; diff --git a/packages/app/tests/e2e/components/HeatmapComponent.ts b/packages/app/tests/e2e/components/HeatmapComponent.ts index 4bbb26784..5d377ca36 100644 --- a/packages/app/tests/e2e/components/HeatmapComponent.ts +++ b/packages/app/tests/e2e/components/HeatmapComponent.ts @@ -29,12 +29,17 @@ export class HeatmapComponent { return this.root.getByText('Not enough data points to render heatmap'); } + /** The open cell tooltip, rendered into the page body rather than the chart. */ + private get tooltipRoot() { + return this.page.getByTestId('heatmap-tooltip'); + } + /** * The hover tooltip, which only appears for a cell with a non-zero count. * Series-axis heatmaps label the cell's series instead of its count. */ get tooltip() { - return this.container.getByText(/^(Count Value|Series):$/); + return this.tooltipRoot.getByText(/^(Count Value|Series):$/); } /** @@ -70,7 +75,7 @@ export class HeatmapComponent { /** The series named by the open cell tooltip of a series-axis heatmap. */ async hoveredSeriesName() { - const row = this.container + const row = this.tooltipRoot .getByText('Series:', { exact: true }) .locator('..'); await expect(row).toBeVisible(); @@ -79,7 +84,7 @@ export class HeatmapComponent { /** A labelled value of the open cell tooltip, e.g. `Count Value`. */ async hoveredTooltipValue(label: 'Count Value' | 'Y Value' | 'Bucket') { - const row = this.container + const row = this.tooltipRoot .getByText(`${label}:`, { exact: true }) .locator('..'); await expect(row).toBeVisible(); diff --git a/packages/app/tests/e2e/components/SavedSearchModalComponent.ts b/packages/app/tests/e2e/components/SavedSearchModalComponent.ts index cf664f247..e562ca5f3 100644 --- a/packages/app/tests/e2e/components/SavedSearchModalComponent.ts +++ b/packages/app/tests/e2e/components/SavedSearchModalComponent.ts @@ -91,9 +91,6 @@ export class SavedSearchModalComponent { // Start waiting for URL change BEFORE clicking submit to avoid race condition const urlPromise = this.page.waitForURL(/\/search\/[a-f0-9]+/, { timeout: 15000, - // Saving now uses a document navigation to avoid useQueryStates restoring - // stale search URL. Do not wait for unrelated resources to finish loading. - waitUntil: 'domcontentloaded', }); await this.submit(); @@ -101,6 +98,8 @@ export class SavedSearchModalComponent { // Wait for navigation to complete await urlPromise; + await expect(this.container).toBeHidden(); + await expect(this.savedSearchNameInput).toBeVisible({ timeout: 5000 }); await expect(this.savedSearchNameInput).toHaveValue(name, { timeout: 5000, diff --git a/packages/app/tests/e2e/components/SearchPageAlertModalComponent.ts b/packages/app/tests/e2e/components/SearchPageAlertModalComponent.ts index 8ef7591f3..3c40fc055 100644 --- a/packages/app/tests/e2e/components/SearchPageAlertModalComponent.ts +++ b/packages/app/tests/e2e/components/SearchPageAlertModalComponent.ts @@ -25,13 +25,13 @@ export class SearchPageAlertModalComponent { 'add-new-webhook-button', ); this.createAlertButtonLocator = page.getByRole('button', { - name: 'Create Alert', + name: 'Create alert', }); this.saveAlertButtonLocator = page.getByRole('button', { - name: 'Save Alert', + name: 'Save alert', }); this.deleteAlertButtonLocator = page.getByRole('button', { - name: 'Delete Alert', + name: 'Delete alert', }); this.webhookSelector = page.getByTestId('select-webhook'); this.webhookAlertModal = new WebhookAlertModalComponent(page); @@ -157,7 +157,7 @@ export class SearchPageAlertModalComponent { /** * Select an existing alert's tab by its zero-based index. Existing alerts * render as tabs labeled "Alert 1", "Alert 2", ... in the order returned by - * the saved search. The "New Alert" tab is separate. + * the saved search. The "New alert" tab is separate. */ async selectExistingAlertTab(index: number) { await this.modal.getByRole('tab', { name: `Alert ${index + 1}` }).click(); @@ -181,7 +181,7 @@ export class SearchPageAlertModalComponent { } /** - * Submit edits to an existing alert via "Save Alert". Waits for the + * Submit edits to an existing alert via "Save alert". Waits for the * PUT /api/alerts/:id so the test fails if the request is never sent, then * waits for the modal to close. */ @@ -198,7 +198,7 @@ export class SearchPageAlertModalComponent { } /** - * Delete the currently open existing alert via "Delete Alert". Waits for the + * Delete the currently open existing alert via "Delete alert". Waits for the * DELETE request and the modal to close. */ async deleteAlert() { diff --git a/packages/app/tests/e2e/components/SidePanelComponent.ts b/packages/app/tests/e2e/components/SidePanelComponent.ts index 753513db3..d32912bb7 100644 --- a/packages/app/tests/e2e/components/SidePanelComponent.ts +++ b/packages/app/tests/e2e/components/SidePanelComponent.ts @@ -329,6 +329,27 @@ export class SidePanelComponent { .click({ timeout: this.defaultTimeout }); } + /** + * The "Column Values" (parsed) tab's content panel, which renders the full + * fetched row via the JSON viewer. + */ + get columnValuesContent() { + return this.panelContainer.getByTestId('side-panel-tab-parsed'); + } + + /** Open the "Column Values" (parsed) tab. */ + async openColumnValues() { + await this.clickTab('parsed'); + } + + /** + * A line in the "Column Values" tab matching `text` (substring). Used to + * assert a fetched row's value is shown. + */ + columnValue(text: string) { + return this.columnValuesContent.getByText(text, { exact: false }); + } + /** * Close the side panel (if it has a close button) */ diff --git a/packages/app/tests/e2e/core/navigation.spec.ts b/packages/app/tests/e2e/core/navigation.spec.ts index 485169926..58fea7bce 100644 --- a/packages/app/tests/e2e/core/navigation.spec.ts +++ b/packages/app/tests/e2e/core/navigation.spec.ts @@ -271,7 +271,7 @@ test.describe('Navigation', { tag: ['@core'] }, () => { ); await expect(drawer.getByTestId('drawer-github-link')).toHaveAttribute( 'href', - /github\.com\/hyperdxio\/hyperdx.*CHANGELOG\.md/, + /github\.com\/ClickHouse\/ClickStack.*CHANGELOG\.md/, ); // Opening the drawer closes the menu. @@ -442,7 +442,7 @@ test.describe('Navigation', { tag: ['@core'] }, () => { ).toBeVisible(); await expect(drawer.getByRole('link')).toHaveAttribute( 'href', - /github\.com\/hyperdxio\/hyperdx.*CHANGELOG\.md/, + /github\.com\/ClickHouse\/ClickStack.*CHANGELOG\.md/, ); }); diff --git a/packages/app/tests/e2e/docker-compose.yml b/packages/app/tests/e2e/docker-compose.yml index 986f3d9c5..6016d24e5 100644 --- a/packages/app/tests/e2e/docker-compose.yml +++ b/packages/app/tests/e2e/docker-compose.yml @@ -15,7 +15,7 @@ services: memory: 512M cpus: '0.5' ch-server: - image: clickhouse/clickhouse-server:26.8.36.3-alpine + image: clickhouse/clickhouse-server:26.10.3.7-alpine ports: - ${HDX_E2E_CH_PORT:-20500}:8123 # http api - ${HDX_E2E_CH_NATIVE_PORT:-20600}:9000 # native diff --git a/packages/app/tests/e2e/features/dashboard-adhoc-filters.spec.ts b/packages/app/tests/e2e/features/dashboard-adhoc-filters.spec.ts index 5ecf45c4f..c2412e95e 100644 --- a/packages/app/tests/e2e/features/dashboard-adhoc-filters.spec.ts +++ b/packages/app/tests/e2e/features/dashboard-adhoc-filters.spec.ts @@ -66,7 +66,10 @@ test.describe( await expect(dashboardPage.variableNameInput).toBeVisible(); await expect(form.getByTestId('source-selector')).toHaveCount(0); - await expect(form.locator('div.cm-editor')).toHaveCount(0); + await expect(form.getByText('Filter expression')).toHaveCount(0); + await expect( + form.getByText('Keys and values filter', { exact: true }), + ).toBeVisible(); await expect( form.getByTestId('filter-variable-enabled-checkbox'), ).toHaveCount(0); @@ -220,6 +223,10 @@ test.describe( await expect( form.getByText(DEFAULT_LOGS_SOURCE_NAME, { exact: true }), ).toHaveCount(0); + // Only SQL suggestions can be narrowed by a condition. + await expect( + form.getByText('Keys and values filter', { exact: true }), + ).toHaveCount(0); }); await test.step('Only PromQL sources are offered', async () => { @@ -437,6 +444,75 @@ test.describe( }); }); + /** Open the editor, pick `key`, and wait for `value` to be suggested. */ + const openValueSuggestions = async ( + filterName: string, + key: string, + value: string, + ) => { + await dashboardPage.openAddAdhocCondition(filterName); + await dashboardPage.getAdhocConditionInput(filterName, 'key').fill(key); + await dashboardPage.getAdhocConditionInput(filterName, 'value').click(); + await expect( + dashboardPage.getAdhocConditionOption(filterName, value), + ).toBeVisible({ timeout: 30000 }); + }; + + test('suggests only from the rows its keys and values filter matches', async () => { + const filterName = 'Accounting'; + + await createDashboardWithAdhocFilter( + filterName, + [DEFAULT_LOGS_SOURCE_NAME], + { where: { value: "ServiceName = 'accounting'", language: 'sql' } }, + ); + + await openValueSuggestions(filterName, 'ServiceName', 'accounting'); + expect(await dashboardPage.getOpenFilterDropdownOptions()).toEqual([ + 'accounting', + ]); + }); + + test('waits for a required filter its keys and values filter references', async ({ + page, + }) => { + const filterName = 'Conditions'; + const addButton = page.getByTestId(`adhoc-filter-add-${filterName}`); + + await test.step('Narrow an ad hoc filter by a required filter', async () => { + await dashboardPage.createNewDashboard(); + await dashboardPage.openEditFiltersModal(); + await dashboardPage.addStaticListFilterToDashboard( + 'Service', + ['accounting', 'ad'], + { variableName: 'svc', required: true }, + ); + await dashboardPage.addAdhocFilterToDashboard( + filterName, + [DEFAULT_LOGS_SOURCE_NAME], + { where: { value: 'ServiceName IN ($svc)', language: 'sql' } }, + ); + await dashboardPage.closeFiltersModal(); + }); + + await test.step('Adding a condition waits for a service', async () => { + await expect(addButton).toHaveAttribute('aria-disabled', 'true'); + await addButton.hover(); + await expect( + page.getByText('This filter depends on: Service'), + ).toBeVisible(); + }); + + await test.step('A selected service unblocks it and narrows its suggestions', async () => { + await dashboardPage.toggleFilterValue('Service', 'ad'); + await expect(addButton).not.toHaveAttribute('aria-disabled', 'true'); + await openValueSuggestions(filterName, 'ServiceName', 'ad'); + expect(await dashboardPage.getOpenFilterDropdownOptions()).toEqual([ + 'ad', + ]); + }); + }); + test('picks conditions from the labels of a PromQL source', async () => { const filterName = 'Labels'; diff --git a/packages/app/tests/e2e/features/search/json-at-prefixed-key-row-details.spec.ts b/packages/app/tests/e2e/features/search/json-at-prefixed-key-row-details.spec.ts new file mode 100644 index 000000000..10d42d486 --- /dev/null +++ b/packages/app/tests/e2e/features/search/json-at-prefixed-key-row-details.spec.ts @@ -0,0 +1,73 @@ +/** + * Selecting an at-prefixed JSON key breaks row details. + * + * When a displayed SELECT column is a JSON subcolumn whose key is not a bare + * identifier (e.g. `ResourceAttributesJSON.`@request_id``), ClickHouse reports + * the result column name without backticks (`ResourceAttributesJSON.@request_id`). + * The row side panel rebuilds a WHERE clause from the displayed columns to fetch + * the full row; before the fix it used that bare name verbatim, producing + * invalid SQL that matched no rows, so the panel came up empty. + * + * This drives the real UI path against a JSON-column schema: select the + * at-prefixed key, open the row, and confirm the detail panel is populated with + * the selected event's values. + */ +import { SearchPage } from '../../page-objects/SearchPage'; +import { + INTERESTING_FILTER_KEYS_JSON_AT_KEY, + INTERESTING_FILTER_KEYS_ROWS, +} from '../../seed-clickhouse'; +import { expect, test } from '../../utils/base-test'; +import { INTERESTING_FILTER_KEYS_SOURCE_NAME } from '../../utils/constants'; + +const QUERY_TIMEOUT = 20_000; + +const [ROW1] = INTERESTING_FILTER_KEYS_ROWS; + +test.describe( + 'Search: at-prefixed JSON key row details', + { tag: ['@search', '@full-stack'] }, + () => { + test('opening a row with an at-prefixed JSON key in SELECT shows the event', async ({ + page, + }) => { + const searchPage = new SearchPage(page); + await searchPage.goto(); + await searchPage.selectSource(INTERESTING_FILTER_KEYS_SOURCE_NAME); + await searchPage.timePicker.selectRelativeTime('Last 1 hour'); + + await test.step('isolate a single row', async () => { + await searchPage.performSearch(`ServiceName:"${ROW1.serviceName}"`); + await expect(searchPage.getTableError()).toHaveCount(0); + await expect(searchPage.table.getRows()).toHaveCount(1, { + timeout: QUERY_TIMEOUT, + }); + }); + + await test.step('select the at-prefixed JSON key as a column', async () => { + await searchPage.setCustomSELECT( + `Timestamp, ServiceName, ResourceAttributesJSON.\`${INTERESTING_FILTER_KEYS_JSON_AT_KEY}\``, + ); + await searchPage.submitEmptySearch(); + await expect(searchPage.getTableError()).toHaveCount(0); + await expect(searchPage.table.getRows()).toHaveCount(1, { + timeout: QUERY_TIMEOUT, + }); + }); + + await test.step('row details load the selected event', async () => { + await searchPage.table.clickFirstRow(); + await expect(searchPage.sidePanel.container).toBeVisible(); + // Before the fix the detail WHERE dropped the key's backticks and + // matched no rows, so the panel rendered empty with no error. + await expect(searchPage.sidePanel.errorState).toHaveCount(0); + + await searchPage.sidePanel.openColumnValues(); + await expect( + searchPage.sidePanel.columnValue(ROW1.jsonAtKeyValue), + ).toBeVisible({ timeout: QUERY_TIMEOUT }); + await expect(searchPage.sidePanel.columnValue(ROW1.body)).toBeVisible(); + }); + }); + }, +); diff --git a/packages/app/tests/e2e/features/search/saved-search.spec.ts b/packages/app/tests/e2e/features/search/saved-search.spec.ts index 9201f730d..32a3c6731 100644 --- a/packages/app/tests/e2e/features/search/saved-search.spec.ts +++ b/packages/app/tests/e2e/features/search/saved-search.spec.ts @@ -49,6 +49,28 @@ test.describe('Saved Search Functionality', () => { await searchPage.goto(); }); + test( + 'should open a newly saved search without reloading the page', + { tag: ['@search', '@full-stack'] }, + async () => { + /** + * Saving used to leave the page through `window.location`, which reloads + * the whole app and 404s on the static ClickStack export, where + * /search/<id> has no exported document. + */ + await searchPage.performSearch('ServiceName:frontend'); + await searchPage.markDocument(); + + await searchPage.openSaveSearchModal(); + await searchPage.savedSearchModal.saveSearchAndWaitForNavigation( + `Client Side Nav ${Date.now()}`, + ); + + expect(await searchPage.hasSurvivedReload()).toBe(true); + await searchPage.table.waitForRowsToPopulate(true); + }, + ); + // TODO: Expand this test to include: // - Add tags // - Verify search appears in sidebar @@ -472,9 +494,16 @@ test.describe('Saved Search Functionality', () => { await test.step('Navigate to sessions page', async () => { await page.goto('/sessions'); await expect(page.getByTestId('sessions-page')).toBeVisible(); + // Settling the sessions page before going back keeps this + // deterministic: it writes its default time range to the URL as a + // *pushed* history entry shortly after mount, so whether Back lands on + // the saved search or on bare /sessions otherwise comes down to which + // happens first. + await page.waitForURL(/\/sessions\?.*\bfrom=/); }); await test.step('Use browser back button', async () => { + await page.goBack(); // undoes the sessions time-range entry await page.goBack(); await expect(page.getByTestId('search-page')).toBeVisible(); }); diff --git a/packages/app/tests/e2e/features/service-map-group-by.spec.ts b/packages/app/tests/e2e/features/service-map-group-by.spec.ts new file mode 100644 index 000000000..3ad025710 --- /dev/null +++ b/packages/app/tests/e2e/features/service-map-group-by.spec.ts @@ -0,0 +1,76 @@ +import { Page } from '@playwright/test'; + +import { expect, test } from '../utils/base-test'; +import { dismissSqlAutocomplete, replaceEditorText } from '../utils/locators'; + +// The seed gives every service two pods, `<service>-pod-0` and +// `<service>-pod-1`, in ResourceAttributes['k8s.pod.name']. +const POD_EXPRESSION = "ResourceAttributes['k8s.pod.name']"; + +// 100% sampling: the default 10% can sample the small seed down to nothing. +async function gotoServiceMap(page: Page, query = '') { + await page.goto(`/service-map?samplingFactor=1${query}`); + await expect(page.getByTestId('service-map-page')).toBeVisible({ + timeout: 30000, + }); + await expect(page.locator('.react-flow__node').first()).toBeVisible({ + timeout: 30000, + }); +} + +const nodes = (page: Page) => page.locator('.react-flow__node'); +const dimensionLabels = (page: Page) => + page.getByTestId('service-map-node-dimensions'); + +// Typing opens the SQL autocomplete, which would swallow the Enter that +// submits the form, so close it and refocus the editor before submitting. +async function setGroupBy(page: Page, sql: string) { + const content = page + .getByTestId('service-map-group-by-input') + .locator('.cm-content'); + await replaceEditorText(page, content, sql); + await dismissSqlAutocomplete(page); + await content.click(); + await page.keyboard.press('Enter'); +} + +test.describe('Service map group by', { tag: ['@service-map'] }, () => { + test('splits nodes by an extra dimension from the URL', async ({ page }) => { + test.setTimeout(120000); + + await gotoServiceMap(page); + const serviceNodeCount = await nodes(page).count(); + await expect(dimensionLabels(page)).toHaveCount(0); + + await gotoServiceMap( + page, + `&groupBy=${encodeURIComponent(POD_EXPRESSION)}`, + ); + await expect + .poll(() => nodes(page).count(), { timeout: 30000 }) + .toBeGreaterThan(serviceNodeCount); + const labels = await dimensionLabels(page).allTextContents(); + expect(labels.length).toBeGreaterThan(0); + expect(labels.some(label => label.includes('-pod-'))).toBe(true); + }); + + test('applies the editor on Enter and caps it at three expressions', async ({ + page, + }) => { + test.setTimeout(120000); + + await gotoServiceMap(page); + + await setGroupBy(page, POD_EXPRESSION); + await expect(page).toHaveURL(/groupBy=/, { timeout: 10000 }); + await expect(dimensionLabels(page).first()).toBeVisible({ timeout: 30000 }); + + const groupByParam = () => new URL(page.url()).searchParams.get('groupBy'); + const groupByBefore = groupByParam(); + await setGroupBy(page, 'a, b, c, d'); + await expect(page.getByTestId('service-map-group-by-error')).toHaveText( + 'Up to 3 group by expressions', + ); + expect(groupByParam()).toBe(groupByBefore); + }); +}); diff --git a/packages/app/tests/e2e/features/sessions.spec.ts b/packages/app/tests/e2e/features/sessions.spec.ts index 54f89ac6c..806af2c16 100644 --- a/packages/app/tests/e2e/features/sessions.spec.ts +++ b/packages/app/tests/e2e/features/sessions.spec.ts @@ -63,9 +63,29 @@ test.describe('Client Sessions Functionality', { tag: ['@sessions'] }, () => { await card.click(); await expect(sessionsPage.sessionSidePanel).toBeVisible(); - await expect( - sessionsPage.getSessionEventRows().filter({ hasText: '500 GET' }), - ).toBeVisible({ timeout: 15000 }); + const span = sessionsPage + .getSessionEventRows() + .filter({ hasText: '500 GET' }); + await expect(span).toBeVisible({ timeout: 15000 }); + + await test.step('Its trace shows the triggering click and the request timings', async () => { + await span.click(); + const trace = page.getByTestId('side-panel-tab-trace'); + const trigger = trace.getByText( + 'Triggered by: Clicked testid=checkout · 3ms before', + ); + await expect(trigger).toBeVisible({ timeout: 15000 }); + await expect(trace.getByTestId('span-event-marker')).toHaveCount(4); + // The timing log is drawn as the dots, so it isn't counted as a log. + await expect(trace.getByText(/^1 span, 1 error/)).toBeVisible(); + + await trigger.click(); + await expect( + trace + .getByText('#root > main > button.checkout', { exact: true }) + .first(), + ).toBeVisible(); + }); }); test('shows browser log events from the OpenTelemetry SDK and opens them', async ({ @@ -73,6 +93,7 @@ test.describe('Client Sessions Functionality', { tag: ['@sessions'] }, () => { }) => { const panel = sessionsPage.sessionSidePanel; const rows = sessionsPage.getSessionEventRows(); + const section = panel.getByTestId('browser-event-section'); await test.step('Highlighted shows the console error but not the click', async () => { await page.goto('/search'); @@ -96,6 +117,14 @@ test.describe('Client Sessions Functionality', { tag: ['@sessions'] }, () => { await click.getByText('Clicked button').click(); await expect(panel.getByTestId('side-panel-tab-overview')).toBeVisible(); await expect(page.getByTestId('row-side-panel')).toHaveCount(0); + // The Log Attributes viewer below repeats these values verbatim. + await expect( + section.getByText('data-otel-testid', { exact: true }), + ).toBeVisible(); + await expect( + section.getByText('#root > main > button.checkout', { exact: true }), + ).toBeVisible(); + await expect(panel.getByText('No body for this event.')).toHaveCount(0); }); await test.step('Escape returns to the event list', async () => { @@ -103,6 +132,15 @@ test.describe('Client Sessions Functionality', { tag: ['@sessions'] }, () => { await expect(rows.first()).toBeVisible(); }); + await test.step('A navigation opens as a browser event, not an HTTP request', async () => { + const navigation = rows.filter({ hasText: 'Navigated' }); + await navigation.getByText('Navigated').click(); + await expect(section.getByText('push', { exact: true })).toBeVisible(); + await expect(panel.getByText('HTTP Request')).toHaveCount(0); + await page.keyboard.press('Escape'); + await expect(rows.first()).toBeVisible(); + }); + await test.step('A session keyed on rum.sessionId shows no log events', async () => { const logQueries: string[] = []; // query_id marks ClickHouse queries; the app's own telemetry exports diff --git a/packages/app/tests/e2e/global-setup-fullstack.ts b/packages/app/tests/e2e/global-setup-fullstack.ts index 9c196b690..a0c92624e 100644 --- a/packages/app/tests/e2e/global-setup-fullstack.ts +++ b/packages/app/tests/e2e/global-setup-fullstack.ts @@ -145,7 +145,11 @@ async function globalSetup(_config: FullConfig) { console.log('Creating test user and logging in'); const browser = await chromium.launch(); - const context = await browser.newContext({ baseURL: APP_URL }); + // Global setup doesn't inherit `use` from playwright.config.ts. + const context = await browser.newContext({ + baseURL: APP_URL, + locale: 'en-US', + }); const page = await context.newPage(); try { diff --git a/packages/app/tests/e2e/page-objects/DashboardPage.ts b/packages/app/tests/e2e/page-objects/DashboardPage.ts index c4a003537..fcc829a79 100644 --- a/packages/app/tests/e2e/page-objects/DashboardPage.ts +++ b/packages/app/tests/e2e/page-objects/DashboardPage.ts @@ -1058,8 +1058,9 @@ export class DashboardPage { } /** - * Fill the "Dropdown values filter" (the filter's `where`) in the open filter - * edit form, replacing whatever is there. + * Fill the "Dropdown values filter" (the filter's `where`, an ad hoc filter's + * "Keys and values filter") in the open filter edit form, replacing whatever + * is there. * * The language is always set explicitly: the form seeds it from the * `hdx-search-where-language` localStorage key, which other specs write, so @@ -1599,6 +1600,7 @@ export class DashboardPage { options?: { variableName?: string; sourceType?: 'ClickHouse' | 'Prometheus'; + where?: FilterWhereOptions; }, ) { await this.addFiltersButton.click(); @@ -1612,6 +1614,9 @@ export class DashboardPage { this.getAdhocFilterSourcesInput(), sourceNames, ); + if (options?.where) { + await this.fillFilterDropdownValuesWhere(options.where); + } if (options?.variableName !== undefined) { await this.variableNameInput.fill(options.variableName); } diff --git a/packages/app/tests/e2e/page-objects/SearchPage.ts b/packages/app/tests/e2e/page-objects/SearchPage.ts index 5806833fd..6467474f5 100644 --- a/packages/app/tests/e2e/page-objects/SearchPage.ts +++ b/packages/app/tests/e2e/page-objects/SearchPage.ts @@ -393,6 +393,23 @@ export class SearchPage { await this.table.waitForRowsToPopulate(); } + /** + * Mark the live document so a later `hasSurvivedReload` can tell a + * client-side route change from a full page load, which replaces the + * document and with it the marker. + */ + async markDocument() { + await this.page.evaluate(() => { + document.documentElement.dataset.e2eDocumentMarker = 'true'; + }); + } + + async hasSurvivedReload() { + return this.page.evaluate( + () => document.documentElement.dataset.e2eDocumentMarker === 'true', + ); + } + /** * Open save search modal */ diff --git a/packages/app/tests/e2e/seed-clickhouse.ts b/packages/app/tests/e2e/seed-clickhouse.ts index c101df91c..9799866c7 100644 --- a/packages/app/tests/e2e/seed-clickhouse.ts +++ b/packages/app/tests/e2e/seed-clickhouse.ts @@ -98,6 +98,10 @@ export const INTERESTING_FILTER_KEYS_ROWS = [ serviceName: 'service1', resourceAttrValue: 'value1', jsonValue: 'value1', + // Top-level JSON key that is NOT a bare identifier (`@` prefix). Selecting + // it (`ResourceAttributesJSON.`@request_id``) and opening the row must keep + // the key backtick-quoted in the detail WHERE clause (HDX-5867). + jsonAtKeyValue: 'request-A', clusterName: 'cluster1', serviceNameHyphen: 'svc-one', mapHyphenValue: 'mapval1', @@ -108,6 +112,7 @@ export const INTERESTING_FILTER_KEYS_ROWS = [ serviceName: 'service2', resourceAttrValue: 'value2', jsonValue: 'value2', + jsonAtKeyValue: 'request-B', clusterName: 'cluster2', serviceNameHyphen: 'svc-two', mapHyphenValue: 'mapval2', @@ -118,6 +123,7 @@ export const INTERESTING_FILTER_KEYS_ROWS = [ serviceName: 'service3', resourceAttrValue: 'value3', jsonValue: 'value3', + jsonAtKeyValue: 'request-C', clusterName: 'cluster3', serviceNameHyphen: 'svc-three', mapHyphenValue: 'mapval3', @@ -126,6 +132,10 @@ export const INTERESTING_FILTER_KEYS_ROWS = [ }, ] as const; +// The at-prefixed JSON key seeded into `ResourceAttributesJSON`. Exported so the +// row-details spec selects and asserts against the same key/values. +export const INTERESTING_FILTER_KEYS_JSON_AT_KEY = '@request_id'; + // A single log whose Body is a JSON string with a flat, dotted key. It lives in // the default E2E Logs table (so it shares the E2E Logs source); the unique // ServiceName isolates it from other default-logs tests, which all scope by @@ -414,8 +424,11 @@ function generateTraceData( Math.floor(Math.random() * 500000000) + (spansPerTrace - spanIdx) * 100000000; + // Two pods per service so the service map can be split by pod. + const podName = `${service}-pod-${traceIdx % 2}`; + rows.push( - `('${timestampNs}', '${traceId}', '${spanId}', '${parentSpanId}', '', '${spanName}', '${spanKind}', '${service}', {'service.name':'${service}','environment':'test'}, '', '', {'http.method':'GET','http.status_code':'${httpStatusCode}'}, ${duration}, '${statusCode}', '', [], [], [], [], [], [], [])`, + `('${timestampNs}', '${traceId}', '${spanId}', '${parentSpanId}', '', '${spanName}', '${spanKind}', '${service}', {'service.name':'${service}','environment':'test','k8s.pod.name':'${podName}'}, '', '', {'http.method':'GET','http.status_code':'${httpStatusCode}'}, ${duration}, '${statusCode}', '', [], [], [], [], [], [], [])`, ); // Stop if we've generated enough spans @@ -793,7 +806,7 @@ function generateK8sEventLogs( function generateInterestingFilterKeyLogData(seedRef: number): string { return INTERESTING_FILTER_KEYS_ROWS.map((row, i) => { const timestampNs = (seedRef - (i + 1) * 1000) * 1000000; - const json = `{"key": {"subKey": {"subSubKey": "${row.jsonValue}"}}}`; + const json = `{"key": {"subKey": {"subSubKey": "${row.jsonValue}"}}, "${INTERESTING_FILTER_KEYS_JSON_AT_KEY}": "${row.jsonAtKeyValue}"}`; // JSON column with a hyphenated name AND hyphenated nested keys. const jsonHyphen = `{"key-1": {"key-2": "${row.jsonHyphenValue}"}}`; return ( @@ -1165,7 +1178,7 @@ async function insertPromqlMetric( .join('\n UNION ALL\n '); await client.query(` - INSERT INTO ${table} (metric_name, tags, time_series) + INSERT INTO ${table} (metric_name, tags, samples) ${rows} `); } diff --git a/packages/app/tests/e2e/seed-otel-sessions.ts b/packages/app/tests/e2e/seed-otel-sessions.ts index c1c6a0da1..ffd57684c 100644 --- a/packages/app/tests/e2e/seed-otel-sessions.ts +++ b/packages/app/tests/e2e/seed-otel-sessions.ts @@ -23,7 +23,35 @@ function replayRows( { type: 2, data: { - node: { type: 0, childNodes: [], id: 1 }, + // rrweb inserts its style rules into <html>, so replay throws without one. + node: { + type: 0, + id: 1, + childNodes: [ + { + type: 2, + tagName: 'html', + attributes: {}, + id: 2, + childNodes: [ + { + type: 2, + tagName: 'head', + attributes: {}, + childNodes: [], + id: 3, + }, + { + type: 2, + tagName: 'body', + attributes: {}, + childNodes: [], + id: 4, + }, + ], + }, + ], + }, initialOffset: { left: 0, top: 0 }, }, }, @@ -61,16 +89,37 @@ export function generateOtelSessionSpans(seedRef: number): string { ].join(',\n'); } -/** Browser events the OTel SDK records as log events, after the +500 ms span. */ +// Four dots inside the 12 ms span. +const RESOURCE_TIMING = { + fetch_start: '1000.5', + request_start: '1002', + response_start: '1009', + response_end: '1011.5', + duration: '11', + transfer_size: '558', + next_hop_protocol: 'http/1.1', +}; + +/** + * OTel SDK log events around the +500 ms span: the click 3 ms before it that + * triggers its trace, its request timing, a same-document navigation, and a + * console error. + */ export function generateOtelSessionLogEvents(seedRef: number): string { const ns = (offsetMs: number) => (seedRef - 5 * 60 * 1000 + offsetMs) * 1_000_000; const resource = `{'service.name':'${SERVICE}'}`; + const { newSdk, bothKeys } = OTEL_SESSIONS; const click = (sessionId: string) => - `('${ns(600)}', '', '', 0, '', 9, '${SERVICE}', '', '', ${resource}, '', '', '', {}, {'session.id':'${sessionId}','browser.tag_name':'BUTTON','browser.css_selector':'#root > main > button.checkout','browser.document.url.full':'${PAGE_URL}','browser.element.attributes.testid':'checkout'}, 'browser.user_action.click')`; + `('${ns(497)}', '', '', 0, '', 9, '${SERVICE}', '', '', ${resource}, '', '', '', {}, {'session.id':'${sessionId}','browser.tag_name':'BUTTON','browser.css_selector':'#root > main > button.checkout','browser.document.url.full':'${PAGE_URL}','browser.element.attributes.testid':'checkout'}, 'browser.user_action.click')`; + const timing = Object.entries(RESOURCE_TIMING) + .map(([key, value]) => `'browser.resource_timing.${key}':'${value}'`) + .join(','); return [ - click(OTEL_SESSIONS.newSdk), - `('${ns(800)}', '', '', 0, 'error', 17, '${SERVICE}', 'Error: checkout failed', '', ${resource}, '', '', '', {}, {'session.id':'${OTEL_SESSIONS.newSdk}','browser.console.method':'error','browser.document.url.full':'${PAGE_URL}'}, 'browser.console')`, - click(OTEL_SESSIONS.bothKeys), + click(newSdk), + `('${ns(520)}', '${newSdk}-trace', '${newSdk}-span', 0, '', 9, '${SERVICE}', '', '', ${resource}, '', '@opentelemetry/browser-instrumentation/resource-timing', '', {}, {'session.id':'${newSdk}','browser.document.url.full':'${PAGE_URL}','url.full':'${PAGE_URL}api/error',${timing}}, 'browser.resource_timing')`, + `('${ns(700)}', '', '', 0, '', 9, '${SERVICE}', '', '', ${resource}, '', '', '', {}, {'session.id':'${newSdk}','url.full':'${PAGE_URL}checkout','browser.document.url.full':'${PAGE_URL}checkout','browser.navigation.same_document':'true','browser.navigation.hash_change':'false','browser.navigation.type':'push'}, 'browser.navigation')`, + `('${ns(800)}', '', '', 0, 'error', 17, '${SERVICE}', 'Error: checkout failed', '', ${resource}, '', '', '', {}, {'session.id':'${newSdk}','browser.console.method':'error','browser.document.url.full':'${PAGE_URL}'}, 'browser.console')`, + click(bothKeys), ].join(',\n'); } diff --git a/packages/cli/AGENTS.md b/packages/cli/AGENTS.md index aa1bc2c65..a2414af7d 100644 --- a/packages/cli/AGENTS.md +++ b/packages/cli/AGENTS.md @@ -34,6 +34,7 @@ hdx auth logout # Clear saved session hdx team list # List teams the user belongs to (multi-team) hdx team current # Show the active team hdx team use <name|id> # Switch the active team (kubectx-style) +hdx mcp install # Add the MCP server to Claude Code, Codex, Cursor, VS Code (interactive only: agents hand it to the user) hdx upload-sourcemaps # Upload JS source maps ``` @@ -73,6 +74,7 @@ src/ │ ├── ColumnValues.tsx # Shared key-value renderer (used by Column Values tab + Event Details) │ ├── LoginForm.tsx # Email/password login form (used inside TUI App) │ └── SourcePicker.tsx # Arrow-key source selector +├── mcp/ # `hdx mcp install`: key check, per-agent config writers, Ink prompt ├── shared/ │ ├── tileConfig.ts # Tile → queryable chart config resolution + per-displayType │ │ # transforms (ports of web DBDashboardPage / ChartUtils) diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 270c917d9..aaa4ffabf 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,23 @@ # @hyperdx/cli +## 0.9.0 + +### Minor Changes + +- 7935c64bc: feat: add `hdx mcp install` to connect AI agents without pasting a key + + `npx @hyperdx/cli mcp install` asks for a personal access key or an + organization API key with hidden input, checks it, and adds the ClickStack MCP + server to Claude Code, Codex, Cursor, and VS Code. Team Settings now leads with + this command, so the key no longer has to go into a copied command or an agent + chat. The per-agent snippets remain for setting up one agent by hand. + +### Patch Changes + +- d7df729e6: chore: GitHub links (changelog, support, package metadata) now point at `ClickHouse/ClickStack`, and `docker-compose.yml` pulls the app image as `clickhouse/clickstack` +- e2754d203: fix: use SHA256 instead of MD5 for JSON row lookup WHERE clauses so row + details and drill-down work on FIPS-enabled ClickHouse deployments + ## 0.8.0 ### Minor Changes diff --git a/packages/cli/README.md b/packages/cli/README.md index 6269ab31a..7d3f6da7a 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -3,7 +3,7 @@ [![npm version](https://img.shields.io/npm/v/@hyperdx/cli.svg)](https://www.npmjs.com/package/@hyperdx/cli) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) -Terminal UI and CLI for [HyperDX](https://github.com/hyperdxio/hyperdx) — +Terminal UI and CLI for [HyperDX](https://github.com/ClickHouse/ClickStack) — search, tail, chart, and query your logs, traces, and metrics without leaving the terminal. @@ -69,6 +69,7 @@ hdx connections # List ClickHouse connections hdx dashboards # List dashboards with tile summaries hdx auth login|status|logout # Manage authentication hdx team list|current|use <team> # Switch between teams +hdx mcp install # Add the MCP server to your AI agents hdx upload-sourcemaps # Upload JS source maps ``` @@ -214,6 +215,20 @@ hdx team use "My Team" # Switch by name or ID The choice persists across CLI invocations. On single-team deployments these commands are effectively no-ops. +### `hdx mcp install` — Connect AI agents + +Adds the ClickStack MCP server to every supported agent it finds: Claude Code, +Codex, Cursor, and VS Code. It asks for a personal access key or an +organization API key with hidden input and checks it before changing any +config, so the key stays out of shell history and agent chats. + +```bash +npx @hyperdx/cli mcp install -a https://your-hyperdx.example +``` + +The key is stored in plain text in each agent's user config, which the +command lists when it finishes. Running it again replaces the existing entry. + ### `hdx upload-sourcemaps` — Source maps Upload JavaScript source maps to HyperDX for stack trace de-obfuscation. Run it @@ -257,11 +272,11 @@ The CLI is built to be driven by scripts and AI agents: ## Links -- [HyperDX repository](https://github.com/hyperdxio/hyperdx) +- [HyperDX repository](https://github.com/ClickHouse/ClickStack) - [ClickStack documentation](https://clickhouse.com/docs/use-cases/observability/clickstack/overview) -- [Report an issue](https://github.com/hyperdxio/hyperdx/issues) -- [Contributing](https://github.com/hyperdxio/hyperdx/tree/main/packages/cli/CONTRIBUTING.md) +- [Report an issue](https://github.com/ClickHouse/ClickStack/issues) +- [Contributing](https://github.com/ClickHouse/ClickStack/tree/main/packages/cli/CONTRIBUTING.md) ## License -[MIT](https://github.com/hyperdxio/hyperdx/blob/main/LICENSE) +[MIT](https://github.com/ClickHouse/ClickStack/blob/main/LICENSE) diff --git a/packages/cli/package.json b/packages/cli/package.json index 850a602f2..eb29ee616 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,16 +1,16 @@ { "name": "@hyperdx/cli", - "version": "0.8.0", + "version": "0.9.0", "license": "MIT", "type": "module", "repository": { "type": "git", - "url": "git+https://github.com/hyperdxio/hyperdx.git", + "url": "git+https://github.com/ClickHouse/ClickStack.git", "directory": "packages/cli" }, - "homepage": "https://github.com/hyperdxio/hyperdx/tree/main/packages/cli#readme", + "homepage": "https://github.com/ClickHouse/ClickStack/tree/main/packages/cli#readme", "bugs": { - "url": "https://github.com/hyperdxio/hyperdx/issues" + "url": "https://github.com/ClickHouse/ClickStack/issues" }, "publishConfig": { "access": "public" @@ -41,7 +41,7 @@ }, "devDependencies": { "@clickhouse/client": "1.23.0-head.fae5998.1", - "@hyperdx/common-utils": "^0.33.0", + "@hyperdx/common-utils": "^0.35.0", "@jest/globals": "^30.2.0", "@types/crypto-js": "^4.2.2", "@types/jest": "^29.5.14", @@ -50,7 +50,7 @@ "chalk": "^5.3.0", "commander": "^12.1.0", "crypto-js": "^4.2.0", - "glob": "^13.0.6", + "glob": "^14.0.2", "ink": "6.8.0", "ink-spinner": "^5.0.0", "ink-text-input": "^6.0.0", diff --git a/packages/cli/src/__tests__/mcpInstall.test.ts b/packages/cli/src/__tests__/mcpInstall.test.ts new file mode 100644 index 000000000..f86f227b9 --- /dev/null +++ b/packages/cli/src/__tests__/mcpInstall.test.ts @@ -0,0 +1,169 @@ +import { + afterEach, + beforeEach, + describe, + expect, + it, + jest, +} from '@jest/globals'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import * as path from 'node:path'; + +import { + mcpUrl, + upsertCodexServer, + upsertJsonServer, + verifyKey, +} from '@/mcp/install'; + +const server = { url: 'https://example.com/api/mcp', key: 'hdx_org_abc' }; + +let dir: string; +beforeEach(() => { + dir = fs.mkdtempSync(path.join(os.tmpdir(), 'hdx-mcp-')); +}); +afterEach(() => { + fs.rmSync(dir, { recursive: true, force: true }); +}); + +describe('mcpUrl', () => { + it('appends /api/mcp without doubling slashes', () => { + expect(mcpUrl('https://example.com/')).toBe('https://example.com/api/mcp'); + }); +}); + +describe('upsertJsonServer', () => { + it('adds the server and keeps other servers and settings', () => { + const file = path.join(dir, 'mcp.json'); + fs.writeFileSync( + file, + JSON.stringify({ theme: 'dark', mcpServers: { other: { url: 'x' } } }), + ); + upsertJsonServer(file, 'mcpServers', { url: server.url }); + expect(JSON.parse(fs.readFileSync(file, 'utf-8'))).toEqual({ + theme: 'dark', + mcpServers: { other: { url: 'x' }, clickstack: { url: server.url } }, + }); + }); + + it('creates the file and its directory with owner-only permissions', () => { + const file = path.join(dir, 'nested', 'mcp.json'); + upsertJsonServer(file, 'servers', { url: server.url }); + expect(fs.statSync(file).mode & 0o777).toBe(0o600); + }); + + it('tightens an existing config to owner-only before writing the key', () => { + const file = path.join(dir, 'mcp.json'); + fs.writeFileSync(file, '{}', { mode: 0o644 }); + upsertJsonServer(file, 'servers', { url: server.url }); + expect(fs.statSync(file).mode & 0o777).toBe(0o600); + }); + + it('refuses JSON that is not an object', () => { + const file = path.join(dir, 'mcp.json'); + fs.writeFileSync(file, 'null'); + expect(() => upsertJsonServer(file, 'servers', {})).toThrow( + /Could not parse/, + ); + }); + + it('refuses to rewrite a file it cannot parse', () => { + const file = path.join(dir, 'mcp.json'); + fs.writeFileSync(file, '{ // comment\n "servers": {} }'); + expect(() => upsertJsonServer(file, 'servers', {})).toThrow( + /Could not parse/, + ); + expect(fs.readFileSync(file, 'utf-8')).toContain('// comment'); + }); +}); + +describe('upsertCodexServer', () => { + it('replaces an existing clickstack table and keeps the rest', () => { + const file = path.join(dir, 'config.toml'); + fs.writeFileSync( + file, + [ + 'model = "gpt-5"', + '', + '[mcp_servers.clickstack]', + 'url = "https://old/api/mcp"', + '', + '[mcp_servers.clickstack.env]', + 'A = "1"', + '', + '[mcp_servers.other]', + 'command = "other"', + '', + ].join('\n'), + ); + upsertCodexServer(file, server); + const out = fs.readFileSync(file, 'utf-8'); + expect(out).toContain('model = "gpt-5"'); + expect(out).toContain('[mcp_servers.other]\ncommand = "other"'); + expect(out).not.toContain('https://old'); + expect(out).not.toContain('[mcp_servers.clickstack.env]'); + expect( + out + .trimEnd() + .endsWith( + [ + '[mcp_servers.clickstack]', + 'url = "https://example.com/api/mcp"', + 'http_headers = { Authorization = "Bearer hdx_org_abc" }', + ].join('\n'), + ), + ).toBe(true); + }); + + it('creates the config when Codex has none yet', () => { + const file = path.join(dir, '.codex', 'config.toml'); + upsertCodexServer(file, server); + expect(fs.readFileSync(file, 'utf-8')).toBe( + '[mcp_servers.clickstack]\nurl = "https://example.com/api/mcp"\nhttp_headers = { Authorization = "Bearer hdx_org_abc" }\n', + ); + }); +}); + +describe('verifyKey', () => { + const realFetch = globalThis.fetch; + afterEach(() => { + globalThis.fetch = realFetch; + }); + + const respond = (status: number, body: unknown = {}) => { + const fetchMock = jest.fn(async (_url: string, _init?: RequestInit) => + Response.json(body, { status }), + ); + globalThis.fetch = fetchMock as unknown as typeof fetch; + return fetchMock; + }; + + it('names an org key by its description and checks through the app proxy', async () => { + const fetchMock = respond(200, { + user: { name: 'terraform', email: 'sa-1@x.invalid', isVirtual: true }, + }); + await expect(verifyKey('https://example.com/', 'k')).resolves.toEqual({ + name: 'terraform', + isServiceAccount: true, + }); + expect(fetchMock).toHaveBeenCalledWith('https://example.com/api/api/v2', { + headers: { Authorization: 'Bearer k' }, + }); + }); + + it('names a personal key by email', async () => { + respond(200, { user: { name: 'Ada', email: 'ada@example.com' } }); + await expect(verifyKey('https://example.com', 'k')).resolves.toEqual({ + name: 'ada@example.com', + isServiceAccount: false, + }); + }); + + it('rejects a revoked or wrong key', async () => { + respond(401); + await expect(verifyKey('https://example.com', 'k')).rejects.toThrow( + /rejected/, + ); + }); +}); diff --git a/packages/cli/src/__tests__/rowWhere.test.ts b/packages/cli/src/__tests__/rowWhere.test.ts index 0f427d4f4..a97a3c5e8 100644 --- a/packages/cli/src/__tests__/rowWhere.test.ts +++ b/packages/cli/src/__tests__/rowWhere.test.ts @@ -4,6 +4,64 @@ import type { ColumnMetaType } from '@hyperdx/common-utils/dist/clickhouse'; import { buildColumnMap, getRowWhere } from '@/shared/useRowWhere'; +type Sha256WhereKind = 'json' | 'leftUtf8'; + +type Sha256TestCase = { + /** ClickHouse expression this hash was verified against. */ + clickHouse: string; + columnMeta: ColumnMetaType[]; + input: string; + expected: string; + whereKind: Sha256WhereKind; +}; + +const SHA256_TEST_CASES: Record<string, Sha256TestCase> = { + 'actual log line': { + clickHouse: 'lower(hex(SHA256(<json log line>)))', + columnMeta: [{ name: 'Body', type: 'JSON' }], + input: + '{"caller":"github.com/cloudzero/cloudzero-agent/app/domain/shipper/shipper.go:289","level":"info","message":"Successfully ran the shipper cycle","time":"2026-10-18T00:00:03Z","version":"5d05872b1f292e4bf481c61b187494b9bafff6a8.1.2.10-2026-03-24_02:00:46PM"}', + expected: + '9bf1e18eb79cfe32fa7abb7c2b5370085a73eb299ffaaa526393084c8681c0b8', + whereKind: 'json', + }, + '600-char string': { + clickHouse: "lower(hex(SHA256(repeat('a', 600))))", + columnMeta: [{ name: 'description', type: 'String' }], + input: 'a'.repeat(600), + expected: + 'ba35c170729417f1499e0886e7e12fcdb4ab00ad411110ae1e888c766d4ed70d', + whereKind: 'leftUtf8', + }, + '2000-char string truncated to 1000 code points': { + clickHouse: "lower(hex(SHA256(leftUTF8(repeat('a', 2000), 1000))))", + columnMeta: [{ name: 'description', type: 'String' }], + input: 'a'.repeat(2000), + expected: + '41edece42d63e8d9bf515a9ba6932e1c20cbc9f5a5d134645adb5db1b9737ea3', + whereKind: 'leftUtf8', + }, + '600 emoji code points': { + clickHouse: "lower(hex(SHA256(leftUTF8(repeat('😀', 600), 1000))))", + columnMeta: [{ name: 'description', type: 'String' }], + input: '😀'.repeat(600), + expected: + '7f22fd88b289648f5f2a8f290d1010a0cefcf260777d613f34f9fb7948db3e43', + whereKind: 'leftUtf8', + }, +}; + +function sha256RowWhere( + columnName: string, + whereKind: Sha256WhereKind, + hash: string, +): string { + if (whereKind === 'json') { + return `lower(hex(SHA256(toString(${columnName}))))='${hash}'`; + } + return `lower(hex(SHA256(leftUTF8(${columnName}, 1000))))='${hash}'`; +} + describe('buildColumnMap', () => { it('quotes a column name that is not a bare identifier', () => { const meta: ColumnMetaType[] = [{ name: 'x-host-header', type: 'String' }]; @@ -66,4 +124,47 @@ describe('buildColumnMap', () => { expect(where).toBe("ResourceAttributes['service.name']='api'"); }); + + it.each(Object.entries(SHA256_TEST_CASES))( + 'SHA256 row WHERE matches ClickHouse for %s', + (_label, testCase) => { + const columnName = testCase.columnMeta[0]!.name; + + const where = getRowWhere( + { [columnName]: testCase.input }, + buildColumnMap(testCase.columnMeta, {}), + {}, + ).where; + + expect(where).toBe( + sha256RowWhere(columnName, testCase.whereKind, testCase.expected), + ); + }, + ); + + it('uses isNull for null JSON column values', () => { + const meta: ColumnMetaType[] = [{ name: 'Body', type: 'JSON' }]; + + const where = getRowWhere( + { Body: null }, + buildColumnMap(meta, {}), + {}, + ).where; + + expect(where).toBe('isNull(Body)'); + }); + + it('uses isNull for null Date column values', () => { + const meta: ColumnMetaType[] = [ + { name: 'event_created', type: "Nullable(DateTime64(3, 'UTC'))" }, + ]; + + const where = getRowWhere( + { event_created: null }, + buildColumnMap(meta, {}), + {}, + ).where; + + expect(where).toBe('isNull(event_created)'); + }); }); diff --git a/packages/cli/src/cli.tsx b/packages/cli/src/cli.tsx index e0dfb2ff7..806152225 100644 --- a/packages/cli/src/cli.tsx +++ b/packages/cli/src/cli.tsx @@ -30,20 +30,13 @@ import { fetchTileData } from '@/shared/tileQuery'; import { renderTileContent } from '@/shared/tileRender'; import { clearSession, loadSession, setActiveTeam } from '@/utils/config'; import { parseTimeValue } from '@/utils/editor'; +import { isValidUrl } from '@/utils/url'; import { uploadSourcemaps } from '@/sourcemaps'; +import { mcpClients } from '@/mcp/install'; +import McpInstallPrompt, { type InstallResult } from '@/mcp/McpInstallPrompt'; // ---- Standalone interactive login for `hdx auth login` ------------- -/** Returns true if the string is a valid HTTP(S) URL. */ -function isValidUrl(value: string): boolean { - try { - const url = new URL(value); - return url.protocol === 'http:' || url.protocol === 'https:'; - } catch { - return false; - } -} - // Add new login methods here to extend the login flow. const LOGIN_METHODS = [ { id: 'password', label: 'Email / Password' }, @@ -547,6 +540,68 @@ function resolveActiveTeam( return me.team ?? null; } +// ---- MCP ----------------------------------------------------------- + +const mcp = program + .command('mcp') + .description('Connect AI agents to ClickStack over MCP') + .enablePositionalOptions() + .passThroughOptions(); + +mcp + .command('install') + .description( + 'Add the ClickStack MCP server to Claude Code, Codex, Cursor, and VS Code', + ) + .option('-a, --app-url <url>', 'ClickStack app URL') + .action(async opts => { + if (!process.stdin.isTTY) { + _origError( + chalk.red( + 'hdx mcp install needs an interactive terminal so the key stays out of logs and agent chats. Run it yourself in a terminal.\n', + ), + ); + process.exit(1); + } + const clients = mcpClients().filter(c => c.detect()); + if (clients.length === 0) { + _origError( + chalk.red( + 'No supported agent found (Claude Code, Codex, Cursor, VS Code).\n', + ), + ); + process.exit(1); + } + + let results: InstallResult[] | null = null; + const { waitUntilExit } = render( + <McpInstallPrompt + initialAppUrl={resolveServer(opts.appUrl)} + clients={clients} + onDone={r => { + results = r; + }} + />, + ); + await waitUntilExit(); + + const done = results as InstallResult[] | null; + if (done == null) { + process.stdout.write('Cancelled. No configs were changed.\n'); + return; + } + for (const { client, error } of done) { + process.stdout.write( + error + ? chalk.red(`✗ ${client.label}: ${error}\n`) + : chalk.green(`✓ ${client.label}`) + + chalk.dim(` (key stored in ${client.location})\n`), + ); + } + process.stdout.write('Restart your agents to pick up the new server.\n'); + if (done.some(r => r.error)) process.exit(1); + }); + // ---- Teams --------------------------------------------------------- const team = program diff --git a/packages/cli/src/mcp/McpInstallPrompt.tsx b/packages/cli/src/mcp/McpInstallPrompt.tsx new file mode 100644 index 000000000..a36835561 --- /dev/null +++ b/packages/cli/src/mcp/McpInstallPrompt.tsx @@ -0,0 +1,164 @@ +import React, { useState } from 'react'; +import { Box, Text, useApp, useInput } from 'ink'; +import TextInput from 'ink-text-input'; +import Spinner from 'ink-spinner'; + +import { + type KeyIdentity, + type McpClient, + mcpUrl, + verifyKey, +} from '@/mcp/install'; +import { isValidUrl } from '@/utils/url'; + +export interface InstallResult { + client: McpClient; + error?: string; +} + +type Step = 'appUrl' | 'key' | 'checking' | 'confirm'; + +/** + * Collects the app URL and API key, checks the key, then asks before writing + * any client config. Calls `onDone` with the results, or with null if the + * user cancels. + */ +export default function McpInstallPrompt({ + initialAppUrl, + clients, + onDone, +}: { + initialAppUrl?: string; + clients: McpClient[]; + onDone: (results: InstallResult[] | null) => void; +}) { + const { exit } = useApp(); + const [step, setStep] = useState<Step>(initialAppUrl ? 'key' : 'appUrl'); + const [appUrl, setAppUrl] = useState(initialAppUrl ?? ''); + const [key, setKey] = useState(''); + const [identity, setIdentity] = useState<KeyIdentity | null>(null); + const [error, setError] = useState<string | null>(null); + + const finish = (results: InstallResult[] | null) => { + exit(); + onDone(results); + }; + + useInput( + (input, inkKey) => { + if (inkKey.return || input.toLowerCase() === 'y') { + const server = { url: mcpUrl(appUrl), key }; + finish( + clients.map(client => { + try { + client.install(server); + return { client }; + } catch (e) { + return { + client, + error: e instanceof Error ? e.message : String(e), + }; + } + }), + ); + } else if (inkKey.escape || input.toLowerCase() === 'n') { + finish(null); + } + }, + { isActive: step === 'confirm' }, + ); + + const submitAppUrl = () => { + const trimmed = appUrl.trim().replace(/\/+$/, ''); + if (!isValidUrl(trimmed)) { + setError('Enter a valid http:// or https:// URL.'); + return; + } + setError(null); + setAppUrl(trimmed); + setStep('key'); + }; + + const submitKey = async () => { + // Keys never contain whitespace; a paste can bring a trailing newline. + const cleaned = key.replace(/\s/g, ''); + if (!cleaned) return; + setKey(cleaned); + setError(null); + setStep('checking'); + try { + setIdentity(await verifyKey(appUrl, cleaned)); + setStep('confirm'); + } catch (e) { + setError(e instanceof Error ? e.message : String(e)); + setKey(''); + setStep('key'); + } + }; + + return ( + <Box flexDirection="column" paddingX={1}> + <Text bold color="cyan"> + ClickStack MCP server install + </Text> + {step !== 'appUrl' && <Text dimColor>Server: {appUrl}</Text>} + <Text> </Text> + {error && <Text color="red">{error}</Text>} + + {step === 'appUrl' && ( + <Box> + <Text>ClickStack URL: </Text> + <TextInput + value={appUrl} + onChange={setAppUrl} + onSubmit={submitAppUrl} + placeholder="http://localhost:8080" + /> + </Box> + )} + + {step === 'key' && ( + <Box flexDirection="column"> + <Text dimColor> + Paste a personal access key or an organization API key from Team + Settings > API & Agents. + </Text> + <Box> + <Text>API key: </Text> + <TextInput + value={key} + onChange={setKey} + onSubmit={submitKey} + mask="*" + /> + </Box> + </Box> + )} + + {step === 'checking' && ( + <Text> + <Spinner type="dots" /> Checking the key… + </Text> + )} + + {step === 'confirm' && identity && ( + <Box flexDirection="column"> + <Text color="green"> + Key works for{' '} + {identity.isServiceAccount + ? `organization key "${identity.name}"` + : identity.name} + . + </Text> + <Text> </Text> + <Text>Add the ClickStack MCP server to:</Text> + {clients.map(c => ( + <Text key={c.id}> - {c.label}</Text> + ))} + <Text> </Text> + <Text dimColor>Enter or y to continue, Esc or n to cancel</Text> + </Box> + )} + </Box> + ); +} diff --git a/packages/cli/src/mcp/install.ts b/packages/cli/src/mcp/install.ts new file mode 100644 index 000000000..c2db869ac --- /dev/null +++ b/packages/cli/src/mcp/install.ts @@ -0,0 +1,230 @@ +import { spawnSync } from 'node:child_process'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import * as path from 'node:path'; + +// Same server name the Team Settings snippets use, so a reinstall replaces +// an entry added by hand instead of adding a second one. +const MCP_SERVER_NAME = 'clickstack'; + +export interface McpServer { + url: string; + key: string; +} + +export interface McpClient { + id: 'claude-code' | 'codex' | 'cursor' | 'vscode'; + label: string; + /** Where the key ends up, shown to the user after install. */ + location: string; + detect: () => boolean; + install: (server: McpServer) => void; +} + +export interface KeyIdentity { + name: string; + isServiceAccount: boolean; +} + +export function mcpUrl(appUrl: string): string { + return `${appUrl.replace(/\/+$/, '')}/api/mcp`; +} + +/** Returns who the key authenticates as, or throws with a message for the user. */ +export async function verifyKey( + appUrl: string, + key: string, +): Promise<KeyIdentity> { + let res: Response; + try { + // The app's /api proxy strips its prefix, and the external API itself is + // mounted at /api/v2, hence the doubled segment. + res = await fetch(`${appUrl.replace(/\/+$/, '')}/api/api/v2`, { + headers: { Authorization: `Bearer ${key}` }, + }); + } catch (e) { + throw new Error( + `Could not reach ${appUrl}: ${e instanceof Error ? e.message : e}`, + ); + } + if (res.status === 401 || res.status === 403) { + throw new Error( + 'The key was rejected. It may be wrong, revoked, or expired.', + ); + } + if (!res.ok) { + throw new Error(`Could not check the key (HTTP ${res.status}).`); + } + const body = (await res.json()) as { + user?: { name?: string; email?: string; isVirtual?: boolean }; + }; + const user = body.user ?? {}; + return { + // A service account's email is synthetic; its name is the key description. + name: (user.isVirtual ? user.name : user.email) ?? user.name ?? 'unknown', + isServiceAccount: !!user.isVirtual, + }; +} + +function onPath(command: string): boolean { + return !spawnSync(command, ['--version'], { stdio: 'ignore' }).error; +} + +function authHeaders(key: string) { + return { Authorization: `Bearer ${key}` }; +} + +/** Sets `<topKey>.<MCP_SERVER_NAME>` in a JSON config, keeping everything else. */ +export function upsertJsonServer( + file: string, + topKey: string, + entry: Record<string, unknown>, +): void { + let config: Record<string, unknown> = {}; + if (fs.existsSync(file)) { + let parsed: unknown; + try { + parsed = JSON.parse(fs.readFileSync(file, 'utf-8')); + } catch { + // Rewriting a file we can't parse (e.g. JSONC comments) would lose them. + } + if (parsed == null || typeof parsed !== 'object' || Array.isArray(parsed)) { + throw new Error(`Could not parse ${file}. Add the server by hand.`); + } + config = parsed as Record<string, unknown>; + } + const servers = (config[topKey] ?? {}) as Record<string, unknown>; + config[topKey] = { ...servers, [MCP_SERVER_NAME]: entry }; + writePrivate(file, `${JSON.stringify(config, null, 2)}\n`); +} + +// writeFileSync's `mode` only applies on create, so tighten existing files too. +function writePrivate(file: string, content: string): void { + fs.mkdirSync(path.dirname(file), { recursive: true }); + fs.writeFileSync(file, content, { mode: 0o600 }); + fs.chmodSync(file, 0o600); +} + +function tomlString(value: string): string { + return JSON.stringify(value); +} + +/** Replaces the `[mcp_servers.clickstack]` table (and its subtables) in Codex's config.toml. */ +export function upsertCodexServer(file: string, server: McpServer): void { + const existing = fs.existsSync(file) ? fs.readFileSync(file, 'utf-8') : ''; + const header = new RegExp(`^\\[mcp_servers\\.${MCP_SERVER_NAME}(\\.|\\])`); + const kept: string[] = []; + let skipping = false; + // shortcut: line-based table removal, no TOML parser. Fine for tables we + // wrote; a hand-written multi-line value inside ours could be split. + for (const line of existing.split('\n')) { + if (line.trimStart().startsWith('[')) { + skipping = header.test(line.trim()); + } + if (!skipping) kept.push(line); + } + const body = kept.join('\n').trimEnd(); + const table = [ + `[mcp_servers.${MCP_SERVER_NAME}]`, + `url = ${tomlString(server.url)}`, + `http_headers = { Authorization = ${tomlString(`Bearer ${server.key}`)} }`, + ].join('\n'); + writePrivate(file, `${body ? `${body}\n\n` : ''}${table}\n`); +} + +function vscodeUserDir(home: string, platform: NodeJS.Platform): string { + if (platform === 'darwin') { + return path.join(home, 'Library', 'Application Support', 'Code', 'User'); + } + if (platform === 'win32') { + return path.join( + process.env.APPDATA ?? path.join(home, 'AppData', 'Roaming'), + 'Code', + 'User', + ); + } + return path.join(home, '.config', 'Code', 'User'); +} + +function runClaude(args: string[]): void { + const res = spawnSync('claude', args, { encoding: 'utf-8' }); + if (res.error || res.status !== 0) { + throw new Error( + (res.stderr || res.error?.message || 'claude mcp add failed').trim(), + ); + } +} + +export function mcpClients( + home = os.homedir(), + platform = process.platform, +): McpClient[] { + const codexConfig = path.join(home, '.codex', 'config.toml'); + const cursorConfig = path.join(home, '.cursor', 'mcp.json'); + const vscodeDir = vscodeUserDir(home, platform); + const vscodeConfig = path.join(vscodeDir, 'mcp.json'); + + return [ + { + id: 'claude-code', + label: 'Claude Code', + location: 'Claude Code user config (~/.claude.json)', + detect: () => onPath('claude'), + install: ({ url, key }) => { + // `mcp add` refuses to overwrite, so drop any earlier entry first. A + // local-scope entry for this directory would also shadow the new one. + for (const scope of ['local', 'user']) { + spawnSync( + 'claude', + ['mcp', 'remove', '--scope', scope, MCP_SERVER_NAME], + { + stdio: 'ignore', + }, + ); + } + runClaude([ + 'mcp', + 'add', + '--scope', + 'user', + '--transport', + 'http', + MCP_SERVER_NAME, + url, + '--header', + `Authorization: Bearer ${key}`, + ]); + }, + }, + { + id: 'codex', + label: 'Codex', + location: codexConfig, + detect: () => fs.existsSync(path.dirname(codexConfig)) || onPath('codex'), + install: server => upsertCodexServer(codexConfig, server), + }, + { + id: 'cursor', + label: 'Cursor', + location: cursorConfig, + detect: () => fs.existsSync(path.dirname(cursorConfig)), + install: ({ url, key }) => + upsertJsonServer(cursorConfig, 'mcpServers', { + url, + headers: authHeaders(key), + }), + }, + { + id: 'vscode', + label: 'VS Code', + location: vscodeConfig, + detect: () => fs.existsSync(vscodeDir), + install: ({ url, key }) => + upsertJsonServer(vscodeConfig, 'servers', { + type: 'http', + url, + headers: authHeaders(key), + }), + }, + ]; +} diff --git a/packages/cli/src/shared/useRowWhere.ts b/packages/cli/src/shared/useRowWhere.ts index 98f2fcddd..2a4e3968a 100644 --- a/packages/cli/src/shared/useRowWhere.ts +++ b/packages/cli/src/shared/useRowWhere.ts @@ -11,7 +11,7 @@ * to common-utils later. */ -import MD5 from 'crypto-js/md5'; +import SHA256 from 'crypto-js/sha256'; import SqlString from 'sqlstring'; import { ColumnMetaType, @@ -19,7 +19,11 @@ import { JSDataType, } from '@hyperdx/common-utils/dist/clickhouse'; import { quoteResultColumnNameIfNeeded } from '@hyperdx/common-utils/dist/core/metadata'; -import { aliasMapToWithClauses } from '@hyperdx/common-utils/dist/core/utils'; +import { + aliasMapToWithClauses, + LEFT_UTF8_HASH_CODE_POINTS, + leftUtf8Prefix, +} from '@hyperdx/common-utils/dist/core/utils'; import type { BuilderChartConfig } from '@hyperdx/common-utils/dist/types'; const MAX_STRING_LENGTH = 512; @@ -67,7 +71,12 @@ function processRowToWhereClause( ); } - const strValue = value != null ? String(value) : null; + // Handle nullish values for all types uniformly + if (value == null) { + return SqlString.format(`isNull(?)`, [SqlString.raw(valueExpr)]); + } + + const strValue = String(value); switch (jsType) { case JSDataType.Date: @@ -89,9 +98,9 @@ function processRowToWhereClause( ]); case JSDataType.JSON: // Handle case for whole json object, ex: json - return SqlString.format(`lower(hex(MD5(toString(?))))=?`, [ + return SqlString.format(`lower(hex(SHA256(toString(?))))=?`, [ SqlString.raw(valueExpr), - MD5(strValue ?? '').toString(), + SHA256(strValue).toString(), ]); case JSDataType.Dynamic: // Handle case for json element, ex: json.c @@ -108,16 +117,17 @@ function processRowToWhereClause( ); default: - // Handle nullish values - if (value == null) { - return SqlString.format(`isNull(?)`, [SqlString.raw(valueExpr)]); - } // Handle the case when string is too long - if ((strValue?.length ?? 0) > MAX_STRING_LENGTH) { - return SqlString.format(`lower(hex(MD5(leftUTF8(?, 1000))))=?`, [ - SqlString.raw(valueExpr), - MD5((strValue ?? '').substring(0, 1000)).toString(), - ]); + if (strValue.length > MAX_STRING_LENGTH) { + return SqlString.format( + `lower(hex(SHA256(leftUTF8(?, ${LEFT_UTF8_HASH_CODE_POINTS}))))=?`, + [ + SqlString.raw(valueExpr), + SHA256( + leftUtf8Prefix(strValue, LEFT_UTF8_HASH_CODE_POINTS), + ).toString(), + ], + ); } return SqlString.format(`?=?`, [ SqlString.raw(valueExpr), // don't escape expressions diff --git a/packages/cli/src/utils/url.ts b/packages/cli/src/utils/url.ts new file mode 100644 index 000000000..4f83b41e3 --- /dev/null +++ b/packages/cli/src/utils/url.ts @@ -0,0 +1,9 @@ +/** Returns true if the string is a valid HTTP(S) URL. */ +export function isValidUrl(value: string): boolean { + try { + const url = new URL(value); + return url.protocol === 'http:' || url.protocol === 'https:'; + } catch { + return false; + } +} diff --git a/packages/common-utils/CHANGELOG.md b/packages/common-utils/CHANGELOG.md index 2700c5608..e89cafd30 100644 --- a/packages/common-utils/CHANGELOG.md +++ b/packages/common-utils/CHANGELOG.md @@ -1,5 +1,73 @@ # @hyperdx/common-utils +## 0.35.0 + +### Minor Changes + +- 2d17de5d7: feat: serve PromQL label lookups from ClickHouse's Prometheus HTTP API + + On ClickHouse 26.9+ with the `prometheus_api_v1` handler, `/labels` and `/label/:name/values` for a ClickHouse-backed PromQL source now proxy to the handler instead of querying the TimeSeries tags table with SQL. Older servers, servers without the handler, and sources set to `table-function` keep the SQL path, so a source that runs queries over HTTP on 26.6-26.8 still gets label autocomplete. + +### Patch Changes + +- ac913ceb3: feat: Choose how a PromQL source on ClickHouse is evaluated (the Prometheus HTTP API or the `prometheusQuery` table functions) instead of probing the server on every query. Without a choice the server is still probed, but the answer is now kept for 5 minutes. A source set to the HTTP API against a server that does not serve it fails with a clear error. Onboarding pins a PromQL source it detects to the HTTP API when the server serves it. + +## 0.34.0 + +### Minor Changes + +- 142c9cc87: feat: narrow ad hoc dashboard filter suggestions with a condition + + An ad hoc filter on SQL sources can now carry a SQL or Lucene "Keys and values + filter", like a queried filter's dropdown values filter, that limits the rows + its keys and values are suggested from. It can reference the dashboard's other + variables. While it references a required filter with nothing selected, the ad + hoc filter can't add or edit conditions and names the filter it is waiting on. + Failed suggestions now show the database's error message. + +- cd0e9edfa: feat: add optional `titleEmoji` webhook option; `false` removes the emoji prefix from notification titles sent through that webhook +- 0b7926d1d: feat: Team members can create team-owned API keys with a description and expiry that keep working after their creator leaves. + +### Patch Changes + +- 9269f7784: fix: "Denoise results" now removes noise on typical data. A pattern now counts as noisy above 5% of sampled events instead of 10%, which often matched nothing. Patterns that include error or warning lines are never hidden. The MCP `denoise` option uses the same 5% threshold. Denoise also mines the source's body column instead of the last table column, removes ANSI-colored rows that match a noisy pattern, says when results can't be denoised, and shows hidden patterns as a short summary with a shortened, expandable list. +- e2754d203: fix: use SHA256 instead of MD5 for JSON row lookup WHERE clauses so row + details and drill-down work on FIPS-enabled ClickHouse deployments +- 22f824c6e: fix: keep JSON path segments with special characters quoted in row detail lookups +- 642533255: perf: PromQL label lookups with `match[]` read only the matched metrics' tags + rows when every selector names its metric +- d0dd06fe8: fix: count legacy STATUS_CODE_ERROR spans as errors on the service map and trace + waterfall +- 5584f84bb: fix: make clickstack_event_patterns drill-down snippets executable + + Each pattern's `whereSnippet` is now a SQL predicate (`whereLanguage: "sql"`) that keeps the template's token order and variable positions and includes the caller's filter and the source table filter, so passing it to `clickstack_search` returns the pattern's events. Before, a template like `Sending <*> rows` produced `Body:"Sending rows"`, which matched nothing, and map fields produced Lucene that failed to parse. `bodyExpression` now also accepts `JSONExtractString(<column>, '<key>', ...)` to mine a field inside JSON bodies, and the tool reports sample coverage and the actual trend bucket interval and boundaries. + + `clickstack_event_patterns`, `clickstack_emerging_signals` and dashboard event-pattern tiles now apply the log source's `tableFilterExpression`, so their counts can drop for sources that set one. `minePatterns` now reports each cluster's own template; before, it could report the template of a different same-length cluster that some members did not fit. + +- 41b2b742a: feat: fall back to server MergeTree settings to detect persisted `_block_number` and `_block_offset` columns when the table's CREATE query omits them +- 442d6dfd9: fix: refresh cached table columns after 5 minutes + + The shared metadata cache kept each table's `DESCRIBE` result for the life of + the process, so the API did not see columns added with `ALTER TABLE`, such as + new MATERIALIZED columns, until it restarted. Cached columns now expire after 5 + minutes. Other cached metadata is unchanged. + +- eb2439ed0: fix: leave metric points with no recorded value out of charts and alerts + + When a scraped series goes away or a scrape fails, the collector's `prometheus` + receiver sends a point flagged "no recorded value" (a Prometheus staleness + marker), and the ClickHouse exporter stores it as zeros. Metric charts and + alerts read it as a real value: a gauge's `min` and `avg` dropped and `count` + included the series that went away, and a counter or histogram that came back + after the marker counted its whole total again. Metric queries now skip points + with this flag. + +- 0a5237e6c: fix: reject alerts on dashboard tiles the alert checker never evaluates (PromQL + tiles, and builder tiles with unsupported display types), and drop them when a + dashboard is saved +- 78143c81a: feat: on ClickHouse Cloud, read `system.shared_merge_tree_settings` when detecting `_block_number` and `_block_offset` columns, falling back to `system.merge_tree_settings` per key +- b1d4e60f8: fix: PromQL label lookups (dashboard variables, label autocomplete) now work on TimeSeries tables of schema version 8, the default from ClickHouse 26.10. These keep each series' time range in a separate time ranges table instead of the tags table's min_time/max_time, so match[] failed with "requires store_min_time_and_max_time = 1" and time-bounded lookups read the whole tags table. + ## 0.33.0 ### Minor Changes diff --git a/packages/common-utils/package.json b/packages/common-utils/package.json index 9742f5661..1525f4f6c 100644 --- a/packages/common-utils/package.json +++ b/packages/common-utils/package.json @@ -1,7 +1,7 @@ { "name": "@hyperdx/common-utils", "description": "Common utilities for HyperDX application", - "version": "0.33.0", + "version": "0.35.0", "license": "MIT", "private": true, "files": [ diff --git a/packages/common-utils/src/__tests__/clickhouseVersion.test.ts b/packages/common-utils/src/__tests__/clickhouseVersion.test.ts index 580bef908..bac73aacb 100644 --- a/packages/common-utils/src/__tests__/clickhouseVersion.test.ts +++ b/packages/common-utils/src/__tests__/clickhouseVersion.test.ts @@ -5,6 +5,7 @@ import { supportsDirectReadMap, supportsMergeTreeIndex, supportsPrometheusHttpApi, + supportsPrometheusLabelsApi, } from '@/core/clickhouseVersion'; type ClickHouseVersionTuple = readonly [number, number, number, number]; @@ -301,3 +302,25 @@ describe('supportsPrometheusHttpApi', () => { expect(supportsPrometheusHttpApi(undefined)).toBe(false); }); }); + +describe('supportsPrometheusLabelsApi', () => { + it.each<readonly [ClickHouseVersionTuple]>([ + [[26, 9, 0, 0]], + [[26, 10, 3, 7]], + [[27, 0, 0, 0]], + ])('accepts %j', version => { + expect(supportsPrometheusLabelsApi(version)).toBe(true); + }); + + it.each<readonly [ClickHouseVersionTuple]>([ + [[26, 8, 36, 3]], + [[26, 6, 0, 0]], + [[25, 12, 0, 0]], + ])('rejects %j', version => { + expect(supportsPrometheusLabelsApi(version)).toBe(false); + }); + + it('returns false when the version is unknown', () => { + expect(supportsPrometheusLabelsApi(undefined)).toBe(false); + }); +}); diff --git a/packages/common-utils/src/__tests__/filters.test.ts b/packages/common-utils/src/__tests__/filters.test.ts index 5cfe4683c..0f26d1492 100644 --- a/packages/common-utils/src/__tests__/filters.test.ts +++ b/packages/common-utils/src/__tests__/filters.test.ts @@ -796,6 +796,47 @@ describe('filters', () => { ]); }); + it("flags a malformed where clause on an ad hoc filter's suggestions", () => { + expect( + validateDashboardFilterQueries([ + { + id: 'conds', + type: 'ADHOC', + name: 'Conditions', + sourceType: 'sql', + sources: ['logs'], + isVariableEnabled: true, + where: 'ServiceName = =', + whereLanguage: 'sql', + }, + ]), + ).toEqual([ + { + filterId: 'conds', + filterName: 'Conditions', + language: 'sql', + where: 'ServiceName = =', + }, + ]); + }); + + it('skips the unused where clause of a PromQL ad hoc filter', () => { + expect( + validateDashboardFilterQueries([ + { + id: 'conds', + type: 'ADHOC', + name: 'Conditions', + sourceType: 'promql', + sources: ['metrics'], + isVariableEnabled: true, + where: 'ServiceName = =', + whereLanguage: 'sql', + }, + ]), + ).toEqual([]); + }); + it('only reports the invalid filters in a mixed list', () => { const issues = validateDashboardFilterQueries([ filter({ id: 'a', where: 'ServiceName:*', whereLanguage: 'lucene' }), diff --git a/packages/common-utils/src/__tests__/metadata.int.test.ts b/packages/common-utils/src/__tests__/metadata.int.test.ts index e27a2ccc0..0e9133bc8 100644 --- a/packages/common-utils/src/__tests__/metadata.int.test.ts +++ b/packages/common-utils/src/__tests__/metadata.int.test.ts @@ -3,7 +3,7 @@ import { ClickHouseClient } from '@clickhouse/client'; import { ClickhouseClient as HdxClickhouseClient } from '@/clickhouse/node'; import { supportsMergeTreeTextIndex } from '@/core/clickhouseVersion'; -import { Metadata, MetadataCache } from '@/core/metadata'; +import { Field, Metadata, MetadataCache } from '@/core/metadata'; import { parseKvItemsCastExpression, parseKvItemsExpression, @@ -1159,14 +1159,17 @@ describe('Metadata Integration Tests', () => { clickhouse_settings: { allow_experimental_time_series_table: 1 }, }); + // Pinned to version 7: from version 8 (the default since ClickHouse 26.10) + // min_time/max_time live in a separate time ranges table, and + // store_min_time_and_max_time is rejected. beforeAll(async () => { await timeSeriesCommand(`DROP TABLE IF EXISTS default.${boundedTable}`); await timeSeriesCommand(`DROP TABLE IF EXISTS default.${unboundedTable}`); await timeSeriesCommand( - `CREATE TABLE default.${boundedTable} ENGINE = TimeSeries`, + `CREATE TABLE default.${boundedTable} ENGINE = TimeSeries SETTINGS version = 7`, ); await timeSeriesCommand( - `CREATE TABLE default.${unboundedTable} ENGINE = TimeSeries SETTINGS store_min_time_and_max_time = 0`, + `CREATE TABLE default.${unboundedTable} ENGINE = TimeSeries SETTINGS store_min_time_and_max_time = 0, version = 7`, ); }); @@ -1219,7 +1222,7 @@ describe('Metadata Integration Tests', () => { }); it.each([ - ['Metrics', ['metric_family_name', 'type', 'unit', 'help']], + ['Metrics', ['metric_family', 'type', 'unit', 'help']], ['Data', ['id', 'timestamp', 'value']], ] as const)( 'describes the %s inner table', @@ -1307,6 +1310,50 @@ describe('Metadata Integration Tests', () => { }); }); + // The version decides which samples column a query reads (`samples` from + // version 3, `time_series` before), so a version read as 0 silently breaks + // queries on new tables. + describe('getTimeSeriesTableVersion', () => { + const defaultTable = 'test_ts_version_default'; + const v7Table = 'test_ts_version_7'; + + const timeSeriesCommand = (query: string) => + client.command({ + query, + clickhouse_settings: { allow_experimental_time_series_table: 1 }, + }); + + const version = (tableName: string) => + new Metadata(hdxClient, new MetadataCache()).getTimeSeriesTableVersion({ + connectionId: 'test_connection', + databaseName: 'default', + tableName, + }); + + beforeAll(async () => { + await timeSeriesCommand( + `CREATE OR REPLACE TABLE default.${defaultTable} ENGINE = TimeSeries`, + ); + await timeSeriesCommand( + `CREATE OR REPLACE TABLE default.${v7Table} ENGINE = TimeSeries SETTINGS version = 7`, + ); + }); + + afterAll(async () => { + await timeSeriesCommand(`DROP TABLE IF EXISTS default.${defaultTable}`); + await timeSeriesCommand(`DROP TABLE IF EXISTS default.${v7Table}`); + }); + + it('reads the version from the table definition', async () => { + expect(await version(defaultTable)).toBe(8); + expect(await version(v7Table)).toBe(7); + }); + + it('answers 0 for a table that does not exist', async () => { + expect(await version('test_ts_version_missing')).toBe(0); + }); + }); + describe('getTimeSeriesTables', () => { const database = 'test_ts_discovery'; @@ -1453,6 +1500,124 @@ describe('Metadata Integration Tests', () => { }); }); + // Shaped like LogHouse: a two-column timestamp, a date partition, a sort key + // led by the namespace, and settings that reject scans which skip either. + describe('getAllFields with a condition', () => { + const tableName = 'test_all_fields_condition'; + const tableConnection = { + databaseName: 'default', + tableName, + connectionId: 'test_connection', + timestampValueExpression: 'EventTime, EventDate', + }; + const nsACondition = { + where: "Namespace = 'ns-a'", + whereLanguage: 'sql' as const, + }; + const lastTwoHours = (): [Date, Date] => [ + new Date(Date.now() - 2 * 60 * 60 * 1000), + new Date(), + ]; + const mapKeys = (fields: Field[]) => + fields + .filter(({ path }) => path.length === 2 && path[0] === 'LogAttributes') + .map(({ path }) => path[1]); + + beforeAll(async () => { + await client.command({ + query: `DROP TABLE IF EXISTS default.${tableName}`, + }); + await client.command({ + query: `CREATE TABLE default.${tableName} ( + EventDate Date, + EventTime DateTime, + Namespace LowCardinality(String), + ServiceName LowCardinality(String), + LogAttributes Map(String, String) + ) + ENGINE = MergeTree() + PARTITION BY EventDate + ORDER BY (Namespace, ServiceName) + `, + }); + + const eventTime = new Date(Date.now() - 60 * 60 * 1000) + .toISOString() + .slice(0, 19) + .replace('T', ' '); + const row = { EventDate: eventTime.slice(0, 10), EventTime: eventTime }; + await client.insert({ + table: `default.${tableName}`, + values: [ + { + ...row, + Namespace: 'ns-a', + ServiceName: 'api', + LogAttributes: { 'a.key': '1' }, + }, + { + ...row, + Namespace: 'ns-b', + ServiceName: 'api', + LogAttributes: { 'b.key': '2' }, + }, + ], + format: 'JSONEachRow', + }); + }); + + afterAll(async () => { + await client.command({ + query: `DROP TABLE IF EXISTS default.${tableName}`, + }); + }); + + it('reads Map keys only from rows matching a SQL condition', async () => { + const metadata = new Metadata(hdxClient, new MetadataCache()); + + const fields = await metadata.getAllFields({ + ...tableConnection, + dateRange: lastTwoHours(), + condition: nsACondition, + }); + + expect(mapKeys(fields)).toEqual(['a.key']); + }); + + it('reads Map keys only from rows matching a Lucene condition', async () => { + const metadata = new Metadata(hdxClient, new MetadataCache()); + + const fields = await metadata.getAllFields({ + ...tableConnection, + dateRange: lastTwoHours(), + condition: { where: 'Namespace:"ns-b"', whereLanguage: 'lucene' }, + }); + + expect(mapKeys(fields)).toEqual(['b.key']); + }); + + it('lets a condition on the sort key pass force_primary_key, which rejects the unscoped scan', async () => { + const metadata = new Metadata(hdxClient, new MetadataCache(), { + force_primary_key: 1, + force_index_by_date: 1, + }); + + await expect( + metadata.getAllFields({ + ...tableConnection, + dateRange: lastTwoHours(), + }), + ).rejects.toThrow(/INDEX_NOT_USED|force_primary_key/); + + const fields = await metadata.getAllFields({ + ...tableConnection, + dateRange: lastTwoHours(), + condition: nsACondition, + }); + expect(mapKeys(fields)).toEqual(['a.key']); + }); + }); + describe.each([ { path: 'key', diff --git a/packages/common-utils/src/__tests__/metadata.test.ts b/packages/common-utils/src/__tests__/metadata.test.ts index 1489354d2..d8e612118 100644 --- a/packages/common-utils/src/__tests__/metadata.test.ts +++ b/packages/common-utils/src/__tests__/metadata.test.ts @@ -1,6 +1,7 @@ import { ColumnMeta } from '@/clickhouse'; import { ClickhouseClient } from '@/clickhouse/node'; import { + COLUMNS_CACHE_TTL_MS, GET_ALL_KEY_VALUES_CHUNK_SIZE, Metadata, MetadataCache, @@ -8,7 +9,10 @@ import { quoteResultColumnNameIfNeeded, } from '@/core/metadata'; import * as renderChartConfigModule from '@/core/renderChartConfig'; -import { timeFilterExpr } from '@/core/renderChartConfig'; +import { + renderWhereExpressionStr, + timeFilterExpr, +} from '@/core/renderChartConfig'; import { isBuilderChartConfig } from '@/guards'; import { TextIndexInfoLookup } from '@/queryParser'; import { BuilderChartConfigWithDateRange, SourceKind, TSource } from '@/types'; @@ -28,6 +32,7 @@ jest.mock('../core/renderChartConfig', () => ({ renderChartConfig: jest .fn() .mockResolvedValue({ sql: 'SELECT 1', params: {} }), + renderWhereExpressionStr: jest.fn().mockResolvedValue('__CONDITION__'), timeFilterExpr: jest .fn() .mockResolvedValue({ sql: '__TIME_FILTER__', params: {} }), @@ -157,6 +162,48 @@ describe('MetadataCache', () => { // And no value should be stored in the cache expect(metadataCache.get(key)).toBeUndefined(); }); + + it('refetches a value stored with a TTL once the TTL has passed', async () => { + const now = jest.spyOn(Date, 'now').mockReturnValue(1_000); + const queryFn = jest + .fn() + .mockResolvedValueOnce('first') + .mockResolvedValueOnce('second'); + + try { + await expect( + metadataCache.getOrFetch('key', queryFn, { ttlMs: 100 }), + ).resolves.toBe('first'); + + now.mockReturnValue(1_099); + await expect( + metadataCache.getOrFetch('key', queryFn, { ttlMs: 100 }), + ).resolves.toBe('first'); + + now.mockReturnValue(1_100); + await expect( + metadataCache.getOrFetch('key', queryFn, { ttlMs: 100 }), + ).resolves.toBe('second'); + expect(queryFn).toHaveBeenCalledTimes(2); + } finally { + now.mockRestore(); + } + }); + + it('keeps a value stored without a TTL', async () => { + const now = jest.spyOn(Date, 'now').mockReturnValue(1_000); + const queryFn = jest.fn().mockResolvedValue('value'); + + try { + await metadataCache.getOrFetch('key', queryFn); + now.mockReturnValue(1_000 + 365 * 24 * 60 * 60 * 1000); + await metadataCache.getOrFetch('key', queryFn); + + expect(queryFn).toHaveBeenCalledTimes(1); + } finally { + now.mockRestore(); + } + }); }); }); @@ -168,6 +215,63 @@ describe('Metadata', () => { jest.clearAllMocks(); }); + describe('getMaterializedColumnsLookupTable', () => { + it('sees a MATERIALIZED column added after the first read once the cached columns expire', async () => { + const now = jest.spyOn(Date, 'now').mockReturnValue(0); + const client = { query: jest.fn() } as unknown as ClickhouseClient; + const md = new Metadata(client, new MetadataCache()); + const describeResult = (columns: Partial<ColumnMeta>[]) => ({ + json: jest.fn().mockResolvedValue({ data: columns }), + }); + const resourceAttributes = { + name: 'ResourceAttributes', + type: 'Map(LowCardinality(String), String)', + default_type: '', + default_expression: '', + }; + const materialized = { + name: '__otel_materialized_k8s.namespace.name', + type: 'LowCardinality(String)', + default_type: 'MATERIALIZED', + default_expression: "ResourceAttributes['k8s.namespace.name']", + }; + (client.query as jest.Mock) + .mockResolvedValueOnce(describeResult([resourceAttributes])) + .mockResolvedValueOnce( + describeResult([resourceAttributes, materialized]), + ); + const table = { + databaseName: 'otel', + tableName: 'otel_metrics_gauge', + connectionId: 'conn-1', + }; + + try { + expect(await md.getMaterializedColumnsLookupTable(table)).toEqual( + new Map(), + ); + + now.mockReturnValue(COLUMNS_CACHE_TTL_MS - 1); + expect(await md.getMaterializedColumnsLookupTable(table)).toEqual( + new Map(), + ); + + now.mockReturnValue(COLUMNS_CACHE_TTL_MS); + expect(await md.getMaterializedColumnsLookupTable(table)).toEqual( + new Map([ + [ + "ResourceAttributes['k8s.namespace.name']", + '__otel_materialized_k8s.namespace.name', + ], + ]), + ); + expect(client.query).toHaveBeenCalledTimes(2); + } finally { + now.mockRestore(); + } + }); + }); + describe('getTableMetadata', () => { beforeEach(() => { mockCache.getOrFetch.mockImplementation((key, queryFn) => queryFn()); @@ -446,6 +550,128 @@ describe('Metadata', () => { }); }); + describe('getMergeTreeSettings', () => { + type SettingRow = { name: string; value: string }; + const mockSettingsTables = ({ + mergeTree, + sharedMergeTree = [], + }: { + mergeTree: SettingRow[]; + sharedMergeTree?: SettingRow[]; + }) => + (mockClickhouseClient.query as jest.Mock).mockImplementation( + async ({ query }: { query: string }) => ({ + json: async () => ({ + data: query.includes('shared_merge_tree_settings') + ? sharedMergeTree + : mergeTree, + }), + }), + ); + + beforeEach(() => { + mockCache.getOrFetch.mockImplementation((key, queryFn) => queryFn()); + }); + + it('reads only merge_tree_settings outside Cloud', async () => { + jest.spyOn(metadata, 'isClickHouseCloud').mockResolvedValue(false); + mockSettingsTables({ + mergeTree: [ + { name: 'enable_block_number_column', value: '1' }, + { name: 'enable_block_offset_column', value: '0' }, + ], + }); + + const result = await metadata.getMergeTreeSettings({ + connectionId: 'test_connection', + }); + + expect(result).toEqual( + new Map([ + ['enable_block_number_column', '1'], + ['enable_block_offset_column', '0'], + ]), + ); + expect(mockClickhouseClient.query).toHaveBeenCalledTimes(1); + expect(mockClickhouseClient.query).toHaveBeenCalledWith( + expect.objectContaining({ + query: 'SELECT name, value FROM system.merge_tree_settings', + }), + ); + }); + + it('prefers shared_merge_tree_settings per key on Cloud', async () => { + jest.spyOn(metadata, 'isClickHouseCloud').mockResolvedValue(true); + mockSettingsTables({ + mergeTree: [ + { name: 'enable_block_number_column', value: '0' }, + { name: 'enable_block_offset_column', value: '1' }, + ], + sharedMergeTree: [{ name: 'enable_block_number_column', value: '1' }], + }); + + const result = await metadata.getMergeTreeSettings({ + connectionId: 'test_connection', + }); + + expect(result).toEqual( + new Map([ + ['enable_block_number_column', '1'], + ['enable_block_offset_column', '1'], + ]), + ); + expect(mockClickhouseClient.query).toHaveBeenCalledWith( + expect.objectContaining({ + query: 'SELECT name, value FROM system.shared_merge_tree_settings', + }), + ); + }); + + it('returns undefined when the shared read fails on Cloud', async () => { + jest.spyOn(metadata, 'isClickHouseCloud').mockResolvedValue(true); + (mockClickhouseClient.query as jest.Mock).mockImplementation( + async ({ query }: { query: string }) => { + if (query.includes('shared_merge_tree_settings')) { + throw new Error('timeout'); + } + return { json: async () => ({ data: [] }) }; + }, + ); + + const result = await metadata.getMergeTreeSettings({ + connectionId: 'test_connection', + }); + + expect(result).toBeUndefined(); + }); + + it('re-queries after a failure instead of caching it', async () => { + const realMetadata = new Metadata( + mockClickhouseClient, + new MetadataCache(), + ); + jest.spyOn(realMetadata, 'isClickHouseCloud').mockResolvedValue(false); + (mockClickhouseClient.query as jest.Mock) + .mockRejectedValueOnce(new Error('Not enough privileges')) + .mockResolvedValueOnce({ + json: jest.fn().mockResolvedValue({ + data: [{ name: 'enable_block_offset_column', value: '1' }], + }), + }); + + const first = await realMetadata.getMergeTreeSettings({ + connectionId: 'test_connection', + }); + const second = await realMetadata.getMergeTreeSettings({ + connectionId: 'test_connection', + }); + + expect(first).toBeUndefined(); + expect(second).toEqual(new Map([['enable_block_offset_column', '1']])); + expect(mockClickhouseClient.query).toHaveBeenCalledTimes(2); + }); + }); + describe('getSkipIndices', () => { beforeEach(() => { mockCache.getOrFetch.mockImplementation((key, queryFn) => queryFn()); @@ -2776,6 +3002,72 @@ describe('Metadata', () => { expect(scanCall.query).toContain('__TIME_FILTER__'); }); + describe('with a condition', () => { + const conditionSql = "ServiceName = 'api'"; + const buildScopedMetadata = () => { + const md = buildMetadata(); + jest.spyOn(md, 'getMapColumnTextIndexes').mockResolvedValue( + new Map([ + [ + 'LogAttributes', + { + key: { + indexName: 'idx_log_attr_keys', + mapColumn: 'LogAttributes', + }, + }, + ], + ]), + ); + jest.spyOn(md, 'getColumn').mockResolvedValue({ + name: 'LogAttributes', + type: 'Map(String, String)', + } as ColumnMeta); + return md; + }; + + it('scans only matching rows, skipping the text index and the rollup', async () => { + const md = buildScopedMetadata(); + (mockClickhouseClient.query as jest.Mock).mockResolvedValue({ + json: () => Promise.resolve({ data: [{ keysArr: ['scoped.key'] }] }), + }); + + const keys = await md.getMapKeys({ ...baseArgs, conditionSql }); + + expect(keys).toEqual(['scoped.key']); + expect(mockClickhouseClient.query).toHaveBeenCalledTimes(1); + const { query, query_params } = ( + mockClickhouseClient.query as jest.Mock + ).mock.calls[0][0]; + expect(query).not.toContain('mergeTreeTextIndex'); + expect(Object.values(query_params)).not.toContain( + 'otel_logs_key_rollup_15m', + ); + expect(query).toContain(`__TIME_FILTER__ AND (${conditionSql})`); + }); + + it('caches its keys apart from the unscoped keys', async () => { + const md = buildScopedMetadata(); + (mockClickhouseClient.query as jest.Mock) + .mockResolvedValueOnce({ + json: () => Promise.resolve({ data: [{ key: 'indexed.key' }] }), + }) + .mockResolvedValueOnce({ + json: () => + Promise.resolve({ data: [{ keysArr: ['scoped.key'] }] }), + }); + + const unscoped = await md.getMapKeys({ ...baseArgs }); + const scoped = await md.getMapKeys({ ...baseArgs, conditionSql }); + const scopedRepeat = await md.getMapKeys({ ...baseArgs, conditionSql }); + + expect(unscoped).toEqual(['indexed.key']); + expect(scoped).toEqual(['scoped.key']); + expect(scopedRepeat).toEqual(['scoped.key']); + expect(mockClickhouseClient.query).toHaveBeenCalledTimes(2); + }); + }); + it('falls back to an unbounded scan (with a warning) when timestampValueExpression is missing', async () => { const md = buildMetadata(); const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {}); @@ -3143,6 +3435,82 @@ describe('Metadata', () => { ); }); + describe('with a condition', () => { + const mapColumn = (name: string): ColumnMeta => ({ + name, + type: 'Map(LowCardinality(String), String)', + default_type: '', + default_expression: '', + comment: '', + codec_expression: '', + ttl_expression: '', + }); + const tableConnection = { + databaseName: 'otel', + tableName: 'otel_logs', + connectionId: 'conn-1', + }; + + const buildMetadata = () => { + const md = new Metadata(mockClickhouseClient, new MetadataCache()); + (mockClickhouseClient.query as jest.Mock).mockResolvedValue({ + json: () => + Promise.resolve({ + data: [ + mapColumn('LogAttributes'), + mapColumn('ResourceAttributes'), + ], + }), + }); + return { + md, + getMapKeysSpy: jest.spyOn(md, 'getMapKeys').mockResolvedValue([]), + }; + }; + + it('renders it once and scans every Map column with it', async () => { + const { md, getMapKeysSpy } = buildMetadata(); + + await md.getAllFields({ + ...tableConnection, + condition: { + where: 'api', + whereLanguage: 'lucene', + implicitColumnExpression: 'Body', + }, + }); + + expect(renderWhereExpressionStr).toHaveBeenCalledTimes(1); + expect(renderWhereExpressionStr).toHaveBeenCalledWith( + expect.objectContaining({ + condition: 'api', + language: 'lucene', + implicitColumnExpression: 'Body', + from: { databaseName: 'otel', tableName: 'otel_logs' }, + connectionId: 'conn-1', + }), + ); + expect(getMapKeysSpy).toHaveBeenCalledTimes(2); + for (const [args] of getMapKeysSpy.mock.calls) { + expect(args.conditionSql).toBe('__CONDITION__'); + } + }); + + it('scans every row when it is blank', async () => { + const { md, getMapKeysSpy } = buildMetadata(); + + await md.getAllFields({ + ...tableConnection, + condition: { where: ' ' }, + }); + + expect(renderWhereExpressionStr).not.toHaveBeenCalled(); + expect(getMapKeysSpy).toHaveBeenCalledWith( + expect.objectContaining({ conditionSql: undefined }), + ); + }); + }); + it('should extract LowCardinality(String) type for Map sub-fields when value type is LowCardinality', async () => { // Simulate: Map(LowCardinality(String), LowCardinality(String)) // This is the "working" case — sub-fields get type LowCardinality(String) @@ -3972,6 +4340,66 @@ describe('quoteResultColumnNameIfNeeded', () => { '`x-host-header`', ); }); + + it('quotes non-identifier segments of a dotted JSON path', () => { + expect(quoteResultColumnNameIfNeeded('event.@request_id')).toBe( + 'event.`@request_id`', + ); + expect(quoteResultColumnNameIfNeeded('event.my key')).toBe( + 'event.`my key`', + ); + expect(quoteResultColumnNameIfNeeded('a.b.@c')).toBe('a.b.`@c`'); + }); + + it('quotes the path but preserves a JSON type cast', () => { + // ClickHouse reports `event.foo.:String` as event.foo.:`String`. + expect(quoteResultColumnNameIfNeeded('event.foo.:`String`')).toBe( + 'event.foo.:`String`', + ); + expect(quoteResultColumnNameIfNeeded('event.@request_id.:`String`')).toBe( + 'event.`@request_id`.:`String`', + ); + expect(quoteResultColumnNameIfNeeded('event.@id.:`Decimal(10, 2)`')).toBe( + 'event.`@id`.:`Decimal(10, 2)`', + ); + expect(quoteResultColumnNameIfNeeded('event.@id.:`Int64`.null')).toBe( + 'event.`@id`.:`Int64`.null', + ); + }); + + it('quotes a key that starts with `:`', () => { + expect(quoteResultColumnNameIfNeeded('event.:k')).toBe('event.`:k`'); + }); + + it('quotes a dotted-path segment that itself contains a colon', () => { + expect(quoteResultColumnNameIfNeeded('event.k8s:pod')).toBe( + 'event.`k8s:pod`', + ); + }); + + it('quotes an all-digit JSON key (unquoted it errors in ClickHouse)', () => { + // `event.200` unquoted is parsed as tuple-element access and rejected for a + // JSON column; backticks make it a key reference. Tuple positional access + // is reported by ClickHouse as `tupleElement(...)`, never a bare `t.1`. + expect(quoteResultColumnNameIfNeeded('event.200')).toBe('event.`200`'); + expect(quoteResultColumnNameIfNeeded('tup.1')).toBe('tup.`1`'); + }); + + it('preserves a sub-object accessor', () => { + // ClickHouse reports `event.^sub` as event.^`sub`. + expect(quoteResultColumnNameIfNeeded('event.^`sub`')).toBe('event.^`sub`'); + expect(quoteResultColumnNameIfNeeded('event.@a.^`b.c`')).toBe( + 'event.`@a`.^`b.c`', + ); + }); + + it('quotes a key that starts with `^`', () => { + expect(quoteResultColumnNameIfNeeded('event.^k')).toBe('event.`^k`'); + }); + + it('leaves a malformed path with an empty segment untouched', () => { + expect(quoteResultColumnNameIfNeeded('a..b')).toBe('a..b'); + }); }); describe('parametric aggregate arguments are inlined as literals', () => { diff --git a/packages/common-utils/src/__tests__/metricNoRecordedValue.int.test.ts b/packages/common-utils/src/__tests__/metricNoRecordedValue.int.test.ts new file mode 100644 index 000000000..904213f53 --- /dev/null +++ b/packages/common-utils/src/__tests__/metricNoRecordedValue.int.test.ts @@ -0,0 +1,366 @@ +import type { ClickHouseClient } from '@clickhouse/client'; +import { createClient } from '@clickhouse/client'; + +import { ClickhouseClient as HdxClickhouseClient } from '@/clickhouse/node'; +import { Metadata, MetadataCache } from '@/core/metadata'; +import { + ChartConfigWithOptDateRange, + DisplayType, + MetricsDataType, +} from '@/types'; + +// A point with OTLP FLAG_NO_RECORDED_VALUE (Flags bit 0) carries no value. The +// collector's prometheus receiver sends one as a staleness marker when a series +// goes away or a scrape fails, and the ClickHouse exporter stores it as zeros. +describe('metric points with no recorded value (integration)', () => { + let client: ClickHouseClient; + let hdxClient: HdxClickhouseClient; + let metadata: Metadata; + + const DATABASE = 'default'; + const GAUGE_TABLE = 'no_recorded_value_gauge_int_test'; + const SUM_TABLE = 'no_recorded_value_sum_int_test'; + const HIST_TABLE = 'no_recorded_value_histogram_int_test'; + const EXP_HIST_TABLE = 'no_recorded_value_exp_histogram_int_test'; + + const NO_RECORDED_VALUE = 1; + + // Inserts are server-local strings; the CI ClickHouse runs in UTC. + const insertTs = (minute: number) => `2025-04-15 10:0${minute}:00`; + const bucket = (minute: number) => `2025-04-15T10:0${minute}:00Z`; + + // Columns of docker/otel-collector/schema/seed/00003_otel_metrics.sql that + // every metric table shares. + const COMMON_COLUMNS = ` + ResourceAttributes Map(LowCardinality(String), String), + ResourceSchemaUrl String, + ScopeName String, + ScopeVersion String, + ScopeAttributes Map(LowCardinality(String), String), + ScopeDroppedAttrCount UInt32, + ScopeSchemaUrl String, + ServiceName LowCardinality(String), + MetricName LowCardinality(String), + MetricDescription String, + MetricUnit String, + Attributes Map(LowCardinality(String), String), + StartTimeUnix DateTime, + TimeUnix DateTime, + Flags UInt32`; + const ENGINE = `ENGINE = MergeTree PARTITION BY toDate(TimeUnix) + ORDER BY (ServiceName, MetricName, toStartOfHour(TimeUnix), cityHash64(Attributes), TimeUnix)`; + + const commonFields = ( + metricName: string, + minute: number, + service: string, + flags = 0, + ) => ({ + ResourceAttributes: { 'service.name': service }, + ResourceSchemaUrl: '', + ScopeName: '', + ScopeVersion: '', + ScopeAttributes: {}, + ScopeDroppedAttrCount: 0, + ScopeSchemaUrl: '', + ServiceName: service, + MetricName: metricName, + MetricDescription: '', + MetricUnit: '', + Attributes: {}, + StartTimeUnix: insertTs(0), + TimeUnix: insertTs(minute), + Flags: flags, + }); + + const metricTables = { + gauge: GAUGE_TABLE, + sum: SUM_TABLE, + histogram: HIST_TABLE, + summary: 'unused', + 'exponential histogram': EXP_HIST_TABLE, + }; + + const runConfig = async ( + metricType: MetricsDataType, + metricName: string, + select: { aggFn: string; level?: number }, + ) => { + const result = await hdxClient.queryChartConfig({ + config: { + displayType: DisplayType.Line, + connection: 'test-connection', + metricTables, + from: { databaseName: DATABASE, tableName: '' }, + select: [ + { + ...select, + aggCondition: '', + aggConditionLanguage: 'sql', + valueExpression: 'Value', + alias: 'Value', + metricName, + metricType, + }, + ], + where: '', + whereLanguage: 'sql', + timestampValueExpression: 'TimeUnix', + dateRange: [new Date('2025-04-14'), new Date('2025-04-16')], + granularity: '1 minute', + } as ChartConfigWithOptDateRange, + metadata, + querySettings: undefined, + }); + return new Map( + (result.data as Array<{ __hdx_time_bucket: string; Value: unknown }>).map( + row => [row.__hdx_time_bucket, Number(row.Value)], + ), + ); + }; + + beforeAll(async () => { + const host = process.env.CLICKHOUSE_HOST || 'http://localhost:8123'; + const username = process.env.CLICKHOUSE_USER || 'default'; + const password = process.env.CLICKHOUSE_PASSWORD || ''; + + client = createClient({ url: host, username, password }); + hdxClient = new HdxClickhouseClient({ host, username, password }); + + await client.command({ + query: `CREATE OR REPLACE TABLE ${DATABASE}.${GAUGE_TABLE} ( + ${COMMON_COLUMNS}, + Value Float64 + ) ${ENGINE}`, + }); + await client.command({ + query: `CREATE OR REPLACE TABLE ${DATABASE}.${SUM_TABLE} ( + ${COMMON_COLUMNS}, + Value Float64, + AggregationTemporality Int32, + IsMonotonic Bool + ) ${ENGINE}`, + }); + await client.command({ + query: `CREATE OR REPLACE TABLE ${DATABASE}.${HIST_TABLE} ( + ${COMMON_COLUMNS}, + Count UInt64, + Sum Float64, + BucketCounts Array(UInt64), + ExplicitBounds Array(Float64), + Min Float64, + Max Float64, + AggregationTemporality Int32 + ) ${ENGINE}`, + }); + await client.command({ + query: `CREATE OR REPLACE TABLE ${DATABASE}.${EXP_HIST_TABLE} ( + ${COMMON_COLUMNS}, + Count UInt64, + Sum Float64, + Scale Int32, + ZeroCount UInt64, + PositiveOffset Int32, + PositiveBucketCounts Array(UInt64), + NegativeOffset Int32, + NegativeBucketCounts Array(UInt64), + Min Float64, + Max Float64, + AggregationTemporality Int32 + ) ${ENGINE}`, + }); + + // Two series report 10 every minute; svc-b goes away after minute 4 and + // leaves a marker at minute 5. + const gaugeRow = ( + minute: number, + service: string, + value = 10, + flags = 0, + ) => ({ + ...commonFields('gauge.cpu', minute, service, flags), + Value: value, + }); + await client.insert({ + table: `${DATABASE}.${GAUGE_TABLE}`, + values: [ + ...[0, 1, 2, 3, 4, 5].map(m => gaugeRow(m, 'svc-a')), + ...[0, 1, 2, 3, 4].map(m => gaugeRow(m, 'svc-b')), + gaugeRow(5, 'svc-b', 0, NO_RECORDED_VALUE), + ], + format: 'JSONEachRow', + }); + + const sumRow = + (metricName: string) => + (minute: number, value: number, flags = 0) => ({ + ...commonFields(metricName, minute, 'svc-a', flags), + Value: value, + AggregationTemporality: 2, + IsMonotonic: true, + }); + // A cumulative counter that goes up by 10 a minute. One scrape fails at + // minute 3, then the same series comes back. + const requests = sumRow('sum.requests'); + // A counter that restarts behind a marker, and the same restart without + // one. + const restart = sumRow('sum.restart'); + const restartControl = sumRow('sum.restart.control'); + await client.insert({ + table: `${DATABASE}.${SUM_TABLE}`, + values: [ + requests(0, 100), + requests(1, 110), + requests(2, 120), + requests(3, 0, NO_RECORDED_VALUE), + requests(4, 130), + restart(0, 100), + restart(1, 120), + restart(2, 0, NO_RECORDED_VALUE), + restart(3, 5), + restartControl(0, 100), + restartControl(1, 120), + restartControl(3, 5), + ], + format: 'JSONEachRow', + }); + + // Cumulative histogram: 10 observations in (0, 10] by minute 1, a marker + // at minute 2, then 5 new observations in (10, 30] by minute 3. + const histRow = (minute: number, bucketCounts: number[], flags = 0) => ({ + ...commonFields('hist.latency', minute, 'svc-a', flags), + Count: bucketCounts.reduce((a, b) => a + b, 0), + Sum: 0, + BucketCounts: bucketCounts, + ExplicitBounds: [10, 30], + Min: 0, + Max: 0, + AggregationTemporality: 2, + }); + await client.insert({ + table: `${DATABASE}.${HIST_TABLE}`, + values: [ + histRow(0, [0, 0, 0]), + histRow(1, [10, 0, 0]), + histRow(2, [0, 0, 0], NO_RECORDED_VALUE), + histRow(3, [10, 5, 0]), + ], + format: 'JSONEachRow', + }); + + // Cumulative native histogram at scale 3, where bucket 8 is (2, 2.18] and + // bucket 16 is (4, 4.36]: 10 observations in bucket 8 by minute 1, a + // marker at minute 2, then 5 new observations in bucket 16 by minute 3. + // The receiver writes a stale point with scale 0 and no buckets. + const expHistRow = (minute: number, buckets: number[], flags = 0) => ({ + ...commonFields('exphist.latency', minute, 'svc-a', flags), + Count: buckets.reduce((a, b) => a + b, 0), + Sum: 0, + Scale: flags ? 0 : 3, + ZeroCount: 0, + PositiveOffset: flags ? 0 : 8, + PositiveBucketCounts: buckets, + NegativeOffset: 0, + NegativeBucketCounts: [], + Min: 0, + Max: 0, + AggregationTemporality: 2, + }); + await client.insert({ + table: `${DATABASE}.${EXP_HIST_TABLE}`, + values: [ + expHistRow(0, []), + expHistRow(1, [10]), + expHistRow(2, [], NO_RECORDED_VALUE), + expHistRow(3, [10, 0, 0, 0, 0, 0, 0, 0, 5]), + ], + format: 'JSONEachRow', + }); + }); + + beforeEach(() => { + metadata = new Metadata(hdxClient, new MetadataCache()); + }); + + afterAll(async () => { + for (const table of [GAUGE_TABLE, SUM_TABLE, HIST_TABLE, EXP_HIST_TABLE]) { + await client.command({ + query: `DROP TABLE IF EXISTS ${DATABASE}.${table}`, + }); + } + await hdxClient.close(); + await client.close(); + }); + + it.each([ + ['min', 10], + ['avg', 10], + ['count', 1], + ])('leaves a gauge marker out of %s', async (aggFn, expected) => { + const values = await runConfig(MetricsDataType.Gauge, 'gauge.cpu', { + aggFn, + }); + expect(values.get(bucket(5))).toBe(expected); + }); + + it('keeps the gauge minute before the marker unchanged', async () => { + const counts = await runConfig(MetricsDataType.Gauge, 'gauge.cpu', { + aggFn: 'count', + }); + expect(counts.get(bucket(4))).toBe(2); + }); + + it('does not count a counter from zero after a marker', async () => { + const values = await runConfig(MetricsDataType.Sum, 'sum.requests', { + aggFn: 'increase', + }); + expect(values.get(bucket(4))).toBe(10); + expect([...values.values()].reduce((a, b) => a + b, 0)).toBe(30); + }); + + // The Sum query clamps a counter decrease to 0, so the restart minute reads + // 0 with and without the marker. + it('treats a counter restart behind a marker like any other counter reset', async () => { + const select = { aggFn: 'increase' }; + expect(await runConfig(MetricsDataType.Sum, 'sum.restart', select)).toEqual( + await runConfig(MetricsDataType.Sum, 'sum.restart.control', select), + ); + }); + + it('does not count a histogram from zero after a marker', async () => { + const counts = await runConfig(MetricsDataType.Histogram, 'hist.latency', { + aggFn: 'count', + }); + expect(counts.get(bucket(1))).toBe(10); + expect(counts.get(bucket(3))).toBe(5); + }); + + it('computes histogram quantiles from the observations after a marker only', async () => { + const p50 = await runConfig(MetricsDataType.Histogram, 'hist.latency', { + aggFn: 'quantile', + level: 0.5, + }); + expect(p50.get(bucket(3))).toBeGreaterThan(10); + expect(p50.get(bucket(3))).toBeLessThanOrEqual(30); + }); + + it('does not count an exponential histogram from zero after a marker', async () => { + const counts = await runConfig( + MetricsDataType.ExponentialHistogram, + 'exphist.latency', + { aggFn: 'count' }, + ); + expect(counts.get(bucket(1))).toBe(10); + expect(counts.get(bucket(3))).toBe(5); + }); + + it('computes exponential histogram quantiles at the series scale from the observations after a marker only', async () => { + const p50 = await runConfig( + MetricsDataType.ExponentialHistogram, + 'exphist.latency', + { aggFn: 'quantile', level: 0.5 }, + ); + expect(p50.get(bucket(3))).toBeGreaterThan(4); + expect(p50.get(bucket(3))).toBeLessThanOrEqual(2 ** (17 / 8)); + }); +}); diff --git a/packages/common-utils/src/__tests__/mine-patterns.test.ts b/packages/common-utils/src/__tests__/mine-patterns.test.ts index 4553d9244..1aa39020a 100644 --- a/packages/common-utils/src/__tests__/mine-patterns.test.ts +++ b/packages/common-utils/src/__tests__/mine-patterns.test.ts @@ -264,6 +264,66 @@ describe('minePatterns', () => { // The bucket containing the event should have count = 1 * 100 = 100 expect(nonZeroBuckets[0].count).toBe(100); }); + + it('rounds the bucket width up, so fewer buckets than requested can come back', () => { + const start = new Date('2024-01-01T00:00:00Z'); + const end = new Date('2024-01-01T01:00:00Z'); + + const result = minePatterns( + [{ body: 'event', ts: start.toISOString() }], + { + totalCount: 1, + startDate: start, + endDate: end, + trendBuckets: 24, + ...defaultCallbacks, + }, + ); + + // 3600s / 24 = 150s, rounded up to the 5 minute interval. + expect(result.trendGranularity).toBe('5 minute'); + expect(result.trendBucketStarts).toHaveLength(12); + expect(result.patterns[0].trend.map(b => b.ts)).toEqual( + result.trendBucketStarts, + ); + }); + + it('aligns the first bucket to the interval, before an unaligned start', () => { + const start = new Date('2024-01-01T00:07:00Z'); + const end = new Date('2024-01-01T01:07:00Z'); + + const result = minePatterns( + [{ body: 'event', ts: start.toISOString() }], + { + totalCount: 1, + startDate: start, + endDate: end, + trendBuckets: 4, + ...defaultCallbacks, + }, + ); + + expect(result.trendGranularity).toBe('15 minute'); + expect(result.trendBucketStarts[0]).toBe( + new Date('2024-01-01T00:00:00Z').getTime(), + ); + expect(result.trendBucketStarts[0]).toBeLessThan(start.getTime()); + }); + + it('skips trend computation when trendBuckets is 0', () => { + const result = minePatterns([makeRow('event')], { + totalCount: 1, + startDate: baseDate, + endDate, + trendBuckets: 0, + ...defaultCallbacks, + }); + + expect(result.trendGranularity).toBeUndefined(); + expect(result.trendBucketStarts).toEqual([]); + expect(result.patterns[0].trend).toEqual([]); + expect(result.patterns[0].sampleCount).toBe(1); + }); }); describe('NaN/null timestamp handling', () => { @@ -390,3 +450,56 @@ describe('minePatterns', () => { }); }); }); + +describe('minePatterns template fidelity', () => { + // Deterministic PRNG so the fuzz input is stable across runs. + function lcg(seed: number) { + let s = seed; + return () => { + s = (s * 1103515245 + 12345) % 2 ** 31; + return s / 2 ** 31; + }; + } + + function fits(template: string, body: string): boolean { + const t = template.split(/\s+/).filter(Boolean); + const b = body.split(/\s+/).filter(Boolean); + return ( + t.length === b.length && + t.every((tok, i) => tok === '<*>' || tok === b.at(i)) + ); + } + + it("reports each cluster's own template, which every member fits", () => { + const words = ['a', 'b', 'c', 'ok', 'fail', 'x1', 'y2', '42', 'retry']; + for (let seed = 1; seed <= 50; seed++) { + const rand = lcg(seed); + const rows = Array.from({ length: 300 }, () => { + const len = 2 + Math.floor(rand() * 3); + const body = Array.from( + { length: len }, + () => words[Math.floor(rand() * words.length)], + ).join(' '); + return makeRow(body); + }); + const { patterns } = minePatterns(rows, { + totalCount: rows.length, + startDate: baseDate, + endDate, + trendBuckets: 0, + maxSamples: rows.length, + ...defaultCallbacks, + }); + for (const p of patterns) { + for (const s of p.samples) { + const body = String(s.body); + if (!fits(p.pattern, body)) { + throw new Error( + `seed ${seed}: "${body}" does not fit "${p.pattern}"`, + ); + } + } + } + } + }); +}); diff --git a/packages/common-utils/src/__tests__/noisy-matcher.test.ts b/packages/common-utils/src/__tests__/noisy-matcher.test.ts new file mode 100644 index 000000000..524518f99 --- /dev/null +++ b/packages/common-utils/src/__tests__/noisy-matcher.test.ts @@ -0,0 +1,143 @@ +import { minePatterns } from '@/drain/mine-patterns'; +import { + buildNoisyBodyMatcher, + selectNoisyPatterns, +} from '@/drain/noisy-matcher'; + +function lcg(seed: number) { + let s = seed; + return () => { + s = (s * 1103515245 + 12345) % 2 ** 31; + return s / 2 ** 31; + }; +} + +const wildcards = (template: string) => + template.split(/\s+/).filter(t => t === '<*>').length; + +describe('buildNoisyBodyMatcher', () => { + const startDate = new Date('2026-01-01T00:00:00Z'); + const endDate = new Date('2026-01-01T01:00:00Z'); + + it('removes members of a noisy cluster unless a non-noisy template fits them more specifically', () => { + // Short random bodies over a small vocabulary produce same-length + // clusters that overlap, where `match` sends a member elsewhere. + const words = ['a', 'b', 'c', 'ok', 'fail', 'x1', 'y2', '42', 'retry']; + for (let seed = 1; seed <= 50; seed++) { + const rand = lcg(seed); + const bodies = Array.from({ length: 300 }, () => + Array.from( + { length: 2 + Math.floor(rand() * 3) }, + () => words[Math.floor(rand() * words.length)], + ).join(' '), + ); + const { patterns } = minePatterns( + bodies.map(body => ({ body })), + { + totalCount: bodies.length, + startDate, + endDate, + trendBuckets: 0, + maxSamples: bodies.length, + getBody: row => row.body, + getTimestamp: () => startDate.getTime(), + }, + ); + const templates = patterns.map(p => p.pattern); + for (const noisy of patterns) { + const isNoisy = buildNoisyBodyMatcher( + templates, + new Set([noisy.pattern]), + ); + const own = wildcards(noisy.pattern); + for (const { body } of noisy.samples) { + const tokens = body.split(' '); + const moreSpecific = templates.some(t => { + const tt = t.split(' '); + return ( + t !== noisy.pattern && + wildcards(t) < own && + tt.length === tokens.length && + tt.every((tok, i) => tok === '<*>' || tok === tokens.at(i)) + ); + }); + if (isNoisy(body) === moreSpecific) { + throw new Error( + `seed ${seed}: "${body}" in noisy "${noisy.pattern}" ` + + `removed=${isNoisy(body)}`, + ); + } + } + } + } + }); + + it('keeps rows of a specific cluster when a broad template is noisy', () => { + const isNoisy = buildNoisyBodyMatcher( + ['<*> <*>', 'user login'], + new Set(['<*> <*>']), + ); + expect(isNoisy('foo bar')).toBe(true); + expect(isNoisy('user login')).toBe(false); + }); + + it('keeps bodies that do not fit a noisy template', () => { + const templates = [ + 'heartbeat ok <*>', + 'GET <*> <*> ok 200', + 'GET user <*> <*> <*>', + 'user <*> logged in', + ]; + const isNoisy = buildNoisyBodyMatcher( + templates, + new Set(['heartbeat ok <*>', 'GET <*> <*> ok 200']), + ); + expect(isNoisy('heartbeat ok 999')).toBe(true); + expect(isNoisy(' GET api a ok 200 ')).toBe(true); + expect(isNoisy('user 7 logged in')).toBe(false); + expect(isNoisy('heartbeat ok')).toBe(false); + expect(isNoisy('GET user p q r')).toBe(false); + expect(isNoisy('something unseen')).toBe(false); + }); + + it('prefers the noisy template on a tie', () => { + const isNoisy = buildNoisyBodyMatcher( + ['a <*> c', 'a b <*>'], + new Set(['a b <*>']), + ); + expect(isNoisy('a b c')).toBe(true); + }); + + it('splits bodies on the miner delimiters', () => { + const isNoisy = buildNoisyBodyMatcher( + ['GET api v1 <*> 200 <*>', 'user <*> logged in'], + new Set(['GET api v1 <*> 200 <*>']), + { extraDelimiters: ['/', '.', ':'] }, + ); + expect(isNoisy('GET /api/v1/search 200 12ms')).toBe(true); + expect(isNoisy('user bob logged in')).toBe(false); + expect(isNoisy('GET /api/v1/search 500 12ms')).toBe(false); + }); +}); + +describe('selectNoisyPatterns', () => { + const select = (counts: number[], sampleSize = 100) => + selectNoisyPatterns( + counts.map((count, i) => ({ id: i, count })), + p => p.count, + sampleSize, + ).map(p => p.id); + + it('takes patterns above 5% of the sample, most frequent first', () => { + // No pattern passes 10% on its own, as in the demo logs + expect(select([6, 9, 5, 7, 4, 3, 66])).toEqual([6, 1, 3, 0]); + }); + + it('keeps patterns at exactly 5%', () => { + expect(select([5, 95])).toEqual([1]); + }); + + it('returns nothing for an empty sample', () => { + expect(select([], 0)).toEqual([]); + }); +}); diff --git a/packages/common-utils/src/__tests__/renderChartConfig.test.ts b/packages/common-utils/src/__tests__/renderChartConfig.test.ts index 0a6761b2c..c025e687e 100644 --- a/packages/common-utils/src/__tests__/renderChartConfig.test.ts +++ b/packages/common-utils/src/__tests__/renderChartConfig.test.ts @@ -927,6 +927,118 @@ describe('renderChartConfig', () => { ); }); + describe('metric points with no recorded value', () => { + const NO_RECORDED_VALUE_FILTER = 'bitAnd(Flags, 1) = 0'; + + const renderMetricSql = async ( + metricType: MetricsDataType, + select: { aggFn: 'avg' | 'count' | 'quantile'; level?: number }, + ) => { + const rendered = await renderChartConfig( + { + ...gaugeConfiguration, + select: [ + { + ...select, + aggCondition: '', + aggConditionLanguage: 'sql', + valueExpression: 'Value', + metricName: 'test.metric', + metricType, + }, + ], + } as ChartConfigWithOptDateRange, + mockMetadata, + querySettings, + ); + return parameterizedQueryToSql(rendered).replace(/\s+/g, ' '); + }; + + const cases = [ + [MetricsDataType.Gauge, { aggFn: 'avg' }], + [MetricsDataType.Sum, { aggFn: 'avg' }], + [MetricsDataType.Histogram, { aggFn: 'quantile', level: 0.5 }], + [MetricsDataType.Histogram, { aggFn: 'count' }], + [MetricsDataType.ExponentialHistogram, { aggFn: 'quantile', level: 0.5 }], + [MetricsDataType.ExponentialHistogram, { aggFn: 'count' }], + ] as const; + + it.each(cases)( + 'leaves flagged points out of the %s source scan (%o)', + async (metricType, select) => { + mockMetadata.getColumn = jest + .fn() + .mockImplementation(async ({ column }) => + column === 'Flags' ? { name: 'Flags', type: 'UInt32' } : undefined, + ); + const sql = await renderMetricSql(metricType, select); + expect(sql).toMatch( + /WHERE .*\(MetricName = 'test\.metric'\)\) AND bitAnd\(Flags, 1\) = 0/, + ); + expect(sql.split(NO_RECORDED_VALUE_FILTER)).toHaveLength(2); + }, + ); + + // Gauge and sum queries already read Flags, so only histogram tables can + // lack it. + it.each( + cases.filter( + ([metricType]) => + metricType === MetricsDataType.Histogram || + metricType === MetricsDataType.ExponentialHistogram, + ), + )( + 'reads a table without a Flags column as before (%s, %o)', + async (metricType, select) => { + const sql = await renderMetricSql(metricType, select); + expect(sql).not.toContain(NO_RECORDED_VALUE_FILTER); + }, + ); + + it('reads the table as before when the Flags lookup fails', async () => { + mockMetadata.getColumn = jest + .fn() + .mockImplementation(async ({ column }) => { + if (column === 'Flags') throw new Error('DESCRIBE failed'); + return undefined; + }); + const sql = await renderMetricSql(MetricsDataType.Gauge, { + aggFn: 'avg', + }); + expect(sql).not.toContain(NO_RECORDED_VALUE_FILTER); + }); + + it.each(['UInt8', 'Int64', 'LowCardinality(UInt32)'])( + 'leaves flagged points out when Flags is %s', + async flagsType => { + mockMetadata.getColumn = jest + .fn() + .mockImplementation(async ({ column }) => + column === 'Flags' ? { name: 'Flags', type: flagsType } : undefined, + ); + const sql = await renderMetricSql(MetricsDataType.Gauge, { + aggFn: 'avg', + }); + expect(sql).toContain(NO_RECORDED_VALUE_FILTER); + }, + ); + + it.each(['String', 'Nullable(UInt32)', 'LowCardinality(Nullable(UInt32))'])( + 'reads the table as before when Flags is %s', + async flagsType => { + mockMetadata.getColumn = jest + .fn() + .mockImplementation(async ({ column }) => + column === 'Flags' ? { name: 'Flags', type: flagsType } : undefined, + ); + const sql = await renderMetricSql(MetricsDataType.Gauge, { + aggFn: 'avg', + }); + expect(sql).not.toContain(NO_RECORDED_VALUE_FILTER); + }, + ); + }); + describe('histogram metric queries', () => { describe('quantile', () => { it('should generate a whole-range query without a time dimension', async () => { diff --git a/packages/common-utils/src/__tests__/selfTelemetry.test.ts b/packages/common-utils/src/__tests__/selfTelemetry.test.ts new file mode 100644 index 000000000..1ce0e1273 --- /dev/null +++ b/packages/common-utils/src/__tests__/selfTelemetry.test.ts @@ -0,0 +1,54 @@ +import { decideSelfTelemetry } from '@/selfTelemetry'; + +describe('decideSelfTelemetry', () => { + it('does not start without a key or OTLP headers', () => { + expect(decideSelfTelemetry({})).toEqual({ start: false }); + }); + + it('treats blank values as unset', () => { + expect( + decideSelfTelemetry({ + HYPERDX_API_KEY: ' ', + OTEL_EXPORTER_OTLP_HEADERS: '', + }), + ).toEqual({ start: false }); + }); + + it('passes a trimmed HYPERDX_API_KEY as the apiKey', () => { + expect(decideSelfTelemetry({ HYPERDX_API_KEY: ' ingest-key ' })).toEqual({ + start: true, + apiKey: 'ingest-key', + otlpHeaders: undefined, + }); + }); + + it('starts on OTLP headers alone and leaves them as they are', () => { + expect( + decideSelfTelemetry({ + OTEL_EXPORTER_OTLP_HEADERS: 'authorization=ingest-key', + }), + ).toEqual({ start: true, apiKey: undefined, otlpHeaders: undefined }); + }); + + it('appends the encoded key to OTLP headers without an authorization entry', () => { + expect( + decideSelfTelemetry({ + HYPERDX_API_KEY: 'ingest,key', + OTEL_EXPORTER_OTLP_HEADERS: ' x-scope-orgid=acme ', + }), + ).toEqual({ + start: true, + apiKey: undefined, + otlpHeaders: 'x-scope-orgid=acme,authorization=ingest%2Ckey', + }); + }); + + it('keeps an authorization entry already in the OTLP headers', () => { + expect( + decideSelfTelemetry({ + HYPERDX_API_KEY: 'ingest-key', + OTEL_EXPORTER_OTLP_HEADERS: 'x-scope-orgid=acme, Authorization =other', + }), + ).toEqual({ start: true, apiKey: 'ingest-key', otlpHeaders: undefined }); + }); +}); diff --git a/packages/common-utils/src/__tests__/spanPredicates.test.ts b/packages/common-utils/src/__tests__/spanPredicates.test.ts index e5ee7c0b9..dccfe11ba 100644 --- a/packages/common-utils/src/__tests__/spanPredicates.test.ts +++ b/packages/common-utils/src/__tests__/spanPredicates.test.ts @@ -1,5 +1,6 @@ import { errorStatusPredicateSql, + isErrorStatusCode, serverSpanKindPredicateSql, } from '@/core/spanPredicates'; @@ -11,6 +12,33 @@ describe('errorStatusPredicateSql', () => { }); }); +describe('isErrorStatusCode', () => { + it.each([ + 'Error', + 'ERROR', + 'error', + 'STATUS_CODE_ERROR', + 'status_code_error', + 'Status_Code_Error', + ])('treats %s as an error', status => { + expect(isErrorStatusCode(status)).toBe(true); + }); + + it.each([ + 'Ok', + 'OK', + 'STATUS_CODE_OK', + 'Unset', + 'STATUS_CODE_UNSET', + 'erroring', + '', + undefined, + null, + ])('does not treat %s as an error', status => { + expect(isErrorStatusCode(status)).toBe(false); + }); +}); + describe('serverSpanKindPredicateSql', () => { it('matches both short and legacy server span kinds', () => { expect(serverSpanKindPredicateSql('SpanKind')).toBe( diff --git a/packages/common-utils/src/__tests__/types.test.ts b/packages/common-utils/src/__tests__/types.test.ts index 3c0786dda..1640578a2 100644 --- a/packages/common-utils/src/__tests__/types.test.ts +++ b/packages/common-utils/src/__tests__/types.test.ts @@ -712,6 +712,36 @@ describe('DashboardFilterSchema query-expression variant', () => { }); }); +describe('DashboardFilterSchema ad hoc variant', () => { + const adhocFilter = { + id: 'f1', + type: 'ADHOC' as const, + name: 'Conditions', + sourceType: 'sql' as const, + sources: ['source-1'], + isVariableEnabled: true as const, + }; + + it('keeps the condition that narrows its suggestions', () => { + const filter = { + ...adhocFilter, + where: 'Namespace IN ($namespace)', + whereLanguage: 'sql' as const, + }; + expect(DashboardFilterSchema.parse(filter)).toEqual(filter); + }); + + it('rejects a PromQL condition language', () => { + expect( + DashboardFilterSchema.safeParse({ + ...adhocFilter, + where: 'up', + whereLanguage: 'promql', + }).success, + ).toBe(false); + }); +}); + // Preset dashboards are broadcast-only, so the preset schema extends the // query-expression variant rather than the union — a static filter is // unrepresentable rather than rejected by a refinement. @@ -921,6 +951,43 @@ describe('PromqlSourceSchema.minAutoGranularity', () => { }); }); +describe('PromqlSourceSchema.promqlBackend', () => { + const base = { + id: 'source-1', + kind: 'promql' as const, + name: 'Prometheus', + connection: 'conn-1', + from: { databaseName: 'default', tableName: 'metrics_ts' }, + timestampValueExpression: 'timestamp', + }; + const parse = (promqlBackend: unknown) => + PromqlSourceSchema.safeParse({ ...base, promqlBackend }); + + it.each(['auto', 'clickhouse-http', 'table-function'])( + 'accepts %s', + value => { + const result = parse(value); + expect(result.success).toBe(true); + if (result.success) { + expect(result.data.promqlBackend).toBe(value); + } + }, + ); + + it('accepts an absent setting', () => { + const result = parse(undefined); + expect(result.success).toBe(true); + if (result.success) { + expect(result.data.promqlBackend).toBeUndefined(); + } + }); + + it('rejects anything else', () => { + expect(parse('http').success).toBe(false); + expect(parse('').success).toBe(false); + }); +}); + describe('MetricFormulaSchema', () => { it('parses an expression-only formula', () => { const result = MetricFormulaSchema.safeParse({ diff --git a/packages/common-utils/src/core/__tests__/promqlChart.test.ts b/packages/common-utils/src/core/__tests__/promqlChart.test.ts new file mode 100644 index 000000000..67b0b669d --- /dev/null +++ b/packages/common-utils/src/core/__tests__/promqlChart.test.ts @@ -0,0 +1,512 @@ +import { + getPromqlChartQueries, + getPromqlChartRange, + PromqlChartError, + reducePromqlChartRows, + toPromqlChartResult, + toPromqlHistogramRows, + toPromqlSamples, + toPromqlTableRows, +} from '@/core/promqlChart'; +import { MAX_TABLE_ROWS } from '@/core/utils'; +import { DisplayType, PromqlReducer } from '@/types'; + +const dateRange: [Date, Date] = [ + new Date('2024-01-01T00:00:30Z'), + new Date('2024-01-01T01:00:30Z'), +]; + +const instantResult = ( + metric: Record<string, string>, + ts: number, + value: number, +) => ({ + expression: 'up', + isBucketed: false, + result: [{ metric, values: [[ts, value]] as [number, number][] }], +}); + +describe('getPromqlChartRange', () => { + it('sizes an auto granularity for a time chart and aligns the range to it', () => { + expect( + getPromqlChartRange({ + displayType: DisplayType.Line, + promqlExpression: [{ expression: 'up' }], + granularity: 'auto', + dateRange, + }), + ).toEqual({ + granularity: '1 minute', + dateRange: [ + new Date('2024-01-01T00:00:00Z'), + new Date('2024-01-01T01:01:00Z'), + ], + }); + }); + + it('sizes an auto granularity for a heatmap for finer buckets', () => { + expect( + getPromqlChartRange({ + displayType: DisplayType.Heatmap, + promqlExpression: [{ expression: 'up' }], + dateRange, + }).granularity, + ).toBe('15 second'); + }); + + it("floors an auto granularity at the source's minimum", () => { + expect( + getPromqlChartRange({ + displayType: DisplayType.Line, + promqlExpression: [{ expression: 'up' }], + dateRange, + minGranularitySeconds: 300, + }).granularity, + ).toBe('5 minute'); + }); + + it('leaves the range of a tile that only runs instant queries unaligned', () => { + expect( + getPromqlChartRange({ + displayType: DisplayType.Number, + promqlExpression: [{ expression: 'up', queryType: 'instant' }], + dateRange, + }).dateRange, + ).toEqual(dateRange); + }); + + it('aligns a time chart even when its expressions ask for instant queries', () => { + expect( + getPromqlChartRange({ + displayType: DisplayType.Line, + promqlExpression: [{ expression: 'up', queryType: 'instant' }], + granularity: '1 minute', + dateRange, + }).dateRange[0], + ).toEqual(new Date('2024-01-01T00:00:00Z')); + }); + + it('leaves the range unaligned when alignment is off', () => { + expect( + getPromqlChartRange({ + displayType: DisplayType.Line, + promqlExpression: [{ expression: 'up' }], + granularity: '5 minute', + alignDateRangeToGranularity: false, + dateRange, + }), + ).toEqual({ granularity: '5 minute', dateRange }); + }); +}); + +describe('getPromqlChartQueries', () => { + const [startSec, endSec] = dateRange.map(d => d.getTime() / 1000); + + it('runs a time chart expression as a range query on the granularity step', () => { + expect( + getPromqlChartQueries( + { + displayType: DisplayType.Line, + granularity: '5 minute', + promqlExpression: [ + { expression: 'up', queryType: 'instant' }, + { expression: 'down' }, + ], + }, + dateRange, + ).map(({ query }) => query), + ).toEqual([ + { kind: 'range', expr: 'up', startSec, endSec, stepSec: 300 }, + { kind: 'range', expr: 'down', startSec, endSec, stepSec: 300 }, + ]); + }); + + it('caps the series of an instant table query, and nothing else', () => { + const instant = (displayType: DisplayType) => + getPromqlChartQueries( + { + displayType, + promqlExpression: [{ expression: 'up', queryType: 'instant' }], + }, + dateRange, + )[0].query; + + expect(instant(DisplayType.Table)).toEqual({ + kind: 'instant', + expr: 'up', + timeSec: endSec, + limit: MAX_TABLE_ROWS, + }); + expect(instant(DisplayType.Number)).toEqual({ + kind: 'instant', + expr: 'up', + timeSec: endSec, + limit: undefined, + }); + }); + + it('expands variables and macros', () => { + expect( + getPromqlChartQueries( + { + displayType: DisplayType.Line, + granularity: '1 minute', + promqlExpression: [ + { expression: 'rate(up{job="$job"}[$__interval])' }, + ], + variables: [{ name: 'job', values: ['api'] }], + }, + dateRange, + )[0].query.expr, + ).toBe('rate(up{job="api"}[60s])'); + }); +}); + +describe('toPromqlSamples', () => { + it('reads a scalar as one unlabelled series', () => { + expect( + toPromqlSamples({ resultType: 'scalar', result: [1700000000, '2.5'] }), + ).toEqual({ + isBucketed: false, + result: [{ metric: {}, values: [[1700000000, 2.5]] }], + }); + }); + + it('rejects a string result', () => { + expect(() => + toPromqlSamples({ resultType: 'string', result: [1700000000, 'a'] }), + ).toThrow(PromqlChartError); + }); +}); + +describe('toPromqlChartResult', () => { + it('names time chart series by the legend template', () => { + const result = toPromqlChartResult( + { displayType: DisplayType.Line, legendTemplate: '{{service}}' }, + [ + { + expression: 'up', + isBucketed: true, + result: [{ metric: { service: 'api' }, values: [[1700000000, 1]] }], + }, + ], + ); + expect(result.data).toEqual([ + { + __hdx_time_bucket: '2023-11-14T22:13:20.000Z', + value: 1, + series_name: 'api', + }, + ]); + expect(result.promqlSeriesLabels).toEqual({ api: { service: 'api' } }); + }); + + it('gives a table tile a column per label', () => { + expect( + toPromqlChartResult({ displayType: DisplayType.Table }, [ + instantResult({ service: 'api' }, 1, 1), + ]).data, + ).toEqual([{ service: 'api', Value: 1 }]); + }); + + it('keys a histogram heatmap by bucket', () => { + expect( + toPromqlChartResult( + { displayType: DisplayType.Heatmap, heatmap: { mode: 'histogram' } }, + [ + { + expression: 'sum by (le) (x_bucket)', + isBucketed: true, + result: [{ metric: { le: '+Inf' }, values: [[1700000000, 4]] }], + }, + ], + ).data, + ).toEqual([ + { __hdx_time_bucket: '2023-11-14T22:13:20.000Z', le: '+Inf', value: 4 }, + ]); + }); +}); + +describe('reducePromqlChartRows', () => { + it('reduces each series, dropping series with no usable sample', () => { + expect( + reducePromqlChartRows( + { + data: [ + { series_name: 'a', value: 1 }, + { series_name: 'a', value: 3 }, + { series_name: 'b', value: NaN }, + ], + }, + PromqlReducer.Max, + ).data, + ).toEqual([{ series_name: 'a', value: 3 }]); + }); +}); + +describe('toPromqlTableRows', () => { + it('projects one row per series for an instant query, with no time column', () => { + const result = toPromqlTableRows([ + { + expression: 'up', + isBucketed: false, + result: [ + { + metric: { __name__: 'up', service: 'accounting' }, + values: [[1700000000, 1]], + }, + { + metric: { __name__: 'up', service: 'billing' }, + values: [[1700000000, 0]], + }, + ], + }, + ]); + + expect(result.data).toEqual([ + { __name__: 'up', service: 'accounting', Value: 1 }, + { __name__: 'up', service: 'billing', Value: 0 }, + ]); + expect(result.meta).toEqual([ + { name: '__name__', type: 'String' }, + { name: 'service', type: 'String' }, + { name: 'Value', type: 'Float64' }, + ]); + expect(result.rows).toBe(2); + }); + + it('projects one row per sample for a range query, with a time column first', () => { + const result = toPromqlTableRows([ + { + expression: 'up', + isBucketed: true, + result: [ + { + metric: { service: 'accounting' }, + values: [ + [1700000000, 1], + [1700000060, 2], + ], + }, + ], + }, + ]); + + expect(result.data).toEqual([ + { + Timestamp: '2023-11-14T22:13:20.000Z', + service: 'accounting', + Value: 1, + }, + { + Timestamp: '2023-11-14T22:14:20.000Z', + service: 'accounting', + Value: 2, + }, + ]); + expect(Object.keys(result.data[0])).toEqual([ + 'Timestamp', + 'service', + 'Value', + ]); + expect(result.meta[0]).toEqual({ + name: 'Timestamp', + type: 'DateTime64(3)', + }); + }); + + it('blanks a label the series does not carry, and orders __name__ first', () => { + const result = toPromqlTableRows([ + { + expression: 'up', + isBucketed: false, + result: [ + { metric: { pod: 'a', __name__: 'up' }, values: [[1, 1]] }, + { metric: { service: 'billing' }, values: [[1, 2]] }, + ], + }, + ]); + + expect(result.data).toEqual([ + { __name__: 'up', pod: 'a', service: '', Value: 1 }, + { __name__: '', pod: '', service: 'billing', Value: 2 }, + ]); + }); + + it('renames the reserved columns when a label already uses them', () => { + const result = toPromqlTableRows([ + { + expression: 'up', + isBucketed: true, + result: [ + { + metric: { Timestamp: 'noon', Value: 'high' }, + values: [[1700000000, 7]], + }, + ], + }, + ]); + + expect(result.data).toEqual([ + { + Timestamp_1: '2023-11-14T22:13:20.000Z', + Timestamp: 'noon', + Value: 'high', + Value_1: 7, + }, + ]); + expect(result.meta).toEqual([ + { name: 'Timestamp_1', type: 'DateTime64(3)' }, + { name: 'Timestamp', type: 'String' }, + { name: 'Value', type: 'String' }, + { name: 'Value_1', type: 'Float64' }, + ]); + }); + + it('caps the rows it returns', () => { + const result = toPromqlTableRows( + [ + { + expression: 'up', + isBucketed: true, + result: [ + { + metric: { service: 'accounting' }, + values: Array.from( + { length: 10 }, + (_, i) => [1700000000 + i, i] as [number, number], + ), + }, + ], + }, + ], + 3, + ); + + expect(result.data).toHaveLength(3); + expect(result.rows).toBe(3); + }); + + it('unions the labels across expressions', () => { + const result = toPromqlTableRows([ + instantResult({ service: 'accounting' }, 1, 1), + instantResult({ pod: 'a' }, 1, 2), + ]); + + expect(result.data).toEqual([ + { pod: '', service: 'accounting', Value: 1 }, + { pod: 'a', service: '', Value: 2 }, + ]); + }); + + it('returns only a value column when there are no expressions', () => { + expect(toPromqlTableRows([])).toEqual({ + data: [], + meta: [{ name: 'Value', type: 'Float64' }], + rows: 0, + }); + }); + + it('returns only a value column for an instant query that matched nothing', () => { + expect( + toPromqlTableRows([{ expression: 'up', isBucketed: false, result: [] }]), + ).toEqual({ + data: [], + meta: [{ name: 'Value', type: 'Float64' }], + rows: 0, + }); + }); + + // The columns come from the series, not the samples, so an empty range + // result still describes the table it would have filled. + it('keeps the columns of a range series that has no samples', () => { + const result = toPromqlTableRows([ + { + expression: 'up', + isBucketed: true, + result: [{ metric: { service: 'web' }, values: [] }], + }, + ]); + + expect(result.data).toEqual([]); + expect(result.rows).toBe(0); + expect(result.meta).toEqual([ + { name: 'Timestamp', type: 'DateTime64(3)' }, + { name: 'service', type: 'String' }, + { name: 'Value', type: 'Float64' }, + ]); + }); + + it('handles label keys that collide with Object.prototype members', () => { + const result = toPromqlTableRows([ + instantResult(JSON.parse('{"constructor":"a","__proto__":"b"}'), 1, 1), + instantResult({ pod: 'x' }, 1, 2), + ]); + + expect(result.meta.map(({ name }) => name)).toEqual([ + '__proto__', + 'constructor', + 'pod', + 'Value', + ]); + expect(Object.entries(result.data[0])).toEqual([ + ['__proto__', 'b'], + ['constructor', 'a'], + ['pod', ''], + ['Value', 1], + ]); + expect(Object.entries(result.data[1])).toEqual([ + ['__proto__', ''], + ['constructor', ''], + ['pod', 'x'], + ['Value', 2], + ]); + }); +}); + +describe('toPromqlHistogramRows', () => { + const bucket = (metric: Record<string, string>, value: number) => ({ + metric, + values: [[1700000000, value]] as [number, number][], + }); + const rangeResult = (...result: ReturnType<typeof bucket>[]) => ({ + expression: 'sum by (le) (rate(x_bucket[5m]))', + isBucketed: true, + result, + }); + + it('keys each sample by its le label', () => { + const result = toPromqlHistogramRows([ + rangeResult(bucket({ le: '0.5' }, 2), bucket({ le: '+Inf' }, 3)), + ]); + expect(result.data).toEqual([ + { __hdx_time_bucket: '2023-11-14T22:13:20.000Z', le: '0.5', value: 2 }, + { __hdx_time_bucket: '2023-11-14T22:13:20.000Z', le: '+Inf', value: 3 }, + ]); + expect(result.meta.map(({ name }) => name)).toEqual([ + '__hdx_time_bucket', + 'le', + 'value', + ]); + }); + + it.each<Record<string, string>>([{}, { le: '' }, { le: 'abc' }])( + 'rejects a series without a numeric le: %p', + metric => { + expect(() => + toPromqlHistogramRows([rangeResult(bucket(metric, 1))]), + ).toThrow(/need series with an "le" label/); + }, + ); + + it('rejects buckets that were not aggregated by le', () => { + expect(() => + toPromqlHistogramRows([ + rangeResult( + bucket({ le: '0.5', instance: 'a' }, 1), + bucket({ le: '0.5', instance: 'b' }, 1), + ), + ]), + ).toThrow('Several series share le="0.5"'); + }); +}); diff --git a/packages/common-utils/src/core/__tests__/promqlSelector.test.ts b/packages/common-utils/src/core/__tests__/promqlSelector.test.ts new file mode 100644 index 000000000..0a13167f4 --- /dev/null +++ b/packages/common-utils/src/core/__tests__/promqlSelector.test.ts @@ -0,0 +1,40 @@ +import { promqlSelectorMetricName } from '@/core/promqlSelector'; + +describe('promqlSelectorMetricName', () => { + it.each([ + ['up', 'up'], + [' node_cpu:rate5m{job="x"}', 'node_cpu:rate5m'], + ['{__name__="up"}', 'up'], + ['{job="x", __name__="up"}', 'up'], + ["{job=~'a|b', env!=`x`, __name__='up'}", 'up'], + [ + '{"http.server.request.duration", "http.response.status_code"="500"}', + 'http.server.request.duration', + ], + [ + '{"__name__"="system.cpu.utilization", "host.name"="web-1"}', + 'system.cpu.utilization', + ], + ['{job="x", "up"}', 'up'], + ])('reads the metric of %s', (selector, name) => { + expect(promqlSelectorMetricName(selector)).toBe(name); + }); + + it.each([ + '{job="x"}', + '{__name__=~"up|down"}', + '{job="x", __name__!="up"}', + '{job="__name__=\\"up\\""}', + `{job='a,__name__="up"'}`, + '{job=`a,__name__="up"`}', + '{__name__="a\\"b"}', + '{"__name__"=~"a.*"}', + '{"a", "b"}', + '{"__name__"="x", "y"}', + '{"a\\"b"}', + 'sum(up)', + 'up{', + ])('returns undefined for %s', selector => { + expect(promqlSelectorMetricName(selector)).toBeUndefined(); + }); +}); diff --git a/packages/common-utils/src/core/clickhouseVersion.ts b/packages/common-utils/src/core/clickhouseVersion.ts index e4d127807..f26eb3216 100644 --- a/packages/common-utils/src/core/clickhouseVersion.ts +++ b/packages/common-utils/src/core/clickhouseVersion.ts @@ -181,3 +181,16 @@ export function supportsPrometheusHttpApi( ): boolean { return isClickHouseVersionAtLeast(version, PROMETHEUS_HTTP_API_MIN); } + +/** + * First release whose Prometheus HTTP API serves `/api/v1/labels` and + * `/api/v1/label/<name>/values`. Older handlers answer both with a 400 + * ("not implemented"). + */ +const PROMETHEUS_LABELS_API_MIN: ClickHouseVersion = [26, 9, 0, 0]; + +export function supportsPrometheusLabelsApi( + version: ClickHouseVersion | undefined, +): boolean { + return isClickHouseVersionAtLeast(version, PROMETHEUS_LABELS_API_MIN); +} diff --git a/packages/common-utils/src/core/metadata.ts b/packages/common-utils/src/core/metadata.ts index 75902266d..3125e57ce 100644 --- a/packages/common-utils/src/core/metadata.ts +++ b/packages/common-utils/src/core/metadata.ts @@ -17,7 +17,11 @@ import { streamToAsyncIterator, tableExpr, } from '@/clickhouse'; -import { renderChartConfig, timeFilterExpr } from '@/core/renderChartConfig'; +import { + renderChartConfig, + renderWhereExpressionStr, + timeFilterExpr, +} from '@/core/renderChartConfig'; import { dfeJsonPathRoot } from '@/dfe/jsonPath'; import { FilterState, @@ -135,7 +139,7 @@ export const DEFAULT_METRIC_NAMES_LIMIT = 500; const escapeLikePattern = (value: string): string => value.replace(/[\\%_]/g, char => `\\${char}`); -// See https://github.com/hyperdxio/hyperdx/issues/2163. Inlining a validated +// See https://github.com/ClickHouse/ClickStack/issues/2163. Inlining a validated // integer literal avoids the `_CAST` wrapper entirely. const inlineNonNegativeInt = (value: number, label: string): string => { if (!Number.isInteger(value) || value < 0) { @@ -191,19 +195,56 @@ export const quoteIdentifierIfNeeded = (identifier: string): string => { : quoteJsonPathSegment(unquoted); }; +// A single column or JSON path segment. No quoting/grouping characters, no `.` separator. +const PLAIN_PATH_SEGMENT = /^[^`'"()[\],.]+/; + +// A JSON sub-object accessor or type cast. ClickHouse reports the operand +// backticked (j.^`a`, j.a.:`Int64`). +const OPERATOR_PATH_SEGMENT = /^[\^:]`(?:[^`]|``)*`/; + +// Split a name into `.`-separated path segments, or undefined when it isn't a +// plain JSON path (function calls, literals, empty segments). +const splitResultColumnPath = (name: string): string[] | undefined => { + const segments: string[] = []; + let rest = name; + while (true) { + const segment = + rest.match(OPERATOR_PATH_SEGMENT)?.[0] ?? + rest.match(PLAIN_PATH_SEGMENT)?.[0]; + if (segment == null) return undefined; + segments.push(segment); + rest = rest.slice(segment.length); + if (rest === '') return segments; + if (!rest.startsWith('.')) return undefined; + rest = rest.slice(1); + } +}; + +const quotePathSegment = (segment: string): string => + OPERATOR_PATH_SEGMENT.test(segment) + ? segment + : quoteIdentifierIfNeeded(segment); + /** * Quote a query result column name so it can be referenced in raw SQL. * * Most result column names do not need quoting: * - Bare identifiers (alphanumeric and underscore, starting with a letter or underscore) * - Numeric literals (e.g., `1`, `0x10`) - * - Dotted column names (e.g., `my.col`) * - Function calls (e.g., `plus(a, b)`, `arrayElement(m, 'key')`) + * + * Dotted names are JSON/nested subcolumn paths (e.g. `event.@request_id`, + * which ClickHouse reports for the select `` event.`@request_id` ``). Each + * segment is quoted on its own. JSON type casts (eg. `` .:`String` ``) and + * `` ^`sub` `` sub-object accessors are preserved. */ -export const quoteResultColumnNameIfNeeded = (name: string): string => - /^[^`'"()[\],.]+$/.test(name) && !Number.isFinite(Number(name)) - ? quoteIdentifierIfNeeded(name) - : name; +export const quoteResultColumnNameIfNeeded = (name: string): string => { + if (Number.isFinite(Number(name))) { + return name; + } + const segments = splitResultColumnPath(name); + return segments ? segments.map(quotePathSegment).join('.') : name; +}; const columnAppearsInMvSelect = (sql: string, columnName: string): boolean => { const escaped = columnName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); @@ -252,17 +293,27 @@ const renderJsonStringSubcolumn = ( }; export class MetadataCache { - private cache = new Map<string, any>(); + private cache = new Map<string, { value: any; expiresAt?: number }>(); private pendingQueries = new Map<string, Promise<any>>(); // this should be getOrUpdate... or just query to follow react query get<T>(key: string): T | undefined { - return this.cache.get(key); + const entry = this.cache.get(key); + if (entry?.expiresAt != null && Date.now() >= entry.expiresAt) { + this.cache.delete(key); + return undefined; + } + return entry?.value; } - async getOrFetch<T>(key: string, query: () => Promise<T>): Promise<T> { + /** Entries stored without `ttlMs` are kept for the life of the cache. */ + async getOrFetch<T>( + key: string, + query: () => Promise<T>, + { ttlMs }: { ttlMs?: number } = {}, + ): Promise<T> { // Check if value exists in cache - const cachedValue: T | undefined = this.cache.get(key); + const cachedValue: T | undefined = this.get(key); if (cachedValue != null) { return cachedValue; } @@ -280,7 +331,7 @@ export class MetadataCache { try { const result = await queryPromise; - this.cache.set(key, result); + this.set(key, result, ttlMs); return result; } finally { // Clean up the pending query map @@ -288,8 +339,11 @@ export class MetadataCache { } } - set<T>(key: string, value: T) { - return this.cache.set(key, value); + set<T>(key: string, value: T, ttlMs?: number) { + this.cache.set(key, { + value, + expiresAt: ttlMs == null ? undefined : Date.now() + ttlMs, + }); } // TODO: This needs to be async, and use tanstack query on frontend for cache @@ -354,6 +408,13 @@ export type SkipIndexMetadata = { const FIELD_METADATA_LOOKBACK_MS = 24 * 60 * 60 * 1000; +// The API keeps one cache for the life of the process, so without a TTL a +// column added by ALTER TABLE (such as a MATERIALIZED one) is only seen after a +// restart. #3475 +export const COLUMNS_CACHE_TTL_MS = 5 * 60 * 1000; + +const CONDITION_KEYS_CACHE_TTL_MS = 5 * 60 * 1000; + // Hour-aligned so a range-keyed cache rotates hourly instead of every call. export function defaultFieldMetadataDateRange(): [Date, Date] { const now = new Date(); @@ -620,6 +681,7 @@ export class Metadata { .then(d => d.data); return columns; }, + { ttlMs: COLUMNS_CACHE_TTL_MS }, ); } @@ -633,7 +695,7 @@ export class Metadata { connectionId: string; databaseName: string; tableName: string; - innerTableType: 'Tags' | 'Metrics' | 'Data'; + innerTableType: 'Tags' | 'Metrics' | 'Data' | 'TimeRanges'; }) { return this.cache.getOrFetch<ColumnMeta[]>( `${connectionId}.${databaseName}.${tableName}.${innerTableType}.getTimeSeriesTableColumns`, @@ -1013,6 +1075,7 @@ export class Metadata { metadataMVs, dateRange: callerDateRange, timestampValueExpression, + conditionSql, signal, }: { databaseName: string; @@ -1024,6 +1087,7 @@ export class Metadata { metadataMVs?: MetadataMaterializedViews; dateRange?: [Date, Date]; timestampValueExpression?: string; + conditionSql?: string; signal?: AbortSignal; }) { inlineNonNegativeInt(maxKeys, 'maxKeys'); @@ -1046,11 +1110,14 @@ export class Metadata { alignedDateRange && timestampValueExpression ? `${alignedDateRange[0].getTime()}.${alignedDateRange[1].getTime()}.${timestampValueExpression}` : ''; - const cacheKey = metricName + const unscopedCacheKey = metricName ? `${connectionId}.${databaseName}.${tableName}.${column}.${metricName}.${dateRangeCacheSuffix}.${maxKeys}.keys` : alignedDateRange ? `${connectionId}.${databaseName}.${tableName}.${column}.${alignedCacheSuffix}.${maxKeys}.keys` : `${connectionId}.${databaseName}.${tableName}.${column}.${dateRangeCacheSuffix}.${maxKeys}.keys`; + const cacheKey = conditionSql + ? `${unscopedCacheKey}.${objectHash(conditionSql)}.condition` + : unscopedCacheKey; const cachedKeys = this.cache.get<string[]>(cacheKey); if (cachedKeys != null) { @@ -1079,6 +1146,7 @@ export class Metadata { let rowPolicyDenied = false; // Without timestampValueExpression, partsFilter can't bound this either. #3037 if ( + !conditionSql && textIndexInfo?.key?.indexName && canQueryMergeTreeTextIndex && timestampValueExpression @@ -1126,6 +1194,7 @@ export class Metadata { ); } } else if ( + !conditionSql && textIndexInfo?.kv?.indexName && canQueryMergeTreeTextIndex && timestampValueExpression @@ -1175,7 +1244,7 @@ export class Metadata { // Rollup path: query the key rollup table filtered by ColumnIdentifier and date range. // Rollups are separate tables the source's row policy doesn't cover, so // after a policy denial only the source-table scan below is safe. - if (metadataMVs && alignedDateRange && !rowPolicyDenied) { + if (!conditionSql && metadataMVs && alignedDateRange && !rowPolicyDenied) { // Own cache key: the shipped OTel rollups only index NativeColumn, so // Map columns come back empty here and must fall through to the bounded // scan below. Caching [] under cacheKey would block that fallback. @@ -1285,6 +1354,7 @@ export class Metadata { }), ] : []), + ...(conditionSql ? [chSql`(${{ UNSAFE_RAW_SQL: conditionSql }})`] : []), ]; const where = whereConditions.length > 0 @@ -1334,7 +1404,7 @@ export class Metadata { `; } - return this.cache.getOrFetch<string[]>(cacheKey, async () => { + const fetchKeys = async () => { const keys = await this.clickhouseClient .query<'JSON'>({ query: sql.sql, @@ -1364,6 +1434,11 @@ export class Metadata { return output.filter(r => r); }); return keys; + }; + // A condition changes with variable selections; expire its entries so + // they don't pile up. + return this.cache.getOrFetch<string[]>(cacheKey, fetchKeys, { + ttlMs: conditionSql ? CONDITION_KEYS_CACHE_TTL_MS : undefined, }); } @@ -1858,9 +1933,11 @@ export class Metadata { metadataMVs, dateRange, timestampValueExpression, + condition, }: TableConnection & { dateRange?: [Date, Date]; timestampValueExpression?: string; + condition?: FieldsCondition; }) { const fields: Field[] = []; const columns = await this.getColumns({ @@ -1880,6 +1957,21 @@ export class Metadata { const mapColumns = filterColumnMetaByType(columns, [JSDataType.Map, JSDataType.JSON]) ?? []; + const conditionSql = + condition?.where.trim() && mapColumns.length > 0 + ? await renderWhereExpressionStr({ + condition: condition.where, + language: condition.whereLanguage ?? 'sql', + metadata: this, + from: { databaseName, tableName }, + implicitColumnExpression: condition.implicitColumnExpression, + bodyExpression: condition.bodyExpression, + useTextIndexForImplicitColumn: + condition.useTextIndexForImplicitColumn, + connectionId, + }) + : undefined; + await Promise.all( mapColumns.map(async column => { if (convertCHDataTypeToJSType(column.type) === JSDataType.JSON) { @@ -1912,6 +2004,7 @@ export class Metadata { metadataMVs, dateRange, timestampValueExpression, + conditionSql, }); const match = column.type.match(/Map\(.+,\s*(.+)\)/); @@ -2185,6 +2278,53 @@ export class Metadata { ); } + /** + * Reads and caches MergeTree settings per connection; on Cloud, + * system.shared_merge_tree_settings overrides system.merge_tree_settings per + * key. Returns undefined on failure so the next call retries. + */ + async getMergeTreeSettings({ + connectionId, + }: { + connectionId: string; + }): Promise<Map<string, string> | undefined> { + const readSettings = (query: string) => + this.clickhouseClient + .query<'JSON'>({ + connectionId, + query, + query_params: undefined, + clickhouse_settings: this.getClickHouseSettings(), + }) + .then(res => res.json<{ name: string; value: string }>()) + .then(json => json.data); + + return this.cache.getOrFetch( + `${connectionId}.mergeTreeSettings`, + async () => { + try { + // OSS has no shared_merge_tree_settings; querying it fails. + const isCloud = await this.isClickHouseCloud({ connectionId }); + const [mergeTreeRows, sharedMergeTreeRows] = await Promise.all([ + readSettings('SELECT name, value FROM system.merge_tree_settings'), + isCloud + ? readSettings( + 'SELECT name, value FROM system.shared_merge_tree_settings', + ) + : [], + ]); + + // Later rows win. + const rows = [...mergeTreeRows, ...sharedMergeTreeRows]; + return new Map(rows.map(row => [row.name, row.value])); + } catch (e) { + console.warn('Error fetching MergeTree settings:', e); + return undefined; + } + }, + ); + } + /** * Queries system.data_skipping_indices to retrieve skip index metadata for a table. * Results are cached using MetadataCache. @@ -3316,6 +3456,16 @@ export type TableConnection = { timestampValueExpression?: string; }; +/** A SQL or Lucene condition on the rows a table's Map keys are read from. */ +export type FieldsCondition = Pick< + BuilderChartConfig, + | 'where' + | 'whereLanguage' + | 'implicitColumnExpression' + | 'bodyExpression' + | 'useTextIndexForImplicitColumn' +>; + export type TableConnectionChoice = | { tableConnection?: never; diff --git a/packages/common-utils/src/core/promql.ts b/packages/common-utils/src/core/promql.ts index 7f070801b..122aa2338 100644 --- a/packages/common-utils/src/core/promql.ts +++ b/packages/common-utils/src/core/promql.ts @@ -107,7 +107,7 @@ export function reducePromqlSamples( * A HyperDX granularity ("5 minute") as a Prometheus step, in seconds. A * `minGranularitySeconds` floor only applies when the granularity is `auto`. */ -const promqlStepSeconds = ( +export const promqlStepSeconds = ( granularity: string | undefined, dateRange?: [Date, Date], minGranularitySeconds?: number, diff --git a/packages/common-utils/src/core/promqlChart.ts b/packages/common-utils/src/core/promqlChart.ts new file mode 100644 index 000000000..6c6829e8c --- /dev/null +++ b/packages/common-utils/src/core/promqlChart.ts @@ -0,0 +1,432 @@ +import { + displayTypeSupportsInstantQuery, + getQueriedPromqlSeries, + isRangeQuery, + parsePromqlLe, + promqlSeriesQueryType, + promqlStepSeconds, + reducePromqlSamples, +} from '@/core/promql'; +import { renderPromqlSeriesNames } from '@/core/seriesNameTemplate'; +import { + getAlignedDateRange, + getTimeChartGranularity, + HEATMAP_AUTO_GRANULARITY_BUCKETS, + MAX_TABLE_ROWS, +} from '@/core/utils'; +import { substitutePromqlChartConfigTemplates } from '@/macros'; +import { + ChartVariable, + DisplayType, + PrometheusMatrixResult, + PrometheusVectorResult, + PromqlConditionFilter, + PromqlExpressionList, + PromqlReducer, + PromqlSeries, +} from '@/types'; + +/** A query result a PromQL chart can't draw, such as a string or an unaggregated histogram. */ +export class PromqlChartError extends Error { + constructor(message: string) { + super(message); + this.name = 'PromqlChartError'; + } +} + +/** + * A PromQL chart's resolved granularity, and its date range aligned to that + * granularity's buckets when it runs a range query, so its samples land on the + * same boundaries as the timeseries charts' and stay put across refreshes. + * Time charts and heatmaps always run range queries. + */ +export function getPromqlChartRange(config: { + promqlExpression?: PromqlExpressionList; + displayType?: DisplayType; + granularity?: string; + alignDateRangeToGranularity?: boolean; + dateRange: [Date, Date]; + minGranularitySeconds?: number; +}): { granularity: string; dateRange: [Date, Date] } { + const granularity = getTimeChartGranularity( + config.granularity, + config.dateRange, + config.minGranularitySeconds, + config.displayType === DisplayType.Heatmap + ? HEATMAP_AUTO_GRANULARITY_BUCKETS + : undefined, + ); + const runsRangeQuery = + !displayTypeSupportsInstantQuery(config) || isRangeQuery(config); + return { + granularity, + dateRange: + runsRangeQuery && config.alignDateRangeToGranularity !== false + ? getAlignedDateRange(config.dateRange, granularity) + : config.dateRange, + }; +} + +export type PromqlQuery = + | { + kind: 'range'; + expr: string; + startSec: number; + endSec: number; + stepSec: number; + } + | { + kind: 'instant'; + expr: string; + timeSec: number; + /** The most series to return. */ + limit?: number; + }; + +/** + * The queries a PromQL chart sends, one per expression it plots, with its + * variables and macros expanded. Expects a resolved granularity and the date + * range from getPromqlChartRange. + */ +export function getPromqlChartQueries( + config: { + promqlExpression: PromqlExpressionList; + displayType?: DisplayType; + granularity?: string; + variables?: ChartVariable[]; + filters?: PromqlConditionFilter[]; + minGranularitySeconds?: number; + }, + dateRange: [Date, Date], +): (PromqlSeries & { query: PromqlQuery })[] { + const substituted = substitutePromqlChartConfigTemplates({ + ...config, + dateRange, + }); + const [startSec, endSec] = dateRange.map(date => date.getTime() / 1000); + const stepSec = promqlStepSeconds( + substituted.granularity, + dateRange, + substituted.minGranularitySeconds, + ); + + return getQueriedPromqlSeries(substituted).map(series => ({ + ...series, + query: + displayTypeSupportsInstantQuery(substituted) && + promqlSeriesQueryType(series) === 'instant' + ? { + kind: 'instant', + expr: series.expression, + timeSec: endSec, + // A vector is one sample per series, so capping series caps a + // table's rows exactly. Range queries go uncapped: series can be + // sparse, so no series count bounds their samples without dropping + // rows that would fit. + limit: + substituted.displayType === DisplayType.Table + ? MAX_TABLE_ROWS + : undefined, + } + : { + kind: 'range', + expr: series.expression, + startSec, + endSec, + stepSec, + }, + })); +} + +/** One series of a result: its labels, and its `[unix seconds, value]` samples. */ +type SampledSeries = { + metric: Record<string, string>; + values: [number, number][]; +}; + +/** One expression's query result, normalized across the two endpoints. */ +export type PromqlExpressionSamples = PromqlSeries & { + /** Whether the result is bucketed by time. */ + isBucketed: boolean; + result: SampledSeries[]; +}; + +/** The `data` of a Prometheus query or query_range response. */ +export type PromqlResultData = + | { resultType: 'matrix'; result: PrometheusMatrixResult[] } + | { resultType: 'vector'; result: PrometheusVectorResult[] } + | { resultType: 'scalar'; result: [number, string] } + | { resultType: 'string'; result: unknown }; + +/** A query result's series, with their samples parsed. */ +export function toPromqlSamples( + data: PromqlResultData, +): Pick<PromqlExpressionSamples, 'isBucketed' | 'result'> { + switch (data.resultType) { + case 'matrix': + return { + isBucketed: true, + result: data.result.map(({ metric, values }) => ({ + metric, + values: values.map(([ts, value]) => [ts, parseFloat(value)]), + })), + }; + case 'vector': + return { + isBucketed: false, + result: data.result.map(({ metric, value }) => ({ + metric, + values: [[value[0], parseFloat(value[1])]], + })), + }; + case 'scalar': + return { + isBucketed: false, + result: [ + { + metric: {}, + values: [[data.result[0], parseFloat(data.result[1])]], + }, + ], + }; + default: + throw new PromqlChartError( + 'A PromQL chart needs numeric samples; this expression returned a string.', + ); + } +} + +/** Chart rows, shaped like a ClickHouse response. */ +export type PromqlChartRows = { + data: Record<string, string | number>[]; + meta: { name: string; type: string }[]; + rows: number; + /** Time series only: each series' labels, by series name. */ + promqlSeriesLabels?: Record<string, Record<string, string>>; +}; + +/** + * Rows for the whole chart, named like the chart names its series. + * + * Rows carry a `__hdx_time_bucket` if the result of any expression spans time, + * otherwise no `__hdx_time_bucket` is included. Samples keep the timestamps + * Prometheus gave them. + */ +export function toPromqlChartRows( + expressions: PromqlExpressionSamples[], + legendTemplate?: string, +): PromqlChartRows { + const seriesNames = renderPromqlSeriesNames(expressions, legendTemplate); + const isBucketed = expressions.some(result => result.isBucketed); + + const data: Record<string, string | number>[] = []; + const promqlSeriesLabels = new Map<string, Record<string, string>>(); + expressions.forEach(({ result: series }, expressionIndex) => { + series.forEach(({ values, metric }, seriesIndex) => { + const seriesName = seriesNames.at(expressionIndex)?.at(seriesIndex); + if (seriesName == null) { + // Unreachable: renderPromqlSeriesNames returns one name per series. + throw new Error( + `No name rendered for series ${expressionIndex}:${seriesIndex}`, + ); + } + promqlSeriesLabels.set(seriesName, metric); + for (const [ts, value] of values) { + data.push( + isBucketed + ? { + __hdx_time_bucket: new Date(ts * 1000).toISOString(), + value, + series_name: seriesName, + } + : { value, series_name: seriesName }, + ); + } + }); + }); + + return { + data, + meta: [ + ...(isBucketed + ? [{ name: '__hdx_time_bucket', type: 'DateTime64(3)' }] + : []), + { name: 'value', type: 'Float64' }, + { name: 'series_name', type: 'String' }, + ], + rows: data.length, + promqlSeriesLabels: Object.fromEntries(promqlSeriesLabels), + }; +} + +/** `base`, or `base_N` with the lowest N that doesn't collide with a label column. */ +function uniqueColumnName(base: string, taken: Set<string>): string { + if (!taken.has(base)) return base; + let n = 1; + while (taken.has(`${base}_${n}`)) n++; + return `${base}_${n}`; +} + +/** Every label any series carries, `__name__` first and the rest alphabetical. */ +function labelColumns(expressions: PromqlExpressionSamples[]): string[] { + const keys = new Set<string>(); + for (const { result } of expressions) { + for (const { metric } of result) { + for (const key of Object.keys(metric)) keys.add(key); + } + } + const hasName = keys.delete('__name__'); + return [...(hasName ? ['__name__'] : []), ...[...keys].sort()]; +} + +/** Every sample of every series, lazily, so a capped caller stops reading early. */ +function* samples(expressions: PromqlExpressionSamples[]) { + for (const { result } of expressions) { + for (const { metric, values } of result) { + const labelValues = new Map(Object.entries(metric)); + for (const [ts, value] of values) yield { labelValues, ts, value }; + } + } +} + +/** + * Rows for a table tile: one per sample, with a column per Prometheus label, + * including __name__, plus Timestamp and Value column. Every row carries the + * same keys in the same order. + */ +export function toPromqlTableRows( + expressions: PromqlExpressionSamples[], + maxRows: number = MAX_TABLE_ROWS, +): PromqlChartRows { + const labels = labelColumns(expressions); + const taken = new Set(labels); + const timeColumn = expressions.some(({ isBucketed }) => isBucketed) + ? uniqueColumnName('Timestamp', taken) + : undefined; + if (timeColumn) taken.add(timeColumn); + const valueColumn = uniqueColumnName('Value', taken); + + // Cap the rows here, before the caller holds every sample. + const data: Record<string, string | number>[] = []; + for (const { labelValues, ts, value } of samples(expressions)) { + if (data.length >= maxRows) break; + const row: [string, string | number][] = []; + if (timeColumn) row.push([timeColumn, new Date(ts * 1000).toISOString()]); + for (const label of labels) { + row.push([label, labelValues.get(label) ?? '']); + } + row.push([valueColumn, value]); + data.push(Object.fromEntries(row)); + } + + return { + data, + meta: [ + ...(timeColumn ? [{ name: timeColumn, type: 'DateTime64(3)' }] : []), + ...labels.map(name => ({ name, type: 'String' })), + { name: valueColumn, type: 'Float64' }, + ], + rows: data.length, + }; +} + +/** + * Rows for a histogram heatmap: one per sample, grouped by the series' `le` + * bucket. Every series must be a distinct bucket (le). + */ +export function toPromqlHistogramRows( + expressions: PromqlExpressionSamples[], +): PromqlChartRows { + const seenLe = new Set<string>(); + const data: Record<string, string | number>[] = []; + for (const { result } of expressions) { + for (const { metric, values } of result) { + const le = metric.le; + if (Number.isNaN(parsePromqlLe(le))) { + throw new PromqlChartError( + 'Histogram heatmaps need series with an "le" label, e.g. sum by (le) (rate(x_bucket[$__rate_interval])).', + ); + } + if (seenLe.has(le)) { + throw new PromqlChartError( + `Several series share le="${le}". Aggregate them by bucket with sum by (le) (...).`, + ); + } + seenLe.add(le); + for (const [ts, value] of values) { + data.push({ + __hdx_time_bucket: new Date(ts * 1000).toISOString(), + le, + value, + }); + } + } + } + + return { + data, + meta: [ + { name: '__hdx_time_bucket', type: 'DateTime64(3)' }, + { name: 'le', type: 'String' }, + { name: 'value', type: 'Float64' }, + ], + rows: data.length, + }; +} + +/** A PromQL chart's rows, in the shape its display type draws. */ +export function toPromqlChartResult( + config: { + displayType?: DisplayType; + legendTemplate?: string; + heatmap?: { mode?: string }; + }, + expressions: PromqlExpressionSamples[], +): PromqlChartRows { + // Rows keyed by the series' `le` bucket, so that alias and legend templates + // don't interfere with the le label. + if (config.heatmap?.mode === 'histogram') { + return toPromqlHistogramRows(expressions); + } + return config.displayType === DisplayType.Table + ? toPromqlTableRows(expressions) + : toPromqlChartRows( + expressions, + config.legendTemplate?.trim() || undefined, + ); +} + +/** + * Aggregate samples for each series according to the specified reducer. A series + * that reduces to nothing is dropped, reading as no value rather than a zero. + */ +export function reducePromqlChartRows( + result: Pick<PromqlChartRows, 'data'>, + reducer: PromqlReducer | undefined, +): PromqlChartRows { + const samplesBySeries = new Map<string, number[]>(); + for (const row of result.data) { + const name = String(row.series_name ?? ''); + const seriesSamples = samplesBySeries.get(name); + if (seriesSamples) { + seriesSamples.push(Number(row.value)); + } else { + samplesBySeries.set(name, [Number(row.value)]); + } + } + + const data: Record<string, string | number>[] = []; + for (const [seriesName, seriesSamples] of samplesBySeries) { + const value = reducePromqlSamples(seriesSamples, reducer); + if (value != null) data.push({ series_name: seriesName, value }); + } + + return { + data, + meta: [ + { name: 'series_name', type: 'String' }, + { name: 'value', type: 'Float64' }, + ], + rows: data.length, + }; +} diff --git a/packages/common-utils/src/core/promqlSelector.ts b/packages/common-utils/src/core/promqlSelector.ts new file mode 100644 index 000000000..4384163e6 --- /dev/null +++ b/packages/common-utils/src/core/promqlSelector.ts @@ -0,0 +1,58 @@ +import { parser } from '@prometheus-io/lezer-promql'; + +type SyntaxNode = ReturnType<typeof parser.parse>['topNode']; + +/** + * The metric a series selector is limited to: `name`, `name{...}`, + * `{"name", ...}`, or `{__name__="name", ...}` (label name quoted or not). + * Undefined when the selector may match more than one metric, isn't a single + * plain selector, or doesn't parse. + */ +export function promqlSelectorMetricName(selector: string): string | undefined { + const tree = parser.parse(selector); + let parseError = false; + tree.iterate({ + enter: node => { + if (node.type.isError) parseError = true; + }, + }); + const vectorSelector = tree.topNode.firstChild; + if (parseError || vectorSelector?.name !== 'VectorSelector') return; + + const text = (node: SyntaxNode | null | undefined) => + node ? selector.slice(node.from, node.to) : undefined; + // Values with escapes would need unquoting; `null` makes the caller fall back. + const unquote = (literal: SyntaxNode | null | undefined) => { + const quoted = text(literal); + if (quoted == null || quoted.includes('\\')) return null; + return quoted.slice(1, -1); + }; + + const names: (string | null)[] = []; + const identifier = vectorSelector.getChild('Identifier'); + if (identifier) names.push(text(identifier) ?? null); + + const matchers = vectorSelector.getChild('LabelMatchers'); + for (let m = matchers?.firstChild; m; m = m.nextSibling) { + if (m.name === 'QuotedLabelName') { + names.push(unquote(m.getChild('StringLiteral'))); + continue; + } + const label = + m.name === 'UnquotedLabelMatcher' + ? text(m.getChild('LabelName')) + : m.name === 'QuotedLabelMatcher' + ? unquote(m.getChild('QuotedLabelName')?.getChild('StringLiteral')) + : undefined; + if ( + label === '__name__' && + m.getChild('MatchOp')?.firstChild?.name === 'EqlSingle' + ) { + names.push(unquote(m.getChild('StringLiteral'))); + } + } + + const unique = new Set(names); + const [name] = unique; + return unique.size === 1 && name != null ? name : undefined; +} diff --git a/packages/common-utils/src/core/renderChartConfig.ts b/packages/common-utils/src/core/renderChartConfig.ts index 5342324b5..f8a4bb50d 100644 --- a/packages/common-utils/src/core/renderChartConfig.ts +++ b/packages/common-utils/src/core/renderChartConfig.ts @@ -2,7 +2,13 @@ import isPlainObject from 'lodash/isPlainObject'; import * as SQLParser from 'node-sql-parser'; import SqlString from 'sqlstring'; -import { ChSql, chSql, concatChSql, wrapChSqlIfNotEmpty } from '@/clickhouse'; +import { + ChSql, + chSql, + concatChSql, + isCHIntegerType, + wrapChSqlIfNotEmpty, +} from '@/clickhouse'; import { stripTypeWrappers } from '@/core/eventDeltas'; import { compileFormulaAst, FormulaAst, validateFormula } from '@/core/formula'; import { @@ -1277,7 +1283,13 @@ function renderFrom({ ); } -async function renderWhereExpressionStr({ +/** + * Render a where condition as a SQL string: Lucene is serialized against the + * table's schema, and the result is rewritten to use materialized columns + * where the table has them. Used by chart rendering and by any caller that + * needs the same SQL outside a chart config. + */ +export async function renderWhereExpressionStr({ condition, language, metadata, @@ -2039,6 +2051,44 @@ async function getComputedMetricColumns( }; } +/** + * WHERE for a metric source CTE. OTLP sets bit 0 of Flags + * (FLAG_NO_RECORDED_VALUE) on a point that has no value, such as a Prometheus + * staleness marker. The ClickHouse exporter stores that point as zeros, so it + * is left out before any aggregation or delta reads it. A series that comes + * back after a marker is then compared with its last real point, so a counter + * that restarted behind the marker is clamped like any other counter reset + * (see the Sum Source CTE). The gauge and sum CTEs already read Flags, but + * HyperDX does not require it on histogram tables, and none of them need it + * to be an integer. So a table without an integer Flags column (or a failed + * column lookup) is read as before. Nullable is excluded too: + * `bitAnd(NULL, 1) = 0` is NULL and would drop the row. + */ +async function renderMetricWhere( + chartConfig: BuilderChartConfigWithOptDateRangeEx, + metadata: Metadata, +): Promise<ChSql> { + const where = await renderWhere(chartConfig, metadata); + let hasFlags = false; + try { + const flags = await metadata.getColumn({ + databaseName: chartConfig.from.databaseName, + tableName: chartConfig.from.tableName, + column: 'Flags', + connectionId: chartConfig.connection, + }); + hasFlags = + flags != null && + isCHIntegerType(flags.type) && + !flags.type.includes('Nullable('); + } catch (e) { + console.warn('Failed to look up the Flags column of a metric table', e); + } + return hasFlags + ? concatChSql(' AND ', where, chSql`bitAnd(Flags, 1) = 0`) + : where; +} + async function translateMetricChartConfig( chartConfig: BuilderChartConfigWithOptDateRangeEx, metadata: Metadata, @@ -2098,7 +2148,7 @@ async function translateMetricChartConfig( minGranularitySeconds: chartConfig.minGranularitySeconds, }); - const where = await renderWhere( + const where = await renderMetricWhere( { ...chartConfig, from: { @@ -2204,7 +2254,7 @@ async function translateMetricChartConfig( // Render the where clause to limit data selection on the source CTE but also search forward/back one // bucket window to ensure that there is enough data to compute a reasonable value on the ends of the // series. - const where = await renderWhere( + const where = await renderMetricWhere( { ...chartConfig, from: { @@ -2500,7 +2550,7 @@ async function translateMetricChartConfig( minGranularitySeconds: cteChartConfig.minGranularitySeconds, }) : undefined; - const where = await renderWhere(cteChartConfig, metadata); + const where = await renderMetricWhere(cteChartConfig, metadata); // Time bucket grouping is being handled separately, so make sure to ignore the granularity // logic for histograms specifically. diff --git a/packages/common-utils/src/core/searchChartConfig.ts b/packages/common-utils/src/core/searchChartConfig.ts index 37144db8a..066c0f976 100644 --- a/packages/common-utils/src/core/searchChartConfig.ts +++ b/packages/common-utils/src/core/searchChartConfig.ts @@ -14,6 +14,18 @@ import { TSource, } from '@/types'; +/** + * The source's `tableFilterExpression` as a SQL filter, or `[]` when it has + * none. Log sources are the only kind that carries the field. Every path + * that queries a source's rows should apply this so they all see the same + * row set (see `buildSearchChartConfig`). + */ +export function getSourceTableFilters(source: TSource): Filter[] { + return isLogSource(source) && source.tableFilterExpression + ? [{ type: 'sql', condition: source.tableFilterExpression }] + : []; +} + /** * Return type for `buildSearchChartConfig`. * @@ -131,10 +143,7 @@ export function buildSearchChartConfig( // For hard isolation, configure a ClickHouse ROW POLICY at the DB level // instead. Existing values are still honored here for backward // compatibility; new sources should not set the field. - const tableFilter: Filter[] = - isLogSource(source) && source.tableFilterExpression != null - ? [{ type: 'sql', condition: source.tableFilterExpression }] - : []; + const tableFilter = getSourceTableFilters(source); const userFilters: Filter[] = input.filters ?? []; const mergedFilters: Filter[] = [...tableFilter, ...userFilters]; diff --git a/packages/common-utils/src/core/spanPredicates.ts b/packages/common-utils/src/core/spanPredicates.ts index e2d37549e..2889e0a21 100644 --- a/packages/common-utils/src/core/spanPredicates.ts +++ b/packages/common-utils/src/core/spanPredicates.ts @@ -1,15 +1,30 @@ +/** + * Span status values that mean the span errored, lowercased. + * Short OTel status ('Error'/'ERROR') and the legacy collector form + * ('STATUS_CODE_ERROR'). Log severity text is a different vocabulary + * ('fatal', 'crit', and friends, never 'status_code_error'), so log callers + * keep their own predicate rather than reusing this list. + */ +const ERROR_STATUS_CODES = ['error', 'status_code_error'] as const; + /** * The single definition of an errored span, as a SQL predicate over a span - * status-code expression. Matches both the short OTel status ('Error'/'ERROR') - * and the legacy collector form ('STATUS_CODE_ERROR'), which some collectors - * write instead. - * - * Span status only. Log severity text is a different vocabulary (its error - * values are 'fatal', 'crit' and friends, never 'status_code_error'), so log - * callers keep their own predicate rather than reusing this one. + * status-code expression. */ export function errorStatusPredicateSql(statusCodeExpression: string): string { - return `lower(${statusCodeExpression}) IN ('error', 'status_code_error')`; + const quoted = ERROR_STATUS_CODES.map(code => `'${code}'`).join(', '); + return `lower(${statusCodeExpression}) IN (${quoted})`; +} + +/** Same match as {@link errorStatusPredicateSql}, for rows already fetched. */ +export function isErrorStatusCode( + statusCode: string | null | undefined, +): boolean { + if (!statusCode) { + return false; + } + const normalized = statusCode.toLowerCase(); + return ERROR_STATUS_CODES.some(code => code === normalized); } /** Server (request entry-point) spans, in both short and legacy enum forms. */ diff --git a/packages/common-utils/src/core/utils.ts b/packages/common-utils/src/core/utils.ts index df92f006a..7c9307845 100644 --- a/packages/common-utils/src/core/utils.ts +++ b/packages/common-utils/src/core/utils.ts @@ -11,7 +11,11 @@ import { isQueryExpressionFilter, isStaticListFilter, } from '@/filters'; -import { isBuilderSavedChartConfig, isRawSqlSavedChartConfig } from '@/guards'; +import { + isBuilderSavedChartConfig, + isPromqlSavedChartConfig, + isRawSqlSavedChartConfig, +} from '@/guards'; import { MacroExpansionError, MalformedMacroArgsError } from '@/macroErrors'; import { getSourceDependentMacrosUsed, @@ -51,6 +55,32 @@ import { SkipIndexMetadata, TableMetadata } from './metadata'; /** The default maximum number of buckets setting when determining a bucket duration for 'auto' granularity */ export const DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS = 60; +/** The bucket count a time chart sizes an 'auto' granularity for. */ +export const TIME_CHART_AUTO_GRANULARITY_BUCKETS = 80; + +/** The bucket count a heatmap sizes an 'auto' granularity for. */ +export const HEATMAP_AUTO_GRANULARITY_BUCKETS = 245; + +/** + * The most rows a table tile shows. Arbitrary limit to prevent OOM crashes for + * very large result sets. Most result sets should be paginated anyway. + */ +export const MAX_TABLE_ROWS = 10_000; + +/** Code-point limit for row-lookup string hashes (matches ClickHouse leftUTF8). */ +export const LEFT_UTF8_HASH_CODE_POINTS = 1000; + +/** First `limit` Unicode code points, matching ClickHouse leftUTF8(s, limit). */ +export function leftUtf8Prefix(value: string, limit: number): string { + let prefix = ''; + let n = 0; + for (const ch of value) { + if (n++ === limit) break; + prefix += ch; + } + return prefix; +} + /** * Returns the quantile level of a percentile shorthand aggFn (`p95` -> 0.95), * or undefined for any other aggFn. @@ -597,6 +627,22 @@ export function hashCode(str: string) { return hash; } +/** A chart's granularity, with 'auto' (or none) resolved for its date range. */ +export function getTimeChartGranularity<T extends string>( + granularity: T | 'auto' | undefined, + dateRange: [Date, Date], + minGranularitySeconds?: number, + maxBuckets = TIME_CHART_AUTO_GRANULARITY_BUCKETS, +) { + return granularity === 'auto' || granularity == null + ? convertDateRangeToGranularityString( + dateRange, + maxBuckets, + minGranularitySeconds, + ) + : granularity; +} + export function convertDateRangeToGranularityString( dateRange: [Date, Date], maxNumBuckets: number = DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS, @@ -1675,6 +1721,22 @@ export function displayTypeSupportsPromQLAlerts( return displayType ? false : false; } +/** + * Whether the alert checker can evaluate an alert on a tile with this config. + * Shared by every save path so alerts are never stored where they cannot run. + */ +export function savedChartConfigSupportsAlerts( + config: SavedChartConfig, +): boolean { + if (isPromqlSavedChartConfig(config)) { + return displayTypeSupportsPromQLAlerts(config.displayType); + } + if (isRawSqlSavedChartConfig(config)) { + return displayTypeSupportsRawSqlAlerts(config.displayType); + } + return displayTypeSupportsBuilderAlerts(config.displayType); +} + /** Expand the chart's macros, returning failures instead of throwing. */ function resolveRawSqlMacros( chartConfig: RawSqlChartConfig, diff --git a/packages/common-utils/src/dfe/jsonPath.ts b/packages/common-utils/src/dfe/jsonPath.ts index 8060c029f..9efa3925a 100644 --- a/packages/common-utils/src/dfe/jsonPath.ts +++ b/packages/common-utils/src/dfe/jsonPath.ts @@ -327,12 +327,14 @@ function isAlreadyCoerced(sql: string, index: number): boolean { } // A comparison operator and a number literal, on either side of the path. +/* eslint-disable security/detect-unsafe-regex -- no quantified group repeats, so matching is linear */ const NUMBER_AFTER = /^\s*(?:[!<>=]=|<>|[<>=])\s*-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?![\w.])/; const NUMBER_BEFORE = /(?<![\w.])-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\s*(?:[!<>=]=|<>|[<>=])\s*$/; const BETWEEN_NUMBERS = /^\s+(?:NOT\s+)?BETWEEN\s+-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\s+AND\s+-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?![\w.])/i; +/* eslint-enable security/detect-unsafe-regex */ /** * True when the path at `index` needs the numeric coercion: it is compared diff --git a/packages/common-utils/src/drain/drain.ts b/packages/common-utils/src/drain/drain.ts index ead441df6..661cf89e1 100644 --- a/packages/common-utils/src/drain/drain.ts +++ b/packages/common-utils/src/drain/drain.ts @@ -65,6 +65,11 @@ export class Drain { return total; } + /** Look up a cluster by ID without touching LRU order. */ + getCluster(id: number): LogCluster | undefined { + return this.clusterPeek(id); + } + private clusterPeek(id: number): LogCluster | undefined { if (this.unlimitedStore) return this.unlimitedStore.get(id); return this.limitedStore!.peek(id); diff --git a/packages/common-utils/src/drain/index.ts b/packages/common-utils/src/drain/index.ts index f735377f0..7615f1109 100644 --- a/packages/common-utils/src/drain/index.ts +++ b/packages/common-utils/src/drain/index.ts @@ -17,5 +17,6 @@ export { minePatterns, } from './mine-patterns'; export { Node } from './node'; +export { buildNoisyBodyMatcher, selectNoisyPatterns } from './noisy-matcher'; export type { AddLogMessageResult, ExtractedParameter } from './template-miner'; export { TemplateMiner } from './template-miner'; diff --git a/packages/common-utils/src/drain/mine-patterns.ts b/packages/common-utils/src/drain/mine-patterns.ts index 83a33397e..c33fa7dc1 100644 --- a/packages/common-utils/src/drain/mine-patterns.ts +++ b/packages/common-utils/src/drain/mine-patterns.ts @@ -1,5 +1,6 @@ import { convertDateRangeToGranularityString, + Granularity, timeBucketByGranularity, toStartOfInterval, } from '@/core/utils'; @@ -13,8 +14,12 @@ import { TemplateMiner } from './template-miner'; /** Number of random rows to sample for pattern learning. */ export const DENOISE_SAMPLE_SIZE = 10_000; -/** Patterns matching more than this fraction of sampled events are "noisy". */ -export const DENOISE_NOISE_THRESHOLD = 0.1; +/** + * Patterns matching more than this fraction of sampled events are "noisy". + * Drain splits one logical pattern across clusters (by token count and + * first token), so dominant patterns often sit well below 10% each. + */ +export const DENOISE_NOISE_THRESHOLD = 0.05; // ─── Body normalization ────────────────────────────────────────────────────── @@ -53,6 +58,18 @@ export interface PatternGroup<TRow = Record<string, unknown>> { export interface MinePatternResult<TRow = Record<string, unknown>> { patterns: PatternGroup<TRow>[]; sampleMultiplier: number; + /** + * Bucket width actually used for `trend`. Rounded up to a standard + * interval, so there can be fewer buckets than requested. Undefined when + * trends are disabled (trendBuckets <= 0). + */ + trendGranularity?: Granularity; + /** + * Start of every trend bucket in ms. Buckets align to the interval, so the + * first one can start before `startDate` and the last can end after + * `endDate`. + */ + trendBucketStarts: number[]; } export interface MinePatternOptions<TRow extends Record<string, unknown>> { @@ -62,7 +79,7 @@ export interface MinePatternOptions<TRow extends Record<string, unknown>> { startDate: Date; /** End of the query time range. */ endDate: Date; - /** Max number of trend time buckets to generate. Default: 24. */ + /** Max number of trend time buckets to generate. Default: 24. 0 disables trends. */ trendBuckets?: number; /** Max number of sample rows to keep per pattern. Default: 5. */ maxSamples?: number; @@ -102,26 +119,29 @@ export function minePatterns<TRow extends Record<string, unknown>>( getTimestamp, } = options; + const granularity = + trendBuckets > 0 + ? convertDateRangeToGranularityString([startDate, endDate], trendBuckets) + : undefined; + const allBuckets = granularity + ? timeBucketByGranularity(startDate, endDate, granularity).map(d => + d.getTime(), + ) + : []; + if (rows.length === 0) { - return { patterns: [], sampleMultiplier: 1 }; + return { + patterns: [], + sampleMultiplier: 1, + trendGranularity: granularity, + trendBucketStarts: allBuckets, + }; } // ── Set up Drain miner ── const drainConfig = new TemplateMinerConfig(); const miner = new TemplateMiner(drainConfig); - // ── Compute time buckets using shared helpers ── - const granularity = convertDateRangeToGranularityString( - [startDate, endDate], - trendBuckets, - ); - const allBucketDates = timeBucketByGranularity( - startDate, - endDate, - granularity, - ); - const allBuckets = allBucketDates.map(d => d.getTime()); - // ── Process each row through Drain ── const clustered: Array<{ clusterId: number; @@ -147,7 +167,9 @@ export function minePatterns<TRow extends Record<string, unknown>>( >(); for (const { clusterId, row, bodyText, tsMs } of clustered) { - const bucket = toStartOfInterval(new Date(tsMs), granularity).getTime(); + const bucket = granularity + ? toStartOfInterval(new Date(tsMs), granularity).getTime() + : 0; const existing = groups.get(clusterId); if (existing) { if (existing.samples.length < maxSamples) { @@ -158,12 +180,15 @@ export function minePatterns<TRow extends Record<string, unknown>>( (existing.bucketCounts.get(bucket) ?? 0) + 1, ); } else { - const match = miner.match(bodyText, 'fallback'); + // Read the template from the row's own cluster: re-matching the body can + // land on a different same-length cluster whose template other members + // of this one do not fit. + const cluster = miner.drain.getCluster(clusterId); const bucketCounts = new Map<number, number>(); bucketCounts.set(bucket, 1); groups.set(clusterId, { samples: [row], - template: match?.getTemplate() ?? bodyText, + template: cluster?.getTemplate() ?? bodyText, bucketCounts, }); } @@ -200,5 +225,10 @@ export function minePatterns<TRow extends Record<string, unknown>>( patterns.sort((a, b) => b.estimatedCount - a.estimatedCount); - return { patterns, sampleMultiplier }; + return { + patterns, + sampleMultiplier, + trendGranularity: granularity, + trendBucketStarts: allBuckets, + }; } diff --git a/packages/common-utils/src/drain/noisy-matcher.ts b/packages/common-utils/src/drain/noisy-matcher.ts new file mode 100644 index 000000000..45ef61f5c --- /dev/null +++ b/packages/common-utils/src/drain/noisy-matcher.ts @@ -0,0 +1,77 @@ +import { DENOISE_NOISE_THRESHOLD, flattenBody } from './mine-patterns'; + +const PATTERN_WILDCARD = '<*>'; + +/** + * The patterns to remove when denoising: those matching more than + * `DENOISE_NOISE_THRESHOLD` of the sample, most frequent first. + */ +export function selectNoisyPatterns<T>( + patterns: T[], + getCount: (pattern: T) => number, + sampleSize: number, +): T[] { + if (sampleSize <= 0) return []; + return patterns + .filter(p => getCount(p) / sampleSize > DENOISE_NOISE_THRESHOLD) + .sort((a, b) => getCount(b) - getCount(a)); +} + +/** + * Return a predicate that is true when the most specific template a body + * fits (fewest <*>) is noisy. Fitting means same token count, same literal + * tokens, any token at each <*>. Taking the most specific fit keeps rows of + * a rare `user login` cluster when a broad `<*> <*>` cluster is noisy; ties + * go to the noisy template. Re-running Drain's `match` instead can land a + * member on a different same-length cluster than the one it was counted in. + * + * `extraDelimiters` must be the ones the miner was configured with, so the + * body splits into the same tokens the templates were built from. + */ +export function buildNoisyBodyMatcher( + templates: string[], + noisyTemplates: Set<string>, + options?: { extraDelimiters?: string[] }, +): (body: string) => boolean { + const extraDelimiters = options?.extraDelimiters ?? []; + const candidates = templates.map(template => { + const tokens = tokenize(template, []); + return { + tokens, + wildcards: tokens.filter(t => t === PATTERN_WILDCARD).length, + noisy: noisyTemplates.has(template), + }; + }); + return body => { + const tokens = tokenize(flattenBody(body), extraDelimiters); + let best: (typeof candidates)[number] | undefined; + for (const c of candidates) { + const fits = + c.tokens.length === tokens.length && + c.tokens.every( + (tok, i) => tok === PATTERN_WILDCARD || tok === tokens.at(i), + ); + if (!fits) continue; + if ( + best == null || + c.wildcards < best.wildcards || + (c.wildcards === best.wildcards && c.noisy) + ) { + best = c; + } + } + return best?.noisy ?? false; + }; +} + +// Mirrors Drain's tokenizer: delimiters become spaces, then split(/\s+/). +// Templates are already space-joined tokens, and splitting one on a +// delimiter would break up `<*>`. +function tokenize(text: string, extraDelimiters: string[]): string[] { + let c = text.trim(); + for (const delimiter of extraDelimiters) { + c = c.split(delimiter).join(' '); + } + c = c.trim(); + return c === '' ? [] : c.split(/\s+/); +} diff --git a/packages/common-utils/src/filters.ts b/packages/common-utils/src/filters.ts index 78e3d09c6..3412e16d8 100644 --- a/packages/common-utils/src/filters.ts +++ b/packages/common-utils/src/filters.ts @@ -778,7 +778,8 @@ export type DashboardFilterQueryIssue = { /** * Validate the `where` clause of each dashboard filter *definition* (the query - * that scopes which values populate the filter's dropdown). + * that scopes which values populate the filter's dropdown, or which keys and + * values an ad hoc filter suggests). * * Useful at import time, where no values query is actually run: a filter whose * `where` clause is malformed would otherwise only surface as a failed query @@ -803,7 +804,9 @@ export function validateDashboardFilterQueries( for (const filter of filters) { // Only ClickHouse-queried filters carry a values query to validate. - if (!isQueryExpressionFilter(filter)) continue; + // A PromQL ad hoc filter may store a `where`, but nothing reads it. + const isSqlAdhoc = isAdhocFilter(filter) && filter.sourceType === 'sql'; + if (!isQueryExpressionFilter(filter) && !isSqlAdhoc) continue; const where = filter.where ?? ''; if (!where.trim()) continue; const language = filter.whereLanguage ?? 'sql'; diff --git a/packages/common-utils/src/selfTelemetry.ts b/packages/common-utils/src/selfTelemetry.ts new file mode 100644 index 000000000..8d043d9dd --- /dev/null +++ b/packages/common-utils/src/selfTelemetry.ts @@ -0,0 +1,65 @@ +/** + * Shared by the API's self-telemetry preload and the Next.js server + * instrumentation, which both wrap the ClickStack SDK's init(). + * + * It has no imports so the API preload can load it before init() without + * loading anything the SDK would then fail to instrument. + */ + +/** + * The variables the decision reads. The index signature lets `process.env` + * through TypeScript's check for objects that share no named property. + */ +export type SelfTelemetryEnv = { + HYPERDX_API_KEY?: string; + OTEL_EXPORTER_OTLP_HEADERS?: string; + [name: string]: string | undefined; +}; + +export type SelfTelemetryDecision = + | { start: false } + | { + start: true; + /** The init() apiKey option. Unset when the key went into otlpHeaders. */ + apiKey: string | undefined; + /** + * The OTEL_EXPORTER_OTLP_HEADERS value to write before init(), when the + * key had to be appended to it. Unset when the variable stays as it is. + */ + otlpHeaders: string | undefined; + }; + +const hasAuthorization = (headers: string) => + headers + .split(',') + .some( + entry => entry.split('=')[0].trim().toLowerCase() === 'authorization', + ); + +export function decideSelfTelemetry( + env: SelfTelemetryEnv, +): SelfTelemetryDecision { + const apiKey = env.HYPERDX_API_KEY?.trim() || undefined; + const otlpHeaders = env.OTEL_EXPORTER_OTLP_HEADERS?.trim() || undefined; + + // The old HyperDX SDK skipped init without a key or OTLP headers, and the + // ClickStack SDK always starts. Without this gate, deployments that never + // exported HyperDX's own telemetry would start sending it to localhost:4318, + // which is the bundled collector in the all-in-one image. + if (!apiKey && !otlpHeaders) { + return { start: false }; + } + + // The SDK ignores apiKey when OTEL_EXPORTER_OTLP_HEADERS is set. The old SDK + // appended the key to those headers, so do the same unless they already + // carry one, in which case the SDK warns that the key is ignored. + if (apiKey && otlpHeaders && !hasAuthorization(otlpHeaders)) { + return { + start: true, + apiKey: undefined, + otlpHeaders: `${otlpHeaders},authorization=${encodeURIComponent(apiKey)}`, + }; + } + + return { start: true, apiKey, otlpHeaders: undefined }; +} diff --git a/packages/common-utils/src/types.ts b/packages/common-utils/src/types.ts index b8c3bc152..dba9c7854 100644 --- a/packages/common-utils/src/types.ts +++ b/packages/common-utils/src/types.ts @@ -259,9 +259,9 @@ export const RootValueExpressionSchema = z * number-tile colors, reference lines, and threshold rules. * * Tokens map to CSS variables in - * `packages/app/src/theme/themes/<theme>/_tokens.scss`: - * chart-{hue} -> --color-chart-{hue} (10 hues, unified across themes) - * chart-success/warning/error -> --color-chart-{success|warning|error} (semantic; unified across brands) + * `packages/app/src/theme/_tokens.scss`: + * chart-{hue} -> --color-chart-{hue} (10 hues) + * chart-success/warning/error -> --color-chart-{success|warning|error} (semantic) * * `chart-info` is a render-time CSS variable (defined in the shared * `chart-semantic-tokens` SCSS mixin) but is intentionally *not* in the @@ -269,7 +269,7 @@ export const RootValueExpressionSchema = z * brand-primary (e.g. info-level log series, `getChartColorInfo()`). * * Storing tokens (not hex) lets user choices reflow correctly across - * themes and color modes; see notes/repo-conventions/hyperdx/tile-styling.md. + * color modes; see notes/repo-conventions/hyperdx/tile-styling.md. * * Lives in common-utils because the schema is shared between the app * and the API; the theme-aware CSS resolver (`getColorFromCSSToken`) @@ -693,6 +693,7 @@ export const WebhookSchema = z.object({ 'Internal API returns masked value (<origin>/****). PUT accepts the masked form to preserve the stored URL.', ), description: z.string().optional(), + titleEmoji: z.boolean().optional(), queryParams: z .record(z.string(), z.string()) .optional() @@ -2422,6 +2423,12 @@ export const AdhocDashboardFilterSchema = dashboardFilterBaseSchema sourceType: AdhocFilterSourceTypeSchema, /** IDs of the sources whose keys and values the filter offers, all of `sourceType`. */ sources: z.array(z.string().min(1)).min(1), + /** + * Narrows the rows keys and values are suggested from, as a queried filter's + * `where` narrows its dropdown. SQL sources only, and never broadcast. + */ + where: QueryExpressionDashboardFilterSchema.shape.where, + whereLanguage: QueryExpressionDashboardFilterSchema.shape.whereLanguage, /** * Sources the conditions are broadcast to, all of `sourceType`. Undefined / * empty means the filter's `sources`. @@ -2826,6 +2833,22 @@ export const MinAutoGranularitySchema = z.preprocess( SQLIntervalSchema.optional(), ); +/** + * How a PromQL source on a ClickHouse connection is evaluated: through the + * Prometheus HTTP API (`clickhouse-http`, which needs ClickHouse 26.6+ with the + * `prometheus_api_v1` handler configured) or through the `prometheusQuery` + * table functions (`table-function`). `auto`, which is also what an unset + * value means, probes the server on first use and prefers the HTTP API. A + * connection that is itself a Prometheus endpoint ignores it. + */ +export const PROMQL_SOURCE_BACKENDS = [ + 'auto', + 'clickhouse-http', + 'table-function', +] as const; +export const PromqlSourceBackendSchema = z.enum(PROMQL_SOURCE_BACKENDS); +export type PromqlSourceBackend = z.infer<typeof PromqlSourceBackendSchema>; + // Metric source form schema export const MetricSourceSchema = BaseSourceSchema.extend({ kind: z.literal(SourceKind.Metric), @@ -2853,6 +2876,7 @@ export const MetricSourceSchema = BaseSourceSchema.extend({ export const PromqlSourceSchema = BaseSourceSchema.extend({ kind: z.literal(SourceKind.Promql), minAutoGranularity: MinAutoGranularitySchema, + promqlBackend: PromqlSourceBackendSchema.optional(), }); // Union of all source form schemas for validation @@ -3392,6 +3416,56 @@ export type RotateAccessKeyApiResponse = z.infer< typeof RotateAccessKeyApiResponseSchema >; +// Team-owned bearer keys for external API v2 and MCP. They outlive the admin +// who created them; the plaintext `key` is only returned on create. +export const OrgApiKeyExpirySchema = z.enum(['30d', '1y', 'never']); +export type OrgApiKeyExpiry = z.infer<typeof OrgApiKeyExpirySchema>; + +const OrgApiKeyDescriptionSchema = z.string().trim().min(1).max(100); + +export const CreateOrgApiKeyRequestSchema = z.object({ + description: OrgApiKeyDescriptionSchema, + expiry: OrgApiKeyExpirySchema, +}); +export type CreateOrgApiKeyRequest = z.infer< + typeof CreateOrgApiKeyRequestSchema +>; + +export const UpdateOrgApiKeyRequestSchema = z.object({ + description: OrgApiKeyDescriptionSchema, +}); +export type UpdateOrgApiKeyRequest = z.infer< + typeof UpdateOrgApiKeyRequestSchema +>; + +export const OrgApiKeyApiResponseSchema = z.object({ + id: z.string(), + description: z.string(), + createdAt: z.string(), + expiresAt: z.string().nullable(), + lastUsedAt: z.string().nullable(), + // Null once the creating user has been removed from the team. + createdBy: z + .object({ + id: z.string(), + name: z.string().optional(), + email: z.string(), + }) + .nullable(), +}); +export type OrgApiKeyApiResponse = z.infer<typeof OrgApiKeyApiResponseSchema>; + +export const OrgApiKeysApiResponseSchema = z.object({ + data: z.array(OrgApiKeyApiResponseSchema), +}); +export type OrgApiKeysApiResponse = z.infer<typeof OrgApiKeysApiResponseSchema>; + +export const CreateOrgApiKeyApiResponseSchema = + OrgApiKeyApiResponseSchema.extend({ key: z.string() }); +export type CreateOrgApiKeyApiResponse = z.infer< + typeof CreateOrgApiKeyApiResponseSchema +>; + // IaC (Terraform) export // // Shared so `GET /iac/import-manifest` and the generators in diff --git a/packages/hdx-eval/src/__tests__/api.test.ts b/packages/hdx-eval/src/__tests__/api.test.ts new file mode 100644 index 000000000..573659f5a --- /dev/null +++ b/packages/hdx-eval/src/__tests__/api.test.ts @@ -0,0 +1,105 @@ +import { HyperdxApiClient } from '@/hyperdx/api'; + +const originalFetch = global.fetch; + +function mockMcpContent(text: string): void { + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + status: 200, + text: async () => + JSON.stringify({ + jsonrpc: '2.0', + result: { + content: [{ type: 'text', text }], + }, + }), + }) as unknown as typeof fetch; +} + +afterEach(() => { + global.fetch = originalFetch; +}); + +describe('HyperdxApiClient', () => { + it('reports invalid MCP content as a failed tile query', async () => { + mockMcpContent('not valid JSON'); + + const result = await new HyperdxApiClient( + 'http://localhost', + ).queryTileWithEvidence({ + accessKey: 'test-key', + dashboardId: 'dashboard-id', + tileId: 'tile-id', + startTime: '2026-01-01T00:00:00.000Z', + endTime: '2026-01-01T01:00:00.000Z', + }); + + expect(result.success).toBe(false); + expect(result.hasData).toBe(false); + expect(result.error).toMatch(/^Invalid MCP content:/); + }); + + it('treats empty MCP content as a successful query with no data', async () => { + mockMcpContent(' \n'); + + const result = await new HyperdxApiClient( + 'http://localhost', + ).queryTileWithEvidence({ + accessKey: 'test-key', + dashboardId: 'dashboard-id', + tileId: 'tile-id', + startTime: '2026-01-01T00:00:00.000Z', + endTime: '2026-01-01T01:00:00.000Z', + }); + + expect(result).toEqual({ success: true, hasData: false }); + }); + + it('extracts rows and groups from valid MCP content', async () => { + mockMcpContent( + JSON.stringify({ + result: [ + { ServiceName: 'api', value: 1 }, + { ServiceName: 'worker', value: 2 }, + ], + }), + ); + + const result = await new HyperdxApiClient( + 'http://localhost', + ).queryTileWithEvidence({ + accessKey: 'test-key', + dashboardId: 'dashboard-id', + tileId: 'tile-id', + startTime: '2026-01-01T00:00:00.000Z', + endTime: '2026-01-01T01:00:00.000Z', + }); + + expect(result).toEqual({ + success: true, + hasData: true, + rowCount: 2, + groupCount: 2, + sampleRows: [ + { ServiceName: 'api', value: 1 }, + { ServiceName: 'worker', value: 2 }, + ], + }); + }); + + it('treats valid MCP content without a result as no data', async () => { + mockMcpContent('{}'); + + const result = await new HyperdxApiClient( + 'http://localhost', + ).queryTileWithEvidence({ + accessKey: 'test-key', + dashboardId: 'dashboard-id', + tileId: 'tile-id', + startTime: '2026-01-01T00:00:00.000Z', + endTime: '2026-01-01T01:00:00.000Z', + }); + + expect(result).toEqual({ success: true, hasData: false }); + }); +}); diff --git a/packages/hdx-eval/src/hyperdx/api.ts b/packages/hdx-eval/src/hyperdx/api.ts index b83d148bf..610c8eb83 100644 --- a/packages/hdx-eval/src/hyperdx/api.ts +++ b/packages/hdx-eval/src/hyperdx/api.ts @@ -325,6 +325,10 @@ export class HyperdxApiClient { }; } + if (!content.text.trim()) { + return { success: true, hasData: false }; + } + try { const inner = JSON.parse(content.text); const result = inner.result; @@ -368,8 +372,14 @@ export class HyperdxApiClient { groupCount, sampleRows: rows.slice(0, 5), }; - } catch { - return { success: true, hasData: content.text.length > 0 }; + } catch (error) { + return { + success: false, + hasData: false, + error: `Invalid MCP content: ${ + error instanceof Error ? error.message : String(error) + }`.slice(0, 300), + }; } } } diff --git a/packages/otel-collector/CHANGELOG.md b/packages/otel-collector/CHANGELOG.md index 8caf4ca89..9c722aed8 100644 --- a/packages/otel-collector/CHANGELOG.md +++ b/packages/otel-collector/CHANGELOG.md @@ -1,5 +1,54 @@ # @hyperdx/otel-collector +## 2.45.0 + +## 2.44.0 + +### Patch Changes + +- 5b0d07441: fix: let browsers cache the collector's CORS preflights for 10 minutes + + The OTLP receiver now answers preflights with `Access-Control-Max-Age: 600`. + Without it, browsers cached a preflight for only 5 seconds, which is how often + the browser SDK exports, so about half of its requests were preflights. + +- 8384fe675: perf: compress the seed schemas with `ZSTD(3)` instead of `ZSTD(1)` + + The seed schemas pinned `ZSTD(1)` on almost every column. Level 3 gives a better + compression ratio at a small insert-time CPU cost, without affecting reads, and + it is the default codec of ClickHouse since 26.9. It is pinned explicitly so + that older ClickHouse versions, whose default is `LZ4`, get it too. `Delta` + codecs drop their byte-size argument, which ClickHouse infers from the column + type. Only newly created tables are affected; existing tables keep their codecs. + +- 702181002: feat: session ID columns, `session.id` from `rum.sessionId`, severity text + + The `hyperdx_sessions` seed adds materialized `rum.sessionId` and `session.id` + columns with skip indexes, and the `otel_logs` seed adds a materialized + `session.id` column with a skip index, so session queries no longer read the + attribute maps. Only newly created tables get them; existing tables need an + `ALTER TABLE ... ADD COLUMN` to benefit. + + Spans, logs and session replay events from older `@hyperdx/browser` SDKs, which + carry the session id only in the `rum.sessionId` resource attribute, now also + get the OpenTelemetry `session.id` attribute. An existing `session.id` is never + overwritten and `rum.sessionId` is kept. If you override pipeline `processors:` + lists in `CUSTOM_OTELCOL_CONFIG_FILE`, add `transform/session_id` to keep this. + + Logs that carry a severity number but no severity text, such as those from the + new browser SDK, now get the matching level text (`info`, `error`, ...) instead + of an empty level. Severity text set by the producer is never overwritten. + +## 2.43.1 + +### Patch Changes + +- 7a9fe57d3: Disable Multipath TCP in the collector image by setting `GODEBUG=multipathtcp=0` + at startup, mitigating CVE-2026-98432. Go 1.24+ opens MPTCP listeners by + default. Any other `GODEBUG` settings you pass are kept, and an explicit + `multipathtcp=` value is left as is. This also applies to the all-in-one image. + Patching the host kernel is still the actual fix. + ## 2.43.0 ## 2.42.0 diff --git a/packages/otel-collector/README.md b/packages/otel-collector/README.md index d200712cc..ff0077ded 100644 --- a/packages/otel-collector/README.md +++ b/packages/otel-collector/README.md @@ -433,13 +433,13 @@ processors: service: pipelines: traces: - processors: [memory_limiter/custom, batch] + processors: [memory_limiter/custom, transform/session_id, batch] metrics: processors: [memory_limiter/custom, batch] logs/out-default: - processors: [memory_limiter/custom, transform, batch] + processors: [memory_limiter/custom, transform, transform/session_id, batch] logs/out-rrweb: - processors: [memory_limiter/custom, batch] + processors: [memory_limiter/custom, transform/session_id, batch] ``` After restart, the collector instantiates `memory_limiter/custom` (and not @@ -466,9 +466,9 @@ processors: service: pipelines: traces: - processors: [memory_limiter, batch/lowlatency] + processors: [memory_limiter, transform/session_id, batch/lowlatency] logs/out-default: - processors: [memory_limiter, transform, batch/lowlatency] + processors: [memory_limiter, transform, transform/session_id, batch/lowlatency] ``` Notes: @@ -606,7 +606,7 @@ codebase without needing to publish a Go module tag on every change. ```yaml receivers: - gomod: - github.com/hyperdxio/hyperdx/packages/otel-collector/receiver/myreceiver + github.com/ClickHouse/ClickStack/packages/otel-collector/receiver/myreceiver v0.0.0 path: ./receiver/myreceiver ``` diff --git a/packages/otel-collector/cmd/migrate/main.go b/packages/otel-collector/cmd/migrate/main.go index fc4e514ed..b67e37309 100644 --- a/packages/otel-collector/cmd/migrate/main.go +++ b/packages/otel-collector/cmd/migrate/main.go @@ -718,6 +718,37 @@ func removeCompatTracesSchema(tempDir string) error { return nil } +// swapSessionsSchemaForCompat replaces the full-text-search sessions schema +// with the compatibility variant (bloom_filter session id indexes) in the +// processed temp directory. It removes 00004_hyperdx_sessions.sql and renames +// 00004_hyperdx_sessions_compat.sql to take its place, so goose runs the +// compat schema instead. +func swapSessionsSchemaForCompat(tempDir string) error { + fullTextPath := filepath.Join(tempDir, "00004_hyperdx_sessions.sql") + compatPath := filepath.Join(tempDir, "00004_hyperdx_sessions_compat.sql") + + if err := os.Remove(fullTextPath); err != nil && !os.IsNotExist(err) { + return fmt.Errorf("failed to remove full text sessions schema: %w", err) + } + + if err := os.Rename(compatPath, fullTextPath); err != nil { + return fmt.Errorf("failed to rename compat sessions schema: %w", err) + } + + return nil +} + +// removeCompatSessionsSchema removes the compat sessions schema file from the +// temp directory when full text search is supported, so goose doesn't run both +// schemas. +func removeCompatSessionsSchema(tempDir string) error { + compatPath := filepath.Join(tempDir, "00004_hyperdx_sessions_compat.sql") + if err := os.Remove(compatPath); err != nil && !os.IsNotExist(err) { + return fmt.Errorf("failed to remove compat sessions schema: %w", err) + } + return nil +} + // listSQLFiles lists all SQL files in a directory for logging purposes func listSQLFiles(dir string) ([]string, error) { entries, err := os.ReadDir(dir) @@ -796,7 +827,7 @@ func main() { } defer os.RemoveAll(tempDir) - // Select the appropriate logs and traces schemas based on ClickHouse version + // Select the appropriate logs, traces and sessions schemas based on ClickHouse version if supportsFullTextSearch(chMajor, chMinor) { if err := removeCompatLogsSchema(tempDir); err != nil { log.Fatalf("Failed to remove compat logs schema: %v", err) @@ -804,14 +835,20 @@ func main() { if err := removeCompatTracesSchema(tempDir); err != nil { log.Fatalf("Failed to remove compat traces schema: %v", err) } + if err := removeCompatSessionsSchema(tempDir); err != nil { + log.Fatalf("Failed to remove compat sessions schema: %v", err) + } } else { - log.Printf("ClickHouse %d.%d < 26.2, falling back to compatibility logs and traces schemas", chMajor, chMinor) + log.Printf("ClickHouse %d.%d < 26.2, falling back to compatibility logs, traces and sessions schemas", chMajor, chMinor) if err := swapLogsSchemaForCompat(tempDir); err != nil { log.Fatalf("Failed to swap logs schema: %v", err) } if err := swapTracesSchemaForCompat(tempDir); err != nil { log.Fatalf("Failed to swap traces schema: %v", err) } + if err := swapSessionsSchemaForCompat(tempDir); err != nil { + log.Fatalf("Failed to swap sessions schema: %v", err) + } } if os.Getenv("ENABLE_PROMQL") != "true" { diff --git a/packages/otel-collector/cmd/migrate/main_test.go b/packages/otel-collector/cmd/migrate/main_test.go index ba066ef6b..84e42687d 100644 --- a/packages/otel-collector/cmd/migrate/main_test.go +++ b/packages/otel-collector/cmd/migrate/main_test.go @@ -1133,6 +1133,81 @@ func TestRemoveCompatLogsSchema(t *testing.T) { }) } +func TestSwapSessionsSchemaForCompat(t *testing.T) { + t.Run("swaps compat over full text", func(t *testing.T) { + dir := t.TempDir() + fullTextPath := filepath.Join(dir, "00004_hyperdx_sessions.sql") + compatPath := filepath.Join(dir, "00004_hyperdx_sessions_compat.sql") + + if err := os.WriteFile(fullTextPath, []byte("FULL TEXT SCHEMA"), 0644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(compatPath, []byte("COMPAT SCHEMA"), 0644); err != nil { + t.Fatal(err) + } + + if err := swapSessionsSchemaForCompat(dir); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + got, err := os.ReadFile(fullTextPath) + if err != nil { + t.Fatalf("failed to read swapped file: %v", err) + } + if string(got) != "COMPAT SCHEMA" { + t.Errorf("expected compat content, got %q", string(got)) + } + if _, err := os.Stat(compatPath); !os.IsNotExist(err) { + t.Error("compat file should have been renamed away") + } + }) + + t.Run("errors when compat file is missing", func(t *testing.T) { + dir := t.TempDir() + fullTextPath := filepath.Join(dir, "00004_hyperdx_sessions.sql") + + if err := os.WriteFile(fullTextPath, []byte("FULL TEXT SCHEMA"), 0644); err != nil { + t.Fatal(err) + } + + if err := swapSessionsSchemaForCompat(dir); err == nil { + t.Fatal("expected error when compat file is missing") + } + }) +} + +func TestRemoveCompatSessionsSchema(t *testing.T) { + t.Run("removes compat file and preserves others", func(t *testing.T) { + dir := t.TempDir() + fullTextPath := filepath.Join(dir, "00004_hyperdx_sessions.sql") + compatPath := filepath.Join(dir, "00004_hyperdx_sessions_compat.sql") + + if err := os.WriteFile(fullTextPath, []byte("FULL TEXT"), 0644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(compatPath, []byte("COMPAT"), 0644); err != nil { + t.Fatal(err) + } + + if err := removeCompatSessionsSchema(dir); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if _, err := os.Stat(compatPath); !os.IsNotExist(err) { + t.Error("compat file should have been removed") + } + if _, err := os.Stat(fullTextPath); err != nil { + t.Error("full text file should still exist") + } + }) + + t.Run("no error when compat file does not exist", func(t *testing.T) { + if err := removeCompatSessionsSchema(t.TempDir()); err != nil { + t.Fatalf("unexpected error: %v", err) + } + }) +} + // --------------------------------------------------------------------------- // processSchemaDir // --------------------------------------------------------------------------- diff --git a/packages/otel-collector/go.mod b/packages/otel-collector/go.mod index a1c3f7632..1fdd12632 100644 --- a/packages/otel-collector/go.mod +++ b/packages/otel-collector/go.mod @@ -1,4 +1,4 @@ -module github.com/hyperdxio/hyperdx/packages/otel-collector +module github.com/ClickHouse/ClickStack/packages/otel-collector go 1.25 diff --git a/packages/otel-collector/package.json b/packages/otel-collector/package.json index 39e20800f..5c6387e5c 100644 --- a/packages/otel-collector/package.json +++ b/packages/otel-collector/package.json @@ -1,7 +1,7 @@ { "name": "@hyperdx/otel-collector", "description": "HyperDX OpenTelemetry Collector configuration and Docker image", - "version": "2.43.0", + "version": "2.45.0", "license": "MIT", "private": true } diff --git a/scripts/ci/ratchet-baseline.json b/scripts/ci/ratchet-baseline.json index 9ddfa04a3..b1712c506 100644 --- a/scripts/ci/ratchet-baseline.json +++ b/scripts/ci/ratchet-baseline.json @@ -2,7 +2,7 @@ "api": { "as-any": 88, "ts-ignore": 0, - "eslint-disable": 56, + "eslint-disable": 55, "@source": 0 }, "app": { @@ -20,7 +20,7 @@ "common-utils": { "as-any": 116, "ts-ignore": 0, - "eslint-disable": 39, + "eslint-disable": 40, "@source": 0 }, "hdx-eval": { diff --git a/security/accepted.yaml b/security/accepted.yaml index 747a3d762..33efd20b9 100644 --- a/security/accepted.yaml +++ b/security/accepted.yaml @@ -40,13 +40,11 @@ accepted: Test-only. Joins __dirname with literal relative paths to read repo files under test. No user input reaches it. - - rule: javascript.lang.security.audit.unsafe-formatstring.unsafe-formatstring - path: packages/app/src/theme/index.ts + - rule: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal + path: packages/app/src/dfe/__tests__/dfeTheme.test.ts reason: >- - The interpolated value is a theme NAME that has just failed validation - against our own closed enum, written to console.warn. It is not - attacker-controlled and the sink is a dev-console log, not a format string - passed to util.format. + Test-only. Joins __dirname with literal relative paths to read repo files + under test. No user input reaches it. - rule: package_managers.renovate.renovate-missing-minimum-release-age.renovate-missing-minimum-release-age path: renovate.json diff --git a/security/overrides.yaml b/security/overrides.yaml index 2d1daad37..e96022c3b 100644 --- a/security/overrides.yaml +++ b/security/overrides.yaml @@ -41,30 +41,6 @@ # run `yarn install` to re-resolve, done. overrides: - - package: systeminformation - # Narrowest range that clears every open advisory against this package. - # ^ rather than >= so a major bump cannot arrive silently. - range: '^5.33.16' - advisory: GHSA-5xpp-75jx-m839 - severity: high - vector: >- - The API instantiates @opentelemetry/host-metrics in - packages/api/src/index.ts, which calls systeminformation's networkStats() - on the metrics interval, and networkStats() calls the vulnerable - networkInterfaces() (systeminformation/lib/network.js:1302,1518). That - function interpolates an interfaces(5) source-directive path - (GHSA-5xpp-75jx-m839) and a NetworkManager connection profile name - (GHSA-hvx9-hwr7-wjj9) into a shell command, so anyone who can write host - network configuration gets code execution inside the API process rather - than only on the host. The sink is provably live; the source is - host-local, not remote. It is the only pin we carry with a live sink. The - floor is 5.33.16 for GHSA-3f7j-7jwc-fxfj, a Windows-only PowerShell - injection in services(). host-metrics requires only - systeminformation/lib/network (build/src/stats/si.js:22), so services() is - never loaded, and the image runs Linux. No live vector, taken because the - vulnerable copy ships and the fix is one generated line. - upstream: https://github.com/hyperdxio/hyperdx/issues/3306 - added: 2026-08-26 - package: follow-redirects range: '^1.16.2' advisory: GHSA-mrwp-f3q8-3g9p @@ -101,32 +77,6 @@ overrides: stay inflating. upstream: none added: 2026-10-28 - - package: mongoose - # 6.13.12 clears all five mongoose advisories osv-scanner reports, and - # stays on the 6.x line packages/api/package.json declares. - range: '^6.13.12' - advisory: GHSA-8332-j7wj-wjw4 - severity: high - vector: >- - Any console user whose role is not viewer can stop every Mongo query in - the shared API process, for every org, until it restarts. PATCH - /dashboards/:id (routers/api/dashboards.ts:217) and PATCH - /saved-search/:id (routers/api/savedSearch.ts:84) pass req.body on to - findOneAndUpdate (controllers/dashboard.ts:248, - controllers/savedSearch.ts:63). zod-express-middleware's validateRequest - checks the body but does not replace it, and both schemas are non-strict - z.objects, so a top-level key such as `toString` arrives intact. Before - 6.13.12, Query._mergeUpdate's utils.mergeClone recurses into the inherited - Object.prototype.toString, and a body of {"toString":{"call":1}} sets - Object.prototype.toString.call to 1. Every later cast then throws. POST - /dashboards does the same through the Mixed savedDateRange path with a - "savedDateRange.toString.call" key. Neither route needs the engine - principal, and a user may create the dashboard it then patches. The other - four advisories (GHSA-pcrw-h46h-c93h, GHSA-gg4r-jv3p-qx3c, - GHSA-6972-9mcm-vhwj, GHSA-wr5m-5jph-8m96) have no vector here and clear - with the same pin. - upstream: none - added: 2026-11-11 # Example of the shape (keep commented - an empty register is the goal state): # # - package: some-parser diff --git a/smoke-tests/otel-collector/README.md b/smoke-tests/otel-collector/README.md index f15974094..b9d2f13f7 100644 --- a/smoke-tests/otel-collector/README.md +++ b/smoke-tests/otel-collector/README.md @@ -45,7 +45,7 @@ The suite exercises all three OTLP signal types against the standalone collector config (`docker/otel-collector/config.standalone.yaml`): - **logs** - severity inference/normalization, JSON auto-parse, JSON-schema - exporter, compat-schema (old ClickHouse), custom-pipeline processor swap, and + exporter, custom-pipeline processor swap, and the `routing/logs` connector that splits rrweb (session replay) logs into `hyperdx_sessions` from ordinary logs in `otel_logs`. - **traces** - the `traces` pipeline into `otel_traces` (`traces.bats`). diff --git a/smoke-tests/otel-collector/ch-compat-config.d/remove-prometheus-api.xml b/smoke-tests/otel-collector/ch-compat-config.d/remove-prometheus-api.xml deleted file mode 100644 index 1213f1ee1..000000000 --- a/smoke-tests/otel-collector/ch-compat-config.d/remove-prometheus-api.xml +++ /dev/null @@ -1,7 +0,0 @@ -<!-- The shared local config.xml declares a `prometheus_api_v1` HTTP handler, - which only exists in ClickHouse >= 26.2. On the older compat server the - unknown handler type aborts the whole HTTP listener (port 8123 never - opens, so the healthcheck fails), so drop the block here. --> -<clickhouse> - <http_handlers remove="1"/> -</clickhouse> diff --git a/smoke-tests/otel-collector/compat-schema.bats b/smoke-tests/otel-collector/compat-schema.bats deleted file mode 100644 index 57055aab5..000000000 --- a/smoke-tests/otel-collector/compat-schema.bats +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bats - -load 'test_helpers/utilities.bash' -load 'test_helpers/assertions.bash' - -@test "compat schema should use bloom_filter indexes instead of full text on ClickHouse < 26.2" { - assert_test_data_compat "data/compat-schema/index-types" -} - -@test "compat schema should insert and query log data correctly" { - emit_otel_data "http://localhost:24318" "data/compat-schema/basic-insert" - sleep 3 - assert_test_data_compat "data/compat-schema/basic-insert" -} diff --git a/smoke-tests/otel-collector/custom-pipeline-config.yaml b/smoke-tests/otel-collector/custom-pipeline-config.yaml index 85e847445..d42f695dc 100644 --- a/smoke-tests/otel-collector/custom-pipeline-config.yaml +++ b/smoke-tests/otel-collector/custom-pipeline-config.yaml @@ -18,10 +18,18 @@ processors: service: pipelines: traces: - processors: [memory_limiter/custom, batch/lowlatency] + processors: + [memory_limiter/custom, transform/session_id, batch/lowlatency] metrics: processors: [memory_limiter/custom, batch/lowlatency] logs/out-default: - processors: [memory_limiter/custom, transform, batch/lowlatency] + processors: + [ + memory_limiter/custom, + transform, + transform/session_id, + batch/lowlatency, + ] logs/out-rrweb: - processors: [memory_limiter/custom, batch/lowlatency] + processors: + [memory_limiter/custom, transform/session_id, batch/lowlatency] diff --git a/smoke-tests/otel-collector/data/compat-schema/basic-insert/assert_query.sql b/smoke-tests/otel-collector/data/compat-schema/basic-insert/assert_query.sql deleted file mode 100644 index 051bd0f5e..000000000 --- a/smoke-tests/otel-collector/data/compat-schema/basic-insert/assert_query.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT SeverityText, SeverityNumber, Body FROM otel_logs WHERE ResourceAttributes['suite-id'] = 'compat-schema' AND ResourceAttributes['test-id'] = 'basic-insert' ORDER BY (toStartOfFiveMinutes(Timestamp), Timestamp) FORMAT CSV diff --git a/smoke-tests/otel-collector/data/compat-schema/basic-insert/expected.snap b/smoke-tests/otel-collector/data/compat-schema/basic-insert/expected.snap deleted file mode 100644 index cf778479d..000000000 --- a/smoke-tests/otel-collector/data/compat-schema/basic-insert/expected.snap +++ /dev/null @@ -1,2 +0,0 @@ -"info",9,"compat schema test log entry" -"warn",13,"compat schema warning message" \ No newline at end of file diff --git a/smoke-tests/otel-collector/data/compat-schema/basic-insert/input.json b/smoke-tests/otel-collector/data/compat-schema/basic-insert/input.json deleted file mode 100644 index 1b14b19bf..000000000 --- a/smoke-tests/otel-collector/data/compat-schema/basic-insert/input.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "resourceLogs": [ - { - "resource": { - "attributes": [ - { - "key": "suite-id", - "value": { - "stringValue": "compat-schema" - } - }, - { - "key": "test-id", - "value": { - "stringValue": "basic-insert" - } - }, - { - "key": "service.name", - "value": { - "stringValue": "compat-test-service" - } - } - ] - }, - "scopeLogs": [ - { - "scope": {}, - "logRecords": [ - { - "timeUnixNano": "1901999580000000000", - "severityNumber": 9, - "severityText": "INFO", - "body": { - "stringValue": "compat schema test log entry" - } - }, - { - "timeUnixNano": "1901999580000000001", - "severityNumber": 13, - "severityText": "WARN", - "body": { - "stringValue": "compat schema warning message" - } - } - ] - } - ] - } - ] -} diff --git a/smoke-tests/otel-collector/data/compat-schema/index-types/assert_query.sql b/smoke-tests/otel-collector/data/compat-schema/index-types/assert_query.sql deleted file mode 100644 index 4e7b27b1d..000000000 --- a/smoke-tests/otel-collector/data/compat-schema/index-types/assert_query.sql +++ /dev/null @@ -1,7 +0,0 @@ -SELECT name, type -FROM system.data_skipping_indices -WHERE database = 'default' - AND table = 'otel_logs' - AND name IN ('idx_trace_id', 'idx_lower_body') -ORDER BY name -FORMAT CSV diff --git a/smoke-tests/otel-collector/data/compat-schema/index-types/expected.snap b/smoke-tests/otel-collector/data/compat-schema/index-types/expected.snap deleted file mode 100644 index 99cc5b5ed..000000000 --- a/smoke-tests/otel-collector/data/compat-schema/index-types/expected.snap +++ /dev/null @@ -1,2 +0,0 @@ -"idx_lower_body","tokenbf_v1" -"idx_trace_id","bloom_filter" \ No newline at end of file diff --git a/smoke-tests/otel-collector/data/session-id-copy/logs/assert_query.sql b/smoke-tests/otel-collector/data/session-id-copy/logs/assert_query.sql new file mode 100644 index 000000000..4c329e7db --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/logs/assert_query.sql @@ -0,0 +1,10 @@ +SELECT + Body, + mapContains(LogAttributes, 'session.id'), + LogAttributes['session.id'], + `__hdx_materialized_session.id` +FROM otel_logs +WHERE ResourceAttributes['suite-id'] = 'session-id-copy' + AND ResourceAttributes['test-id'] = 'logs' +ORDER BY Timestamp +FORMAT CSV diff --git a/smoke-tests/otel-collector/data/session-id-copy/logs/expected.snap b/smoke-tests/otel-collector/data/session-id-copy/logs/expected.snap new file mode 100644 index 000000000..e33879879 --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/logs/expected.snap @@ -0,0 +1,5 @@ +"copied from rum.sessionId",1,"abc","abc" +"own session.id wins",1,"app1","app1" +"{""session.id"":""body1"",""message"":""json body session.id wins""}",1,"body1","body1" +"new sdk session.id unchanged",1,"xyz","xyz" +"no session",0,"","" \ No newline at end of file diff --git a/smoke-tests/otel-collector/data/session-id-copy/logs/input.json b/smoke-tests/otel-collector/data/session-id-copy/logs/input.json new file mode 100644 index 000000000..2495b40a5 --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/logs/input.json @@ -0,0 +1,118 @@ +{ + "resourceLogs": [ + { + "resource": { + "attributes": [ + { + "key": "suite-id", + "value": { + "stringValue": "session-id-copy" + } + }, + { + "key": "test-id", + "value": { + "stringValue": "logs" + } + }, + { + "key": "service.name", + "value": { + "stringValue": "old-browser-sdk" + } + }, + { + "key": "rum.sessionId", + "value": { + "stringValue": "abc" + } + } + ] + }, + "scopeLogs": [ + { + "scope": {}, + "logRecords": [ + { + "timeUnixNano": "1901999590000000000", + "body": { + "stringValue": "copied from rum.sessionId" + } + }, + { + "timeUnixNano": "1901999590000000001", + "body": { + "stringValue": "own session.id wins" + }, + "attributes": [ + { + "key": "session.id", + "value": { + "stringValue": "app1" + } + } + ] + }, + { + "timeUnixNano": "1901999590000000002", + "body": { + "stringValue": "{\"session.id\":\"body1\",\"message\":\"json body session.id wins\"}" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "suite-id", + "value": { + "stringValue": "session-id-copy" + } + }, + { + "key": "test-id", + "value": { + "stringValue": "logs" + } + }, + { + "key": "service.name", + "value": { + "stringValue": "new-browser-sdk" + } + } + ] + }, + "scopeLogs": [ + { + "scope": {}, + "logRecords": [ + { + "timeUnixNano": "1901999590000000003", + "body": { + "stringValue": "new sdk session.id unchanged" + }, + "attributes": [ + { + "key": "session.id", + "value": { + "stringValue": "xyz" + } + } + ] + }, + { + "timeUnixNano": "1901999590000000004", + "body": { + "stringValue": "no session" + } + } + ] + } + ] + } + ] +} diff --git a/smoke-tests/otel-collector/data/session-id-copy/replay/assert_query.sql b/smoke-tests/otel-collector/data/session-id-copy/replay/assert_query.sql new file mode 100644 index 000000000..56b2b342a --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/replay/assert_query.sql @@ -0,0 +1,10 @@ +SELECT + Body, + LogAttributes['session.id'], + `__hdx_materialized_session.id`, + `__hdx_materialized_rum.sessionId` +FROM hyperdx_sessions +WHERE ResourceAttributes['suite-id'] = 'session-id-copy' + AND ResourceAttributes['test-id'] = 'replay' +ORDER BY Timestamp +FORMAT CSV diff --git a/smoke-tests/otel-collector/data/session-id-copy/replay/expected.snap b/smoke-tests/otel-collector/data/session-id-copy/replay/expected.snap new file mode 100644 index 000000000..2411f76aa --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/replay/expected.snap @@ -0,0 +1,2 @@ +"replay event copied from rum.sessionId","abc","abc","abc" +"replay event own session.id wins","app1","app1","abc" \ No newline at end of file diff --git a/smoke-tests/otel-collector/data/session-id-copy/replay/input.json b/smoke-tests/otel-collector/data/session-id-copy/replay/input.json new file mode 100644 index 000000000..68715f3f5 --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/replay/input.json @@ -0,0 +1,75 @@ +{ + "resourceLogs": [ + { + "resource": { + "attributes": [ + { + "key": "suite-id", + "value": { + "stringValue": "session-id-copy" + } + }, + { + "key": "test-id", + "value": { + "stringValue": "replay" + } + }, + { + "key": "service.name", + "value": { + "stringValue": "old-browser-sdk" + } + }, + { + "key": "rum.sessionId", + "value": { + "stringValue": "abc" + } + } + ] + }, + "scopeLogs": [ + { + "scope": {}, + "logRecords": [ + { + "timeUnixNano": "1901999590000000000", + "body": { + "stringValue": "replay event copied from rum.sessionId" + }, + "attributes": [ + { + "key": "rr-web.event", + "value": { + "stringValue": "2" + } + } + ] + }, + { + "timeUnixNano": "1901999590000000001", + "body": { + "stringValue": "replay event own session.id wins" + }, + "attributes": [ + { + "key": "rr-web.event", + "value": { + "stringValue": "3" + } + }, + { + "key": "session.id", + "value": { + "stringValue": "app1" + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/smoke-tests/otel-collector/data/session-id-copy/spans/assert_query.sql b/smoke-tests/otel-collector/data/session-id-copy/spans/assert_query.sql new file mode 100644 index 000000000..d409609c0 --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/spans/assert_query.sql @@ -0,0 +1,10 @@ +SELECT + SpanName, + mapContains(SpanAttributes, 'session.id'), + SpanAttributes['session.id'], + ResourceAttributes['rum.sessionId'] +FROM otel_traces +WHERE ResourceAttributes['suite-id'] = 'session-id-copy' + AND ResourceAttributes['test-id'] = 'spans' +ORDER BY Timestamp +FORMAT CSV diff --git a/smoke-tests/otel-collector/data/session-id-copy/spans/expected.snap b/smoke-tests/otel-collector/data/session-id-copy/spans/expected.snap new file mode 100644 index 000000000..f23472608 --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/spans/expected.snap @@ -0,0 +1,3 @@ +"copied from rum.sessionId",1,"abc","abc" +"own session.id wins",1,"app1","abc" +"no session",0,"","" \ No newline at end of file diff --git a/smoke-tests/otel-collector/data/session-id-copy/spans/input.json b/smoke-tests/otel-collector/data/session-id-copy/spans/input.json new file mode 100644 index 000000000..f200299dd --- /dev/null +++ b/smoke-tests/otel-collector/data/session-id-copy/spans/input.json @@ -0,0 +1,107 @@ +{ + "resourceSpans": [ + { + "resource": { + "attributes": [ + { + "key": "suite-id", + "value": { + "stringValue": "session-id-copy" + } + }, + { + "key": "test-id", + "value": { + "stringValue": "spans" + } + }, + { + "key": "service.name", + "value": { + "stringValue": "old-browser-sdk" + } + }, + { + "key": "rum.sessionId", + "value": { + "stringValue": "abc" + } + } + ] + }, + "scopeSpans": [ + { + "scope": {}, + "spans": [ + { + "traceId": "6c9f0f0a1b2c3d4e5f60718293a4b5c6", + "spanId": "a1a2a3a4a5a6a7a8", + "parentSpanId": "", + "name": "copied from rum.sessionId", + "kind": 1, + "startTimeUnixNano": "1901999590000000000", + "endTimeUnixNano": "1901999590000100000" + }, + { + "traceId": "6c9f0f0a1b2c3d4e5f60718293a4b5c6", + "spanId": "b1b2b3b4b5b6b7b8", + "parentSpanId": "a1a2a3a4a5a6a7a8", + "name": "own session.id wins", + "kind": 1, + "startTimeUnixNano": "1901999590000000001", + "endTimeUnixNano": "1901999590000100000", + "attributes": [ + { + "key": "session.id", + "value": { + "stringValue": "app1" + } + } + ] + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "suite-id", + "value": { + "stringValue": "session-id-copy" + } + }, + { + "key": "test-id", + "value": { + "stringValue": "spans" + } + }, + { + "key": "service.name", + "value": { + "stringValue": "backend" + } + } + ] + }, + "scopeSpans": [ + { + "scope": {}, + "spans": [ + { + "traceId": "7d0a1b2c3d4e5f60718293a4b5c6d7e8", + "spanId": "c1c2c3c4c5c6c7c8", + "parentSpanId": "", + "name": "no session", + "kind": 2, + "startTimeUnixNano": "1901999590000000002", + "endTimeUnixNano": "1901999590000100000" + } + ] + } + ] + } + ] +} diff --git a/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/assert_query.sql b/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/assert_query.sql new file mode 100644 index 000000000..712c70d0e --- /dev/null +++ b/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/assert_query.sql @@ -0,0 +1 @@ +SELECT SeverityText, SeverityNumber, Body FROM otel_logs WHERE ResourceAttributes['suite-id'] = 'severity-inference' AND ResourceAttributes['test-id'] = 'infer-text-from-number' ORDER BY (toStartOfFiveMinutes(Timestamp), Timestamp) FORMAT CSV diff --git a/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/expected.snap b/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/expected.snap new file mode 100644 index 000000000..dad30759a --- /dev/null +++ b/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/expected.snap @@ -0,0 +1,11 @@ +"trace",1,"number 1 only" +"trace",4,"number 4 only" +"debug",5,"number 5 only" +"info",9,"number 9 only" +"warn",13,"number 13 only" +"error",17,"number 17 only" +"error",20,"number 20 only" +"fatal",21,"number 21 only" +"fatal",24,"number 24 only" +"error",17,"producer text wins" +"notice",9,"producer text wins even when it disagrees with the number" \ No newline at end of file diff --git a/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/input.json b/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/input.json new file mode 100644 index 000000000..ee1a69f23 --- /dev/null +++ b/smoke-tests/otel-collector/data/severity-inference/infer-text-from-number/input.json @@ -0,0 +1,108 @@ +{ + "resourceLogs": [ + { + "resource": { + "attributes": [ + { + "key": "suite-id", + "value": { + "stringValue": "severity-inference" + } + }, + { + "key": "test-id", + "value": { + "stringValue": "infer-text-from-number" + } + } + ] + }, + "scopeLogs": [ + { + "scope": {}, + "logRecords": [ + { + "timeUnixNano": "1901999590000000000", + "severity_number": 1, + "body": { + "stringValue": "number 1 only" + } + }, + { + "timeUnixNano": "1901999590000000001", + "severity_number": 4, + "body": { + "stringValue": "number 4 only" + } + }, + { + "timeUnixNano": "1901999590000000002", + "severity_number": 5, + "body": { + "stringValue": "number 5 only" + } + }, + { + "timeUnixNano": "1901999590000000003", + "severity_number": 9, + "body": { + "stringValue": "number 9 only" + } + }, + { + "timeUnixNano": "1901999590000000004", + "severity_number": 13, + "body": { + "stringValue": "number 13 only" + } + }, + { + "timeUnixNano": "1901999590000000005", + "severity_number": 17, + "body": { + "stringValue": "number 17 only" + } + }, + { + "timeUnixNano": "1901999590000000006", + "severity_number": 20, + "body": { + "stringValue": "number 20 only" + } + }, + { + "timeUnixNano": "1901999590000000007", + "severity_number": 21, + "body": { + "stringValue": "number 21 only" + } + }, + { + "timeUnixNano": "1901999590000000008", + "severity_number": 24, + "body": { + "stringValue": "number 24 only" + } + }, + { + "timeUnixNano": "1901999590000000009", + "severity_number": 17, + "severity_text": "ERROR", + "body": { + "stringValue": "producer text wins" + } + }, + { + "timeUnixNano": "1901999590000000010", + "severity_number": 9, + "severity_text": "notice", + "body": { + "stringValue": "producer text wins even when it disagrees with the number" + } + } + ] + } + ] + } + ] +} diff --git a/smoke-tests/otel-collector/data/severity-inference/skip-infer/expected.snap b/smoke-tests/otel-collector/data/severity-inference/skip-infer/expected.snap index b5b2d7b7e..fbab43797 100644 --- a/smoke-tests/otel-collector/data/severity-inference/skip-infer/expected.snap +++ b/smoke-tests/otel-collector/data/severity-inference/skip-infer/expected.snap @@ -1,2 +1,2 @@ "debug",0,"2025-05-03T03:23:14Z [INFO] this should skip because the severity_text is already set" -"",9,"[warn] this should also be skipped because a severity_number was set even if it's missing text" \ No newline at end of file +"info",9,"[warn] this should also be skipped because a severity_number was set even if it's missing text" \ No newline at end of file diff --git a/smoke-tests/otel-collector/docker-compose.yaml b/smoke-tests/otel-collector/docker-compose.yaml index 0c0201d9d..cf015c993 100644 --- a/smoke-tests/otel-collector/docker-compose.yaml +++ b/smoke-tests/otel-collector/docker-compose.yaml @@ -158,55 +158,6 @@ services: networks: - internal - # Older ClickHouse (< 26.2) to test the compatibility schema (bloom filters - # instead of full text indexes) - ch-server-compat: - image: clickhouse/clickhouse-server:25.12-alpine - environment: - CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1 - volumes: - - ../../docker/clickhouse/local/config.xml:/etc/clickhouse-server/config.xml - - ../../docker/clickhouse/local/users.xml:/etc/clickhouse-server/users.xml - - ./ch-compat-config.d/remove-prometheus-api.xml:/etc/clickhouse-server/config.d/remove-prometheus-api.xml:ro - ports: - - 29000:9000 - - 28123:8123 - networks: - - internal - healthcheck: - test: - wget -O /dev/null --no-verbose --tries=1 http://127.0.0.1:8123/ping || - exit 1 - interval: 5s - timeout: 3s - retries: 5 - start_period: 10s - otel-collector-compat: - build: - context: ../.. - dockerfile: docker/otel-collector/Dockerfile - target: dev - args: - OTEL_COLLECTOR_VERSION: ${OTEL_COLLECTOR_VERSION:-0.155.0} - OTEL_COLLECTOR_CORE_VERSION: ${OTEL_COLLECTOR_CORE_VERSION:-1.61.0} - environment: - - CLICKHOUSE_ENDPOINT=tcp://ch-server-compat:9000?dial_timeout=10s - - CLICKHOUSE_PROMETHEUS_METRICS_ENDPOINT=ch-server-compat:9363 - - CLICKHOUSE_USER=default - - CLICKHOUSE_PASSWORD= - - HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE=default - - HYPERDX_LOG_LEVEL=info - # See the note on the otel-collector service above for rationale. - - HYPERDX_OTEL_BATCH_TIMEOUT=100ms - # OPAMP_SERVER_URL is intentionally not set to run in standalone mode - ports: - - 24318:4318 # OTLP http receiver - networks: - - internal - depends_on: - ch-server-compat: - condition: service_healthy - # Static bearer-token auth (see docker/otel-collector/config.standalone.auth.yaml). # Verifies both accepted Authorization header forms end-to-end: the bare # token and the `Bearer `-prefixed value. diff --git a/smoke-tests/otel-collector/godebug.bats b/smoke-tests/otel-collector/godebug.bats new file mode 100644 index 000000000..4897fa4ae --- /dev/null +++ b/smoke-tests/otel-collector/godebug.bats @@ -0,0 +1,10 @@ +#!/usr/bin/env bats + +# The entrypoint must disable Go's default Multipath TCP listeners +# (CVE-2026-98432). In standalone mode the collector is exec'd as PID 1. + +@test "GODEBUG: the collector process runs with multipathtcp=0" { + run docker compose exec -T otel-collector sh -c 'tr "\0" "\n" < /proc/1/environ' + [ "$status" -eq 0 ] + echo "$output" | grep -qx 'GODEBUG=multipathtcp=0' +} diff --git a/smoke-tests/otel-collector/session-id-copy.bats b/smoke-tests/otel-collector/session-id-copy.bats new file mode 100644 index 000000000..0e407cd3a --- /dev/null +++ b/smoke-tests/otel-collector/session-id-copy.bats @@ -0,0 +1,26 @@ +#!/usr/bin/env bats + +# transform/session_id copies the old @hyperdx/browser `rum.sessionId` +# resource attribute into the OTel `session.id` attribute on spans, logs and +# replay rows. An existing `session.id` is never overwritten. + +load 'test_helpers/utilities.bash' +load 'test_helpers/assertions.bash' + +@test "session id copy: spans get session.id from rum.sessionId" { + emit_otel_data "http://localhost:4318" "data/session-id-copy/spans" "traces" + wait_for_rows 9000 "SELECT count() FROM otel_traces WHERE ResourceAttributes['suite-id'] = 'session-id-copy' AND ResourceAttributes['test-id'] = 'spans'" 3 + assert_test_data "data/session-id-copy/spans" +} + +@test "session id copy: logs get session.id from rum.sessionId, own and JSON body values win" { + emit_otel_data "http://localhost:4318" "data/session-id-copy/logs" + wait_for_rows 9000 "SELECT count() FROM otel_logs WHERE ResourceAttributes['suite-id'] = 'session-id-copy' AND ResourceAttributes['test-id'] = 'logs'" 5 + assert_test_data "data/session-id-copy/logs" +} + +@test "session id copy: replay rows in hyperdx_sessions get session.id from rum.sessionId" { + emit_otel_data "http://localhost:4318" "data/session-id-copy/replay" + wait_for_rows 9000 "SELECT count() FROM hyperdx_sessions WHERE ResourceAttributes['suite-id'] = 'session-id-copy' AND ResourceAttributes['test-id'] = 'replay'" 2 + assert_test_data "data/session-id-copy/replay" +} diff --git a/smoke-tests/otel-collector/setup_suite.bash b/smoke-tests/otel-collector/setup_suite.bash index 82bc5cb6b..a76a28450 100644 --- a/smoke-tests/otel-collector/setup_suite.bash +++ b/smoke-tests/otel-collector/setup_suite.bash @@ -13,7 +13,6 @@ setup_suite() { docker compose up --build --detach wait_for_ready "otel-collector" wait_for_ready "otel-collector-json" - wait_for_ready "otel-collector-compat" wait_for_ready "otel-collector-custom" wait_for_ready "otel-collector-oidc" wait_for_ready "otel-collector-bearer-auth" diff --git a/smoke-tests/otel-collector/severity-inference.bats b/smoke-tests/otel-collector/severity-inference.bats index b5683efe1..032aa3112 100644 --- a/smoke-tests/otel-collector/severity-inference.bats +++ b/smoke-tests/otel-collector/severity-inference.bats @@ -45,6 +45,12 @@ load 'test_helpers/assertions.bash' assert_test_data "data/severity-inference/skip-infer" } +@test "should derive severity text from severity number when only the number is set" { + emit_otel_data "http://localhost:4318" "data/severity-inference/infer-text-from-number" + sleep 1 + assert_test_data "data/severity-inference/infer-text-from-number" +} + @test "should not infer severity from keywords embedded mid-word" { emit_otel_data "http://localhost:4318" "data/severity-inference/no-infer-substring" sleep 1 diff --git a/smoke-tests/otel-collector/test_helpers/assertions.bash b/smoke-tests/otel-collector/test_helpers/assertions.bash index a4ed90c0c..3c86aaedb 100644 --- a/smoke-tests/otel-collector/test_helpers/assertions.bash +++ b/smoke-tests/otel-collector/test_helpers/assertions.bash @@ -2,10 +2,6 @@ assert_test_data() { _assert_test_data_on_port "9000" "$@" } -assert_test_data_compat() { - _assert_test_data_on_port "29000" "$@" -} - _assert_test_data_on_port() { local port=$1 local testdir=$2 diff --git a/yarn.lock b/yarn.lock index 23152c054..e34342ea5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1076,14 +1076,21 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.28.6, @babel/compat-data@npm:^7.29.7": +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.24.6, @babel/compat-data@npm:^7.27.2": + version: 7.28.5 + resolution: "@babel/compat-data@npm:7.28.5" + checksum: 10c0/702a25de73087b0eba325c1d10979eed7c9b6662677386ba7b5aa6eace0fc0676f78343bae080a0176ae26f58bd5535d73b9d0fbb547fef377692e8b249353a7 + languageName: node + linkType: hard + +"@babel/compat-data@npm:^7.29.7": version: 7.29.7 resolution: "@babel/compat-data@npm:7.29.7" checksum: 10c0/47913f05e08a45a1c9df38c02b4b49e391005085b489432647a1abe112e5d9c75e3be8ea5972b7f6da4ec5d1339922ceb9ea02b8a25d4ed1cb8636e5261f344e languageName: node linkType: hard -"@babel/core@npm:^7.23.9, @babel/core@npm:^7.24.4, @babel/core@npm:^7.27.4, @babel/core@npm:^7.28.0, @babel/core@npm:^7.28.5, @babel/core@npm:~7.29.0": +"@babel/core@npm:^7.18.9, @babel/core@npm:^7.23.9, @babel/core@npm:^7.24.4, @babel/core@npm:^7.27.4, @babel/core@npm:^7.28.0, @babel/core@npm:~7.29.0": version: 7.29.7 resolution: "@babel/core@npm:7.29.7" dependencies: @@ -1106,16 +1113,38 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.27.5, @babel/generator@npm:^7.29.7, @babel/generator@npm:^7.29.8, @babel/generator@npm:~7.29.0": - version: 7.29.8 - resolution: "@babel/generator@npm:7.29.8" +"@babel/generator@npm:^7.27.5, @babel/generator@npm:^7.28.5": + version: 7.28.5 + resolution: "@babel/generator@npm:7.28.5" dependencies: - "@babel/parser": "npm:^7.29.8" - "@babel/types": "npm:^7.29.8" + "@babel/parser": "npm:^7.28.5" + "@babel/types": "npm:^7.28.5" "@jridgewell/gen-mapping": "npm:^0.3.12" "@jridgewell/trace-mapping": "npm:^0.3.28" jsesc: "npm:^3.0.2" - checksum: 10c0/7b896696314a659652393b76d78276e236acd0f7fae40a9a1af7f01c76aeafc630dd0966aad6f9386d35d7c674a8e6e2d8e217c44d25fb11460e68afa9ba8441 + checksum: 10c0/9f219fe1d5431b6919f1a5c60db8d5d34fe546c0d8f5a8511b32f847569234ffc8032beb9e7404649a143f54e15224ecb53a3d11b6bb85c3203e573d91fca752 + languageName: node + linkType: hard + +"@babel/generator@npm:^7.29.7, @babel/generator@npm:~7.29.0": + version: 7.29.7 + resolution: "@babel/generator@npm:7.29.7" + dependencies: + "@babel/parser": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + "@jridgewell/gen-mapping": "npm:^0.3.12" + "@jridgewell/trace-mapping": "npm:^0.3.28" + jsesc: "npm:^3.0.2" + checksum: 10c0/9bf72b01b5bd0ea5b1288a0e37dbd360bff2f2b1ce73342c0d40fb3db2ec3dc004ada5ffa925c5e12939a416eed59e600d562b8ecd938ce0d27dfd0eb6c6c2b7 + languageName: node + linkType: hard + +"@babel/helper-annotate-as-pure@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-annotate-as-pure@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/3fe446e3bd37e5e32152279c84ace4e83815e5b88b9e09a82a83974a0bb22e941d89db26b23aaab4c9eb0f9713772c2f6163feffc1bcb055c4cdb6b67e5dc82f languageName: node linkType: hard @@ -1128,7 +1157,29 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.28.6, @babel/helper-compilation-targets@npm:^7.29.7": +"@babel/helper-builder-binary-assignment-operator-visitor@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-builder-binary-assignment-operator-visitor@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/d468ba492163bdcf5b6c53248edcf0aaed6194c0f7bdebef4f29ef626e5b03e9fcc7ed737445eb80a961ec6e687c330e1c5242d8a724efb0af002141f3b3e66c + languageName: node + linkType: hard + +"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.24.6": + version: 7.27.2 + resolution: "@babel/helper-compilation-targets@npm:7.27.2" + dependencies: + "@babel/compat-data": "npm:^7.27.2" + "@babel/helper-validator-option": "npm:^7.27.1" + browserslist: "npm:^4.24.0" + lru-cache: "npm:^5.1.1" + semver: "npm:^6.3.1" + checksum: 10c0/f338fa00dcfea931804a7c55d1a1c81b6f0a09787e528ec580d5c21b3ecb3913f6cb0f361368973ce953b824d910d3ac3e8a8ee15192710d3563826447193ad1 + languageName: node + linkType: hard + +"@babel/helper-compilation-targets@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-compilation-targets@npm:7.29.7" dependencies: @@ -1141,6 +1192,25 @@ __metadata: languageName: node linkType: hard +"@babel/helper-create-class-features-plugin@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-create-class-features-plugin@npm:7.24.6" + dependencies: + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-function-name": "npm:^7.24.6" + "@babel/helper-member-expression-to-functions": "npm:^7.24.6" + "@babel/helper-optimise-call-expression": "npm:^7.24.6" + "@babel/helper-replace-supers": "npm:^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.6" + "@babel/helper-split-export-declaration": "npm:^7.24.6" + semver: "npm:^6.3.1" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10c0/e6734671bc6a5f3cca4ec46e4cc70238e5a2fa063e51225c2be572f157119002af419b33ea0f846dbb1307370fe9f3aa92d199449abbea5e88e0262513c8a821 + languageName: node + linkType: hard + "@babel/helper-create-class-features-plugin@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-create-class-features-plugin@npm:7.29.7" @@ -1158,31 +1228,55 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.29.7": - version: 7.29.10 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.29.10" +"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-create-regexp-features-plugin@npm:7.24.6" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.29.7" - regexpu-core: "npm:^6.5.3" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + regexpu-core: "npm:^5.3.1" semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/6d4e37eb5bc6fb7a33afc23fa53cd6f94ea6de99fa29b33948138294a831ac4990406dbeef18e06318376054cef26e07dc04360a20ca7f5788fab2a817322e91 + checksum: 10c0/c6e1b07c94b3b93a3f534039da88bc67ec3156080f1959aa07d5d534e9a640de3533e7ded0516dfcbccde955e91687044e6a950852b1d3f402ac5d5001be56cf languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.6.5, @babel/helper-define-polyfill-provider@npm:^0.6.8": - version: 0.6.8 - resolution: "@babel/helper-define-polyfill-provider@npm:0.6.8" +"@babel/helper-define-polyfill-provider@npm:^0.6.1, @babel/helper-define-polyfill-provider@npm:^0.6.2": + version: 0.6.2 + resolution: "@babel/helper-define-polyfill-provider@npm:0.6.2" dependencies: - "@babel/helper-compilation-targets": "npm:^7.28.6" - "@babel/helper-plugin-utils": "npm:^7.28.6" - debug: "npm:^4.4.3" + "@babel/helper-compilation-targets": "npm:^7.22.6" + "@babel/helper-plugin-utils": "npm:^7.22.5" + debug: "npm:^4.1.1" lodash.debounce: "npm:^4.0.8" - resolve: "npm:^1.22.11" + resolve: "npm:^1.14.2" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/306a169f2cb285f368578219ef18ea9702860d3d02d64334f8d45ea38648be0b9e1edad8c8f732fa34bb4206ccbb9883c395570fd57ab7bbcf293bc5964c5b3a + checksum: 10c0/f777fe0ee1e467fdaaac059c39ed203bdc94ef2465fb873316e9e1acfc511a276263724b061e3b0af2f6d7ad3ff174f2bb368fde236a860e0f650fda43d7e022 + languageName: node + linkType: hard + +"@babel/helper-environment-visitor@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-environment-visitor@npm:7.24.6" + checksum: 10c0/fdcd18ac505ed71f40c05cc992b648a4495b0aa5310a774492a0f74d8dcf3579691102f516561a651d3de6c3a44fe64bfb3049d11c14c5857634ef1823ea409a + languageName: node + linkType: hard + +"@babel/helper-function-name@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-function-name@npm:7.24.6" + dependencies: + "@babel/template": "npm:^7.24.6" + "@babel/types": "npm:^7.24.6" + checksum: 10c0/5ba2f8db789b3f5a2b2239300a217aa212e303cd7bfad9c8b90563807f49215e8c679e8f8f177b6aaca2038038e29bc702b83839e1f7b4896d79c44a75cac97a + languageName: node + linkType: hard + +"@babel/helper-globals@npm:^7.28.0": + version: 7.28.0 + resolution: "@babel/helper-globals@npm:7.28.0" + checksum: 10c0/5a0cd0c0e8c764b5f27f2095e4243e8af6fa145daea2b41b53c0c1414fe6ff139e3640f4e2207ae2b3d2153a1abd346f901c26c290ee7cb3881dd922d4ee9232 languageName: node linkType: hard @@ -1193,6 +1287,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-member-expression-to-functions@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-member-expression-to-functions@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/7595f62978f55921b24de6ed5252fcedbffacfb8271f71e092f38724179ba554cb3a24a4764a1a3890b8a53504c2bee9c99eab81f1f365582739f566c8e28eaa + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-member-expression-to-functions@npm:7.29.7" @@ -1203,6 +1306,25 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-imports@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-module-imports@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/e0db3fbfcd963d138f0792ff626f940a576fcf212d02b8fe6478dccf3421bd1c2a76f8e69c7450c049985e7b63b30be309a24eeeb6ad7c2137a31b676a095a84 + languageName: node + linkType: hard + +"@babel/helper-module-imports@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-module-imports@npm:7.27.1" + dependencies: + "@babel/traverse": "npm:^7.27.1" + "@babel/types": "npm:^7.27.1" + checksum: 10c0/e00aace096e4e29290ff8648455c2bc4ed982f0d61dbf2db1b5e750b9b98f318bf5788d75a4f974c151bd318fd549e81dbcab595f46b14b81c12eda3023f51e8 + languageName: node + linkType: hard + "@babel/helper-module-imports@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-module-imports@npm:7.29.7" @@ -1213,6 +1335,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-module-transforms@npm:^7.24.6": + version: 7.28.3 + resolution: "@babel/helper-module-transforms@npm:7.28.3" + dependencies: + "@babel/helper-module-imports": "npm:^7.27.1" + "@babel/helper-validator-identifier": "npm:^7.27.1" + "@babel/traverse": "npm:^7.28.3" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10c0/549be62515a6d50cd4cfefcab1b005c47f89bd9135a22d602ee6a5e3a01f27571868ada10b75b033569f24dc4a2bb8d04bfa05ee75c16da7ade2d0db1437fcdb + languageName: node + linkType: hard + "@babel/helper-module-transforms@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-module-transforms@npm:7.29.7" @@ -1226,6 +1361,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-optimise-call-expression@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-optimise-call-expression@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/7fce2c4ce22c4ba3c2178d1ce85f34fc9bbe286af5ec153b4b6ea9bf2212390359c4a1e8a54551c4daa4688022d619668bdb8c8060cb185c0c9ad02c5247efc9 + languageName: node + linkType: hard + "@babel/helper-optimise-call-expression@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-optimise-call-expression@npm:7.29.7" @@ -1242,7 +1386,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.18.6": +"@babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.24.6, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.24.6 resolution: "@babel/helper-plugin-utils@npm:7.24.6" checksum: 10c0/636d3ce8cabc0621c1f78187e1d95f1087209921fa452f76aad06224ef5dffb3d934946f5183109920f32a4b94dd75ac91c63bc52813fee639d10cd54d49ba1f @@ -1256,23 +1400,36 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.28.6, @babel/helper-plugin-utils@npm:^7.29.7": +"@babel/helper-plugin-utils@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-plugin-utils@npm:7.29.7" checksum: 10c0/380477a06133274a2759f9355929cb60a95e8b8fee624a1ae1fa349e1d1645b89daca456f72833f6d1062bffa12ee4271c5bf0cc5a61c0166cdc24c7591e2408 languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/helper-remap-async-to-generator@npm:7.29.7" +"@babel/helper-remap-async-to-generator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-remap-async-to-generator@npm:7.24.6" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.29.7" - "@babel/helper-wrap-function": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-wrap-function": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/d71a4f2c7e4523568b1fbeb4d85823bda7ebcd48263b2862ee8194b0a647b612e70d6a64472e0842fc7e557a16e9fa5d3c032af5c1308a342e2a3b49a87d4833 + checksum: 10c0/b379b844eba352ac9487d31867e7bb2b8a264057f1739d9161b614145ea6e60969a7a82e75e5e83089e50cf1b6559f53aa085a787942bf40706fee15a2faa33c + languageName: node + linkType: hard + +"@babel/helper-replace-supers@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-replace-supers@npm:7.24.6" + dependencies: + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-member-expression-to-functions": "npm:^7.24.6" + "@babel/helper-optimise-call-expression": "npm:^7.24.6" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10c0/aaf2dfaf25360da1525ecea5979d5afed201b96f0feeed2e15f90883a97776132a720b25039e67fee10a5c537363aea5cc2a46c0f1d13fdb86d0e920244f2da7 languageName: node linkType: hard @@ -1289,6 +1446,24 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-simple-access@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/b17e404dd6c9787fc7d558aea5222471a77e29596705f0d10b4c2a58b9d71ff7eae915094204848cc1af99b771553caa69337a768b9abdd82b54a0050ba83eb9 + languageName: node + linkType: hard + +"@babel/helper-skip-transparent-expression-wrappers@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/6928f698362d6082a67ee2bc73991ef6b0cc6b5f2854177389bc8f3c09296580f0ee20134dd1a29dfcb1906ad9e346fa0f7c6fcd7589ab3ff176d4f09504577f + languageName: node + linkType: hard + "@babel/helper-skip-transparent-expression-wrappers@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.29.7" @@ -1299,10 +1474,40 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.29.11": - version: 7.29.11 - resolution: "@babel/helper-string-parser@npm:7.29.11" - checksum: 10c0/673a309056c593af89296464ff149d0478889e3f5a577add33f1d4d38c54e44d0381cf232f744965ee71534489ebaa4d5c45ba5f87e1d2ce9bf54a67d2d0d72d +"@babel/helper-split-export-declaration@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-split-export-declaration@npm:7.24.6" + dependencies: + "@babel/types": "npm:^7.24.6" + checksum: 10c0/53a5dd8691fdffc89cc7fcf5aed0ad1d8bc39796a5782a3d170dcbf249eb5c15cc8a290e8d09615711d18798ad04a7d0694ab5195d35fa651abbc1b9c885d6a8 + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-string-parser@npm:7.24.6" + checksum: 10c0/95115bf676e92c4e99166395649108d97447e6cabef1fabaec8cdbc53a43f27b5df2268ff6534439d405bc1bd06685b163eb3b470455bd49f69159dada414145 + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.24.8": + version: 7.24.8 + resolution: "@babel/helper-string-parser@npm:7.24.8" + checksum: 10c0/6361f72076c17fabf305e252bf6d580106429014b3ab3c1f5c4eb3e6d465536ea6b670cc0e9a637a77a9ad40454d3e41361a2909e70e305116a23d68ce094c08 + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-string-parser@npm:7.27.1" + checksum: 10c0/8bda3448e07b5583727c103560bcf9c4c24b3c1051a4c516d4050ef69df37bb9a4734a585fe12725b8c2763de0a265aa1e909b485a4e3270b7cfd3e4dbe4b602 + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-string-parser@npm:7.29.7" + checksum: 10c0/194bc0f1716e396d5ffde56ad6119745fb9557662c98611590e5e454906783a4ccb21ce93056b8eb69a4909044834e45d96e50ac695bbe9e3221648fe033c06c languageName: node linkType: hard @@ -1313,13 +1518,20 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.24.6, @babel/helper-validator-identifier@npm:^7.27.1": +"@babel/helper-validator-identifier@npm:^7.24.6, @babel/helper-validator-identifier@npm:^7.27.1, @babel/helper-validator-identifier@npm:^7.28.5": version: 7.28.5 resolution: "@babel/helper-validator-identifier@npm:7.28.5" checksum: 10c0/42aaebed91f739a41f3d80b72752d1f95fd7c72394e8e4bd7cdd88817e0774d80a432451bcba17c2c642c257c483bf1d409dd4548883429ea9493a3bc4ab0847 languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.24.7": + version: 7.24.7 + resolution: "@babel/helper-validator-identifier@npm:7.24.7" + checksum: 10c0/87ad608694c9477814093ed5b5c080c2e06d44cb1924ae8320474a74415241223cc2a725eea2640dd783ff1e3390e5f95eede978bc540e870053152e58f1d651 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.29.7": version: 7.29.7 resolution: "@babel/helper-validator-identifier@npm:7.29.7" @@ -1327,7 +1539,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.27.1": +"@babel/helper-validator-option@npm:^7.24.6, @babel/helper-validator-option@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-validator-option@npm:7.27.1" checksum: 10c0/6fec5f006eba40001a20f26b1ef5dbbda377b7b68c8ad518c05baa9af3f396e780bdfded24c4eef95d14bb7b8fd56192a6ed38d5d439b97d10efc5f1a191d148 @@ -1341,14 +1553,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-wrap-function@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/helper-wrap-function@npm:7.29.7" +"@babel/helper-wrap-function@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/helper-wrap-function@npm:7.24.6" dependencies: - "@babel/template": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" - "@babel/types": "npm:^7.29.7" - checksum: 10c0/d765b341863ede049eb6923b9c20fc79fb6c64995a906b60a70c22fbffb21eef5d5a5cf15948c843047d31e8c902a85fa94ccfe5d30d0631a7b1e40e4d667c70 + "@babel/helper-function-name": "npm:^7.24.6" + "@babel/template": "npm:^7.24.6" + "@babel/types": "npm:^7.24.6" + checksum: 10c0/d32844275a544a8e7c71c13e9832d34d80656aafce659dc6c23b02e14d1c1179d8045125ded5096da1a99de83299ffb48211183d0403da2c8584ed55dc0ab646 languageName: node linkType: hard @@ -1385,85 +1597,82 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.4, @babel/parser@npm:^7.29.7, @babel/parser@npm:^7.29.8, @babel/parser@npm:^7.29.9, @babel/parser@npm:~7.29.0": - version: 7.29.11 - resolution: "@babel/parser@npm:7.29.11" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.27.2, @babel/parser@npm:^7.28.5": + version: 7.28.5 + resolution: "@babel/parser@npm:7.28.5" dependencies: - "@babel/types": "npm:^7.29.11" + "@babel/types": "npm:^7.28.5" bin: parser: ./bin/babel-parser.js - checksum: 10c0/4bf9d2e8520627c20bfefe34a0117348bf62a002fb1fdbeeee82a08ee02ff71767e079ac4e728a76da2e0db48cabf50121b3bdac0831ed4a9a6d8aa12765846d + checksum: 10c0/5bbe48bf2c79594ac02b490a41ffde7ef5aa22a9a88ad6bcc78432a6ba8a9d638d531d868bd1f104633f1f6bba9905746e15185b8276a3756c42b765d131b1ef languageName: node linkType: hard -"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.29.7" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6877a4112797885bcf90f361131e2b63dcbbcb3e334c984c527e1e380eb7e81785219dcf99f1291eef4edc83907cb582204120d97d777807c252f9eb31fd2e6e +"@babel/parser@npm:^7.24.4": + version: 7.24.6 + resolution: "@babel/parser@npm:7.24.6" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/cbef70923078a20fe163b03f4a6482be65ed99d409a57f3091a23ce3a575ee75716c30e7ea9f40b692ac5660f34055f4cbeb66a354fad15a6cf1fca35c3496c5 languageName: node linkType: hard -"@babel/plugin-bugfix-safari-class-field-initializer-scope@npm:^7.29.7": +"@babel/parser@npm:^7.29.7, @babel/parser@npm:~7.29.0": version: 7.29.7 - resolution: "@babel/plugin-bugfix-safari-class-field-initializer-scope@npm:7.29.7" + resolution: "@babel/parser@npm:7.29.7" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/557565fc052b9ab306802b19b9cfc89be9aa7aa709447698dbb5080db356048d4c3dd94ccad8bcb4d5ef3c4002947a340d1c326acde0d95950c3773472f46282 + "@babel/types": "npm:^7.29.7" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/65133038f80b54a714d6027cb77cee3f9a6b5c4c6842ce674301e13947cbcbfa8055e63acaf1b84c085d34226a14425b2c2b97b829e0e226d2e8f1299942a51d languageName: node linkType: hard -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.29.7" +"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/5b949826cfadd9d90c3cfba01cc917f218ba2da05b2a2dc4781bd3805c150eb858ba52d2f3972c8ae6cc887257ac4d114fdda6d695a30510137abae5c76bf054 + checksum: 10c0/0dbf12de5a7e5d092271124f0d9bff1ceb94871d5563041940512671cd40ab2a93d613715ee37076cd8263cf49579afb805faa3189996c11639bb10d3e9837f1 languageName: node linkType: hard -"@babel/plugin-bugfix-safari-rest-destructuring-rhs-array@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-bugfix-safari-rest-destructuring-rhs-array@npm:7.29.7" +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/727a464410623fb47d47a2803562b8bb9fb4b915de94cc51bd3149937522b85e6a5d19c71207ac5269c51684f282a918785e78e359435d1f4ac889dc4f258855 + checksum: 10c0/b0a03d4f587e1fa92312c912864a0af3f68bfc87367b7c93770e94f171767d563d7adfca7ad571d20cd755e89e1373e7414973ce30e694e7b6eb8f57d2b1b889 languageName: node linkType: hard -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.29.7" +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" - "@babel/plugin-transform-optional-chaining": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.6" + "@babel/plugin-transform-optional-chaining": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.13.0 - checksum: 10c0/9ccc704d1382771b2a6a4f1281b2f63d7be47fb0ebc9890e2f820e2a645b77aaf207ec8e6136854bb059715eac5fd7cab436b054c3b3b4a472b9fd0c73ee98b3 + checksum: 10c0/fdd40fdf7e87f3dbc5396c9a8f92005798865f6f20d2c24c33246ac43aab8df93742b63dfcfcda67c0a5cf1f7b8a987fdbccaceb9ccbb9a67bef10012b522390 languageName: node linkType: hard -"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.29.7" +"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/547bddf129eed825c0a3c706828c579bfedd0fa850054ded515e90af91fa1a643bb88461e49b59946d95737622766ae0db2c04346ee319e06e49852c270a2c2f + checksum: 10c0/cc1e8ee138c71e78ec262a5198d2cf75c305f2fb4ea9771ebd4ded47f51bc1bacbf917db3cb28c681e7499a07f9803ab0bbe5ad50b9576cbe03902189e3871ed languageName: node linkType: hard @@ -1555,25 +1764,36 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-import-assertions@npm:^7.27.1, @babel/plugin-syntax-import-assertions@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-syntax-import-assertions@npm:7.29.7" +"@babel/plugin-syntax-export-namespace-from@npm:^7.8.3": + version: 7.8.3 + resolution: "@babel/plugin-syntax-export-namespace-from@npm:7.8.3" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/d5628692a0ba2fadf469aaef20f4f0a216259eeb92d31fc23d48c9d201696099691f0dfaa895c657f9c591a7fab94f62545f20196326af1812ebab72cf34e9fe + checksum: 10c0/5100d658ba563829700cd8d001ddc09f4c0187b1a13de300d729c5b3e87503f75a6d6c99c1794182f7f1a9f546ee009df4f15a0ce36376e206ed0012fa7cdc24 languageName: node linkType: hard -"@babel/plugin-syntax-import-attributes@npm:^7.24.7, @babel/plugin-syntax-import-attributes@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-syntax-import-attributes@npm:7.29.7" +"@babel/plugin-syntax-import-assertions@npm:^7.24.1, @babel/plugin-syntax-import-assertions@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-syntax-import-assertions@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/b9a47e869d8c06676297069895ae34e2bd244ec4c3bdf15002f1e69aed32eef0361044af22a43f271b8de5e23a40534fe6a74a63e7ab98e3d60a74b322444b49 + checksum: 10c0/8e81c7cd3d5812a3dda32f06f84492a1b5640f42c594619ed57bf4017529889f87bfb4e8e95c50ba1527d89501dae71a0c73770502676545c2cd9ce58ce3258d + languageName: node + linkType: hard + +"@babel/plugin-syntax-import-attributes@npm:^7.24.6, @babel/plugin-syntax-import-attributes@npm:^7.24.7": + version: 7.27.1 + resolution: "@babel/plugin-syntax-import-attributes@npm:7.27.1" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.27.1" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/e66f7a761b8360419bbb93ab67d87c8a97465ef4637a985ff682ce7ba6918b34b29d81190204cf908d0933058ee7b42737423cd8a999546c21b3aabad4affa9a languageName: node linkType: hard @@ -1599,14 +1819,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.27.1, @babel/plugin-syntax-jsx@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-syntax-jsx@npm:7.29.7" +"@babel/plugin-syntax-jsx@npm:^7.24.6, @babel/plugin-syntax-jsx@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/plugin-syntax-jsx@npm:7.27.1" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.27.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/1736000de183538ba8eef34520105508860e48b0c763254ba9158af5e814ed8bbceeedbb4281fbda33de787ae5b3870e92f60c6ae7131e7d322e451d57387896 + checksum: 10c0/bc5afe6a458d5f0492c02a54ad98c5756a0c13bd6d20609aae65acd560a9e141b0876da5f358dce34ea136f271c1016df58b461184d7ae9c4321e0f98588bc84 languageName: node linkType: hard @@ -1698,7 +1918,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.27.1": +"@babel/plugin-syntax-typescript@npm:^7.24.6, @babel/plugin-syntax-typescript@npm:^7.27.1": version: 7.27.1 resolution: "@babel/plugin-syntax-typescript@npm:7.27.1" dependencies: @@ -1732,114 +1952,129 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-arrow-functions@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-arrow-functions@npm:7.29.7" +"@babel/plugin-transform-arrow-functions@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-arrow-functions@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/03405abac83122b760c4d688a256c7a67961fd5a4396dfd119cf89a118984d31add38eeace38a158c63c3a4257a644e15da8836ee9e50876bf6876e988060be2 + checksum: 10c0/46250eb3f535327825db323740a301b76b882b70979f1fb5f89cbb1a820378ab68ee880b912981dd5276dd116deaaee0f4a2a95f1c9cf537a67749fd4209a2d3 languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.29.7" +"@babel/plugin-transform-async-generator-functions@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-async-generator-functions@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-remap-async-to-generator": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-remap-async-to-generator": "npm:^7.24.6" + "@babel/plugin-syntax-async-generators": "npm:^7.8.4" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/efeeb26e8474d75b469b68fd7de74b757929b78aba5714ccb705a42f23d4e0de178ca09b59efd19113d42461bcf876dd9a919fd61f4e5e6fd1d1e5e7998e5bfe + checksum: 10c0/8876431855220ccfbf1ae510a4a7c4e0377b21189d3f73ea6dde5ffd31eee57f03ea2b2d1da59b6a36b6e107e41b38d0c1d1bb015e0d1c2c2fb627962260edb7 languageName: node linkType: hard -"@babel/plugin-transform-async-to-generator@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-async-to-generator@npm:7.29.7" +"@babel/plugin-transform-async-to-generator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-async-to-generator@npm:7.24.6" dependencies: - "@babel/helper-module-imports": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-remap-async-to-generator": "npm:^7.29.7" + "@babel/helper-module-imports": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-remap-async-to-generator": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/1aa514d28a2a87747f54e031cf6d2884a792a41c8bb9ebcf4d3d663284a4ae14e02c744ad76819ab09b96b6a0cdb60dd20e54c75f2eb9c3cc3fb255e0ef79e74 + checksum: 10c0/52c137668e7a35356c3b1caf25ab3bf90ff61199885bfd9f0232bfe168a53a5cf0ca4c1e283c27e44ad76cc366b73e4ff7042241469d1944c7042fb78c57bfd8 languageName: node linkType: hard -"@babel/plugin-transform-block-scoped-functions@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.29.7" +"@babel/plugin-transform-block-scoped-functions@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-block-scoped-functions@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/bb790629b9bce5215f932932222b50f371f8dfd30b874b7e6ea294213ddf10f427d5fc80dc7e1c0fba3568f02c1865290ce40aef89657570d98c4eb13b6af3c2 + checksum: 10c0/0c761b5e3a2959b63edf47d67f6752e01f24777ad1accd82457a2dca059877f8a8297fbc7a062db6b48836309932f2ac645c507070ef6ad4e765b3600822c048 languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.29.7": - version: 7.29.11 - resolution: "@babel/plugin-transform-block-scoping@npm:7.29.11" +"@babel/plugin-transform-block-scoping@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-block-scoping@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0ae4925490b668d11b482577192b0bd3f36c6e30c240cd0fa225f5203ff227f22762f1974c26e75f99a08817c7593e03681e0af04111458fbfed2bdb30faf99b + checksum: 10c0/95c25e501c4553515f92d4e86032a8859a8855cea8aafb6df30f956979caa70af1e126e6dfaf9e51328d1306232ff1e081bda7d84a9aaf23f418d9da120c7018 languageName: node linkType: hard -"@babel/plugin-transform-class-properties@npm:^7.27.1, @babel/plugin-transform-class-properties@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-class-properties@npm:7.29.7" +"@babel/plugin-transform-class-properties@npm:^7.24.1, @babel/plugin-transform-class-properties@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-class-properties@npm:7.24.6" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-class-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/c370700423439aa9f0c1f8c4b97f2ef7c2dc46a1b04ec3b10e83e6bae5e4e2159f56d8e4376c9d669b3cf827650cc3740170a36e3924e3e9970d27fd85f4e48a + checksum: 10c0/ae01e00dd528112d542a77f0f1cf6b43726553d2011bbdec9e4fac441dfa161d44bf14449dc4121b45cc971686a8c652652032594e83c5d6cab8e9fd794eecb2 languageName: node linkType: hard -"@babel/plugin-transform-class-static-block@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-class-static-block@npm:7.29.7" +"@babel/plugin-transform-class-static-block@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-class-static-block@npm:7.24.6" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-class-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" peerDependencies: "@babel/core": ^7.12.0 - checksum: 10c0/d2fa7e8af5d05cee838bab20b624c2911ef6618c7ead146f6ace6421280d0e57487fc2b946b42832289a35764b559e584983b32e51bf5a85596495ba3452970f + checksum: 10c0/425f237faf62b531d973f23ac3eefe3f29c4f6c988c33c2dd660b6dfb61d4ed1e865a5088574742d87ed02437d26aa6ec6b107468b7df35ca9d3082bad742d8f languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.29.7": - version: 7.29.11 - resolution: "@babel/plugin-transform-classes@npm:7.29.11" +"@babel/plugin-transform-classes@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-classes@npm:7.24.6" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.29.7" - "@babel/helper-compilation-targets": "npm:^7.29.7" - "@babel/helper-globals": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-replace-supers": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.10" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-compilation-targets": "npm:^7.24.6" + "@babel/helper-environment-visitor": "npm:^7.24.6" + "@babel/helper-function-name": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-replace-supers": "npm:^7.24.6" + "@babel/helper-split-export-declaration": "npm:^7.24.6" + globals: "npm:^11.1.0" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/213ad53649b213a263e1d31a8d6f9fc9f8d3c808dce74ff5d7fc90b31f3b36bef47bba5ecac5a23aee47ec2f17c1d019c75486ed68094461bdf0d3e1e9e7b06f + checksum: 10c0/d29c26feea9ad5a64d790aeab1833b7a50d6af2be24140dad7e06510b754b8fe0ffb292d43d96fedaf7765fcb90c0034ac7c42635f814d9235697431076a1cf0 languageName: node linkType: hard -"@babel/plugin-transform-computed-properties@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-computed-properties@npm:7.29.7" +"@babel/plugin-transform-computed-properties@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-computed-properties@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/template": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/template": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a8755338ffbfb374bafc2b3c22b00b025b8e5cf1cbac9c1ecdb3fb4c538508cb1b8f7a4e8c874b05df5166ff19ef105e65d54fefcf0546c628fa67214453b708 + checksum: 10c0/c464144c2eda8d526d70c8d8e3bf30820f591424991452f816617347ef3ccc5d04133c6e903b90c1d832d95d9c8550e5693ea40ea14856ede54fb8e1cd36c5de + languageName: node + linkType: hard + +"@babel/plugin-transform-destructuring@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-destructuring@npm:7.24.6" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.24.6" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/1fcc064e2b0c45a4340418bd70d2cf2b3644d1215eb975ec14f83e4f7615fdc3948e355db5091f81602f6c3d933f9308caa66232091aad4edd6c16b00240fcc7 languageName: node linkType: hard @@ -1855,168 +2090,174 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-dotall-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-dotall-regex@npm:7.29.7" +"@babel/plugin-transform-dotall-regex@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-dotall-regex@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/1c3eecc214bae152fc9af66b6d7e045a58e364a1cbc18a6c8e0ecea2d470eb6171f35b454dde51dffb4e687245bc8ad9abb9e233cc708db5bd3bdced74a1511c + checksum: 10c0/4a2c98f1c22a18754c6ada1486563865690008df2536066d8a146fa58eed8515b607e162c7efb0b8fa062d755e77afea145495046cffdb4ea56194d38f489254 languageName: node linkType: hard -"@babel/plugin-transform-duplicate-keys@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-duplicate-keys@npm:7.29.7" +"@babel/plugin-transform-duplicate-keys@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-duplicate-keys@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0d895326d8b29f6acaa8da72ebdc6393537311eaa33d8cab99cbb322a73c21be51d5d932a6d0c124e4f51539c5731dc3ed93084d3a2078a63db59dda6b00a724 + checksum: 10c0/44ddba252f0b9f1f0b1ff8d903bbcf8871246670fb2883f65d09d371d403ce9c3e2e582b94b36506c1d042110b464eb3492e53cd1e87c1d479b145bcc01c04fd languageName: node linkType: hard -"@babel/plugin-transform-duplicate-named-capturing-groups-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-duplicate-named-capturing-groups-regex@npm:7.29.7" +"@babel/plugin-transform-dynamic-import@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-dynamic-import@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/1dfecfb693ad6f1b6b779ac2fd676df048a051b83b4856f9ddced6217cd1f69b96259b01b5a67ee970fe531edf845944aadcc3f5dc74780331997f1dbf2de0da + "@babel/core": ^7.0.0-0 + checksum: 10c0/b4411f21112127a02aef15103765e207e4c03e7321d7f4de3522fc181cb377c5abc8484cf0169e6c30f2e51e6c602c09894fa6b15643d24f66273833ef34e4a6 languageName: node linkType: hard -"@babel/plugin-transform-dynamic-import@npm:^7.29.7": +"@babel/plugin-transform-explicit-resource-management@npm:^7.28.0": version: 7.29.7 - resolution: "@babel/plugin-transform-dynamic-import@npm:7.29.7" + resolution: "@babel/plugin-transform-explicit-resource-management@npm:7.29.7" dependencies: "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/plugin-transform-destructuring": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/9f824556ab369173e5945cceeb3b83516a2896b161a5cd9f14641e30b7d1535426eebbf04d1f3cfcac557e0148180650584b4ce552b09a6b03f03adf1fbc689c + checksum: 10c0/083ef2bbc8c78ff80d70b1fe12604a8a2cc6a5ec68115c6efa4be7b5291b7576a092a102739af7c7e743cad79234b7cb7efe4216ca1913b598e0afc04a9962d5 languageName: node linkType: hard -"@babel/plugin-transform-explicit-resource-management@npm:^7.28.0, @babel/plugin-transform-explicit-resource-management@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-explicit-resource-management@npm:7.29.7" +"@babel/plugin-transform-exponentiation-operator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/plugin-transform-destructuring": "npm:^7.29.7" + "@babel/helper-builder-binary-assignment-operator-visitor": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/083ef2bbc8c78ff80d70b1fe12604a8a2cc6a5ec68115c6efa4be7b5291b7576a092a102739af7c7e743cad79234b7cb7efe4216ca1913b598e0afc04a9962d5 + checksum: 10c0/c4f15518a5d1614dfac0dbadfb99b0f36a98c1c1ff1c39794a105c3c87cfce00689e0943fcb13368b43b00b2eebaa01136ea12fb8600a574720853b5a8a11de7 languageName: node linkType: hard -"@babel/plugin-transform-exponentiation-operator@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-exponentiation-operator@npm:7.29.7" +"@babel/plugin-transform-export-namespace-from@npm:^7.24.1, @babel/plugin-transform-export-namespace-from@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-export-namespace-from@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/1db57e065c5bceafcf7839d0c4cefd5723adba6d858df89d077d3f336364266a2dab71f1eb44746c14024736dd15fbe20ea392128c16b898abefc27cc1ca173f + checksum: 10c0/bff16d1800d7e5b38d3a3c8d404cc14442a37383dff7769dcc599a0723b2507647cafe9ba7d9b52d2e2f02a78bb78d149676d8d8ddf7357b160f4096b89ae9c5 languageName: node linkType: hard -"@babel/plugin-transform-export-namespace-from@npm:^7.27.1, @babel/plugin-transform-export-namespace-from@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-export-namespace-from@npm:7.29.7" +"@babel/plugin-transform-for-of@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-for-of@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6cd951e366c5c30223c409157e312d949feecfae8b4b4927053764ec71ff2bacf43aceda9b53239cd90d71caf4ae849c70549e0d3e31377dd8f42a0c283bdda2 + checksum: 10c0/c8def2a160783c5c4a1c136c721fc88aca9cd3757a60f1c885a804b5320edb5f143d3f989f698bdd9aae359fdabab0830dba3d35138cea42988a77d2c72c8443 languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-for-of@npm:7.29.7" +"@babel/plugin-transform-function-name@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-function-name@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" + "@babel/helper-compilation-targets": "npm:^7.24.6" + "@babel/helper-function-name": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/1d0143067df5f0d5ff0097099876da5d9d0fb7e2670939fde2523a0b14be2ea2cbcf736f874081d13ec5c3fca756f7aa1782a7c8cf17c262b0a493115a23b6b1 + checksum: 10c0/efa6527438ad94df0b7a4c92c33110ec40b086a0aceda567176b150ed291f8eb44b2ce697d8e3e1d4841496c10693add1e88f296418e72a171ead5c76b890a47 languageName: node linkType: hard -"@babel/plugin-transform-function-name@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-function-name@npm:7.29.7" +"@babel/plugin-transform-json-strings@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-json-strings@npm:7.24.6" dependencies: - "@babel/helper-compilation-targets": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-json-strings": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/3ed2bca4f49356cd8fe1aa69daf5de63451be3b9271264eae536baf8d53476c63033e7fed6b5e97277cc10bdbfa10148f2f03315ca4cd94fae2b4ad5cb9b437f + checksum: 10c0/46af52dcc16f494c6c11dc22c944f2533623b9d9dfce5097bc0bdb99535ad4c4cfe5bca0d8ce8c39a94202e69d99ee60f546ce0be0ad782b681c7b5b4c9ddd6f languageName: node linkType: hard -"@babel/plugin-transform-json-strings@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-json-strings@npm:7.29.7" +"@babel/plugin-transform-literals@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-literals@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6cc66ffbfa1dd50f1f225da0668740e93357ea84e67c798e9814085595d4f04a65d0d1368d15fd4b0022b7e76eded3a1c822791a93a8855b62897c836c547fff + checksum: 10c0/961b64df79a673706d74cf473d1f4646f250b4f8813f9d7ef5d897e30acdacd1ca104584de2e88546289fce055d71bd7559cdb8ad4a2d5e7eea17f3c829faa97 languageName: node linkType: hard -"@babel/plugin-transform-literals@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-literals@npm:7.29.7" +"@babel/plugin-transform-logical-assignment-operators@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/bcfb8ca4092f2927ed61fdb75ddbadd701eda08ea2dd972f110d2ef1428643275c7adc7ce26847e15fbd573997e93654ff9afb4c1767a058e6d5843cbb9a4ae7 + checksum: 10c0/0ae7f4098c63f442fd038de6034155bcf20214e7e490e92189decb2980932247b97cb069b11ac8bc471b53f71d6859e607969440d63ff400b8932ee3e05b4958 languageName: node linkType: hard -"@babel/plugin-transform-logical-assignment-operators@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.29.7" +"@babel/plugin-transform-member-expression-literals@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-member-expression-literals@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/b0b85f47bde7efd253b273bcbe317178df6f281b99f8399c04a3af1a8b0878ddb6e3d57e395292917d0376c337e57f4d64ad9f861001590a90f888c30abf2c51 + checksum: 10c0/ec8908a409bd39d20f0428e35425c9e4c540bad252a0e33e08b84e3bea5088c785531197bdcf049afbdba841325962a93030b7be6da3586cb13d0ca0ebab89c9 languageName: node linkType: hard -"@babel/plugin-transform-member-expression-literals@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-member-expression-literals@npm:7.29.7" +"@babel/plugin-transform-modules-amd@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-modules-amd@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-module-transforms": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/b8db313de0a4aeb3a617afcf9413774a53ec71a361030c89dbe2d05aa17310e9d33d4307727c898bfc9b07a9c676482fa8b0463840d1829c21323bc04623d556 + checksum: 10c0/074d26c79f517b27a07fef00319aff9705df1e6b41a805db855fe719e0f246b9815d6525cf1c5f0890c7f830dd0b9776e9b2493bbc929a3c23c0dee15f10a514 languageName: node linkType: hard -"@babel/plugin-transform-modules-amd@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-modules-amd@npm:7.29.7" +"@babel/plugin-transform-modules-commonjs@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.24.6" dependencies: - "@babel/helper-module-transforms": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-module-transforms": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-simple-access": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/425e9f99506968196a239944fe4eb51e144eadc2490b49a74798f92226f76b328d13b13e90e07962cd5df327994011570a3c2883b65091dde984b5bdff066c6b + checksum: 10c0/4fc790136d066105fa773ffc7e249d88c6f0d0126984ede36fedd51ac2b622b46c08565bcdd1ab62ac10195eeedeaba0d26e7e4c676ed50906cbed16540a4e22 languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.27.1, @babel/plugin-transform-modules-commonjs@npm:^7.29.7": +"@babel/plugin-transform-modules-commonjs@npm:^7.27.1": version: 7.29.7 resolution: "@babel/plugin-transform-modules-commonjs@npm:7.29.7" dependencies: @@ -2028,332 +2269,339 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.29.7": - version: 7.29.8 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.29.8" +"@babel/plugin-transform-modules-systemjs@npm:^7.24.6": + version: 7.29.7 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.29.7" dependencies: "@babel/helper-module-transforms": "npm:^7.29.7" "@babel/helper-plugin-utils": "npm:^7.29.7" "@babel/helper-validator-identifier": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.8" + "@babel/traverse": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/18167443bae93f485a43a1acdba9e53ac143043b93553d2ca1178030b68d4c1a7d5f5e717198aa8d73f39f33c023090af2270da774484105307e0fada5654687 + checksum: 10c0/7b950bcc4a4b077b742b9299c8c9d4285e15854e23816d0b1c1177fafda4c153f3c3c4487c1b965afbf7a69a8788fc75656d0c591b91f0a5a543faabe738ca58 languageName: node linkType: hard -"@babel/plugin-transform-modules-umd@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-modules-umd@npm:7.29.7" +"@babel/plugin-transform-modules-umd@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-modules-umd@npm:7.24.6" dependencies: - "@babel/helper-module-transforms": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-module-transforms": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/14545c7dfc8f95010766075d9cd4c1bf99a868c2dad7f780e9a609c6d94d23044f85672548b35a2162c027647386c0cfb85f68cee8f4e02352683acf6aade76d + checksum: 10c0/73c6cecb4f45ca3f665e2c57b6d04d65358518522dfaffb9b6913c026aeb704281d015324d02bf07f2cb026de6bac9308c62e82979364bd39f3687f752652b0d languageName: node linkType: hard -"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.29.7" +"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/e16e270fc3640baf403497cbbab196cc0f18477576cf3535713c851f69c6e27b2902cc7502c3a863dce7f0432dc344ddcb14766a2af7cf37333aa864c7e5739b + checksum: 10c0/92547309d81938488753f87b05a679a7557a1cec253756966044367c268b27311e51efad91724aa3e433cf61626e10bf1008e112998350c2013a87824c4cfe0b languageName: node linkType: hard -"@babel/plugin-transform-new-target@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-new-target@npm:7.29.7" +"@babel/plugin-transform-new-target@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-new-target@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/9a192ded7083850d5b3c5629a3da4fe209298ac9d7a84d1495916a5c841cd4017e4d126d98a3b7c322eafae3851345fe2670377a16561b9cbd817e952f6fdbd5 + checksum: 10c0/5e9b9edfbe46489f64013d2bbd422f29acdb8057ccc85e7c759f7cf1415fde6a82ac13a13f0f246defaba6e2f7f4d424178ba78fc02237bdbf7df6692fc1dca8 languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.29.7" +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/b0c186fe38bc66830e1be76f06fabbae8a655d3896a841ba5ffa12d6c40bb9c8a6ecd38a7e2196034b1d7470653109b1ceac1ef5e46a5fdc9291d14afa56e0d0 + checksum: 10c0/53ab5b16bbcf47e842a48f1f0774d238dae0222c3e1f31653307808048e249ed140cba12dfc280cbc9a577cb3bb5b2f50ca0e3e4ffe5260fcf8c3ca0b83fb21e languageName: node linkType: hard -"@babel/plugin-transform-numeric-separator@npm:^7.27.1, @babel/plugin-transform-numeric-separator@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-numeric-separator@npm:7.29.7" +"@babel/plugin-transform-numeric-separator@npm:^7.24.1, @babel/plugin-transform-numeric-separator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-numeric-separator@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a0e79a9627717277cc21ede56d8e57da0ac5e0c9620c963da2526791657044b57eeeafe27f297754cfdea470dd590c763e9bc71d589f1850654f77f5f4f77ece + checksum: 10c0/14863e735fc407e065e1574914864a956b8250a84cfb4704592656763c9455d67034c7745e53066725195d9ed042121f424c4aaee00027791640e2639386b701 languageName: node linkType: hard -"@babel/plugin-transform-object-rest-spread@npm:^7.28.4, @babel/plugin-transform-object-rest-spread@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-object-rest-spread@npm:7.29.7" +"@babel/plugin-transform-object-rest-spread@npm:^7.24.1, @babel/plugin-transform-object-rest-spread@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-object-rest-spread@npm:7.24.6" dependencies: - "@babel/helper-compilation-targets": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/plugin-transform-destructuring": "npm:^7.29.7" - "@babel/plugin-transform-parameters": "npm:^7.29.7" - "@babel/traverse": "npm:^7.29.7" + "@babel/helper-compilation-targets": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" + "@babel/plugin-transform-parameters": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/7963bcbb3165699cabad1ac5dcf03c26ffbe41c4a130283376d6e7a69ee6a353105c666e533e024bdf28862968434d1e13635846c8d8e7f5f9271407112aed1c + checksum: 10c0/1a192b9756ebfa0bc69ad5e285d7d0284963b4b95738ca7721354297329d5c1ab4eb05ff5b198cbfffa3ec00e97a15a712aa7a5011d9407478796966aab54527 languageName: node linkType: hard -"@babel/plugin-transform-object-super@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-object-super@npm:7.29.7" +"@babel/plugin-transform-object-super@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-object-super@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-replace-supers": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-replace-supers": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/eacfa0f571cb9bbdb283253b41c7a3cafe03e6da81ea92f61d003971b3ada43a3f65e5392d31ba3fe7da6cd8b4210968729769f22d3f0feb418db9e66f167413 + checksum: 10c0/2e48b9e0a1f3b04b439ede2d0c83bcc5324a81c8bab73c70f0c466cf48061a4ff469f283e2feb17b4cc2e20372c1362253604477ecd77e622192d5d7906aa062 languageName: node linkType: hard -"@babel/plugin-transform-optional-catch-binding@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.29.7" +"@babel/plugin-transform-optional-catch-binding@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0df7a9cdaec349e4b893cb26b7ad45454b3ac01de722ccea5e8b4332d15f3e1bc2c130a18367052ce195c957178ad773121c5d586454c438d890585fc548dacc + checksum: 10c0/411db3177b1bffd2f9e5b33a6b62e70158380e67d91ff4725755312e8a0a2f2c3fd340c60005295a672115fb593222ab2d7076266aebced6ef087a5505b6f371 languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.29.7" +"@babel/plugin-transform-optional-chaining@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-optional-chaining@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.6" + "@babel/plugin-syntax-optional-chaining": "npm:^7.8.3" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/71feacf9a7083030f4c69bf4e91db75f2fceae28e58c58b63db040006d908e15bc1e85a464f24ad659f17702e91a64eabbff9f1dd555ba33d78bb1af8a1d697a + checksum: 10c0/8ee5a500a2309444d4fb27979857598e9c91d804fe23217c51cc208b1bc6b9cd0650b355b1ebd625f180c5f1dc4cb89b5f313c982f7c89d90281a69b24a88ccb languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-parameters@npm:7.29.7" +"@babel/plugin-transform-parameters@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-parameters@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/ea1ff347e7b33b2483d18dcb9fb6c58f9819312f38235bf142e12f5355fcf77bb6640929734b12bd26b900c7abbb8cbd77ad06082d4c10d6e0e097ad016237e6 + checksum: 10c0/d9648924b9c0d35a243c0742c22838932a024205c61f4cc419857e5195edd893a33e6be4f2c8fbd89e925051c7cbe8968029ec2d3e7f2f098bfa682f4e2b9731 languageName: node linkType: hard -"@babel/plugin-transform-private-methods@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-private-methods@npm:7.29.7" +"@babel/plugin-transform-private-methods@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-private-methods@npm:7.24.6" dependencies: - "@babel/helper-create-class-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-class-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/d0dc12fa478d05e346dfb02fad2ed99b308d9a7324bada71530a62dc1ccbf07b4c2581ac677b7196b3994f191ef1922199e2c8f33957b726e2019ce07b4ced0f + checksum: 10c0/55f93959b2e8aeda818db7cdc7dfdcd5076f5bdc8a819566818004a68969fb7297d617f9d108bf76ac232d6056d9f9d20f73ce10380baa43ff1755c5591aa803 languageName: node linkType: hard -"@babel/plugin-transform-private-property-in-object@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-private-property-in-object@npm:7.29.7" +"@babel/plugin-transform-private-property-in-object@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-private-property-in-object@npm:7.24.6" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.29.7" - "@babel/helper-create-class-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-create-class-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6378b34725c6aab4b580cbb5d35ca45ba52213084d54c6672bc4282d86dc45937b8788ad450a9fb60ceb405e3c0d4b25e2804293c2509b54c5e0078babd56a8a + checksum: 10c0/c9eb9597362b598a91536375a49ba80cdf13461e849680e040898b103f7998c4d33a7832da5afba9fa51e3473f79cf8605f9ace07a887e386b7801797021631b languageName: node linkType: hard -"@babel/plugin-transform-property-literals@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-property-literals@npm:7.29.7" +"@babel/plugin-transform-property-literals@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-property-literals@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/231ef97caeed1b79676978c9c04f203ba39f98da79097b733946aa29eb302d7cefc863d407f032a805080e8d20f70d7b2265c9c3ce634ca627d63c8f0f6e6e42 + checksum: 10c0/d1195d93406b6c400cdbc9ac57a2b8b58c72cc6480cc03656abfc243be0e2a48133cbb96559c2db95b1c78803daeb538277821540fe19e2a9105905e727ef618 languageName: node linkType: hard -"@babel/plugin-transform-react-display-name@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-react-display-name@npm:7.29.7" +"@babel/plugin-transform-react-display-name@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-react-display-name@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0a3b2461b189d6f4ca4f691bb4d1872bdebbac90d2e933a42a2fb22a0d26c81fa1ba7bc8128f3886b3f0f8a0ffe5aa0d7eaf4cd5b9610fc4967913a060501781 + checksum: 10c0/e929d054035fa3b7432bd2b3e5cf280ffd8cf60d1ce80c863c5e0b03ad01bf6ae2546575d2da31cca2ab83d9399ac01a351f20e21af5075d9c0d4c893e4a36bd languageName: node linkType: hard -"@babel/plugin-transform-react-jsx-development@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-react-jsx-development@npm:7.29.7" +"@babel/plugin-transform-react-jsx-development@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-react-jsx-development@npm:7.24.6" dependencies: - "@babel/plugin-transform-react-jsx": "npm:^7.29.7" + "@babel/plugin-transform-react-jsx": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a2d44d068d35f8e6bc0437ba0da86526d4473491a43108caf77cba467a3ab522cbd09bcd8184b7a49f3d2b52e0883ad797ed2f91c090b857a80a6f383e88f449 + checksum: 10c0/f899ffa65c7f459a682246a346af0e4132929ffe928cb0d02ae08aac1cf3fb01b2f6e944ef1eaca78f14e94eff935e2bf96aad878030c25ff6de2070a8b72448 languageName: node linkType: hard -"@babel/plugin-transform-react-jsx@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-react-jsx@npm:7.29.7" +"@babel/plugin-transform-react-jsx@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-react-jsx@npm:7.24.6" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.29.7" - "@babel/helper-module-imports": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/plugin-syntax-jsx": "npm:^7.29.7" - "@babel/types": "npm:^7.29.7" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-module-imports": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-jsx": "npm:^7.24.6" + "@babel/types": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/ae6487c3deafcffda8a2c1b1eb77e0b7121630fa1a9646cecd73dbbdd8271532a0f7f0e8c01f69b6d39a36d8d79eb67e2d51031369c9055f18f7d8e70d9b5446 + checksum: 10c0/6144f56a76529a82077475583a17be8f0b0b461c83673e650f3894e09dbe2bcdfdbfff089eca2e5e239e119f72cd9562749a9af7eb3f2e3266a730da31cd19f2 languageName: node linkType: hard -"@babel/plugin-transform-react-pure-annotations@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.29.7" +"@babel/plugin-transform-react-pure-annotations@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-react-pure-annotations@npm:7.24.6" dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/ad85d57dfa105cd19dc5271f68c9a3e134ab96edce9b8c6b521fdb158499bc616df9d4ee9b386e9dc5532e67bd5682ba2047b88550699d7f1060eaaba80fb6d1 + checksum: 10c0/7f83c5a3a275dbb9a291dee4642a3a0f2249265346d8d3cc9324fc9ee063c3e35c3853b52752ece603f0ac92b405deb38c4b5307a99a74d3e1c9c32a2cefa465 languageName: node linkType: hard -"@babel/plugin-transform-regenerator@npm:^7.29.7": - version: 7.29.8 - resolution: "@babel/plugin-transform-regenerator@npm:7.29.8" +"@babel/plugin-transform-regenerator@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-regenerator@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + regenerator-transform: "npm:^0.15.2" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/768da9bc3c8cbb0c591bc7db050215b8cea44df9df525d5cd6034aa179b091c2321a745b68139b3fc70b4493f2df1fc99a57acd4029c6d355d32a8ed8bd69f82 + checksum: 10c0/d17eaa97514d583866182420024b8c22da2c6ca822bdbf16fe7564121564c1844935592dc3315c73d1f78f7c908a4338b1d783618811e694c9bb6d5f9233e58d languageName: node linkType: hard -"@babel/plugin-transform-regexp-modifiers@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-regexp-modifiers@npm:7.29.7" +"@babel/plugin-transform-reserved-words@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-reserved-words@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/1c6c79f87a7163d33c1c9d787d239e3981755a66822ef0d41a95ce12e76277a247eaeeab29e3cf79bb6288e37e48a18accc13c3a9c351c06e4303b1d9b8b37cb + "@babel/core": ^7.0.0-0 + checksum: 10c0/5d2d4c579bd90c60fc6468a1285b3384e7b650b47d41a937a1590d4aecfc28bd945e82704c6e71cc91aa016b7e78c5594290c1c386edf11ec98e09e36235c5ae languageName: node linkType: hard -"@babel/plugin-transform-reserved-words@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-reserved-words@npm:7.29.7" +"@babel/plugin-transform-runtime@npm:^7.24.3": + version: 7.24.6 + resolution: "@babel/plugin-transform-runtime@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-module-imports": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + babel-plugin-polyfill-corejs2: "npm:^0.4.10" + babel-plugin-polyfill-corejs3: "npm:^0.10.1" + babel-plugin-polyfill-regenerator: "npm:^0.6.1" + semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/9eee586b7c7a9a34a659fd4d55ae8b156b03c8120a8459724062c212a59327ee8878168c0ce6bb5abd6c2a28aa87bc280b5180b1cbb2b03b12f7c71690f48718 + checksum: 10c0/89c43c1236506ecbfc547b12936283ca41e611430c2d2e6d12bf1cbdb0d80760cdae481951f486946733e1c9ae064cb05f4bc779c65b3288d40963b0c4a20c5c languageName: node linkType: hard -"@babel/plugin-transform-runtime@npm:^7.28.5": - version: 7.29.7 - resolution: "@babel/plugin-transform-runtime@npm:7.29.7" +"@babel/plugin-transform-shorthand-properties@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-shorthand-properties@npm:7.24.6" dependencies: - "@babel/helper-module-imports": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - babel-plugin-polyfill-corejs2: "npm:^0.4.14" - babel-plugin-polyfill-corejs3: "npm:^0.13.0" - babel-plugin-polyfill-regenerator: "npm:^0.6.5" - semver: "npm:^6.3.1" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/570592fc99e55a976000532c5006ac7721b5c508fb905f4f919032291dcd3836617622d1c74177b1f872c88bb48c3f707cb6c2f7477d86d191d8b412d32385e9 + checksum: 10c0/4141b5da1d0d20d66ca0affaef8dfc45ed5e954bfa9003eb8aa779842599de443b37c2b265da27693f304c35ab68a682b44098e9eea0d39f8f94072ab616657f languageName: node linkType: hard -"@babel/plugin-transform-shorthand-properties@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-shorthand-properties@npm:7.29.7" +"@babel/plugin-transform-spread@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-spread@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0f28300b873ce874c759917c7b22f68d5145a9c2d97df076e23dca99f8aa565dfceeb7e487af330e01d3e07d78f80d05b584aa411c60a63128b6a04a7633d45b + checksum: 10c0/6d12da05311690c4a73d775688ba6931b441e96e512377a166a60184292edeac0b17f5154a49e2f1d262a3f80b96e064bc9c88c63b2a6125f0a2132eff9ed585 languageName: node linkType: hard -"@babel/plugin-transform-spread@npm:^7.29.7": - version: 7.29.11 - resolution: "@babel/plugin-transform-spread@npm:7.29.11" +"@babel/plugin-transform-sticky-regex@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-sticky-regex@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/31be19b71373243582d478eb0f524b298e31c9881d56851937317398101566ecc02e226acba887751156a5aca5527934e7e4aab1ced5b2965034ad3a3e2bfefa + checksum: 10c0/2a65f57554f51d3b9cd035513a610f47e46b26dba112b3b9fb42d1c1f2ae153fce8f76294b4721d099817814f57895c656f5b7dccd5df683277da6522c817ee9 languageName: node linkType: hard -"@babel/plugin-transform-sticky-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-sticky-regex@npm:7.29.7" +"@babel/plugin-transform-template-literals@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-template-literals@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/45b245f07841cc30a8e781a77bb09a2e86b2cc7f872785f315c92e2805825be43ac99f3ba63afcd4722307c648cb7d3f4f6f3e2b27d2d3e281414532a2601762 + checksum: 10c0/fcde48e9c3ecd7f5f37ceb6908f1edd537d3115fc2f27d187d58fd83b2a13637a1bb3d24589d841529ed081405b951bf1c5d194ea81eff6ad2d88204d153010d languageName: node linkType: hard -"@babel/plugin-transform-template-literals@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-template-literals@npm:7.29.7" +"@babel/plugin-transform-typeof-symbol@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-typeof-symbol@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/961c2b42eb6d88042c2c213ed3b11ee1d92783ba63e1afe7e1a3392ec1a810556b5eec369fc5097a4a81f73ef92fa5d245bcf8b15d442e62a086bb1f64b50c95 + checksum: 10c0/a24b3a3c7b87c6496ee13d2438effd4645868f054397357ec3cbe92a2f0df4152ac7fd7228cb956576c1b772c0675b065d6ad5f5053c382e97dd022015e9a028 languageName: node linkType: hard -"@babel/plugin-transform-typeof-symbol@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-typeof-symbol@npm:7.29.7" +"@babel/plugin-transform-typescript@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-typescript@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-annotate-as-pure": "npm:^7.24.6" + "@babel/helper-create-class-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/plugin-syntax-typescript": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/937408e0b9b2c8df6a6ce590421096fd793f77b417eb1f3f5ec560362e0a855d6ef66346c12cc7b337b8fa1d3ecf6b9b15674aa5ded54141adaed4cdeeed8528 + checksum: 10c0/46b054e4d4253187403e392ef30f4dd624d8486a1992703f5ff1b415d4e8d00f474e35fb77bc7a3a16a17330873cadcd5af4a8493c61b16da2dde212b2788ccd languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.28.5, @babel/plugin-transform-typescript@npm:^7.29.7": - version: 7.29.9 - resolution: "@babel/plugin-transform-typescript@npm:7.29.9" +"@babel/plugin-transform-typescript@npm:^7.28.5": + version: 7.29.7 + resolution: "@babel/plugin-transform-typescript@npm:7.29.7" dependencies: "@babel/helper-annotate-as-pure": "npm:^7.29.7" "@babel/helper-create-class-features-plugin": "npm:^7.29.7" @@ -2362,135 +2610,145 @@ __metadata: "@babel/plugin-syntax-typescript": "npm:^7.29.7" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/6caf62e8359fa08b112d7762036cd3c82ec5c5fd604f5faf4446a7f7b8fa8a85e5536e8425dc61dc3846316b5fdc9adb59de0cc51e39d3354a89bb31705f36de + checksum: 10c0/8bf6a89c6827af6f11d4b189f1f97a64b8d754cc4caa5cbae16a6a8b113294d7f310dd40efd82e87ebcff2a1c683584b872d6d8960abe88d48f441d42f94c4d1 languageName: node linkType: hard -"@babel/plugin-transform-unicode-escapes@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.29.7" +"@babel/plugin-transform-unicode-escapes@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-unicode-escapes@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/65090012ede685913fb1020a585361dac366801d87caa577075924cac3c3ddd8e2a953bc6f75048dd480e62e529482e6ba68b945b0780087981c9ffff32e84f2 + checksum: 10c0/0e4038c589b7a63a2469466a25b78aad4ecb7267732e3c953c3055f9a77c7bee859a71983a08b025179f1b094964f2ebbfca1b6c33de4ead90a0b5ef06ddb47e languageName: node linkType: hard -"@babel/plugin-transform-unicode-property-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.29.7" +"@babel/plugin-transform-unicode-property-regex@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-unicode-property-regex@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/3a869cab02013209192da67ce911fa577eed03293331ee1d2c98498461f31fb5e99cbcb47f0c1c3211cf0c48fdd391060c77ac6a8f9978cd1f48e1096024cb73 + checksum: 10c0/bca99e00de91d0460dfcb25f285f3606248acc905193c05587e2862c54ddb790c5d8cb45e80927290390cffbcba7620f8af3e74c5301ff0c1c59ce7d47c5629f languageName: node linkType: hard -"@babel/plugin-transform-unicode-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-unicode-regex@npm:7.29.7" +"@babel/plugin-transform-unicode-regex@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-unicode-regex@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/1bd788fd953e9b9a662d9a5ec78750f48daa6ef142a141cc96c38278dff49cf082288fd568acc184386f9accb89fa145cf016cc615ef19bd110ff2162a88cfd7 + checksum: 10c0/ab6e253cfc38c7e8a2844d7ad46f85fdcbe33610b7f92f71045cf0b040438a08f1f1717ab4b84c480537f54e5478db8b404a4ccc2ff846b4e3ed33d373e3b47a languageName: node linkType: hard -"@babel/plugin-transform-unicode-sets-regex@npm:^7.29.7": - version: 7.29.7 - resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.29.7" +"@babel/plugin-transform-unicode-sets-regex@npm:^7.24.6": + version: 7.24.6 + resolution: "@babel/plugin-transform-unicode-sets-regex@npm:7.24.6" dependencies: - "@babel/helper-create-regexp-features-plugin": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" + "@babel/helper-create-regexp-features-plugin": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10c0/7e07f6435b2ba32de80460ddcacc4214c9380984c00fd41ddaa79e4df3f06c022c1283e86bcae7ee09081f4e020f0bb76b26b9f98dc5ea7f4647f559544fe5f9 + checksum: 10c0/a52e84f85519fed330e88f7a17611064d2b5f1d0fe2823f8113ed312828e69787888bd023f404e8d35d0bb96461e42e19cdc4f0a44d35959bc86c219a3062237 languageName: node linkType: hard -"@babel/preset-env@npm:^7.28.5": - version: 7.29.7 - resolution: "@babel/preset-env@npm:7.29.7" - dependencies: - "@babel/compat-data": "npm:^7.29.7" - "@babel/helper-compilation-targets": "npm:^7.29.7" - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-validator-option": "npm:^7.29.7" - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "npm:^7.29.7" - "@babel/plugin-bugfix-safari-class-field-initializer-scope": "npm:^7.29.7" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "npm:^7.29.7" - "@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": "npm:^7.29.7" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "npm:^7.29.7" - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "npm:^7.29.7" +"@babel/preset-env@npm:^7.24.4": + version: 7.24.6 + resolution: "@babel/preset-env@npm:7.24.6" + dependencies: + "@babel/compat-data": "npm:^7.24.6" + "@babel/helper-compilation-targets": "npm:^7.24.6" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-validator-option": "npm:^7.24.6" + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "npm:^7.24.6" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "npm:^7.24.6" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "npm:^7.24.6" + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "npm:^7.24.6" "@babel/plugin-proposal-private-property-in-object": "npm:7.21.0-placeholder-for-preset-env.2" - "@babel/plugin-syntax-import-assertions": "npm:^7.29.7" - "@babel/plugin-syntax-import-attributes": "npm:^7.29.7" + "@babel/plugin-syntax-async-generators": "npm:^7.8.4" + "@babel/plugin-syntax-class-properties": "npm:^7.12.13" + "@babel/plugin-syntax-class-static-block": "npm:^7.14.5" + "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" + "@babel/plugin-syntax-export-namespace-from": "npm:^7.8.3" + "@babel/plugin-syntax-import-assertions": "npm:^7.24.6" + "@babel/plugin-syntax-import-attributes": "npm:^7.24.6" + "@babel/plugin-syntax-import-meta": "npm:^7.10.4" + "@babel/plugin-syntax-json-strings": "npm:^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators": "npm:^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator": "npm:^7.8.3" + "@babel/plugin-syntax-numeric-separator": "npm:^7.10.4" + "@babel/plugin-syntax-object-rest-spread": "npm:^7.8.3" + "@babel/plugin-syntax-optional-catch-binding": "npm:^7.8.3" + "@babel/plugin-syntax-optional-chaining": "npm:^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "npm:^7.14.5" + "@babel/plugin-syntax-top-level-await": "npm:^7.14.5" "@babel/plugin-syntax-unicode-sets-regex": "npm:^7.18.6" - "@babel/plugin-transform-arrow-functions": "npm:^7.29.7" - "@babel/plugin-transform-async-generator-functions": "npm:^7.29.7" - "@babel/plugin-transform-async-to-generator": "npm:^7.29.7" - "@babel/plugin-transform-block-scoped-functions": "npm:^7.29.7" - "@babel/plugin-transform-block-scoping": "npm:^7.29.7" - "@babel/plugin-transform-class-properties": "npm:^7.29.7" - "@babel/plugin-transform-class-static-block": "npm:^7.29.7" - "@babel/plugin-transform-classes": "npm:^7.29.7" - "@babel/plugin-transform-computed-properties": "npm:^7.29.7" - "@babel/plugin-transform-destructuring": "npm:^7.29.7" - "@babel/plugin-transform-dotall-regex": "npm:^7.29.7" - "@babel/plugin-transform-duplicate-keys": "npm:^7.29.7" - "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "npm:^7.29.7" - "@babel/plugin-transform-dynamic-import": "npm:^7.29.7" - "@babel/plugin-transform-explicit-resource-management": "npm:^7.29.7" - "@babel/plugin-transform-exponentiation-operator": "npm:^7.29.7" - "@babel/plugin-transform-export-namespace-from": "npm:^7.29.7" - "@babel/plugin-transform-for-of": "npm:^7.29.7" - "@babel/plugin-transform-function-name": "npm:^7.29.7" - "@babel/plugin-transform-json-strings": "npm:^7.29.7" - "@babel/plugin-transform-literals": "npm:^7.29.7" - "@babel/plugin-transform-logical-assignment-operators": "npm:^7.29.7" - "@babel/plugin-transform-member-expression-literals": "npm:^7.29.7" - "@babel/plugin-transform-modules-amd": "npm:^7.29.7" - "@babel/plugin-transform-modules-commonjs": "npm:^7.29.7" - "@babel/plugin-transform-modules-systemjs": "npm:^7.29.7" - "@babel/plugin-transform-modules-umd": "npm:^7.29.7" - "@babel/plugin-transform-named-capturing-groups-regex": "npm:^7.29.7" - "@babel/plugin-transform-new-target": "npm:^7.29.7" - "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.29.7" - "@babel/plugin-transform-numeric-separator": "npm:^7.29.7" - "@babel/plugin-transform-object-rest-spread": "npm:^7.29.7" - "@babel/plugin-transform-object-super": "npm:^7.29.7" - "@babel/plugin-transform-optional-catch-binding": "npm:^7.29.7" - "@babel/plugin-transform-optional-chaining": "npm:^7.29.7" - "@babel/plugin-transform-parameters": "npm:^7.29.7" - "@babel/plugin-transform-private-methods": "npm:^7.29.7" - "@babel/plugin-transform-private-property-in-object": "npm:^7.29.7" - "@babel/plugin-transform-property-literals": "npm:^7.29.7" - "@babel/plugin-transform-regenerator": "npm:^7.29.7" - "@babel/plugin-transform-regexp-modifiers": "npm:^7.29.7" - "@babel/plugin-transform-reserved-words": "npm:^7.29.7" - "@babel/plugin-transform-shorthand-properties": "npm:^7.29.7" - "@babel/plugin-transform-spread": "npm:^7.29.7" - "@babel/plugin-transform-sticky-regex": "npm:^7.29.7" - "@babel/plugin-transform-template-literals": "npm:^7.29.7" - "@babel/plugin-transform-typeof-symbol": "npm:^7.29.7" - "@babel/plugin-transform-unicode-escapes": "npm:^7.29.7" - "@babel/plugin-transform-unicode-property-regex": "npm:^7.29.7" - "@babel/plugin-transform-unicode-regex": "npm:^7.29.7" - "@babel/plugin-transform-unicode-sets-regex": "npm:^7.29.7" + "@babel/plugin-transform-arrow-functions": "npm:^7.24.6" + "@babel/plugin-transform-async-generator-functions": "npm:^7.24.6" + "@babel/plugin-transform-async-to-generator": "npm:^7.24.6" + "@babel/plugin-transform-block-scoped-functions": "npm:^7.24.6" + "@babel/plugin-transform-block-scoping": "npm:^7.24.6" + "@babel/plugin-transform-class-properties": "npm:^7.24.6" + "@babel/plugin-transform-class-static-block": "npm:^7.24.6" + "@babel/plugin-transform-classes": "npm:^7.24.6" + "@babel/plugin-transform-computed-properties": "npm:^7.24.6" + "@babel/plugin-transform-destructuring": "npm:^7.24.6" + "@babel/plugin-transform-dotall-regex": "npm:^7.24.6" + "@babel/plugin-transform-duplicate-keys": "npm:^7.24.6" + "@babel/plugin-transform-dynamic-import": "npm:^7.24.6" + "@babel/plugin-transform-exponentiation-operator": "npm:^7.24.6" + "@babel/plugin-transform-export-namespace-from": "npm:^7.24.6" + "@babel/plugin-transform-for-of": "npm:^7.24.6" + "@babel/plugin-transform-function-name": "npm:^7.24.6" + "@babel/plugin-transform-json-strings": "npm:^7.24.6" + "@babel/plugin-transform-literals": "npm:^7.24.6" + "@babel/plugin-transform-logical-assignment-operators": "npm:^7.24.6" + "@babel/plugin-transform-member-expression-literals": "npm:^7.24.6" + "@babel/plugin-transform-modules-amd": "npm:^7.24.6" + "@babel/plugin-transform-modules-commonjs": "npm:^7.24.6" + "@babel/plugin-transform-modules-systemjs": "npm:^7.24.6" + "@babel/plugin-transform-modules-umd": "npm:^7.24.6" + "@babel/plugin-transform-named-capturing-groups-regex": "npm:^7.24.6" + "@babel/plugin-transform-new-target": "npm:^7.24.6" + "@babel/plugin-transform-nullish-coalescing-operator": "npm:^7.24.6" + "@babel/plugin-transform-numeric-separator": "npm:^7.24.6" + "@babel/plugin-transform-object-rest-spread": "npm:^7.24.6" + "@babel/plugin-transform-object-super": "npm:^7.24.6" + "@babel/plugin-transform-optional-catch-binding": "npm:^7.24.6" + "@babel/plugin-transform-optional-chaining": "npm:^7.24.6" + "@babel/plugin-transform-parameters": "npm:^7.24.6" + "@babel/plugin-transform-private-methods": "npm:^7.24.6" + "@babel/plugin-transform-private-property-in-object": "npm:^7.24.6" + "@babel/plugin-transform-property-literals": "npm:^7.24.6" + "@babel/plugin-transform-regenerator": "npm:^7.24.6" + "@babel/plugin-transform-reserved-words": "npm:^7.24.6" + "@babel/plugin-transform-shorthand-properties": "npm:^7.24.6" + "@babel/plugin-transform-spread": "npm:^7.24.6" + "@babel/plugin-transform-sticky-regex": "npm:^7.24.6" + "@babel/plugin-transform-template-literals": "npm:^7.24.6" + "@babel/plugin-transform-typeof-symbol": "npm:^7.24.6" + "@babel/plugin-transform-unicode-escapes": "npm:^7.24.6" + "@babel/plugin-transform-unicode-property-regex": "npm:^7.24.6" + "@babel/plugin-transform-unicode-regex": "npm:^7.24.6" + "@babel/plugin-transform-unicode-sets-regex": "npm:^7.24.6" "@babel/preset-modules": "npm:0.1.6-no-external-plugins" - babel-plugin-polyfill-corejs2: "npm:^0.4.15" - babel-plugin-polyfill-corejs3: "npm:^0.14.0" - babel-plugin-polyfill-regenerator: "npm:^0.6.6" - core-js-compat: "npm:^3.48.0" + babel-plugin-polyfill-corejs2: "npm:^0.4.10" + babel-plugin-polyfill-corejs3: "npm:^0.10.4" + babel-plugin-polyfill-regenerator: "npm:^0.6.1" + core-js-compat: "npm:^3.31.0" semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a6527c75e54c06c453e214496df83c2f6aa61da32d786e9a8921af05c4bc580c87ee64248122652df8d0f4b140d651b11282cd3dc3b61bb640b2a86b5812eabf + checksum: 10c0/d837d294197803d550e48d9458a356853a54a0528e7cdc51c2b8a5d8dfe41c6fbc597b4fc67464615a7385198a3db2e839da15cca7b9502fedf27170fc6ef673 languageName: node linkType: hard @@ -2507,34 +2765,34 @@ __metadata: languageName: node linkType: hard -"@babel/preset-react@npm:^7.28.5": - version: 7.29.7 - resolution: "@babel/preset-react@npm:7.29.7" +"@babel/preset-react@npm:^7.24.1": + version: 7.24.6 + resolution: "@babel/preset-react@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-validator-option": "npm:^7.29.7" - "@babel/plugin-transform-react-display-name": "npm:^7.29.7" - "@babel/plugin-transform-react-jsx": "npm:^7.29.7" - "@babel/plugin-transform-react-jsx-development": "npm:^7.29.7" - "@babel/plugin-transform-react-pure-annotations": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-validator-option": "npm:^7.24.6" + "@babel/plugin-transform-react-display-name": "npm:^7.24.6" + "@babel/plugin-transform-react-jsx": "npm:^7.24.6" + "@babel/plugin-transform-react-jsx-development": "npm:^7.24.6" + "@babel/plugin-transform-react-pure-annotations": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/a84e90805ce06dd5d7fcbfd8e32fe0c79966feba218e1d89097699ff5224d232e56191688ae264be2c6ef516523e3e2246949439e1e141d21def881a5752181f + checksum: 10c0/edc470b86dfcfdedf53feca3f2266bd7f836a300806938a422f4120d39bbdea6a780b9b0a9ac0333e0bb1b8e554699a74cafd135b2a75b02b77ef1b21f7c7f62 languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.28.5": - version: 7.29.7 - resolution: "@babel/preset-typescript@npm:7.29.7" +"@babel/preset-typescript@npm:^7.24.1": + version: 7.24.6 + resolution: "@babel/preset-typescript@npm:7.24.6" dependencies: - "@babel/helper-plugin-utils": "npm:^7.29.7" - "@babel/helper-validator-option": "npm:^7.29.7" - "@babel/plugin-syntax-jsx": "npm:^7.29.7" - "@babel/plugin-transform-modules-commonjs": "npm:^7.29.7" - "@babel/plugin-transform-typescript": "npm:^7.29.7" + "@babel/helper-plugin-utils": "npm:^7.24.6" + "@babel/helper-validator-option": "npm:^7.24.6" + "@babel/plugin-syntax-jsx": "npm:^7.24.6" + "@babel/plugin-transform-modules-commonjs": "npm:^7.24.6" + "@babel/plugin-transform-typescript": "npm:^7.24.6" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/40746a23a7ab46c0beb1c02d69883d9ffbe3043685cb3ae5363644391376b9261189fdad317191349e322c2c9bc550b031daa42470a1f8987362e4c56e492194 + checksum: 10c0/bfcef91ed80d67301301e17a799814457b57bfd0d85d9897dce6df6ed0b0af155c0f5b2af7a1a122a3f36faaaa1de87ccf9954ce06d2f440898ffdfaf18aab86 languageName: node linkType: hard @@ -2553,6 +2811,13 @@ __metadata: languageName: node linkType: hard +"@babel/regjsgen@npm:^0.8.0": + version: 0.8.0 + resolution: "@babel/regjsgen@npm:0.8.0" + checksum: 10c0/4f3ddd8c7c96d447e05c8304c1d5ba3a83fcabd8a716bc1091c2f31595cdd43a3a055fff7cb5d3042b8cb7d402d78820fcb4e05d896c605a7d8bcf30f2424c4a + languageName: node + linkType: hard + "@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.28.4": version: 7.29.7 resolution: "@babel/runtime@npm:7.29.7" @@ -2560,7 +2825,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.7": +"@babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.24.4, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7": version: 7.24.6 resolution: "@babel/runtime@npm:7.24.6" dependencies: @@ -2587,21 +2852,14 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.21.0": - version: 7.22.5 - resolution: "@babel/runtime@npm:7.22.5" - dependencies: - regenerator-runtime: "npm:^0.13.11" - checksum: 10c0/11dcaeecd2246857ccf22f939fcae28a58d29e410607bfa28b95d9b03e298a3e3df8a530e22637d5bfccfc1661fb39cc50c06b404b5d53454bd93889c7dd3eb8 - languageName: node - linkType: hard - -"@babel/runtime@npm:~7.18.3": - version: 7.18.9 - resolution: "@babel/runtime@npm:7.18.9" +"@babel/template@npm:^7.24.6, @babel/template@npm:^7.27.2": + version: 7.27.2 + resolution: "@babel/template@npm:7.27.2" dependencies: - regenerator-runtime: "npm:^0.13.4" - checksum: 10c0/f996fca79e2cd3c80289c2655e95358254f0437ca28cf10ec4343498dd4a59002fc506d5ce6f37019f1a961e8f26ce43523844ee5a87412d32c17a8ef2f608ee + "@babel/code-frame": "npm:^7.27.1" + "@babel/parser": "npm:^7.27.2" + "@babel/types": "npm:^7.27.1" + checksum: 10c0/ed9e9022651e463cc5f2cc21942f0e74544f1754d231add6348ff1b472985a3b3502041c0be62dc99ed2d12cfae0c51394bf827452b98a2f8769c03b87aadc81 languageName: node linkType: hard @@ -2616,28 +2874,75 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.28.0, @babel/traverse@npm:^7.29.10, @babel/traverse@npm:^7.29.7, @babel/traverse@npm:^7.29.8": - version: 7.29.10 - resolution: "@babel/traverse@npm:7.29.10" +"@babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.27.1, @babel/traverse@npm:^7.28.0, @babel/traverse@npm:^7.28.3": + version: 7.28.5 + resolution: "@babel/traverse@npm:7.28.5" + dependencies: + "@babel/code-frame": "npm:^7.27.1" + "@babel/generator": "npm:^7.28.5" + "@babel/helper-globals": "npm:^7.28.0" + "@babel/parser": "npm:^7.28.5" + "@babel/template": "npm:^7.27.2" + "@babel/types": "npm:^7.28.5" + debug: "npm:^4.3.1" + checksum: 10c0/f6c4a595993ae2b73f2d4cd9c062f2e232174d293edd4abe1d715bd6281da8d99e47c65857e8d0917d9384c65972f4acdebc6749a7c40a8fcc38b3c7fb3e706f + languageName: node + linkType: hard + +"@babel/traverse@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/traverse@npm:7.29.7" dependencies: "@babel/code-frame": "npm:^7.29.7" - "@babel/generator": "npm:^7.29.8" + "@babel/generator": "npm:^7.29.7" "@babel/helper-globals": "npm:^7.29.7" - "@babel/parser": "npm:^7.29.9" + "@babel/parser": "npm:^7.29.7" "@babel/template": "npm:^7.29.7" - "@babel/types": "npm:^7.29.8" + "@babel/types": "npm:^7.29.7" debug: "npm:^4.3.1" - checksum: 10c0/dc97fc5ac9778ba3fa7df2dcff0811bca4466173ad710d9be94ffd82c9944cfa962df33d144fd59b6256fc7ab895aad30d830aade8a8a96327c8f49fbb487fda + checksum: 10c0/e256a1fbdb956555b76f3c285b1e453f6bedec8b3afb61751d99d933efd11c7d79caf5ddf2493570058a9f7deaa1b48324380d7c1aa1443fd9508becbf56331a + languageName: node + linkType: hard + +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.26.0, @babel/types@npm:^7.27.1, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.28.5": + version: 7.28.5 + resolution: "@babel/types@npm:7.28.5" + dependencies: + "@babel/helper-string-parser": "npm:^7.27.1" + "@babel/helper-validator-identifier": "npm:^7.28.5" + checksum: 10c0/a5a483d2100befbf125793640dec26b90b95fd233a94c19573325898a5ce1e52cdfa96e495c7dcc31b5eca5b66ce3e6d4a0f5a4a62daec271455959f208ab08a + languageName: node + linkType: hard + +"@babel/types@npm:^7.18.9, @babel/types@npm:^7.24.6, @babel/types@npm:^7.4.4": + version: 7.24.6 + resolution: "@babel/types@npm:7.24.6" + dependencies: + "@babel/helper-string-parser": "npm:^7.24.6" + "@babel/helper-validator-identifier": "npm:^7.24.6" + to-fast-properties: "npm:^2.0.0" + checksum: 10c0/1d94d92d97ef49030ad7f9e14cfccfeb70b1706dabcaa69037e659ec9d2c3178fb005d2088cce40d88dfc1306153d9157fe038a79ea2be92e5e6b99a59ef80cc languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.26.0, @babel/types@npm:^7.27.3, @babel/types@npm:^7.28.2, @babel/types@npm:^7.29.11, @babel/types@npm:^7.29.7, @babel/types@npm:^7.29.8, @babel/types@npm:^7.4.4": - version: 7.29.11 - resolution: "@babel/types@npm:7.29.11" +"@babel/types@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/types@npm:7.29.7" dependencies: - "@babel/helper-string-parser": "npm:^7.29.11" + "@babel/helper-string-parser": "npm:^7.29.7" "@babel/helper-validator-identifier": "npm:^7.29.7" - checksum: 10c0/d0d4edd2fbff0a8e79af1fea3c3c056de86bc0e01ed734d00062287638379933a232f087959c6eb67365c2f4fb44d57b88793cd1e87f0aad568f1c8b3b94da80 + checksum: 10c0/b6623994c69717fa27294f5fa46d59140338e2d86c6c1c13085c84ef7d53086ee357fbf4fe9abe3dd3da75734dc77c4c0df2f90fb29e667558bb3b3fb705e88f + languageName: node + linkType: hard + +"@babel/types@npm:^7.8.3": + version: 7.25.6 + resolution: "@babel/types@npm:7.25.6" + dependencies: + "@babel/helper-string-parser": "npm:^7.24.8" + "@babel/helper-validator-identifier": "npm:^7.24.7" + to-fast-properties: "npm:^2.0.0" + checksum: 10c0/89d45fbee24e27a05dca2d08300a26b905bd384a480448823f6723c72d3a30327c517476389b7280ce8cb9a2c48ef8f47da7f9f6d326faf6f53fd6b68237bdc4 languageName: node linkType: hard @@ -2982,6 +3287,46 @@ __metadata: languageName: node linkType: hard +"@clickhouse/clickstack-browser@npm:^1.2.1": + version: 1.2.1 + resolution: "@clickhouse/clickstack-browser@npm:1.2.1" + dependencies: + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/browser-instrumentation": "npm:^0.9.0" + "@opentelemetry/core": "npm:^2.12.0" + "@opentelemetry/instrumentation-long-task": "npm:^0.67.0" + "@opentelemetry/otlp-transformer": "npm:^0.223.0" + "@opentelemetry/resources": "npm:^2.12.0" + "@opentelemetry/sdk-logs": "npm:^0.223.0" + "@opentelemetry/sdk-trace": "npm:^2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.43.0" + "@rrweb/record": "npm:~2.2.0" + peerDependencies: + "@opentelemetry/api": ">=1.9.1 <1.10.0" + "@opentelemetry/browser-sdk": ^0.6.0 + checksum: 10c0/0cd745d118b16faee1399c0d5577f75fde042b9714daaa0cbbc76ab607660364e830c72322f9327d88b0cdc1d517bd5d4e223263019285f8f8bab046b93eb64f + languageName: node + linkType: hard + +"@clickhouse/clickstack-node@npm:^1.0.2": + version: 1.0.2 + resolution: "@clickhouse/clickstack-node@npm:1.0.2" + dependencies: + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/auto-instrumentations-node": "npm:^0.81.0" + "@opentelemetry/core": "npm:^2.12.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/instrumentation-console": "npm:^0.5.0" + "@opentelemetry/resources": "npm:^2.12.0" + "@opentelemetry/sdk-node": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.43.0" + import-in-the-middle: "npm:^3.5.2" + peerDependencies: + "@opentelemetry/api": ">=1.9.1 <1.10.0" + checksum: 10c0/5bfe331b719ea11b69f131ca5b5072e3c58372bd4ab5c7582c5138a3141b1d2caf69fd8029f9567172558b6800147fc7503df9e711d69ff3546b585cd6f8f497 + languageName: node + linkType: hard + "@clickhouse/client-common@npm:1.23.0-head.fae5998.1": version: 1.23.0-head.fae5998.1 resolution: "@clickhouse/client-common@npm:1.23.0-head.fae5998.1" @@ -4322,13 +4667,13 @@ __metadata: languageName: node linkType: hard -"@grpc/grpc-js@npm:^1.7.1": - version: 1.14.5 - resolution: "@grpc/grpc-js@npm:1.14.5" +"@grpc/grpc-js@npm:^1.14.3": + version: 1.14.7 + resolution: "@grpc/grpc-js@npm:1.14.7" dependencies: "@grpc/proto-loader": "npm:^0.8.0" "@js-sdsl/ordered-map": "npm:^4.4.2" - checksum: 10c0/25a44d80127ed166181fc3db25d9815a62081e33331938bdae31830296ec94a1c8ed3ade79fae26642ec3158e97a79936145c680f95c19528ffff334cca491e0 + checksum: 10c0/9f6dd28237edbd868f4aeb775f2c9f51a57b1b5ed35cc8dad36cd7b1c7d40010abe3bcba525035fea99dbbffa800a2ead88f57f08af2f623c0962861b68a059a languageName: node linkType: hard @@ -4360,12 +4705,12 @@ __metadata: languageName: node linkType: hard -"@hono/node-server@npm:^1.19.9 || ^2.0.5": - version: 2.1.5 - resolution: "@hono/node-server@npm:2.1.5" +"@hono/node-server@npm:^1.19.9": + version: 1.19.17 + resolution: "@hono/node-server@npm:1.19.17" peerDependencies: - hono: ^4 || ^5.0.0-0 - checksum: 10c0/3c3d5ffcc4a229e532530729b64db623493171bcda7b40ffbac3a46489884f700c881439d8c0d0413cd18793458ca252acedf6a9c13c8c3a024037e47974cacb + hono: ^4 + checksum: 10c0/e77907e3b5db8ab68ed4f297ad84807bfdd698636408de86ab8d36dab4658504ac4c0ed9d9436bc272a0172b9b7a5a4b578532e0b5baf97674c7b420cb5cff4b languageName: node linkType: hard @@ -4417,15 +4762,18 @@ __metadata: "@ai-sdk/openai": "npm:^4.0.78" "@ai-sdk/otel": "npm:^1.0.116" "@braintree/sanitize-url": "npm:^7.1.1" + "@clickhouse/clickstack-node": "npm:^1.0.2" "@clickhouse/client-common": "npm:1.23.0-head.fae5998.1" "@esm2cjs/p-queue": "npm:^7.3.0" - "@hyperdx/common-utils": "npm:^0.33.0" - "@hyperdx/node-opentelemetry": "npm:^0.9.0" + "@hyperdx/common-utils": "npm:^0.35.0" "@hyperdx/passport-local-mongoose": "npm:^9.0.1" "@modelcontextprotocol/sdk": "npm:^1.27.1" - "@opentelemetry/api": "npm:^1.8.0" - "@opentelemetry/host-metrics": "npm:^0.35.5" - "@opentelemetry/sdk-metrics": "npm:^1.30.1" + "@opentelemetry/api": "npm:~1.9.1" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/core": "npm:^2.12.0" + "@opentelemetry/otlp-transformer": "npm:^0.223.0" + "@opentelemetry/resources": "npm:^2.12.0" + "@opentelemetry/sdk-logs": "npm:^0.223.0" "@opentelemetry/sdk-trace-base": "npm:^1.30.1" "@slack/webhook": "npm:^7.0.0" "@stoplight/spectral-cli": "npm:^6.15.0" @@ -4467,7 +4815,7 @@ __metadata: migrate-mongo: "npm:^11.0.0" minimist: "npm:^1.2.7" mongodb: "npm:^6.15.0" - mongoose: "npm:^6.13.10" + mongoose: "npm:^6.13.12" ms: "npm:^2.1.3" nodemon: "npm:^2.0.20" on-headers: "npm:^1.1.0" @@ -4490,6 +4838,7 @@ __metadata: tsc-alias: "npm:^1.8.8" tsconfig-paths: "npm:^4.2.0" typescript: "npm:^6.0.3" + undici: "npm:^7.29.0" uuid: "npm:^8.3.2" zod: "npm:3.25" zod-express-middleware: "npm:^1.4.0" @@ -4502,6 +4851,8 @@ __metadata: dependencies: "@chromatic-com/storybook": "npm:^4.1.3" "@clickhouse/click-ui": "npm:^0.12.0" + "@clickhouse/clickstack-browser": "npm:^1.2.1" + "@clickhouse/clickstack-node": "npm:^1.0.2" "@codemirror/autocomplete": "npm:^6.0.0" "@codemirror/lang-json": "npm:^6.0.1" "@codemirror/lang-sql": "npm:^6.7.0" @@ -4515,9 +4866,7 @@ __metadata: "@eslint/compat": "npm:^2.0.0" "@hookform/resolvers": "npm:^3.9.0" "@hyperdx/api": "workspace:*" - "@hyperdx/browser": "npm:^0.22.1" - "@hyperdx/common-utils": "npm:^0.33.0" - "@hyperdx/node-opentelemetry": "npm:^0.9.0" + "@hyperdx/common-utils": "npm:^0.35.0" "@mantine/core": "npm:^9.0.0" "@mantine/dates": "npm:^9.0.0" "@mantine/dropzone": "npm:^9.0.0" @@ -4526,6 +4875,8 @@ __metadata: "@mantine/notifications": "npm:^9.0.0" "@mantine/spotlight": "npm:^9.0.0" "@next/eslint-plugin-next": "npm:^16.3.4" + "@opentelemetry/api": "npm:~1.9.1" + "@opentelemetry/browser-sdk": "npm:^0.6.0" "@playwright/test": "npm:^1.57.0" "@prometheus-io/codemirror-promql": "npm:^0.311.3" "@rrweb/replay": "npm:2.1.1" @@ -4584,7 +4935,7 @@ __metadata: ms: "npm:^2.1.3" msw: "npm:^2.3.0" msw-storybook-addon: "npm:^2.0.2" - next: "npm:^16.4.2" + next: "npm:^16.4.3" next-runtime-env: "npm:1" next-seo: "npm:^4.28.1" numbro: "npm:^2.4.0" @@ -4622,28 +4973,18 @@ __metadata: timestamp-nano: "npm:^1.0.1" ts-jest: "npm:^29.4.11" typescript: "npm:^6.0.3" - uplot: "npm:^1.6.31" + uplot: "patch:uplot@npm%3A1.6.32#~/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch" uplot-react: "npm:^1.2.2" zod: "npm:3.25" languageName: unknown linkType: soft -"@hyperdx/browser@npm:^0.22.1": - version: 0.22.1 - resolution: "@hyperdx/browser@npm:0.22.1" - dependencies: - "@hyperdx/otel-web": "npm:0.16.4" - "@hyperdx/otel-web-session-recorder": "npm:0.16.2" - checksum: 10c0/60a53e056e41fa74061c8d4d6e1a083b8daeb8ac5995d57c44146fd7e2adc16cf3e070514ce31439fc8f317018e2e773eee34af435c247d84467509f149dde86 - languageName: node - linkType: hard - "@hyperdx/cli@workspace:packages/cli": version: 0.0.0-use.local resolution: "@hyperdx/cli@workspace:packages/cli" dependencies: "@clickhouse/client": "npm:1.23.0-head.fae5998.1" - "@hyperdx/common-utils": "npm:^0.33.0" + "@hyperdx/common-utils": "npm:^0.35.0" "@jest/globals": "npm:^30.2.0" "@types/crypto-js": "npm:^4.2.2" "@types/jest": "npm:^29.5.14" @@ -4652,7 +4993,7 @@ __metadata: chalk: "npm:^5.3.0" commander: "npm:^12.1.0" crypto-js: "npm:^4.2.0" - glob: "npm:^13.0.6" + glob: "npm:^14.0.2" ink: "npm:6.8.0" ink-spinner: "npm:^5.0.0" ink-text-input: "npm:^6.0.0" @@ -4670,7 +5011,7 @@ __metadata: languageName: unknown linkType: soft -"@hyperdx/common-utils@npm:^0.33.0, @hyperdx/common-utils@workspace:packages/common-utils": +"@hyperdx/common-utils@npm:^0.35.0, @hyperdx/common-utils@workspace:packages/common-utils": version: 0.0.0-use.local resolution: "@hyperdx/common-utils@workspace:packages/common-utils" dependencies: @@ -4734,42 +5075,6 @@ __metadata: languageName: unknown linkType: soft -"@hyperdx/instrumentation-exception@npm:^0.1.0": - version: 0.1.0 - resolution: "@hyperdx/instrumentation-exception@npm:0.1.0" - dependencies: - "@hyperdx/instrumentation-sentry-node": "npm:^0.1.0" - "@opentelemetry/core": "npm:^1.24.1" - "@opentelemetry/instrumentation": "npm:^0.51.1" - "@opentelemetry/semantic-conventions": "npm:^1.24.1" - "@sentry/core": "npm:^8.7.0" - "@sentry/types": "npm:^8.7.0" - "@sentry/utils": "npm:^8.7.0" - json-stringify-safe: "npm:^5.0.1" - shimmer: "npm:^1.2.1" - tslib: "npm:^2.5.3" - peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/f0a5dcf5c3da19d6b7ebac21a627a2e7ca203b3210b33c52219b4af4c3e87186525fa58518ddfd7d18f29c3c84059187c5259b991902e62af1669225cdd74990 - languageName: node - linkType: hard - -"@hyperdx/instrumentation-sentry-node@npm:^0.1.0": - version: 0.1.0 - resolution: "@hyperdx/instrumentation-sentry-node@npm:0.1.0" - dependencies: - "@opentelemetry/core": "npm:^1.24.1" - "@opentelemetry/instrumentation": "npm:^0.51.1" - "@opentelemetry/semantic-conventions": "npm:^1.24.1" - json-stringify-safe: "npm:^5.0.1" - shimmer: "npm:^1.2.1" - tslib: "npm:^2.5.3" - peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/10f64b58adc2ec567be739e05aed96baf78dc2a51ab68e7179a9912445416ecd8d7be9ead0bfbcbbf4490cfb0dcc1dfc680becc4cf1a0c63131ee087a68859c7 - languageName: node - linkType: hard - "@hyperdx/lucene@npm:^3.1.1": version: 3.1.1 resolution: "@hyperdx/lucene@npm:3.1.1" @@ -4777,101 +5082,12 @@ __metadata: languageName: node linkType: hard -"@hyperdx/node-opentelemetry@npm:^0.9.0": - version: 0.9.0 - resolution: "@hyperdx/node-opentelemetry@npm:0.9.0" - dependencies: - "@hyperdx/instrumentation-exception": "npm:^0.1.0" - "@hyperdx/instrumentation-sentry-node": "npm:^0.1.0" - "@opentelemetry/api": "npm:^1.8.0" - "@opentelemetry/api-logs": "npm:^0.57.2" - "@opentelemetry/auto-instrumentations-node": "npm:^0.56.1" - "@opentelemetry/core": "npm:^1.30.1" - "@opentelemetry/exporter-logs-otlp-grpc": "npm:^0.57.2" - "@opentelemetry/exporter-logs-otlp-http": "npm:^0.57.2" - "@opentelemetry/exporter-metrics-otlp-grpc": "npm:^0.57.2" - "@opentelemetry/exporter-metrics-otlp-proto": "npm:^0.57.2" - "@opentelemetry/exporter-trace-otlp-grpc": "npm:^0.57.2" - "@opentelemetry/exporter-trace-otlp-proto": "npm:^0.57.2" - "@opentelemetry/instrumentation": "npm:^0.57.2" - "@opentelemetry/instrumentation-http": "npm:^0.57.2" - "@opentelemetry/instrumentation-runtime-node": "npm:^0.12.2" - "@opentelemetry/resources": "npm:^1.30.1" - "@opentelemetry/sdk-logs": "npm:^0.57.2" - "@opentelemetry/sdk-metrics": "npm:^1.30.1" - "@opentelemetry/sdk-node": "npm:^0.57.2" - "@opentelemetry/sdk-trace-base": "npm:^1.30.1" - "@opentelemetry/semantic-conventions": "npm:^1.30.0" - cli-spinners: "npm:^2.9.2" - json-stringify-safe: "npm:^5.0.1" - lodash.isobject: "npm:^3.0.2" - lodash.isplainobject: "npm:^4.0.6" - lodash.isstring: "npm:^4.0.1" - node-fetch: "npm:^2.7.0" - open: "npm:^8.4.2" - ora: "npm:^5.4.1" - pino-abstract-transport: "npm:^1.2.0" - semver: "npm:^7.6.2" - shimmer: "npm:^1.2.1" - tslib: "npm:^2.5.3" - winston-transport: "npm:^4.7.0" - bin: - opentelemetry-instrument: build/bin/opentelemetry-instrument.js - checksum: 10c0/dc4101e78b1aca867377b68568a29ad2c1a12ae79ecd07486fbd152d1bc9d4b057469154cb49c7b4a8f6f690f9851d0cb497381bd7dd11ce11bca71e0f884981 - languageName: node - linkType: hard - "@hyperdx/otel-collector@workspace:packages/otel-collector": version: 0.0.0-use.local resolution: "@hyperdx/otel-collector@workspace:packages/otel-collector" languageName: unknown linkType: soft -"@hyperdx/otel-web-session-recorder@npm:0.16.2": - version: 0.16.2 - resolution: "@hyperdx/otel-web-session-recorder@npm:0.16.2" - dependencies: - "@babel/runtime": "npm:~7.18.3" - "@opentelemetry/api": "npm:^1.8.0" - "@opentelemetry/core": "npm:^1.24.1" - "@opentelemetry/resources": "npm:^1.24.1" - fflate: "npm:0.7.4" - long: "npm:^5.2.3" - protobufjs: "npm:~6.11.2" - rrweb: "npm:1.1.3" - type-fest: "npm:4.20.1" - peerDependencies: - "@hyperdx/otel-web": ^0.16.2 - checksum: 10c0/0cc6259efa293e532f5aa2a62f2473a1c595c80b1f71c6907b95e92222b70ddbbc21e117bb3b4cc557919f984cf9605e7d03f78708d52eac1d079b1701aa50d3 - languageName: node - linkType: hard - -"@hyperdx/otel-web@npm:0.16.4": - version: 0.16.4 - resolution: "@hyperdx/otel-web@npm:0.16.4" - dependencies: - "@babel/runtime": "npm:^7.21.0" - "@hyperdx/instrumentation-exception": "npm:^0.1.0" - "@opentelemetry/api": "npm:^1.8.0" - "@opentelemetry/core": "npm:^1.24.1" - "@opentelemetry/exporter-trace-otlp-http": "npm:^0.51.1" - "@opentelemetry/instrumentation": "npm:^0.51.1" - "@opentelemetry/instrumentation-document-load": "npm:^0.38.0" - "@opentelemetry/instrumentation-fetch": "npm:^0.51.1" - "@opentelemetry/instrumentation-user-interaction": "npm:^0.38.0" - "@opentelemetry/instrumentation-xml-http-request": "npm:^0.51.1" - "@opentelemetry/resources": "npm:^1.24.1" - "@opentelemetry/sdk-trace-base": "npm:~1.24.1" - "@opentelemetry/sdk-trace-web": "npm:~1.24.1" - "@opentelemetry/semantic-conventions": "npm:^1.24.1" - json-stringify-safe: "npm:^5.0.1" - lodash: "npm:^4.17.23" - shimmer: "npm:^1.2.1" - web-vitals: "npm:^3.3.2" - checksum: 10c0/fe549fec7e4955254a973c9dd2834968b39958984a8d619f18216c71a95484e28b593a2e264819bd22fc3922f75ff6960779b6d02e51fd7e42a9a6926f892141 - languageName: node - linkType: hard - "@hyperdx/passport-local-mongoose@npm:^9.0.1": version: 9.0.1 resolution: "@hyperdx/passport-local-mongoose@npm:9.0.1" @@ -5427,12 +5643,10 @@ __metadata: languageName: node linkType: hard -"@isaacs/fs-minipass@npm:^4.0.0": - version: 4.0.1 - resolution: "@isaacs/fs-minipass@npm:4.0.1" - dependencies: - minipass: "npm:^7.0.4" - checksum: 10c0/c25b6dc1598790d5b55c0947a9b7d111cfa92594db5296c3b907e2f533c033666f692a3939eadac17b1c7c40d362d0b0635dc874cbfe3e70db7c2b07cc97a5d2 +"@isaacs/nonrecursive-glob-match@npm:^1.0.3": + version: 1.0.3 + resolution: "@isaacs/nonrecursive-glob-match@npm:1.0.3" + checksum: 10c0/dc2eb2b9cffc8d4b22b0de8beb8ecdc903b7bef1cb094d83fe0a7e454f0c7e1a8bcb4a168f66299eb17e1620fdf3c8cdf69545d11933845a122a10393b86c40a languageName: node linkType: hard @@ -5994,10 +6208,17 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.6.0": - version: 1.6.0 - resolution: "@jridgewell/sourcemap-codec@npm:1.6.0" - checksum: 10c0/b5be700e45a775f218589c3466c4ffea630582b4988657652da464e5ab8a7d18bf928ee4fd2363fb346ede4bea9c6ff0bae05a538358c4565ece6199531b5f72 +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.5.5": + version: 1.5.5 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.5" + checksum: 10c0/f9e538f302b63c0ebc06eecb1dd9918dd4289ed36147a0ddce35d6ea4d7ebbda243cda7b2213b6a5e1d8087a298d5cf630fb2bd39329cdecb82017023f6081a0 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: 10c0/0c6b5ae663087558039052a626d2d7ed5208da36cfd707dcc5cea4a07cfc918248403dcb5989a8f7afaf245ce0573b7cc6fd94c4a30453bd10e44d9363940ba5 languageName: node linkType: hard @@ -6282,10 +6503,10 @@ __metadata: linkType: hard "@modelcontextprotocol/sdk@npm:^1.27.1": - version: 1.32.2 - resolution: "@modelcontextprotocol/sdk@npm:1.32.2" + version: 1.29.0 + resolution: "@modelcontextprotocol/sdk@npm:1.29.0" dependencies: - "@hono/node-server": "npm:^1.19.9 || ^2.0.5" + "@hono/node-server": "npm:^1.19.9" ajv: "npm:^8.17.1" ajv-formats: "npm:^3.0.1" content-type: "npm:^1.0.5" @@ -6310,7 +6531,7 @@ __metadata: optional: true zod: optional: false - checksum: 10c0/31d045fe1121242ee7871f5fc9d5dc1f2ad622d9a9750fab5c14d1a1da227dd7225b16df0e8f22783356981255b22f5da84d1f74985df264ad79f2f00cc6ac7b + checksum: 10c0/7c4bc339205b1652330cd4e6b121cc859079655f2b9c0506bbb15563ba0d07924bda3d949705530532db7f4d2cb86d633dc8f92bc32803d97c7bece2ac63e29f languageName: node linkType: hard @@ -6397,10 +6618,10 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:16.4.2": - version: 16.4.2 - resolution: "@next/env@npm:16.4.2" - checksum: 10c0/7cb9bcb53b9c1aa2990da738d4ded24ead689255c98cfc47ee34250137c262ff9c8b3ead09601d6e10887138d93e3e08aca79c895f2dc9803ccbed6f76b8db63 +"@next/env@npm:16.4.3": + version: 16.4.3 + resolution: "@next/env@npm:16.4.3" + checksum: 10c0/9502fdaed8caa4a31aa05fec41c71c573ea5def37ecc2f3f935c06443f6c38e74074f62ffbd924605621f105161189d4f37fdb105d3ddeeac9cee03007b61f43 languageName: node linkType: hard @@ -6414,58 +6635,58 @@ __metadata: languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-darwin-arm64@npm:16.4.2" +"@next/swc-darwin-arm64@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-darwin-arm64@npm:16.4.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-darwin-x64@npm:16.4.2" +"@next/swc-darwin-x64@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-darwin-x64@npm:16.4.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-linux-arm64-gnu@npm:16.4.2" +"@next/swc-linux-arm64-gnu@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-linux-arm64-gnu@npm:16.4.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-linux-arm64-musl@npm:16.4.2" +"@next/swc-linux-arm64-musl@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-linux-arm64-musl@npm:16.4.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-linux-x64-gnu@npm:16.4.2" +"@next/swc-linux-x64-gnu@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-linux-x64-gnu@npm:16.4.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-linux-x64-musl@npm:16.4.2" +"@next/swc-linux-x64-musl@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-linux-x64-musl@npm:16.4.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-win32-arm64-msvc@npm:16.4.2" +"@next/swc-win32-arm64-msvc@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-win32-arm64-msvc@npm:16.4.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:16.4.2": - version: 16.4.2 - resolution: "@next/swc-win32-x64-msvc@npm:16.4.2" +"@next/swc-win32-x64-msvc@npm:16.4.3": + version: 16.4.3 + resolution: "@next/swc-win32-x64-msvc@npm:16.4.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -6510,13 +6731,35 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3": - version: 1.2.8 - resolution: "@nodelib/fs.walk@npm:1.2.8" +"@nodelib/fs.walk@npm:^1.2.3": + version: 1.2.8 + resolution: "@nodelib/fs.walk@npm:1.2.8" + dependencies: + "@nodelib/fs.scandir": "npm:2.1.5" + fastq: "npm:^1.6.0" + checksum: 10c0/db9de047c3bb9b51f9335a7bb46f4fcfb6829fb628318c12115fbaf7d369bfce71c15b103d1fc3b464812d936220ee9bc1c8f762d032c9f6be9acc99249095b1 + languageName: node + linkType: hard + +"@npmcli/agent@npm:^2.0.0": + version: 2.2.2 + resolution: "@npmcli/agent@npm:2.2.2" + dependencies: + agent-base: "npm:^7.1.0" + http-proxy-agent: "npm:^7.0.0" + https-proxy-agent: "npm:^7.0.1" + lru-cache: "npm:^10.0.1" + socks-proxy-agent: "npm:^8.0.3" + checksum: 10c0/325e0db7b287d4154ecd164c0815c08007abfb07653cc57bceded17bb7fd240998a3cbdbe87d700e30bef494885eccc725ab73b668020811d56623d145b524ae + languageName: node + linkType: hard + +"@npmcli/fs@npm:^3.1.0": + version: 3.1.1 + resolution: "@npmcli/fs@npm:3.1.1" dependencies: - "@nodelib/fs.scandir": "npm:2.1.5" - fastq: "npm:^1.6.0" - checksum: 10c0/db9de047c3bb9b51f9335a7bb46f4fcfb6829fb628318c12115fbaf7d369bfce71c15b103d1fc3b464812d936220ee9bc1c8f762d032c9f6be9acc99249095b1 + semver: "npm:^7.3.5" + checksum: 10c0/c37a5b4842bfdece3d14dfdb054f73fe15ed2d3da61b34ff76629fb5b1731647c49166fd2a8bf8b56fcfa51200382385ea8909a3cbecdad612310c114d3f6c99 languageName: node linkType: hard @@ -6614,39 +6857,23 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/api-logs@npm:0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/api-logs@npm:0.51.1" - dependencies: - "@opentelemetry/api": "npm:^1.0.0" - checksum: 10c0/bb469406a1b6f8310c2623b66688d1187731f55516fe3866090ac048d0f58ff88e7d2ad050378d66ca9ce9074529385c884c3a47a8200275abf4dd83b0eaf90a - languageName: node - linkType: hard - -"@opentelemetry/api-logs@npm:0.57.2, @opentelemetry/api-logs@npm:^0.57.1, @opentelemetry/api-logs@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/api-logs@npm:0.57.2" +"@opentelemetry/api-logs@npm:0.223.0, @opentelemetry/api-logs@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/api-logs@npm:0.223.0" dependencies: "@opentelemetry/api": "npm:^1.3.0" - checksum: 10c0/1e514d3fd4ca68e7e8b008794a95ee0562a5d9e1d3ebb02647b245afaa6c2d72cc14e99e3ea47a1d1007f8a965c62bfb6170e1aa26756230bea063cfde2898bf + checksum: 10c0/3be606243df08c7356d584d48194464050f3c379d63a92cc059de4f45dd5e81bbd7810f0a95419bed71fe4b790d2e495663eaf563f2e67bde30b381182add32e languageName: node linkType: hard -"@opentelemetry/api@npm:1.9.1": +"@opentelemetry/api@npm:1.9.1, @opentelemetry/api@npm:~1.9.1": version: 1.9.1 resolution: "@opentelemetry/api@npm:1.9.1" checksum: 10c0/c608485fc8b5a91e1f7e05e843b45b509307456b31cd2ad365933d90813e40ebfedf179f1451c762037e82d7c76aa8500e95d2da3609f640a1206cde5322cd14 languageName: node linkType: hard -"@opentelemetry/api@npm:^1.0.0": - version: 1.4.1 - resolution: "@opentelemetry/api@npm:1.4.1" - checksum: 10c0/5ee641d3d64c91e87ee328fc22251fc70c809a3c744e51e595ca77c0bd3cad933b77a79beb4dac66b811e5068941cef9da58c1ec217c0748a01f598e08a7ae66 - languageName: node - linkType: hard - -"@opentelemetry/api@npm:^1.3.0, @opentelemetry/api@npm:^1.8.0": +"@opentelemetry/api@npm:^1.3.0": version: 1.9.0 resolution: "@opentelemetry/api@npm:1.9.0" checksum: 10c0/9aae2fe6e8a3a3eeb6c1fdef78e1939cf05a0f37f8a4fae4d6bf2e09eb1e06f966ece85805626e01ba5fab48072b94f19b835449e58b6d26720ee19a58298add @@ -6660,117 +6887,121 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/auto-instrumentations-node@npm:^0.56.1": - version: 0.56.1 - resolution: "@opentelemetry/auto-instrumentations-node@npm:0.56.1" - dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/instrumentation-amqplib": "npm:^0.46.1" - "@opentelemetry/instrumentation-aws-lambda": "npm:^0.50.3" - "@opentelemetry/instrumentation-aws-sdk": "npm:^0.49.1" - "@opentelemetry/instrumentation-bunyan": "npm:^0.45.1" - "@opentelemetry/instrumentation-cassandra-driver": "npm:^0.45.1" - "@opentelemetry/instrumentation-connect": "npm:^0.43.1" - "@opentelemetry/instrumentation-cucumber": "npm:^0.14.1" - "@opentelemetry/instrumentation-dataloader": "npm:^0.16.1" - "@opentelemetry/instrumentation-dns": "npm:^0.43.1" - "@opentelemetry/instrumentation-express": "npm:^0.47.1" - "@opentelemetry/instrumentation-fastify": "npm:^0.44.2" - "@opentelemetry/instrumentation-fs": "npm:^0.19.1" - "@opentelemetry/instrumentation-generic-pool": "npm:^0.43.1" - "@opentelemetry/instrumentation-graphql": "npm:^0.47.1" - "@opentelemetry/instrumentation-grpc": "npm:^0.57.1" - "@opentelemetry/instrumentation-hapi": "npm:^0.45.2" - "@opentelemetry/instrumentation-http": "npm:^0.57.1" - "@opentelemetry/instrumentation-ioredis": "npm:^0.47.1" - "@opentelemetry/instrumentation-kafkajs": "npm:^0.7.1" - "@opentelemetry/instrumentation-knex": "npm:^0.44.1" - "@opentelemetry/instrumentation-koa": "npm:^0.47.1" - "@opentelemetry/instrumentation-lru-memoizer": "npm:^0.44.1" - "@opentelemetry/instrumentation-memcached": "npm:^0.43.1" - "@opentelemetry/instrumentation-mongodb": "npm:^0.52.0" - "@opentelemetry/instrumentation-mongoose": "npm:^0.46.1" - "@opentelemetry/instrumentation-mysql": "npm:^0.45.1" - "@opentelemetry/instrumentation-mysql2": "npm:^0.45.2" - "@opentelemetry/instrumentation-nestjs-core": "npm:^0.44.1" - "@opentelemetry/instrumentation-net": "npm:^0.43.1" - "@opentelemetry/instrumentation-pg": "npm:^0.51.1" - "@opentelemetry/instrumentation-pino": "npm:^0.46.1" - "@opentelemetry/instrumentation-redis": "npm:^0.46.1" - "@opentelemetry/instrumentation-redis-4": "npm:^0.46.1" - "@opentelemetry/instrumentation-restify": "npm:^0.45.1" - "@opentelemetry/instrumentation-router": "npm:^0.44.1" - "@opentelemetry/instrumentation-socket.io": "npm:^0.46.1" - "@opentelemetry/instrumentation-tedious": "npm:^0.18.1" - "@opentelemetry/instrumentation-undici": "npm:^0.10.1" - "@opentelemetry/instrumentation-winston": "npm:^0.44.1" - "@opentelemetry/resource-detector-alibaba-cloud": "npm:^0.30.1" - "@opentelemetry/resource-detector-aws": "npm:^1.12.0" - "@opentelemetry/resource-detector-azure": "npm:^0.6.1" - "@opentelemetry/resource-detector-container": "npm:^0.6.1" - "@opentelemetry/resource-detector-gcp": "npm:^0.33.1" - "@opentelemetry/resources": "npm:^1.24.0" - "@opentelemetry/sdk-node": "npm:^0.57.1" +"@opentelemetry/auto-instrumentations-node@npm:^0.81.0": + version: 0.81.2 + resolution: "@opentelemetry/auto-instrumentations-node@npm:0.81.2" + dependencies: + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/instrumentation-amqplib": "npm:^0.70.0" + "@opentelemetry/instrumentation-aws-lambda": "npm:^0.75.0" + "@opentelemetry/instrumentation-aws-sdk": "npm:^0.78.0" + "@opentelemetry/instrumentation-bunyan": "npm:^0.68.0" + "@opentelemetry/instrumentation-cassandra-driver": "npm:^0.68.0" + "@opentelemetry/instrumentation-connect": "npm:^0.66.0" + "@opentelemetry/instrumentation-cucumber": "npm:^0.39.0" + "@opentelemetry/instrumentation-dataloader": "npm:^0.40.0" + "@opentelemetry/instrumentation-dns": "npm:^0.66.0" + "@opentelemetry/instrumentation-express": "npm:^0.71.1" + "@opentelemetry/instrumentation-fs": "npm:^0.42.0" + "@opentelemetry/instrumentation-generic-pool": "npm:^0.66.0" + "@opentelemetry/instrumentation-graphql": "npm:^0.71.0" + "@opentelemetry/instrumentation-grpc": "npm:^0.223.0" + "@opentelemetry/instrumentation-hapi": "npm:^0.69.0" + "@opentelemetry/instrumentation-host-metrics": "npm:^0.6.0" + "@opentelemetry/instrumentation-http": "npm:^0.223.0" + "@opentelemetry/instrumentation-ioredis": "npm:^0.71.0" + "@opentelemetry/instrumentation-kafkajs": "npm:^0.32.0" + "@opentelemetry/instrumentation-knex": "npm:^0.67.0" + "@opentelemetry/instrumentation-koa": "npm:^0.71.0" + "@opentelemetry/instrumentation-lru-memoizer": "npm:^0.67.0" + "@opentelemetry/instrumentation-memcached": "npm:^0.66.0" + "@opentelemetry/instrumentation-mongodb": "npm:^0.76.0" + "@opentelemetry/instrumentation-mongoose": "npm:^0.69.0" + "@opentelemetry/instrumentation-mysql": "npm:^0.69.1" + "@opentelemetry/instrumentation-mysql2": "npm:^0.69.0" + "@opentelemetry/instrumentation-nestjs-core": "npm:^0.70.0" + "@opentelemetry/instrumentation-net": "npm:^0.67.0" + "@opentelemetry/instrumentation-openai": "npm:^0.21.0" + "@opentelemetry/instrumentation-oracledb": "npm:^0.48.0" + "@opentelemetry/instrumentation-pg": "npm:^0.76.0" + "@opentelemetry/instrumentation-pino": "npm:^0.69.0" + "@opentelemetry/instrumentation-redis": "npm:^0.71.0" + "@opentelemetry/instrumentation-restify": "npm:^0.68.0" + "@opentelemetry/instrumentation-router": "npm:^0.67.0" + "@opentelemetry/instrumentation-runtime-node": "npm:^0.36.1" + "@opentelemetry/instrumentation-socket.io": "npm:^0.70.0" + "@opentelemetry/instrumentation-tedious": "npm:^0.42.0" + "@opentelemetry/instrumentation-undici": "npm:^0.33.0" + "@opentelemetry/instrumentation-winston": "npm:^0.68.1" + "@opentelemetry/resource-detector-alibaba-cloud": "npm:^0.38.0" + "@opentelemetry/resource-detector-aws": "npm:^2.23.0" + "@opentelemetry/resource-detector-azure": "npm:^0.31.0" + "@opentelemetry/resource-detector-container": "npm:^0.8.14" + "@opentelemetry/resource-detector-gcp": "npm:^0.58.0" + "@opentelemetry/resources": "npm:^2.0.0" + "@opentelemetry/sdk-node": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.4.1 - checksum: 10c0/20fa3fec19dc7f8a868793a5b1bdc18e8014dafec5184208e885f0ee607b4bc298ec5631aa905a79e35ed801f5d8a7273a89691c4e45c96fa62805f206fafbc2 - languageName: node - linkType: hard - -"@opentelemetry/context-async-hooks@npm:1.30.1": - version: 1.30.1 - resolution: "@opentelemetry/context-async-hooks@npm:1.30.1" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.10.0" - checksum: 10c0/3e8114d360060a5225226d2fcd8df08cd542246003790a7f011c0774bc60b8a931f46f4c6673f3977a7d9bba717de6ee028cae51b752c2567053d7f46ed3eba3 + "@opentelemetry/core": ^2.0.0 + checksum: 10c0/be388bfc6e5bf3adc2e7b58312bf8904576928776d478c9b40a54a6319b75886f9320af3fed9379b4bea9f508f02c955a800d163ef4fdf2998eb1e98246121ad languageName: node linkType: hard -"@opentelemetry/core@npm:1.12.0": - version: 1.12.0 - resolution: "@opentelemetry/core@npm:1.12.0" +"@opentelemetry/browser-instrumentation@npm:^0.9.0": + version: 0.9.0 + resolution: "@opentelemetry/browser-instrumentation@npm:0.9.0" dependencies: - "@opentelemetry/semantic-conventions": "npm:1.12.0" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.43.0" + web-vitals: "npm:^6.2.3" peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.5.0" - checksum: 10c0/2fa217d4aaa6c31be4b672c814fe25d4e14eff6429a78c28190f87ecf2d2c47c3b0b3e20e53f3f2724c068dbb6c7e87deb4008bb3855d7e2687f78d12247cee7 + "@opentelemetry/api": ^1.9.1 + checksum: 10c0/5b368bac00a01b9dd0df882e635bada9e213901dcaf74d0ad7003d5adf0ed11a1b26b1c0dabf00774b754d6726cda169bc9431f97552d5becc389e2db5e1b89c languageName: node linkType: hard -"@opentelemetry/core@npm:1.21.0": - version: 1.21.0 - resolution: "@opentelemetry/core@npm:1.21.0" +"@opentelemetry/browser-sdk@npm:^0.6.0": + version: 0.6.0 + resolution: "@opentelemetry/browser-sdk@npm:0.6.0" dependencies: - "@opentelemetry/semantic-conventions": "npm:1.21.0" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/core": "npm:^2.12.0" + "@opentelemetry/exporter-logs-otlp-http": "npm:^0.223.0" + "@opentelemetry/exporter-trace-otlp-http": "npm:^0.223.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/resources": "npm:^2.12.0" + "@opentelemetry/sdk-logs": "npm:^0.223.0" + "@opentelemetry/sdk-trace": "npm:^2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.43.0" peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.8.0" - checksum: 10c0/e6f1adcd224944f725ccfc4a337cb20405cb2081fa0a2a66a47a9044b248f47318f43c6d140e8ebbd4082d8657894e9d1a8e1a10db112ca8896c6bc4494c346c + "@opentelemetry/api": ^1.9.1 + checksum: 10c0/e78572a474b80735ef5dc17ed4b30f50576df122535a1b6be355c40214eadd03ebdf1fb17e14a5b4a68066a94864eafe1c6cd9d70fc298173dcd18c78c0a4030 languageName: node linkType: hard -"@opentelemetry/core@npm:1.24.1": - version: 1.24.1 - resolution: "@opentelemetry/core@npm:1.24.1" +"@opentelemetry/configuration@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/configuration@npm:0.223.0" dependencies: - "@opentelemetry/semantic-conventions": "npm:1.24.1" + "@opentelemetry/core": "npm:2.12.0" + yaml: "npm:^2.8.3" peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.9.0" - checksum: 10c0/e7af32d4253542ee42be74618cef56813ddec878950421d7e51384bde33c5a09f9aeb4391cc9617e1d117091597d1d96a6b80658fb0453a93bcf2d4d316b149d + "@opentelemetry/api": ^1.9.0 + checksum: 10c0/351110987ff43f75b0e6af18623f8f3e71d4a489b965af10a601a5befba7d721b07dc2c6fc31b7604d3dbae81488da28d010a80c2a0e88a0ab933d1f2d26a75b languageName: node linkType: hard -"@opentelemetry/core@npm:1.25.1": - version: 1.25.1 - resolution: "@opentelemetry/core@npm:1.25.1" - dependencies: - "@opentelemetry/semantic-conventions": "npm:1.25.1" +"@opentelemetry/context-async-hooks@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/context-async-hooks@npm:2.12.0" peerDependencies: "@opentelemetry/api": ">=1.0.0 <1.10.0" - checksum: 10c0/37270396fe3546e454f5a6e8cab0e5777e49a8e4e56ef05644c4e458b3ba7c662f57ad1ba2dd936ddaef54cbe985abd7cee0d3e9188dfdc0e3b3d446c3484337 + checksum: 10c0/fc4185cc643562527532cc5de985edc963a02a68aa1cf6ec517da5602cb51620ea9ffd2201f0fb75295eb9eb7d281a517598a081eeda79a905245a110f21282c languageName: node linkType: hard -"@opentelemetry/core@npm:1.30.1, @opentelemetry/core@npm:^1.0.0, @opentelemetry/core@npm:^1.24.1, @opentelemetry/core@npm:^1.25.0, @opentelemetry/core@npm:^1.25.1, @opentelemetry/core@npm:^1.26.0, @opentelemetry/core@npm:^1.30.1, @opentelemetry/core@npm:^1.8.0": +"@opentelemetry/core@npm:1.30.1": version: 1.30.1 resolution: "@opentelemetry/core@npm:1.30.1" dependencies: @@ -6781,1016 +7012,861 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/core@npm:^1.1.0": - version: 1.15.2 - resolution: "@opentelemetry/core@npm:1.15.2" +"@opentelemetry/core@npm:2.12.0, @opentelemetry/core@npm:^2.0.0, @opentelemetry/core@npm:^2.12.0, @opentelemetry/core@npm:^2.9.0": + version: 2.12.0 + resolution: "@opentelemetry/core@npm:2.12.0" dependencies: - "@opentelemetry/semantic-conventions": "npm:1.15.2" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.5.0" - checksum: 10c0/330f5905edec32f965151f2b314ae73344ac28672ea2c41ac41687413ac91dcd5c7ab99590dac9870ce189bb3d2a73a780c98e7bf1c8826c4c197a5698db96a4 + "@opentelemetry/api": ">=1.0.0 <1.10.0" + checksum: 10c0/e0d0338d314ca827b4395acf8c7eb8f88a58fd63f1effc6068ba4dd8e3443e02e5796333ae6723fb926a7e6c18dd6d2102f5cc7e531b185618562dadbf6cad71 languageName: node linkType: hard -"@opentelemetry/exporter-logs-otlp-grpc@npm:0.57.2, @opentelemetry/exporter-logs-otlp-grpc@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-logs-otlp-grpc@npm:0.57.2" +"@opentelemetry/exporter-logs-otlp-grpc@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-logs-otlp-grpc@npm:0.223.0" dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-grpc-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/sdk-logs": "npm:0.57.2" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-grpc-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/sdk-logs": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/321b7667c37d204ebf1ae02d1250703e5c089f4079282b4f22723ed70d5a7a8cea5f90990845850ed072662d7c862888556c358b5e4fb6f9917497abec402f8b + checksum: 10c0/c6ba6213d9dc960297220e30e86104afbe295016800a5c17efef46ad262e321c34956747eeba1b8c0c4db2de1b50bf2537b75768c8b16baf5ddacfa96cc6cc67 languageName: node linkType: hard -"@opentelemetry/exporter-logs-otlp-http@npm:0.57.2, @opentelemetry/exporter-logs-otlp-http@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-logs-otlp-http@npm:0.57.2" +"@opentelemetry/exporter-logs-otlp-http@npm:0.223.0, @opentelemetry/exporter-logs-otlp-http@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-logs-otlp-http@npm:0.223.0" dependencies: - "@opentelemetry/api-logs": "npm:0.57.2" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/sdk-logs": "npm:0.57.2" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/sdk-logs": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/3823a5fc66a134e7ca6b60cafad9a4180fc7782c9ffd45fd5ce8bcf4459ec633beb5c0103f9caedffadb85937dfe40b871f6115c852cdbb45d3c7645a3d8baac + checksum: 10c0/9f159081a9aae65134cbf21b8d47961eab4721a72a6130d8e4140cdcbe4f11b7e6ad6bc4732c8517e9d3b3bc9a457350cae7e46d9c64ac9df2b1e0f1b238404b languageName: node linkType: hard -"@opentelemetry/exporter-logs-otlp-proto@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-logs-otlp-proto@npm:0.57.2" +"@opentelemetry/exporter-logs-otlp-proto@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-logs-otlp-proto@npm:0.223.0" dependencies: - "@opentelemetry/api-logs": "npm:0.57.2" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-logs": "npm:0.57.2" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/sdk-logs": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/2bf929bd50cf837a48e57deed45ad9e7dc531818fad7bb89740ab3af0044f5479817d691458c507a3d052d6b7c00fa5ab1a2b55a1b185a28828fe1c177019895 + checksum: 10c0/ac012ffe406e2465ea450725e6bdecd5131de5e65d38b50e2f62df2cfd9b27f369878dfc25ead7dec444a495b21f4145c0a25ca71bff0fbf53de489792a3989b languageName: node linkType: hard -"@opentelemetry/exporter-metrics-otlp-grpc@npm:0.57.2, @opentelemetry/exporter-metrics-otlp-grpc@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-metrics-otlp-grpc@npm:0.57.2" +"@opentelemetry/exporter-metrics-otlp-grpc@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-metrics-otlp-grpc@npm:0.223.0" dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/exporter-metrics-otlp-http": "npm:0.57.2" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-grpc-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-metrics": "npm:1.30.1" + "@opentelemetry/exporter-metrics-otlp-http": "npm:0.223.0" + "@opentelemetry/otlp-grpc-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/b23a5e74c367d47d854e97a16775b29c4df0b893ed9b8c8bb5969b412d21bffcfa65bb95e60405c8976242257e7c6206080cb29d8de1954aff0d7d179c21a95d + checksum: 10c0/1a7a78cc415788f5d24511c478c05f37f891ca8982f452d0fdb87f20fa34494a5b2b6acc3aa5e5e07c9f0d6dc345b7f85a9c6ca9cedf9fb3d97f2e0354e3666d languageName: node linkType: hard -"@opentelemetry/exporter-metrics-otlp-http@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-metrics-otlp-http@npm:0.57.2" +"@opentelemetry/exporter-metrics-otlp-http@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-metrics-otlp-http@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-metrics": "npm:1.30.1" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/sdk-metrics": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/06732d21aa32bdcd981447eeeeac76660e2d81de92abb10e8baade3c8d8c119f3c0fa25ca26b4dd913c65bd849e99dd9571409fac12771ceba118c6686c40460 + checksum: 10c0/6db9827b6704ec088f0cf52b19fed565797682015c402990e0c0d397dbe4260daf9fec25cb479124fb25cfb31ad4657039002bf664d6e1820205563b615e425d languageName: node linkType: hard -"@opentelemetry/exporter-metrics-otlp-proto@npm:0.57.2, @opentelemetry/exporter-metrics-otlp-proto@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-metrics-otlp-proto@npm:0.57.2" +"@opentelemetry/exporter-metrics-otlp-proto@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-metrics-otlp-proto@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/exporter-metrics-otlp-http": "npm:0.57.2" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-metrics": "npm:1.30.1" + "@opentelemetry/exporter-metrics-otlp-http": "npm:0.223.0" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/2897b56c7a8823b6060211a78d41a2cd91f5142c6f26bf66ed945ba6f1e1a7f2d156444dd907f3916a458dc0dc3605331e05c11aa8e5810b7289db2527207a2d + checksum: 10c0/9450ae3cbc88abef6b40f658d48d141dbad4f45afe39527dcc9e8b2959f9bf142d22648b478e3680a73ae63f02fa2139a8229a8173aebfb4abd85c6a6262ed06 languageName: node linkType: hard -"@opentelemetry/exporter-prometheus@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-prometheus@npm:0.57.2" +"@opentelemetry/exporter-prometheus@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-prometheus@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-metrics": "npm:1.30.1" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/sdk-metrics": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/158a4bf256c0a7985964c32dacd9384d268f5573cbe41db1fa6d315440c87b3f8f7b7165749c3db9c8540f80dc573e08a15ce1326138ecc1c90d064142756a1f + checksum: 10c0/c6a596ab91d1165fb4b31abc9535dd79c17ac1deb0b1d604173a8ac1ef6d6bed2906f3a53d0bdf79679282b78ebdea34710a15d4d47b007bcde5ad788194e342 languageName: node linkType: hard -"@opentelemetry/exporter-trace-otlp-grpc@npm:0.57.2, @opentelemetry/exporter-trace-otlp-grpc@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-trace-otlp-grpc@npm:0.57.2" +"@opentelemetry/exporter-trace-otlp-grpc@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-trace-otlp-grpc@npm:0.223.0" dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-grpc-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-grpc-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/ac88a7978f231db1d327af0c26807f01230807d4f80a04119cc487aaafed287b9383e0511895d438b76ec35d66e0243ed5ad3eecdcf797caab5f2624c4e28bb4 + checksum: 10c0/678b487d942773debaedf583e79318c9e9e8144bab37a8cc3333c74876bf6936c01e8f8bcc6358370e6d06af50b0cd3f2ec33ee26833a9e43c3f2325fd5e8058 languageName: node linkType: hard -"@opentelemetry/exporter-trace-otlp-http@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-trace-otlp-http@npm:0.57.2" +"@opentelemetry/exporter-trace-otlp-http@npm:0.223.0, @opentelemetry/exporter-trace-otlp-http@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-trace-otlp-http@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/ccf0f8c573173ed3e735dc007600ec0cc04469f85784acff69fcdaa3423d25f87068618d1454b725f684fbc72481d0d383dac02406a27ba750ce38321bfe718a - languageName: node - linkType: hard - -"@opentelemetry/exporter-trace-otlp-http@npm:^0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/exporter-trace-otlp-http@npm:0.51.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/otlp-exporter-base": "npm:0.51.1" - "@opentelemetry/otlp-transformer": "npm:0.51.1" - "@opentelemetry/resources": "npm:1.24.1" - "@opentelemetry/sdk-trace-base": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/e0909eafab0f4c0a8ca5e37d18f07771f361bfa95b9d57bfb09e69e11abb783c04c3008c6a7eb1aa79e20eb857d1cd142025872f2dc70d8ae8a74830bf3cf2e0 + checksum: 10c0/0c22aa441b9d688064e4ca3693f5e270801a9a80e52d4203e58cdf2d0e83ec2ea16367612a4ae3d9ca4bf4d706a2cb5c2924c9dfd798b18f49e4e2278ac3158f languageName: node linkType: hard -"@opentelemetry/exporter-trace-otlp-proto@npm:0.57.2, @opentelemetry/exporter-trace-otlp-proto@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/exporter-trace-otlp-proto@npm:0.57.2" +"@opentelemetry/exporter-trace-otlp-proto@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/exporter-trace-otlp-proto@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/34d82615d81cd02ba2ab02e76122a4957197d6383270a8983d10558df4f765ccbb81a68e559e73380faf4c3f7815efa7b345c0ca36929c07aab679b64808d08f + checksum: 10c0/a825dad88996154878804c63cc0223b5db3235a5aff304112bf1693c671656ed9eb6c48c270167e293a3651c6c22f4b895dc081c738d66c52701fc0911401e34 languageName: node linkType: hard -"@opentelemetry/exporter-zipkin@npm:1.30.1": - version: 1.30.1 - resolution: "@opentelemetry/exporter-zipkin@npm:1.30.1" +"@opentelemetry/exporter-zipkin@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/exporter-zipkin@npm:2.12.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" - "@opentelemetry/semantic-conventions": "npm:1.28.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/e2918387c0ddc1835779f5551f5f04b3c1331643f05e3cf6019abf169de035c55be8112a30d5ee0dfef6938cbe260e84c426d5a46bce6f9eb6b2c9b916a425f6 + checksum: 10c0/a0210fbeee84acb5252260f38091c6bedd2246a4451ad1e07429469f40b63992adad954ba87576d9a0b15ef3db140b432ab54e8dd1dc9bd5c9d8ea2acbbd27dd languageName: node linkType: hard -"@opentelemetry/host-metrics@npm:^0.35.5": - version: 0.35.5 - resolution: "@opentelemetry/host-metrics@npm:0.35.5" +"@opentelemetry/instrumentation-amqplib@npm:^0.70.0": + version: 0.70.0 + resolution: "@opentelemetry/instrumentation-amqplib@npm:0.70.0" dependencies: - systeminformation: "npm:5.23.8" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/3065ab9f8b2f02e26d12298d9a8171cf8370b0af0fd2dd08f7b14685a2587093e31aa46e4a04563c9833914990dcaa7ab858cb7d8f2a0d129f2d41a604df9243 + checksum: 10c0/b0579101a9e24dc20d2bbd81bde9f1da05c13beae5a15893e3d754c0bb09e5202977893b097815b23380ce0bec67151cf1b023ea1c672b83b95bb8da0c4b6b2d languageName: node linkType: hard -"@opentelemetry/instrumentation-amqplib@npm:^0.46.1": - version: 0.46.1 - resolution: "@opentelemetry/instrumentation-amqplib@npm:0.46.1" +"@opentelemetry/instrumentation-aws-lambda@npm:^0.75.0": + version: 0.75.0 + resolution: "@opentelemetry/instrumentation-aws-lambda@npm:0.75.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/propagator-aws-xray": "npm:^2.1.4" "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@types/aws-lambda": "npm:^8.10.155" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/4a8b870ccaa64cfd200663ec14385aca7eeb7146124d82e566f3d48678f237c9a56661ae3401345fe0dce5c56366ae02a312dc7905eb4fd6e073df2cface30fb + checksum: 10c0/3e616dba42eec8c6860885aba6669654498328a0bab77483079a52d70f3f33007ff72f4ee6f1b43ed44871365620abb16e9d3d68a51cb048e853be9b3f09a441 languageName: node linkType: hard -"@opentelemetry/instrumentation-aws-lambda@npm:^0.50.3": - version: 0.50.3 - resolution: "@opentelemetry/instrumentation-aws-lambda@npm:0.50.3" +"@opentelemetry/instrumentation-aws-sdk@npm:^0.78.0": + version: 0.78.0 + resolution: "@opentelemetry/instrumentation-aws-sdk@npm:0.78.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@types/aws-lambda": "npm:8.10.147" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.34.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/40bd0394946214a66f4f1b6a26cf53e0e238edfb8df8a72d4a2f9913e7bca50c07d8e32cd6fd93434bef15bb784cff8c490f62368cca4ab9285f2394626a930e + checksum: 10c0/0b722756a61f3d589ef92fcd5bf186dc4dae9691fb51018d1b8ff85e26a76aa2c0d6afc0ae3fe955ba313002c3b51509658ba996ac366ec369fbf86bc8af041b languageName: node linkType: hard -"@opentelemetry/instrumentation-aws-sdk@npm:^0.49.1": - version: 0.49.1 - resolution: "@opentelemetry/instrumentation-aws-sdk@npm:0.49.1" +"@opentelemetry/instrumentation-bunyan@npm:^0.68.0": + version: 0.68.0 + resolution: "@opentelemetry/instrumentation-bunyan@npm:0.68.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/propagation-utils": "npm:^0.30.16" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.41.1" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/9b1d0f7c3704f78eaee6c380c929bd43c2b2f95d5c1c057ec8a26589a71764bd58f8bd4a32a5b30bafd2aa5c414e43eb28c08cd86985dba7da778b8a44df842f + checksum: 10c0/64ecd65e39477b49f1fc20305fb8f0898ff4fccdcd5dfa7f5af1f4dfab55ad8bf53f4986b09d52d3c0c6ac7e9502c544f89dc78b4a3ea300d9ab104a57164c93 languageName: node linkType: hard -"@opentelemetry/instrumentation-bunyan@npm:^0.45.1": - version: 0.45.1 - resolution: "@opentelemetry/instrumentation-bunyan@npm:0.45.1" +"@opentelemetry/instrumentation-cassandra-driver@npm:^0.68.0": + version: 0.68.0 + resolution: "@opentelemetry/instrumentation-cassandra-driver@npm:0.68.0" dependencies: - "@opentelemetry/api-logs": "npm:^0.57.1" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@types/bunyan": "npm:1.8.11" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.37.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/791529b7e5736c55549d72d89b8a7e465e95eba5298e49f0a8547e8a6ff088ba2b2cff06cd70dbdb7dd9063df1f9aad14e2722bd755b28794cf59739e1ec8db3 + checksum: 10c0/9a1fa66d889d13e6a99335bb12b4c515e387a746131e119ede9caf95d9d2368b9f5749b3c4aa68f5ebb7e158efba77773c55d0971ebf9900b08c5de5383a28fa languageName: node linkType: hard -"@opentelemetry/instrumentation-cassandra-driver@npm:^0.45.1": - version: 0.45.1 - resolution: "@opentelemetry/instrumentation-cassandra-driver@npm:0.45.1" +"@opentelemetry/instrumentation-connect@npm:^0.66.0": + version: 0.66.0 + resolution: "@opentelemetry/instrumentation-connect@npm:0.66.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@types/connect": "npm:3.4.38" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/6401c6a94a945515fd71a49d1f086210c464ce4b3d7072cad28c7ba9287887d4404d31f8b34aab0b807f68b3befc6a7e0bb923a000febd947e95c960b3673c59 + checksum: 10c0/b5dea959a74cf896382bf351ab8bfc5613a35f6a4845d00dc8161d4dedaa0f3acc8a1243cc63667064404a20efa6ae09059f80ef62a7a55819f3d82ecb30da6a languageName: node linkType: hard -"@opentelemetry/instrumentation-connect@npm:^0.43.1": - version: 0.43.1 - resolution: "@opentelemetry/instrumentation-connect@npm:0.43.1" +"@opentelemetry/instrumentation-console@npm:^0.5.0": + version: 0.5.0 + resolution: "@opentelemetry/instrumentation-console@npm:0.5.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@types/connect": "npm:3.4.38" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/a7e2629fbfa775f2d1a6b2c9387e27809db16177cf6de89159017d7353c270c6c84d81550c58ccc51ea72c2304b1fcb911499440451d8df6954cc1f4e654eb64 + "@opentelemetry/api": ^1.9.1 + checksum: 10c0/6af16c1b8f3af42735598e2b5a23391f5243643e226d39ab12410c1223f8c2ca00dcf47c3066c1ee0beea76a013eb63fbfcac9c5b57617ef7dbf1ad4486f517c languageName: node linkType: hard -"@opentelemetry/instrumentation-cucumber@npm:^0.14.1": - version: 0.14.1 - resolution: "@opentelemetry/instrumentation-cucumber@npm:0.14.1" +"@opentelemetry/instrumentation-cucumber@npm:^0.39.0": + version: 0.39.0 + resolution: "@opentelemetry/instrumentation-cucumber@npm:0.39.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" "@opentelemetry/semantic-conventions": "npm:^1.27.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/73481d39f5d0a9e97ca700afed52db38774d7266b9370b72d3fe0f10de8a9978616908bfbf80ec5be22e67602610fdce5bf7026f8d13333be4bf05654c89c97c - languageName: node - linkType: hard - -"@opentelemetry/instrumentation-dataloader@npm:^0.16.1": - version: 0.16.1 - resolution: "@opentelemetry/instrumentation-dataloader@npm:0.16.1" - dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/83bd0267672cc3e8709401e1f107612aed3bb72faedfed76fe25e174b19c41f65d503bc3a666ba0872bbef8c31adcefb8884982f785fa3b0df28eec40b6578aa + checksum: 10c0/bf358f857f777ceef4496389ba35f0558eaf9a14e5b03da7da7db6f62c38189eed1d89251636c79768df1fc4c58452c0678104a409f8d5f64ff34927ee8ae400 languageName: node linkType: hard -"@opentelemetry/instrumentation-dns@npm:^0.43.1": - version: 0.43.1 - resolution: "@opentelemetry/instrumentation-dns@npm:0.43.1" +"@opentelemetry/instrumentation-dataloader@npm:^0.40.0": + version: 0.40.0 + resolution: "@opentelemetry/instrumentation-dataloader@npm:0.40.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/ae747e168222890470f638a4e720f641d845b512e857ee57326012697a0858e40ba9dbb59000c87bb0b09b3c0af8b072acafdc66098019a22042f1e79b248e9d + checksum: 10c0/70daab40e59dc8cc5f4f3ad35caf9c225f2d82771069b3a7050b5bfec29107b3ca6a58002c1df9acc21be6c27330305d8e8965a93bfb4c77df994f4fe1b35d72 languageName: node linkType: hard -"@opentelemetry/instrumentation-document-load@npm:^0.38.0": - version: 0.38.0 - resolution: "@opentelemetry/instrumentation-document-load@npm:0.38.0" +"@opentelemetry/instrumentation-dns@npm:^0.66.0": + version: 0.66.0 + resolution: "@opentelemetry/instrumentation-dns@npm:0.66.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.51.0" - "@opentelemetry/sdk-trace-base": "npm:^1.0.0" - "@opentelemetry/sdk-trace-web": "npm:^1.15.0" - "@opentelemetry/semantic-conventions": "npm:^1.22.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/720f023963b3e7fa555e7e56b3f24f686661c05c70161350c638c4a198e3fe7a345443738f8045e6e8cbd34606a25e6c960af128618aa71b086348e2a6c0f4c7 + checksum: 10c0/c8f883ded91b652a28ab0bff801821e975e66b2d968b112eb1fbfd1630696718f8ae4a44e95975cd156f1f00480740c2405c0880a3640956761d10d5adf18850 languageName: node linkType: hard -"@opentelemetry/instrumentation-express@npm:^0.47.1": - version: 0.47.1 - resolution: "@opentelemetry/instrumentation-express@npm:0.47.1" +"@opentelemetry/instrumentation-express@npm:^0.71.1": + version: 0.71.1 + resolution: "@opentelemetry/instrumentation-express@npm:0.71.1" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" "@opentelemetry/semantic-conventions": "npm:^1.27.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/eca448eb088857c7c0c7d0a1875b9e20a990b23e2f64355d2e645618d3f5c038efb9d605009a6d8fa1e05243d0ccef14b9aa1effffee693fd071de3cc39ad3d1 + checksum: 10c0/69e5fc75dd93a843b853a34ae5660cbc01188fef80167391c8a34374989ac545580a89791a11c43fe40a6721aebc2b6e627a75d39ae9b3cd018be89aecfbe529 languageName: node linkType: hard -"@opentelemetry/instrumentation-fastify@npm:^0.44.2": - version: 0.44.2 - resolution: "@opentelemetry/instrumentation-fastify@npm:0.44.2" +"@opentelemetry/instrumentation-fs@npm:^0.42.0": + version: 0.42.0 + resolution: "@opentelemetry/instrumentation-fs@npm:0.42.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/2306bbf9b59e5d29002b9c14493de92817e268c92587b285a0a4bbeece4a3f791db8e0d1be0e22ad9f6a97075071aa5c3269cf2d219e378480dc1ceafbf2927c - languageName: node - linkType: hard - -"@opentelemetry/instrumentation-fetch@npm:^0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/instrumentation-fetch@npm:0.51.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/instrumentation": "npm:0.51.1" - "@opentelemetry/sdk-trace-web": "npm:1.24.1" - "@opentelemetry/semantic-conventions": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/ec28f862ceb91eaac383263b2a5322d40cd47f87fa743e4ae731920d239049b7c105bb59bc8d55af7f517fef0b1e176aba35652dced77be32959ca8e78234087 + checksum: 10c0/c2fba7bac5a488e7afaf4912ca60b183117e22350c8abec853301c6a59b24471882aa23a260eed670dfb81fd9138db6792b6ee6b39560fe89cb686bb9e82227f languageName: node linkType: hard -"@opentelemetry/instrumentation-fs@npm:^0.19.1": - version: 0.19.1 - resolution: "@opentelemetry/instrumentation-fs@npm:0.19.1" +"@opentelemetry/instrumentation-generic-pool@npm:^0.66.0": + version: 0.66.0 + resolution: "@opentelemetry/instrumentation-generic-pool@npm:0.66.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/8bf714658c0fcc34ba7db4c28af3196690f756a9b4fb6d1b6cab59938a7b5c1e40e834c518b39085e744915c0c384ca6d997a8a97901955732acf3af0cba6e7f + checksum: 10c0/5b49fd633e07dfc50c1a66e90f446abde376610cb6acf70cf5a8600c5f19a8779d9e9a2fab5a68f69b1243cddd26a48aa5053c281732debd7d8a8117e5ffd0df languageName: node linkType: hard -"@opentelemetry/instrumentation-generic-pool@npm:^0.43.1": - version: 0.43.1 - resolution: "@opentelemetry/instrumentation-generic-pool@npm:0.43.1" +"@opentelemetry/instrumentation-graphql@npm:^0.71.0": + version: 0.71.0 + resolution: "@opentelemetry/instrumentation-graphql@npm:0.71.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/bdc95146d1f6f5dcf5922af8161c4954b9feeb505a01c5e61b1246ed67909dc1f6e72ad067839f085a4977e863246e7e4b468c814cf4104f35fcc20fb570eac2 + checksum: 10c0/14c6d55f142bc81ff74bef18382806d22a309650e28c19df65a420413a674031f2ba7a595e7ac1346284ed4b77ed825c7023b8597876b68bd54033d62bdf0357 languageName: node linkType: hard -"@opentelemetry/instrumentation-graphql@npm:^0.47.1": - version: 0.47.1 - resolution: "@opentelemetry/instrumentation-graphql@npm:0.47.1" +"@opentelemetry/instrumentation-grpc@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/instrumentation-grpc@npm:0.223.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/d5cfeb668b5ea4e4d97d8433c642457ac9f7f2023278a84a183b4c4c2cc43bbae3eac916ff7176ef8492661877560b519663c52eb2fad0a8a1f00718a0449aa6 + checksum: 10c0/a90a218eedc7928190651d6e5d829f15925bf71c67e98cb32cc831e11ba23fd69beaf8c9d4977798eeb98566377113ba415c30e5448ba437b24cd4dfd528f4c5 languageName: node linkType: hard -"@opentelemetry/instrumentation-grpc@npm:^0.57.1": - version: 0.57.2 - resolution: "@opentelemetry/instrumentation-grpc@npm:0.57.2" +"@opentelemetry/instrumentation-hapi@npm:^0.69.0": + version: 0.69.0 + resolution: "@opentelemetry/instrumentation-hapi@npm:0.69.0" dependencies: - "@opentelemetry/instrumentation": "npm:0.57.2" - "@opentelemetry/semantic-conventions": "npm:1.28.0" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.27.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/dd5d28907c1ab88ff9de16fd1267c40c1c1a7db0d26267b4b5c7f77837d567aa45167fc9838a9907e43ded94924ccedd4ff2a6c1411e152edb290d518561c4fb + checksum: 10c0/288f0d462426747d8c6af4b38b43d3dd9ed71622aedbb3ab7247ca12f23a7377baed28043ba6bd57e97782d41161a3ad9b545e5a0350378520f44c3accbddba7 languageName: node linkType: hard -"@opentelemetry/instrumentation-hapi@npm:^0.45.2": - version: 0.45.2 - resolution: "@opentelemetry/instrumentation-hapi@npm:0.45.2" +"@opentelemetry/instrumentation-host-metrics@npm:^0.6.0": + version: 0.6.0 + resolution: "@opentelemetry/instrumentation-host-metrics@npm:0.6.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + systeminformation: "npm:^5.31.6" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/bb491327ce86d8f1f7e2a12621a00dbf921e1fc3e9b64f975fc23e443d92bcd6ef779b34349214871763d459650da219c5e23bb1fdd1bc261fa0f92190521b2e + checksum: 10c0/d9f8025927c6f7f4948d682b0447d6bf9b79029d1863f0f2686e50821d6250a1f44163ea7136a1460c679c796e54136ff37ec8737ec11cdb7df9979452473cc9 languageName: node linkType: hard -"@opentelemetry/instrumentation-http@npm:^0.57.1, @opentelemetry/instrumentation-http@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/instrumentation-http@npm:0.57.2" +"@opentelemetry/instrumentation-http@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/instrumentation-http@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/instrumentation": "npm:0.57.2" - "@opentelemetry/semantic-conventions": "npm:1.28.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/instrumentation": "npm:0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" forwarded-parse: "npm:2.1.2" - semver: "npm:^7.5.2" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/b95a1b61cddabd32358fa565a4fcf5c17e8340907b171dcdf2a104533c9afdee821efa7b82dabb3123318dcc66272b0a7b8c37c44fc87e593cb8138a7a63fc23 + checksum: 10c0/24edf71293780b1ca1384fd599ef7cf75393aa3047ed26c1041759e407e1d5bcee88948695b43133994d87f20b54faf0e8a7d090be1689ce9f71141478866e96 languageName: node linkType: hard -"@opentelemetry/instrumentation-ioredis@npm:^0.47.1": - version: 0.47.1 - resolution: "@opentelemetry/instrumentation-ioredis@npm:0.47.1" +"@opentelemetry/instrumentation-ioredis@npm:^0.71.0": + version: 0.71.0 + resolution: "@opentelemetry/instrumentation-ioredis@npm:0.71.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/redis-common": "npm:^0.36.2" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/redis-common": "npm:^0.38.3" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/ec741778041cecc133a143292d66631c99311bf098db8f03276a48b87fe18826eec4513e4de70bb555ef50268db6520442e9a2f7752f7ea9b5a3e8363fecb8c9 + checksum: 10c0/fe7413ae48ef14bddd2281cbd1e0928bf5668f987b44dca7567ce74b14d1ced981b2e0777eebcb1191a94d94f1f2f87ce6973fbbcdd109ef67f63e2a475de7ce languageName: node linkType: hard -"@opentelemetry/instrumentation-kafkajs@npm:^0.7.1": - version: 0.7.1 - resolution: "@opentelemetry/instrumentation-kafkajs@npm:0.7.1" +"@opentelemetry/instrumentation-kafkajs@npm:^0.32.0": + version: 0.32.0 + resolution: "@opentelemetry/instrumentation-kafkajs@npm:0.32.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.30.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/440a479ec65414da706f15b5c2ff82235ea8b11701e811ae235af5e8f01bee7e639223243e9f18550ce55cc94b8cdaa8a72297ded55f1c7993f1d95488c2b02e + checksum: 10c0/cdfa03f7b7828a7f0c9868c83896f55b902b7749400738e280dd0c0c01c3cd417628be698be364fd1b1bffe645a163312a0be84ee8d37e7f980c04d5f3237d6c languageName: node linkType: hard -"@opentelemetry/instrumentation-knex@npm:^0.44.1": - version: 0.44.1 - resolution: "@opentelemetry/instrumentation-knex@npm:0.44.1" +"@opentelemetry/instrumentation-knex@npm:^0.67.0": + version: 0.67.0 + resolution: "@opentelemetry/instrumentation-knex@npm:0.67.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.1" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/75dcbda2c412cc448ac95238899d92846bda14bb21a1c9e9bc0c51fd48dcedb6064c2a8ab9e53d112945748d50513ecda13afbc4c0f24a884674d2a485f0efcd + checksum: 10c0/2cb7461a1e5ac94b5dce0a5fcf8fbdf3ea8829b6e5912bb68ce9308ab7280bb7aacea4e1a5563622cbc6af33969af765c1888de771a708f04c5ca74756794249 languageName: node linkType: hard -"@opentelemetry/instrumentation-koa@npm:^0.47.1": - version: 0.47.1 - resolution: "@opentelemetry/instrumentation-koa@npm:0.47.1" +"@opentelemetry/instrumentation-koa@npm:^0.71.0": + version: 0.71.0 + resolution: "@opentelemetry/instrumentation-koa@npm:0.71.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.36.0" peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/a1c5433da1265f1f8da3e46ebe085a3ddba3e16f43c5f44bd41082a0839f6bdf9a6a737b80b0d2f2a05d1ef2c23e2b0a4f7e55858bf1e32570b4c150c69135bc + "@opentelemetry/api": ^1.9.0 + checksum: 10c0/031aa0a8662b20a77457ae07d1a8496a4481bd558f9212f0d867ff33ac1f34d1d24927e4a110c2b4d6a48f2c86ba91385221643c04a66af1a3425f036ed4d7d3 languageName: node linkType: hard -"@opentelemetry/instrumentation-lru-memoizer@npm:^0.44.1": - version: 0.44.1 - resolution: "@opentelemetry/instrumentation-lru-memoizer@npm:0.44.1" +"@opentelemetry/instrumentation-long-task@npm:^0.67.0": + version: 0.67.0 + resolution: "@opentelemetry/instrumentation-long-task@npm:0.67.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/5728d0b6ed560ba8426546ab30ef251cbe9f25a130abc8bea0d7635b51cc29fbade4d00c7b1869fa0543fe54891799483fe0f6fb4073d1bf5d12dbdd543aaae5 + checksum: 10c0/151df6c3f108ecd32e128adce5bacbe76f1380a35e0ae210379a7b6f1f2360589bcb484d185b074dd26ca03f86b930430164192d43082757b334fe78f3a10da3 languageName: node linkType: hard -"@opentelemetry/instrumentation-memcached@npm:^0.43.1": - version: 0.43.1 - resolution: "@opentelemetry/instrumentation-memcached@npm:0.43.1" +"@opentelemetry/instrumentation-lru-memoizer@npm:^0.67.0": + version: 0.67.0 + resolution: "@opentelemetry/instrumentation-lru-memoizer@npm:0.67.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@types/memcached": "npm:^2.2.6" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/a0e4cd09b88c4586113812464c88dbdd322022398525af6e229381b187786ac621a955450f5f9be907122adca92ffe80617f68e39efb514d167d7e5459798e7b + checksum: 10c0/3419ae17778801d4665be73dbc2524fc5c7bd9da00c049b40c88ddc93c799e26d7ccb7b2daf736b55bdd7bfc2d3a0b457e7b2d65f0d67adc699653a130628adf languageName: node linkType: hard -"@opentelemetry/instrumentation-mongodb@npm:^0.52.0": - version: 0.52.0 - resolution: "@opentelemetry/instrumentation-mongodb@npm:0.52.0" +"@opentelemetry/instrumentation-memcached@npm:^0.66.0": + version: 0.66.0 + resolution: "@opentelemetry/instrumentation-memcached@npm:0.66.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" + "@types/memcached": "npm:^2.2.6" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/dcd072a296369a6b254a809e3708e5f9842ac9f8c61700bfa2014872fa6e6ca65adfa5efdbf9021df57e749dea2cddd828351e73cb581370b8b97693c06df7e8 + checksum: 10c0/d29843c184d88757fb6d23e35f47bb88646d625b6e6a63a16907dcfd54190880516aaa519eaa4129829601f094ab490f0a5e6147c31a2e494df0a3b5447fb7f6 languageName: node linkType: hard -"@opentelemetry/instrumentation-mongoose@npm:^0.46.1": - version: 0.46.1 - resolution: "@opentelemetry/instrumentation-mongoose@npm:0.46.1" +"@opentelemetry/instrumentation-mongodb@npm:^0.76.0": + version: 0.76.0 + resolution: "@opentelemetry/instrumentation-mongodb@npm:0.76.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/69378d41df172c2edb8b36042e751936837bb1cbee11ee72a3d1608c6d7f609d79beec2020b25de72086553ad9d85347642c4066e0b4e96d442513b29ac4f0aa + checksum: 10c0/61cfcfb17952147d22b26fb8924717bd265f13291007ec6f2d5bdc7df4141bdcd090103e6224f3fca6ab6bfe80af86968db2894e936f7bab414ad761455533b8 languageName: node linkType: hard -"@opentelemetry/instrumentation-mysql2@npm:^0.45.2": - version: 0.45.2 - resolution: "@opentelemetry/instrumentation-mysql2@npm:0.45.2" +"@opentelemetry/instrumentation-mongoose@npm:^0.69.0": + version: 0.69.0 + resolution: "@opentelemetry/instrumentation-mongoose@npm:0.69.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@opentelemetry/sql-common": "npm:^0.40.1" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/8ac62064b32facfddd7d47ba0bce9689d2277ba4ef74348655faffe818522c919654c5bf1a5fac211a75f2093fbd588a14cba278c353da2f60d1919d58d419aa + checksum: 10c0/610b53a7577cf005f1524c02e070a8b59de5c5d278214b2eedd943377177bfe9836a2d71b5766420eda84bb5298be07eb49b1dd2d7fff1980022503aee549c95 languageName: node linkType: hard -"@opentelemetry/instrumentation-mysql@npm:^0.45.1": - version: 0.45.1 - resolution: "@opentelemetry/instrumentation-mysql@npm:0.45.1" +"@opentelemetry/instrumentation-mysql2@npm:^0.69.0": + version: 0.69.0 + resolution: "@opentelemetry/instrumentation-mysql2@npm:0.69.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@types/mysql": "npm:2.15.26" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" + "@opentelemetry/sql-common": "npm:^0.42.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/c820a6929fe2e010dacb8962d40fdb8c9ac95c265efc74f478eadc021b2a3add9ce8d303c4bda20af01327564f487c9e052e710d9e975d7f17a5918d802d7ae4 + checksum: 10c0/332a5c58ba64f050cd449995e5ead1126f6741c8bcfa48400368b28575f585b1dd2a7c5595339602cc0128ffe10653b7207e1ebeea089796885ba76ff98696f8 languageName: node linkType: hard -"@opentelemetry/instrumentation-nestjs-core@npm:^0.44.1": - version: 0.44.1 - resolution: "@opentelemetry/instrumentation-nestjs-core@npm:0.44.1" +"@opentelemetry/instrumentation-mysql@npm:^0.69.1": + version: 0.69.1 + resolution: "@opentelemetry/instrumentation-mysql@npm:0.69.1" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/bd9f4b931305f9e184aeaf0fe2c36c1a88579012f5d43a2f029a4dd147d0c77c24301aaa6096ab84cc439a8c57ca43abbf1de4d67faa3c7235707975ae631080 + checksum: 10c0/b7b1dc7f662dc03650d7514705324606e09e9a3b12c12cb5dbcbe771c80608497c9e568ea2d52494d8b1f45f1004f222e6f5adb3ae5b8c8b25b100957382457b languageName: node linkType: hard -"@opentelemetry/instrumentation-net@npm:^0.43.1": - version: 0.43.1 - resolution: "@opentelemetry/instrumentation-net@npm:0.43.1" +"@opentelemetry/instrumentation-nestjs-core@npm:^0.70.0": + version: 0.70.0 + resolution: "@opentelemetry/instrumentation-nestjs-core@npm:0.70.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.30.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/aadbaa06d6334267e75596ad093438ebf9d3b9f72dfaa89cc12459b537ba24ccf02323756ef78aded31bcb1018e51eb129eed4fe19b59c08327298452fd022bc + checksum: 10c0/44ef2a4eeed92e10e6129355a684dd5e3982dfcb6fbc823a33c66ec49222fdff899ece8e732e92823551fe7ac4e36bd7c2e972f0c7711648727faa464826fc81 languageName: node linkType: hard -"@opentelemetry/instrumentation-pg@npm:^0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/instrumentation-pg@npm:0.51.1" +"@opentelemetry/instrumentation-net@npm:^0.67.0": + version: 0.67.0 + resolution: "@opentelemetry/instrumentation-net@npm:0.67.0" dependencies: - "@opentelemetry/core": "npm:^1.26.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@opentelemetry/sql-common": "npm:^0.40.1" - "@types/pg": "npm:8.6.1" - "@types/pg-pool": "npm:2.0.6" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/fff3dcc092b959601a20c20e19c27d39d6386e6bc2b7014c1be5a5e22c0e275bf9980dad758b1f7824b1448a6178e13938b6bb2da53095f410fbb4d248b5ede6 + checksum: 10c0/a54e1ed66d44db521877673cb9c56e0e2132a40123c31765112b179911108954e555016a6c7bdf1f6a254bb868362b75112941329ecf55e40ed125749604811f languageName: node linkType: hard -"@opentelemetry/instrumentation-pino@npm:^0.46.1": - version: 0.46.1 - resolution: "@opentelemetry/instrumentation-pino@npm:0.46.1" +"@opentelemetry/instrumentation-openai@npm:^0.21.0": + version: 0.21.0 + resolution: "@opentelemetry/instrumentation-openai@npm:0.21.0" dependencies: - "@opentelemetry/api-logs": "npm:^0.57.1" - "@opentelemetry/core": "npm:^1.25.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.36.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/aa8e20ff91fa9883dc4f1361580472fa8489dc8f23bb5567b8c66c399f1ff235698a1e546e6a939204aefc81f7baf7e0688aee2f4be3ab37bb4a6ea2500fcdf5 + checksum: 10c0/c59a80d3720b1df90d71e6ea1cbfd3d5f28a1a2791c2eda7d1a59f565e2d383cf562b5a160c6d732c66418424dc865082ff661b8c6df3aa39bab1002a8f221c2 languageName: node linkType: hard -"@opentelemetry/instrumentation-redis-4@npm:^0.46.1": - version: 0.46.1 - resolution: "@opentelemetry/instrumentation-redis-4@npm:0.46.1" +"@opentelemetry/instrumentation-oracledb@npm:^0.48.0": + version: 0.48.0 + resolution: "@opentelemetry/instrumentation-oracledb@npm:0.48.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/redis-common": "npm:^0.36.2" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.34.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/df0bdd865e254c9b4c0339ce5aabf3698d99b8ab8cf8ea1aa57ffa13620f2193fda247ed43ec4ccc6edadab1ffec5cc263038ab6f3c9e96ef000ee232b9181f8 + checksum: 10c0/93e32064286562841ffbfe5c2efb15cd3d339814ebd156dea453ac2cf9cab095d67c8005e2ebd79ba34f2c2542827ce2ee20a4fef4457f2765cee1a5a7034f87 languageName: node linkType: hard -"@opentelemetry/instrumentation-redis@npm:^0.46.1": - version: 0.46.1 - resolution: "@opentelemetry/instrumentation-redis@npm:0.46.1" +"@opentelemetry/instrumentation-pg@npm:^0.76.0": + version: 0.76.0 + resolution: "@opentelemetry/instrumentation-pg@npm:0.76.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/redis-common": "npm:^0.36.2" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.34.0" + "@opentelemetry/sql-common": "npm:^0.42.0" + "@types/pg": "npm:8.15.6" + "@types/pg-pool": "npm:2.0.7" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/e70f3d4ea8933aa5eeafe3d643a69f1dbcc0d26d24a0dadb5833aaf964cfc5c92600cdc775a33c6449521719364e19ba9be839f436aec12aee52e8586fa90c7d + checksum: 10c0/b7557905aa7928308bcc417af59fea935fbe65ac7c44d68d6edd13e9aeac8ac67a4c88f5cb0c3ebd6f5e9d32d5724e42ba375dd5e93533a7116e8cc27f29cb6f languageName: node linkType: hard -"@opentelemetry/instrumentation-restify@npm:^0.45.1": - version: 0.45.1 - resolution: "@opentelemetry/instrumentation-restify@npm:0.45.1" +"@opentelemetry/instrumentation-pino@npm:^0.69.0": + version: 0.69.0 + resolution: "@opentelemetry/instrumentation-pino@npm:0.69.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.41.1" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/df3428db1d9d4a1dca070490213841cb87b93cdb61807208408f92ce7bf5b1b99cd7f907168383a942b3f6cd7a0d2723c49b4df4a48d4f233086fdbfd17915a4 + checksum: 10c0/71ea470a7cf8af5a1c86b2ba4c1a45b30eaab513279c0bbeeed6acf1d4efba4f7d83edb0cc3c59521376654e8f5b1c2ae46d51b744edf85da77a523e843fdbdc languageName: node linkType: hard -"@opentelemetry/instrumentation-router@npm:^0.44.1": - version: 0.44.1 - resolution: "@opentelemetry/instrumentation-router@npm:0.44.1" +"@opentelemetry/instrumentation-redis@npm:^0.71.0": + version: 0.71.0 + resolution: "@opentelemetry/instrumentation-redis@npm:0.71.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/redis-common": "npm:^0.38.3" "@opentelemetry/semantic-conventions": "npm:^1.27.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/d9d9672b8fdcc59fc226475fe6e49f6eea856879eac08aa03bd6d251cdb417e56747f1a6e82dbd232854b3d4ca16f38e8c80e0ff16114aab898f23eb18a2528c - languageName: node - linkType: hard - -"@opentelemetry/instrumentation-runtime-node@npm:^0.12.2": - version: 0.12.2 - resolution: "@opentelemetry/instrumentation-runtime-node@npm:0.12.2" - dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" - peerDependencies: - "@opentelemetry/api": ^1.3.0 - checksum: 10c0/91c7daff3f5fe9b75f799a413eec03bb9d34519a9d7229960ad6a5d2c29201dc902caca70050908c0a98aedbdcb9f55bb0a5be9baf3e6cd792e7da51150d1369 + checksum: 10c0/1639be7d5d9700f234cb85b78b881077fc88965a27ad2fe96e3e4cfa686cca1effdb812f2173a6827172c99d4387903642a655662b413867be6fd193fc8af6bc languageName: node linkType: hard -"@opentelemetry/instrumentation-socket.io@npm:^0.46.1": - version: 0.46.1 - resolution: "@opentelemetry/instrumentation-socket.io@npm:0.46.1" +"@opentelemetry/instrumentation-restify@npm:^0.68.0": + version: 0.68.0 + resolution: "@opentelemetry/instrumentation-restify@npm:0.68.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" "@opentelemetry/semantic-conventions": "npm:^1.27.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/ed6be04ce334d5de6c3284ed0e85c43bef8594c17fff29e7328bb8bfd58552633e5f11560ba648ac44fdf0d27290383d83b1b9774c12cc279362781810949583 + checksum: 10c0/3ef6c09ecf2e760144395c70eeaa4b8b585eea35f8205231a1d17a94703ac9de2d1bd484c6c80c1aada17b0b7221d235f342c3cca5ad3be289012708f483edc0 languageName: node linkType: hard -"@opentelemetry/instrumentation-tedious@npm:^0.18.1": - version: 0.18.1 - resolution: "@opentelemetry/instrumentation-tedious@npm:0.18.1" +"@opentelemetry/instrumentation-router@npm:^0.67.0": + version: 0.67.0 + resolution: "@opentelemetry/instrumentation-router@npm:0.67.0" dependencies: - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" "@opentelemetry/semantic-conventions": "npm:^1.27.0" - "@types/tedious": "npm:^4.0.14" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/fda9ac4dc89998a2cf739a70f06b1d6eebf98fe22713dc3fbca4a1119dc289d83c91ada4a3cea37f39a34c69978ae21ff9b599c27beaee128879b993677696dc + checksum: 10c0/9bf06975da0f4a657940dce33c6c56edd0d9c9d48eff8dc37c306683b001def9159690089b8abe9972091205604fb0ea53f0924eca1501ba1adf04f735fc7e00 languageName: node linkType: hard -"@opentelemetry/instrumentation-undici@npm:^0.10.1": - version: 0.10.1 - resolution: "@opentelemetry/instrumentation-undici@npm:0.10.1" +"@opentelemetry/instrumentation-runtime-node@npm:^0.36.1": + version: 0.36.1 + resolution: "@opentelemetry/instrumentation-runtime-node@npm:0.36.1" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: - "@opentelemetry/api": ^1.7.0 - checksum: 10c0/3958f291d14f2f7bb5e3b957487444ffee449d8ea76c973ca09b9669258d37e98b3797c7167190c5038802529cc6b539bdf6efc7887398ec9b53d3ba51c90bda + "@opentelemetry/api": ^1.3.0 + checksum: 10c0/5f4abed3586d333967a1a17613a5493ab1017bcf98abde9763952c7baa94aefe50b0a04b48393cc05de9413a1bfd3db619bb3a7a851b0aaec7df1fa3499b4eb7 languageName: node linkType: hard -"@opentelemetry/instrumentation-user-interaction@npm:^0.38.0": - version: 0.38.0 - resolution: "@opentelemetry/instrumentation-user-interaction@npm:0.38.0" +"@opentelemetry/instrumentation-socket.io@npm:^0.70.0": + version: 0.70.0 + resolution: "@opentelemetry/instrumentation-socket.io@npm:0.70.0" dependencies: - "@opentelemetry/core": "npm:^1.8.0" - "@opentelemetry/instrumentation": "npm:^0.51.0" - "@opentelemetry/sdk-trace-web": "npm:^1.8.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - zone.js: ^0.11.4 || ^0.13.0 || ^0.14.0 - checksum: 10c0/57c4c441d9b987ddad6dc656fb5fecc42f0fb81adee2ca7e3b962763994bda8ec7d3337edc8b8e69a6b7e3cd2d93fb3a989bd8382bbeb4d87c15db1a303787a4 + checksum: 10c0/72413f1c47de5a19d3480b28f8fd9ee64a9ad4652d8a6649958561a2ef0ca71fcfab1f2c503f13e44df758752de1061c7591f2f32ec767515ac13a8b201000c4 languageName: node linkType: hard -"@opentelemetry/instrumentation-winston@npm:^0.44.1": - version: 0.44.1 - resolution: "@opentelemetry/instrumentation-winston@npm:0.44.1" +"@opentelemetry/instrumentation-tedious@npm:^0.42.0": + version: 0.42.0 + resolution: "@opentelemetry/instrumentation-tedious@npm:0.42.0" dependencies: - "@opentelemetry/api-logs": "npm:^0.57.1" - "@opentelemetry/instrumentation": "npm:^0.57.1" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.33.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/dc32175ae8791efab0e6d2f242535824472675658fc1467f3defd291638bf064baab0a39bbe90b848da348fbb93491d15b2f8374f4d03abf810a7f78da45049e + checksum: 10c0/2f75991f6ba95d235830242dd8776e262a5646b53fd81ab9e90c546d34a3f507001850976ba471929c7af786851abb276a79e86d3b0651593c62ed28eb5e9b6b languageName: node linkType: hard -"@opentelemetry/instrumentation-xml-http-request@npm:^0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/instrumentation-xml-http-request@npm:0.51.1" +"@opentelemetry/instrumentation-undici@npm:^0.33.0": + version: 0.33.0 + resolution: "@opentelemetry/instrumentation-undici@npm:0.33.0" dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/instrumentation": "npm:0.51.1" - "@opentelemetry/sdk-trace-web": "npm:1.24.1" - "@opentelemetry/semantic-conventions": "npm:1.24.1" + "@opentelemetry/core": "npm:^2.9.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" + "@opentelemetry/semantic-conventions": "npm:^1.24.0" peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/9ca8a99bd0d5e3a08d953be1bd09f6baa6f8ad75740ca9cc21d0a5a3bf184ffc971226c0f83b88b0b1f22f25e03821a902393e5b970efdbe473c9a8662fcf94b + "@opentelemetry/api": ^1.7.0 + checksum: 10c0/64e2efb9f86064b698c992908fbc0bb93e362976b49f30ab4cdd601a1b3aa8db6da74532f0c28f691ce395c6176c6a6efbf00e86c2c0dc56806825ab867b6fbb languageName: node linkType: hard -"@opentelemetry/instrumentation@npm:0.51.1, @opentelemetry/instrumentation@npm:^0.51.0, @opentelemetry/instrumentation@npm:^0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/instrumentation@npm:0.51.1" +"@opentelemetry/instrumentation-winston@npm:^0.68.1": + version: 0.68.1 + resolution: "@opentelemetry/instrumentation-winston@npm:0.68.1" dependencies: - "@opentelemetry/api-logs": "npm:0.51.1" - "@types/shimmer": "npm:^1.0.2" - import-in-the-middle: "npm:1.7.4" - require-in-the-middle: "npm:^7.1.1" - semver: "npm:^7.5.2" - shimmer: "npm:^1.2.1" + "@opentelemetry/api-logs": "npm:^0.223.0" + "@opentelemetry/instrumentation": "npm:^0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/39e02944becc7ee54c257b17ddef239b4d4e0c9c52223a74a32b0399b8cfe8bbd86af41f6940b85ab05481de0504a59f17fd2e8e5b6a32b5f0314f2a57d2e101 + checksum: 10c0/5034027e1d973bcc338e6bcceb3dc75873edd30368cd270e8eca0c0c526e8ed16d0eb4614a514c6e5871008919bf2aa163cf991bdf230bfc16562e18ea799268 languageName: node linkType: hard -"@opentelemetry/instrumentation@npm:0.57.2, @opentelemetry/instrumentation@npm:^0.57.1, @opentelemetry/instrumentation@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/instrumentation@npm:0.57.2" +"@opentelemetry/instrumentation@npm:0.223.0, @opentelemetry/instrumentation@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/instrumentation@npm:0.223.0" dependencies: - "@opentelemetry/api-logs": "npm:0.57.2" - "@types/shimmer": "npm:^1.2.0" - import-in-the-middle: "npm:^1.8.1" - require-in-the-middle: "npm:^7.1.1" - semver: "npm:^7.5.2" - shimmer: "npm:^1.2.1" + "@opentelemetry/api-logs": "npm:0.223.0" + import-in-the-middle: "npm:^3.0.0" + require-in-the-middle: "npm:^8.0.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/79ca65b66357665d19f89da7027da25ea1c6b55ecdacb0a99534923743c80deb9282870db563de8ae284b13e7e0aab8413efa1937f199deeaef069e07c7e4875 - languageName: node - linkType: hard - -"@opentelemetry/otlp-exporter-base@npm:0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/otlp-exporter-base@npm:0.51.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/5274013e6b23ac1e2e422c9ba0041553621414aaecd0643caa526c32ff08811d0e266b3a3eda526e0e64651fad8ce77a4eeb43850415240d36df26ff5a81914b + checksum: 10c0/91d376a6625ed005655b27492922068f0d2fbe04372002407a6498d96e953b0b4669a97b9946cc49286a28082195b6db849ad35583b9772bc3a359b4e672756f languageName: node linkType: hard -"@opentelemetry/otlp-exporter-base@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/otlp-exporter-base@npm:0.57.2" +"@opentelemetry/otlp-exporter-base@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/otlp-exporter-base@npm:0.223.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-transformer": "npm:0.57.2" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/56e0b7f3c7ff38a53c7976d87dc6bb4d4830f3be42c93f6d079d66b7e4f9f6004f62b853149e831ae936782716fb7ea7a7ca7871527fa7d09d73a2aa90880d21 + checksum: 10c0/94a27d295ba1acebe253c2ca379a0de15423032899c939653e38950c09f0eccdb09347fe3938e57089e52568c4f0e97a1282c36e6c355ba5f999d1fd32970637 languageName: node linkType: hard -"@opentelemetry/otlp-grpc-exporter-base@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/otlp-grpc-exporter-base@npm:0.57.2" +"@opentelemetry/otlp-grpc-exporter-base@npm:0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/otlp-grpc-exporter-base@npm:0.223.0" dependencies: - "@grpc/grpc-js": "npm:^1.7.1" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/otlp-exporter-base": "npm:0.57.2" - "@opentelemetry/otlp-transformer": "npm:0.57.2" + "@grpc/grpc-js": "npm:^1.14.3" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-transformer": "npm:0.223.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/4a5ced2720061a6833b8210e0c606211393da98e0701087dc803c333e04a186550224408c7d82960c6cc07c96b1ab9c16b918cafdc9b77c27bc2f3781b6de6b1 - languageName: node - linkType: hard - -"@opentelemetry/otlp-transformer@npm:0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/otlp-transformer@npm:0.51.1" - dependencies: - "@opentelemetry/api-logs": "npm:0.51.1" - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/resources": "npm:1.24.1" - "@opentelemetry/sdk-logs": "npm:0.51.1" - "@opentelemetry/sdk-metrics": "npm:1.24.1" - "@opentelemetry/sdk-trace-base": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ">=1.3.0 <1.9.0" - checksum: 10c0/55082908439568f862f24cc714561d3b424cae8e726359c03bbe42f33868d8297fa30d93bcf6f475169ccceaf97ac47ba514e426871a83c8dfe0d2779e3644f3 + checksum: 10c0/549e2123fddb386e59055bbe375d0e010e021a8a9044579d5ebfd7864f400b77fa3e867d087cd47e2c1be036b0c4f7744f328fae3d9f592d3c4ead0c7d2a3efc languageName: node linkType: hard -"@opentelemetry/otlp-transformer@npm:0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/otlp-transformer@npm:0.57.2" +"@opentelemetry/otlp-transformer@npm:0.223.0, @opentelemetry/otlp-transformer@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/otlp-transformer@npm:0.223.0" dependencies: - "@opentelemetry/api-logs": "npm:0.57.2" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-logs": "npm:0.57.2" - "@opentelemetry/sdk-metrics": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" - protobufjs: "npm:^7.3.0" + "@opentelemetry/api-logs": "npm:0.223.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/sdk-logs": "npm:0.223.0" + "@opentelemetry/sdk-metrics": "npm:2.12.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ^1.3.0 - checksum: 10c0/094979421768c5ac0672d1ce62bbc710a8cc836eb24e1cdfe5fb2c5c55908d19cf35fd6810cd266e7444d5677087846d5a8959df5886dfe1774199a3ae1d50a4 + checksum: 10c0/5d6ba136f950864b5843c7df273d29289598f822e33a31bc7ef2cd29962460206e6c6dc163182f6ba2fdb52f2568ea7c893be8ee96356570da0709bcd440fd52 languageName: node linkType: hard -"@opentelemetry/propagation-utils@npm:^0.30.16": - version: 0.30.16 - resolution: "@opentelemetry/propagation-utils@npm:0.30.16" +"@opentelemetry/propagator-aws-xray@npm:^2.1.4": + version: 2.2.0 + resolution: "@opentelemetry/propagator-aws-xray@npm:2.2.0" peerDependencies: - "@opentelemetry/api": ^1.0.0 - checksum: 10c0/a6fa69694f9a5231a188846cec2989ec929d4caf4e74ddea133fc69c6b96072f80b67a919c5b967f50f49f5929b1e327ab1800666b1920fb63c3e10f580195f0 + "@opentelemetry/api": ">=1.0.0 <1.10.0" + checksum: 10c0/2fa665a1e867a8ff3fb3875db5d302a8f3c625337ae18378f9bc0a29633484e61b9fb8c3d2b5f1096b285b92a96c4615af4e5adfbca2a971dcee3b604953e5ba languageName: node linkType: hard -"@opentelemetry/propagator-b3@npm:1.30.1": - version: 1.30.1 - resolution: "@opentelemetry/propagator-b3@npm:1.30.1" +"@opentelemetry/propagator-b3@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/propagator-b3@npm:2.12.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" + "@opentelemetry/core": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ">=1.0.0 <1.10.0" - checksum: 10c0/aeeaa6325e2d970a207a396b98562e05578688ffd047e64544c441456702c593a74b614216c0360ee0f63bb7c3cf39b63f74c0f59c8580a1aac067970cee9bc2 + checksum: 10c0/f8e86e373fed5995b2b498985430d39f0b6ba310b14ba4ef55fc03c60b4e8bde082628859b3a2f013234d83c64951e0e988733231e7e17279c19e2d67a90c4df languageName: node linkType: hard -"@opentelemetry/propagator-jaeger@npm:1.30.1": - version: 1.30.1 - resolution: "@opentelemetry/propagator-jaeger@npm:1.30.1" +"@opentelemetry/propagator-jaeger@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/propagator-jaeger@npm:2.12.0" dependencies: - "@opentelemetry/core": "npm:1.30.1" + "@opentelemetry/core": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ">=1.0.0 <1.10.0" - checksum: 10c0/e828d67768150bb23b4e75589bc6e9a3ae28e50a6ba6f6e737cf14fd33ab4108fb0aa84d363045e7e591b89a55bef4b8823fbd1734f64f7bb918338b78b86881 + checksum: 10c0/a2ee2dbf8da9530bfe7c021016c6c29c9ba5d6bfbab1efbb9fe47342e9f99c4046cdc99f009f1cda48f18c0188cde434b289399a91b0abf52b7d98ac80ec5c03 languageName: node linkType: hard -"@opentelemetry/redis-common@npm:^0.36.2": - version: 0.36.2 - resolution: "@opentelemetry/redis-common@npm:0.36.2" - checksum: 10c0/4cb831628551b9f13dca8d65897e300ff7be0e256b77f455a26fb053bbdfc7997b27d066ab1402ca929e7ac77598e0d593f91762d8af9f798c19ba1524e9d078 +"@opentelemetry/redis-common@npm:^0.38.3": + version: 0.38.3 + resolution: "@opentelemetry/redis-common@npm:0.38.3" + checksum: 10c0/e978eca4e322efdb3635797d4109d2195c1c0e815d2e24caab0e9ab619c9e62316622e97de5b46faa5e15a735c36135377c14ced9aec1566a25e91b5cc9f8d94 languageName: node linkType: hard -"@opentelemetry/resource-detector-alibaba-cloud@npm:^0.30.1": - version: 0.30.1 - resolution: "@opentelemetry/resource-detector-alibaba-cloud@npm:0.30.1" +"@opentelemetry/resource-detector-alibaba-cloud@npm:^0.38.0": + version: 0.38.0 + resolution: "@opentelemetry/resource-detector-alibaba-cloud@npm:0.38.0" dependencies: - "@opentelemetry/core": "npm:^1.26.0" - "@opentelemetry/resources": "npm:^1.10.0" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/resources": "npm:^2.0.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/b38649acaa973cc1c7781fd64aaa6f680f5276ab66e0ebd98fbd36395bafcae693e372ed89e2ed08707ac07caf54999717dafe4aedc61a7f92132f514caec770 + checksum: 10c0/8d50960170bd713695fba77443862fafc6ae73c724c096ab754c2f9143ac110bd22f6eb4bdeafbed9d37e2d52dac4bfe4fe47ef0c46a54faf73b9431a0bd5818 languageName: node linkType: hard -"@opentelemetry/resource-detector-aws@npm:^1.12.0": - version: 1.12.0 - resolution: "@opentelemetry/resource-detector-aws@npm:1.12.0" +"@opentelemetry/resource-detector-aws@npm:^2.23.0": + version: 2.23.0 + resolution: "@opentelemetry/resource-detector-aws@npm:2.23.0" dependencies: - "@opentelemetry/core": "npm:^1.0.0" - "@opentelemetry/resources": "npm:^1.10.0" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/resources": "npm:^2.0.0" "@opentelemetry/semantic-conventions": "npm:^1.27.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/af8634d040358d19839678ab3b7e1b6429ee9a58f852749201cc4cfa522628c68d4a615f3e4f6b9f56388ef364f583620551983e241ad064fe55c5595904ede8 + checksum: 10c0/d0c1689e87a1fe49d7b1f4ecaf403982b1642e2d195662150371e9cc64f973d027893422235420704c80f3299fffc8bf769e124a4cd269713b14c0906623975a languageName: node linkType: hard -"@opentelemetry/resource-detector-azure@npm:^0.6.1": - version: 0.6.1 - resolution: "@opentelemetry/resource-detector-azure@npm:0.6.1" +"@opentelemetry/resource-detector-azure@npm:^0.31.0": + version: 0.31.0 + resolution: "@opentelemetry/resource-detector-azure@npm:0.31.0" dependencies: - "@opentelemetry/core": "npm:^1.25.1" - "@opentelemetry/resources": "npm:^1.10.1" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/resources": "npm:^2.0.0" + "@opentelemetry/semantic-conventions": "npm:^1.37.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/c6f63739bc766baea2a9caf86be22d1d6cbf94f58b934c5344be6a61fd3b917bb2dc82891365ed0f396a811715efb60b4a1f1e22dd4ad2c3b1d31903167459ba + checksum: 10c0/c0f45ff0cdfef42e48ce3e14c7ceabe035f3cd145e72841b55a49e1f9d83a0461e760210c9f8b7ae7355b67e50841fe0d341f5b3ded4ff5c19adb20b6f938e51 languageName: node linkType: hard -"@opentelemetry/resource-detector-container@npm:^0.6.1": - version: 0.6.1 - resolution: "@opentelemetry/resource-detector-container@npm:0.6.1" +"@opentelemetry/resource-detector-container@npm:^0.8.14": + version: 0.8.14 + resolution: "@opentelemetry/resource-detector-container@npm:0.8.14" dependencies: - "@opentelemetry/core": "npm:^1.26.0" - "@opentelemetry/resources": "npm:^1.10.0" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/resources": "npm:^2.0.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/c3cf745d62657dd8d32c44cd326b645c74397f4159c055d2b4c0b432e95982f9dacae1de3fbad3d5e586993c80f44505a64bc74f8fd164df02c9c18d2b4a4217 + checksum: 10c0/fd9c54a3465265c18f0b3ddf569abdab455007bd3cc253e27b89442d38b0c63e3930968887c9fd9b2ef5cd0b5abcb85969be43aa33411ca94b5942df9bfaaa59 languageName: node linkType: hard -"@opentelemetry/resource-detector-gcp@npm:^0.33.1": - version: 0.33.1 - resolution: "@opentelemetry/resource-detector-gcp@npm:0.33.1" +"@opentelemetry/resource-detector-gcp@npm:^0.58.0": + version: 0.58.0 + resolution: "@opentelemetry/resource-detector-gcp@npm:0.58.0" dependencies: - "@opentelemetry/core": "npm:^1.0.0" - "@opentelemetry/resources": "npm:^1.10.0" - "@opentelemetry/semantic-conventions": "npm:^1.27.0" - gcp-metadata: "npm:^6.0.0" + "@opentelemetry/core": "npm:^2.0.0" + "@opentelemetry/resources": "npm:^2.0.0" + gcp-metadata: "npm:^8.0.0" peerDependencies: "@opentelemetry/api": ^1.0.0 - checksum: 10c0/c09639fbfd3836879d685e831794c4f118c2b9978d87bce710fe92f50c9c1ab53d6937ca9ffbe1022435a22667cffa7187b23aa953867c088573eb28a062d7a6 - languageName: node - linkType: hard - -"@opentelemetry/resources@npm:1.12.0": - version: 1.12.0 - resolution: "@opentelemetry/resources@npm:1.12.0" - dependencies: - "@opentelemetry/core": "npm:1.12.0" - "@opentelemetry/semantic-conventions": "npm:1.12.0" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.5.0" - checksum: 10c0/a2fca297798297f649fa71534bb16001145c957ab4733fb186bb6a2d60b3741a436e1b11327448f7338ed75ed8abbcf89509ddfcdaf37fbe782814a78818a3e1 - languageName: node - linkType: hard - -"@opentelemetry/resources@npm:1.21.0": - version: 1.21.0 - resolution: "@opentelemetry/resources@npm:1.21.0" - dependencies: - "@opentelemetry/core": "npm:1.21.0" - "@opentelemetry/semantic-conventions": "npm:1.21.0" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.8.0" - checksum: 10c0/0ac61b835e20d3323e1e6a5c74cbb64a9200e165724d6d1449f01bd18a0c5af3da854dacdc729cdb4ed00cb740639c76d6cd7c638ad6efffc23f9da0de36406a + checksum: 10c0/605bc69b0ec63b179f5df2e7d20c9d4f5cb30ad1ae3c1e0d8cb94f4117485f7870a0bdfa327a1ee56f0aee092265c1896dcad8c6450b6b6bac202db3ae45acf0 languageName: node linkType: hard -"@opentelemetry/resources@npm:1.24.1": - version: 1.24.1 - resolution: "@opentelemetry/resources@npm:1.24.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/semantic-conventions": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.9.0" - checksum: 10c0/b2f68c153231bdca6491d6050d43d84c7679f44783eaca9daa9bdb3381b5bbdb54eb6de472e9177bc1c161b0bc83423af59e5e356cce8f7880fece757a0106b6 - languageName: node - linkType: hard - -"@opentelemetry/resources@npm:1.30.1, @opentelemetry/resources@npm:^1.10.0, @opentelemetry/resources@npm:^1.30.1": +"@opentelemetry/resources@npm:1.30.1": version: 1.30.1 resolution: "@opentelemetry/resources@npm:1.30.1" dependencies: @@ -7802,139 +7878,96 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/resources@npm:^1.10.1, @opentelemetry/resources@npm:^1.24.0, @opentelemetry/resources@npm:^1.24.1": - version: 1.25.1 - resolution: "@opentelemetry/resources@npm:1.25.1" - dependencies: - "@opentelemetry/core": "npm:1.25.1" - "@opentelemetry/semantic-conventions": "npm:1.25.1" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.10.0" - checksum: 10c0/4edbf04945c7647b9af847f2f8abccabb54f4f8935fd75c199dc22879f8b7927ac50fac8e877ef48e81c586a08d63bbfe41c345caf94a8ce2c623fa99bb8e999 - languageName: node - linkType: hard - -"@opentelemetry/sdk-logs@npm:0.51.1": - version: 0.51.1 - resolution: "@opentelemetry/sdk-logs@npm:0.51.1" +"@opentelemetry/resources@npm:2.12.0, @opentelemetry/resources@npm:^2.0.0, @opentelemetry/resources@npm:^2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/resources@npm:2.12.0" dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/resources": "npm:1.24.1" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: - "@opentelemetry/api": ">=1.4.0 <1.9.0" - "@opentelemetry/api-logs": ">=0.39.1" - checksum: 10c0/8359ce836c7431f1bbd915d42c885b01351351a4090cfd99f5e88d4549700c24128f03e99daac22adcef307c9417c6dddc0ed8af0d8e31b4dbc15516d75b4093 + "@opentelemetry/api": ">=1.3.0 <1.10.0" + checksum: 10c0/ef3f8470b9ada8406fa4e4a0f002ca31537c1b7fe61f06102fb9023c97a56b0d978c687dd392539f1e005c20f0467f6a1c66f9c43e8d31c2900023164529f2bc languageName: node linkType: hard -"@opentelemetry/sdk-logs@npm:0.57.2, @opentelemetry/sdk-logs@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/sdk-logs@npm:0.57.2" +"@opentelemetry/sdk-logs@npm:0.223.0, @opentelemetry/sdk-logs@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/sdk-logs@npm:0.223.0" dependencies: - "@opentelemetry/api-logs": "npm:0.57.2" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/resources": "npm:1.30.1" + "@opentelemetry/api-logs": "npm:0.223.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: "@opentelemetry/api": ">=1.4.0 <1.10.0" - checksum: 10c0/dda61cf656a93d2f5ef1ca0495db59bfa33efc8ca7ee11018850a9ff78ee0459fb0393e70be7ae5d3cd084e0652d36fbf5778c7b3e9028c6668f9bf0d6c9473e - languageName: node - linkType: hard - -"@opentelemetry/sdk-metrics@npm:1.24.1": - version: 1.24.1 - resolution: "@opentelemetry/sdk-metrics@npm:1.24.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/resources": "npm:1.24.1" - lodash.merge: "npm:^4.6.2" - peerDependencies: - "@opentelemetry/api": ">=1.3.0 <1.9.0" - checksum: 10c0/a9e374851d44f67ec64f72721f9f2f9fae7ecf4ddb9dafdd80322b846b31421f29cdaf1aacb7e6944030319405d9d14cb9bd26ce51a23df4eb1061812c0b407c + checksum: 10c0/18f7b608f52845a0404c2eacc03e3156f75bb6e901a53c4c0ba43e6bf103f7760e4e4e932d971a6ed6e8ab82db124f6dad7381f920fb6060516e09a8d7b33445 languageName: node linkType: hard -"@opentelemetry/sdk-metrics@npm:1.30.1, @opentelemetry/sdk-metrics@npm:^1.30.1": - version: 1.30.1 - resolution: "@opentelemetry/sdk-metrics@npm:1.30.1" - dependencies: - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/resources": "npm:1.30.1" +"@opentelemetry/sdk-metrics@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/sdk-metrics@npm:2.12.0" + dependencies: + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + peerDependencies: + "@opentelemetry/api": ">=1.9.0 <1.10.0" + checksum: 10c0/ade35092d89de10ff3fe5058c632bf26c2dc21a74336e7946bd46156f58f85aab048fb30367cb091494b099242711895b27624efb31e78551ee6b2d05eee0c52 + languageName: node + linkType: hard + +"@opentelemetry/sdk-node@npm:^0.223.0": + version: 0.223.0 + resolution: "@opentelemetry/sdk-node@npm:0.223.0" + dependencies: + "@opentelemetry/api-logs": "npm:0.223.0" + "@opentelemetry/configuration": "npm:0.223.0" + "@opentelemetry/context-async-hooks": "npm:2.12.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/exporter-logs-otlp-grpc": "npm:0.223.0" + "@opentelemetry/exporter-logs-otlp-http": "npm:0.223.0" + "@opentelemetry/exporter-logs-otlp-proto": "npm:0.223.0" + "@opentelemetry/exporter-metrics-otlp-grpc": "npm:0.223.0" + "@opentelemetry/exporter-metrics-otlp-http": "npm:0.223.0" + "@opentelemetry/exporter-metrics-otlp-proto": "npm:0.223.0" + "@opentelemetry/exporter-prometheus": "npm:0.223.0" + "@opentelemetry/exporter-trace-otlp-grpc": "npm:0.223.0" + "@opentelemetry/exporter-trace-otlp-http": "npm:0.223.0" + "@opentelemetry/exporter-trace-otlp-proto": "npm:0.223.0" + "@opentelemetry/exporter-zipkin": "npm:2.12.0" + "@opentelemetry/instrumentation": "npm:0.223.0" + "@opentelemetry/otlp-exporter-base": "npm:0.223.0" + "@opentelemetry/otlp-grpc-exporter-base": "npm:0.223.0" + "@opentelemetry/propagator-b3": "npm:2.12.0" + "@opentelemetry/propagator-jaeger": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/sdk-logs": "npm:0.223.0" + "@opentelemetry/sdk-metrics": "npm:2.12.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" + "@opentelemetry/sdk-trace-base": "npm:2.12.0" + "@opentelemetry/sdk-trace-node": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: "@opentelemetry/api": ">=1.3.0 <1.10.0" - checksum: 10c0/7e60178e61eaf49db5d74f6c3701706762d71d370044253c72bb5668dba3a435030ed6847605ee55d0e1b8908ad123a2517b5f00415a2fb3d98468a0a318e3c0 + checksum: 10c0/5650b5399040e965536977e98cc47b3e30eadf792e579013ccb680172b5beef33c0380ffeb1d9e0714e19c35cd4d90ce11aef3372534f9d822d2c8131e55e7d1 languageName: node linkType: hard -"@opentelemetry/sdk-node@npm:^0.57.1, @opentelemetry/sdk-node@npm:^0.57.2": - version: 0.57.2 - resolution: "@opentelemetry/sdk-node@npm:0.57.2" +"@opentelemetry/sdk-trace-base@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/sdk-trace-base@npm:2.12.0" dependencies: - "@opentelemetry/api-logs": "npm:0.57.2" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/exporter-logs-otlp-grpc": "npm:0.57.2" - "@opentelemetry/exporter-logs-otlp-http": "npm:0.57.2" - "@opentelemetry/exporter-logs-otlp-proto": "npm:0.57.2" - "@opentelemetry/exporter-metrics-otlp-grpc": "npm:0.57.2" - "@opentelemetry/exporter-metrics-otlp-http": "npm:0.57.2" - "@opentelemetry/exporter-metrics-otlp-proto": "npm:0.57.2" - "@opentelemetry/exporter-prometheus": "npm:0.57.2" - "@opentelemetry/exporter-trace-otlp-grpc": "npm:0.57.2" - "@opentelemetry/exporter-trace-otlp-http": "npm:0.57.2" - "@opentelemetry/exporter-trace-otlp-proto": "npm:0.57.2" - "@opentelemetry/exporter-zipkin": "npm:1.30.1" - "@opentelemetry/instrumentation": "npm:0.57.2" - "@opentelemetry/resources": "npm:1.30.1" - "@opentelemetry/sdk-logs": "npm:0.57.2" - "@opentelemetry/sdk-metrics": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" - "@opentelemetry/sdk-trace-node": "npm:1.30.1" - "@opentelemetry/semantic-conventions": "npm:1.28.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/sdk-trace": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: "@opentelemetry/api": ">=1.3.0 <1.10.0" - checksum: 10c0/5897cc13a01a23bc49823f0f6fbad86d9efef20e9ee8d211eb7b45ef2995fcd2b9ca8212d81a3adaf7dd8e877e19634a89c7f64ea4c3076c23d8526f6816d183 - languageName: node - linkType: hard - -"@opentelemetry/sdk-trace-base@npm:1.12.0": - version: 1.12.0 - resolution: "@opentelemetry/sdk-trace-base@npm:1.12.0" - dependencies: - "@opentelemetry/core": "npm:1.12.0" - "@opentelemetry/resources": "npm:1.12.0" - "@opentelemetry/semantic-conventions": "npm:1.12.0" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.5.0" - checksum: 10c0/93267087ec5602a8c4230c87016f22dd3736364e672f5ba239c98f32bfa61fff6bd0b24778ca5b879ca0a92733bbbf7348ed9fc20c924a7b1504bd5356124be4 - languageName: node - linkType: hard - -"@opentelemetry/sdk-trace-base@npm:1.21.0": - version: 1.21.0 - resolution: "@opentelemetry/sdk-trace-base@npm:1.21.0" - dependencies: - "@opentelemetry/core": "npm:1.21.0" - "@opentelemetry/resources": "npm:1.21.0" - "@opentelemetry/semantic-conventions": "npm:1.21.0" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.8.0" - checksum: 10c0/0d68bfb614c45713185d20ad6aa766f38060fc5716d4fd196bb3195386f8bf22e3a9a56d3ec2a2c6753f9edb0d0b0e780f0d271a2d50ca866440ae624b4268ab - languageName: node - linkType: hard - -"@opentelemetry/sdk-trace-base@npm:1.24.1, @opentelemetry/sdk-trace-base@npm:~1.24.1": - version: 1.24.1 - resolution: "@opentelemetry/sdk-trace-base@npm:1.24.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/resources": "npm:1.24.1" - "@opentelemetry/semantic-conventions": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.9.0" - checksum: 10c0/071783367b06410e4e4bf4626bc560e664ccfa5eff497fe645db99b6074702259dba1c56ed8b003e9c0949ba53cd55d32aae1d46fa7bd47da1186f3d941a9713 + checksum: 10c0/cd1de7e881f60a98047d662915b74b7b39cde69a51e9fc146fb4f02af4df4441a785af57e7ad267ea22bbc6ac19c5497684b51d7407573c2aef51f9e402aea4b languageName: node linkType: hard -"@opentelemetry/sdk-trace-base@npm:1.30.1, @opentelemetry/sdk-trace-base@npm:^1.0.0, @opentelemetry/sdk-trace-base@npm:^1.30.1": +"@opentelemetry/sdk-trace-base@npm:^1.30.1": version: 1.30.1 resolution: "@opentelemetry/sdk-trace-base@npm:1.30.1" dependencies: @@ -7947,93 +7980,29 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/sdk-trace-node@npm:1.30.1": - version: 1.30.1 - resolution: "@opentelemetry/sdk-trace-node@npm:1.30.1" +"@opentelemetry/sdk-trace-node@npm:2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/sdk-trace-node@npm:2.12.0" dependencies: - "@opentelemetry/context-async-hooks": "npm:1.30.1" - "@opentelemetry/core": "npm:1.30.1" - "@opentelemetry/propagator-b3": "npm:1.30.1" - "@opentelemetry/propagator-jaeger": "npm:1.30.1" - "@opentelemetry/sdk-trace-base": "npm:1.30.1" - semver: "npm:^7.5.2" + "@opentelemetry/context-async-hooks": "npm:2.12.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/sdk-trace-base": "npm:2.12.0" peerDependencies: "@opentelemetry/api": ">=1.0.0 <1.10.0" - checksum: 10c0/8ae1c2b49389d45bc9419e106c47fa3b91cb39708281dc7dfb7dab8e4d98d5bb27c1758a5521722840bca37bb825d4b8b1571e19ab88a7884867f994e29a5989 - languageName: node - linkType: hard - -"@opentelemetry/sdk-trace-web@npm:1.24.1, @opentelemetry/sdk-trace-web@npm:~1.24.1": - version: 1.24.1 - resolution: "@opentelemetry/sdk-trace-web@npm:1.24.1" - dependencies: - "@opentelemetry/core": "npm:1.24.1" - "@opentelemetry/sdk-trace-base": "npm:1.24.1" - "@opentelemetry/semantic-conventions": "npm:1.24.1" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.9.0" - checksum: 10c0/b08e6814b8d80d06d86b503466d25786da9c0edf569a069838e3ce49483b163167554f449412842622959f35bea86b2a95ed3f0ddb7009fcfb605d148f83c640 - languageName: node - linkType: hard - -"@opentelemetry/sdk-trace-web@npm:^1.15.0": - version: 1.21.0 - resolution: "@opentelemetry/sdk-trace-web@npm:1.21.0" - dependencies: - "@opentelemetry/core": "npm:1.21.0" - "@opentelemetry/sdk-trace-base": "npm:1.21.0" - "@opentelemetry/semantic-conventions": "npm:1.21.0" - peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.8.0" - checksum: 10c0/1e07ddd72eb66f89402d78e710d71b730228c6a8b550f20294249cddf34e0fa8d75cae42bafdb86effc5f26668144dd4b06810420f077010cdb3412fe8403317 + checksum: 10c0/988c6d5f6536e103b619c7375841672da7193f49f046f4b9d33dc91dcbcc9495b4adb64cac0d029d5c7d17b6b13b46c4140ae118f30dc46641d2be3513550813 languageName: node linkType: hard -"@opentelemetry/sdk-trace-web@npm:^1.8.0": - version: 1.12.0 - resolution: "@opentelemetry/sdk-trace-web@npm:1.12.0" +"@opentelemetry/sdk-trace@npm:2.12.0, @opentelemetry/sdk-trace@npm:^2.12.0": + version: 2.12.0 + resolution: "@opentelemetry/sdk-trace@npm:2.12.0" dependencies: - "@opentelemetry/core": "npm:1.12.0" - "@opentelemetry/sdk-trace-base": "npm:1.12.0" - "@opentelemetry/semantic-conventions": "npm:1.12.0" + "@opentelemetry/core": "npm:2.12.0" + "@opentelemetry/resources": "npm:2.12.0" + "@opentelemetry/semantic-conventions": "npm:^1.29.0" peerDependencies: - "@opentelemetry/api": ">=1.0.0 <1.5.0" - checksum: 10c0/e711ce4fe97d3075e183a9c62609a64ec36a13656cdaaaf4d03a9a2a791d043d1e27fb815ad71dc5e1604e1e5e371ccb7a55d8a06848d1fbd1dee27d37e0946b - languageName: node - linkType: hard - -"@opentelemetry/semantic-conventions@npm:1.12.0": - version: 1.12.0 - resolution: "@opentelemetry/semantic-conventions@npm:1.12.0" - checksum: 10c0/d1fa8361b347ee8cf66da7caea3e0feb52ebdb02cfae294c5d4e0e5caedb56abd384706d51317f768b828cfab46b6dde66623ce2a6602c2720abda317d6b144d - languageName: node - linkType: hard - -"@opentelemetry/semantic-conventions@npm:1.15.2": - version: 1.15.2 - resolution: "@opentelemetry/semantic-conventions@npm:1.15.2" - checksum: 10c0/84428c3703e5bd0fb8e3f99cad0a48feb2ac03fec025f3a5691745486a89e446ea8fdf701c334d9dbb70a0c9f7053af777105f4ebc58fb1c602edb9aef918b28 - languageName: node - linkType: hard - -"@opentelemetry/semantic-conventions@npm:1.21.0": - version: 1.21.0 - resolution: "@opentelemetry/semantic-conventions@npm:1.21.0" - checksum: 10c0/ba1eabdbe5cdc04cbb7ce28f2df91fc95000e14861eb93937cfc7768d29c7e57692eb4fb2645f6ba87ae046acc1d1e27e4e6415e46e03015d54a6fdaf8e9635b - languageName: node - linkType: hard - -"@opentelemetry/semantic-conventions@npm:1.24.1": - version: 1.24.1 - resolution: "@opentelemetry/semantic-conventions@npm:1.24.1" - checksum: 10c0/5a3707860b70df8430745ef4ef99810a6d61d770942c217ac25ef8d6840a6b17b943c1ebe4da4a118dee0e3b1e71da3c16e2790f3c3a7e7e6b171e8d1944f73e - languageName: node - linkType: hard - -"@opentelemetry/semantic-conventions@npm:1.25.1": - version: 1.25.1 - resolution: "@opentelemetry/semantic-conventions@npm:1.25.1" - checksum: 10c0/fb1d6349e91f142c82931e89e0242215be8248e77919b6faa7e259757e499183546c9b4046de72b053b5222453bc74fff70280d2b4d1229484ba7b2c07f16a3a + "@opentelemetry/api": ">=1.3.0 <1.10.0" + checksum: 10c0/bc36d6c3c0a007e0e1f928a7e3c9e6e6d130e157efab8da36a07a624000c2fd25309c0a3d42d4e58f6b30ae233cddfbc6270c2a8566c9f611b9d964f5b7ea8a6 languageName: node linkType: hard @@ -8044,21 +8013,21 @@ __metadata: languageName: node linkType: hard -"@opentelemetry/semantic-conventions@npm:^1.22.0, @opentelemetry/semantic-conventions@npm:^1.24.1, @opentelemetry/semantic-conventions@npm:^1.27.0, @opentelemetry/semantic-conventions@npm:^1.30.0": - version: 1.34.0 - resolution: "@opentelemetry/semantic-conventions@npm:1.34.0" - checksum: 10c0/a51a32a5cf5c803bd2125a680d0abacbff632f3b255d0fe52379dac191114a0e8d72a34f9c46c5483ccfe91c4061c309f3cf61a19d11347e2a69779e82cfefd0 +"@opentelemetry/semantic-conventions@npm:^1.24.0, @opentelemetry/semantic-conventions@npm:^1.27.0, @opentelemetry/semantic-conventions@npm:^1.29.0, @opentelemetry/semantic-conventions@npm:^1.30.0, @opentelemetry/semantic-conventions@npm:^1.33.0, @opentelemetry/semantic-conventions@npm:^1.33.1, @opentelemetry/semantic-conventions@npm:^1.34.0, @opentelemetry/semantic-conventions@npm:^1.36.0, @opentelemetry/semantic-conventions@npm:^1.37.0, @opentelemetry/semantic-conventions@npm:^1.41.1, @opentelemetry/semantic-conventions@npm:^1.43.0": + version: 1.44.0 + resolution: "@opentelemetry/semantic-conventions@npm:1.44.0" + checksum: 10c0/38ce72dfe254e16177903cc42475eecdfd312d20487133a84d1ab8d97c452acabb186e0069ddcd9a8ba1f65d76535dfec670ce059ef4265f8f29fc395b0db5f0 languageName: node linkType: hard -"@opentelemetry/sql-common@npm:^0.40.1": - version: 0.40.1 - resolution: "@opentelemetry/sql-common@npm:0.40.1" +"@opentelemetry/sql-common@npm:^0.42.0": + version: 0.42.0 + resolution: "@opentelemetry/sql-common@npm:0.42.0" dependencies: - "@opentelemetry/core": "npm:^1.1.0" + "@opentelemetry/core": "npm:^2.0.0" peerDependencies: "@opentelemetry/api": ^1.1.0 - checksum: 10c0/60a70358f0c94f610e2995333e96b406626d67d03d38ed03b15a3461ad0f8d64afbf6275cca7cb58fe955ecdce832f3ffc9b73f9d88503bba5d2a620bbd6d351 + checksum: 10c0/de51b4938c2b2032618004ca842d6a8a683a6d710676d5fd39569e84a6658cc00581fb43a63c17f6e737ba686d82104aa7ad1ab1879bc1e6351b724f4a105fab languageName: node linkType: hard @@ -8757,24 +8726,10 @@ __metadata: languageName: node linkType: hard -"@protobufjs/codegen@npm:^2.0.4": - version: 2.0.4 - resolution: "@protobufjs/codegen@npm:2.0.4" - checksum: 10c0/26ae337c5659e41f091606d16465bbcc1df1f37cc1ed462438b1f67be0c1e28dfb2ca9f294f39100c52161aef82edf758c95d6d75650a1ddf31f7ddee1440b43 - languageName: node - linkType: hard - "@protobufjs/codegen@npm:^2.0.5": version: 2.0.5 - resolution: "@protobufjs/codegen@npm:2.0.5" - checksum: 10c0/1b8a2ae56ee60a56e9d205cd4b6072a1503c5069b8ebb905710f974ff0098a0d0700641c137e0a8d98dedf14423156a106a9433695cbf52574810f55000fdcab - languageName: node - linkType: hard - -"@protobufjs/eventemitter@npm:^1.1.0": - version: 1.1.0 - resolution: "@protobufjs/eventemitter@npm:1.1.0" - checksum: 10c0/1eb0a75180e5206d1033e4138212a8c7089a3d418c6dfa5a6ce42e593a4ae2e5892c4ef7421f38092badba4040ea6a45f0928869989411001d8c1018ea9a6e70 + resolution: "@protobufjs/codegen@npm:2.0.5" + checksum: 10c0/1b8a2ae56ee60a56e9d205cd4b6072a1503c5069b8ebb905710f974ff0098a0d0700641c137e0a8d98dedf14423156a106a9433695cbf52574810f55000fdcab languageName: node linkType: hard @@ -8785,16 +8740,6 @@ __metadata: languageName: node linkType: hard -"@protobufjs/fetch@npm:^1.1.0": - version: 1.1.0 - resolution: "@protobufjs/fetch@npm:1.1.0" - dependencies: - "@protobufjs/aspromise": "npm:^1.1.1" - "@protobufjs/inquire": "npm:^1.1.0" - checksum: 10c0/cda6a3dc2d50a182c5865b160f72077aac197046600091dbb005dd0a66db9cce3c5eaed6d470ac8ed49d7bcbeef6ee5f0bc288db5ff9a70cbd003e5909065233 - languageName: node - linkType: hard - "@protobufjs/fetch@npm:^1.1.1": version: 1.1.1 resolution: "@protobufjs/fetch@npm:1.1.1" @@ -8811,10 +8756,10 @@ __metadata: languageName: node linkType: hard -"@protobufjs/inquire@npm:^1.1.0": - version: 1.1.0 - resolution: "@protobufjs/inquire@npm:1.1.0" - checksum: 10c0/64372482efcba1fb4d166a2664a6395fa978b557803857c9c03500e0ac1013eb4b1aacc9ed851dd5fc22f81583670b4f4431bae186f3373fedcfde863ef5921a +"@protobufjs/inquire@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/inquire@npm:1.1.2" + checksum: 10c0/af69597818a14cac6a00a74cd5b3fb85aa96658b9dbbae73e6d907cb154ebf470953a8c537b3e6095a43de565ec4e6c5b40227c72f4a7d762d34fbec7ac179e7 languageName: node linkType: hard @@ -8832,7 +8777,7 @@ __metadata: languageName: node linkType: hard -"@protobufjs/utf8@npm:^1.1.0, @protobufjs/utf8@npm:^1.1.1": +"@protobufjs/utf8@npm:^1.1.1": version: 1.1.1 resolution: "@protobufjs/utf8@npm:1.1.1" checksum: 10c0/641fc145f00626405e8984b6e90b9edcbcc072ffc82d0647ca3176e09c730b2d022f988e65f011a7a17e2e4d77cde7733643aa10d8ac2bfa30f134dbcad553fd @@ -9918,6 +9863,17 @@ __metadata: languageName: node linkType: hard +"@rrweb/record@npm:~2.2.0": + version: 2.2.0 + resolution: "@rrweb/record@npm:2.2.0" + dependencies: + "@rrweb/types": "npm:^2.2.0" + "@rrweb/utils": "npm:^2.2.0" + rrweb: "npm:^2.2.0" + checksum: 10c0/23c5af50c50e706b8505a368a0064716ed12a7fe0831eaefccec08ceff5bf8e6a14a6ba5abc97943a7b238efe1dbb07b6be7b5f8b51a25d9a5a1548fe59473a3 + languageName: node + linkType: hard + "@rrweb/replay@npm:2.1.1": version: 2.1.1 resolution: "@rrweb/replay@npm:2.1.1" @@ -9935,6 +9891,13 @@ __metadata: languageName: node linkType: hard +"@rrweb/types@npm:^2.2.0": + version: 2.2.0 + resolution: "@rrweb/types@npm:2.2.0" + checksum: 10c0/ff1f59601ca8f854218190d683bbbc527166bba0f15be6d9cffd924dedb2505083f175e3b64b5193b677baddad1a446f817dac9e7a98727d977fb69f53492edd + languageName: node + linkType: hard + "@rrweb/utils@npm:^2.1.1": version: 2.1.1 resolution: "@rrweb/utils@npm:2.1.1" @@ -9942,6 +9905,13 @@ __metadata: languageName: node linkType: hard +"@rrweb/utils@npm:^2.2.0": + version: 2.2.0 + resolution: "@rrweb/utils@npm:2.2.0" + checksum: 10c0/e54cd099c160a965965a83aee0fffb864c3a2f22b68e3af7b93212d59c82376b35a1ab4135eaf372e4093cd4ecb70da99b4472036893143369de85f38528cba7 + languageName: node + linkType: hard + "@rtsao/scc@npm:^1.1.0": version: 1.1.0 resolution: "@rtsao/scc@npm:1.1.0" @@ -9963,32 +9933,6 @@ __metadata: languageName: node linkType: hard -"@sentry/core@npm:^8.7.0": - version: 8.13.0 - resolution: "@sentry/core@npm:8.13.0" - dependencies: - "@sentry/types": "npm:8.13.0" - "@sentry/utils": "npm:8.13.0" - checksum: 10c0/327bbe2cd7e0d931ff70138f2d339a67a3880b8d1311a2743a5ecd631a6bbd4ad818a0d0777ceef5a6cc4b93f6dbf233629c722f1f23c80687639ba6c2fab0a2 - languageName: node - linkType: hard - -"@sentry/types@npm:8.13.0, @sentry/types@npm:^8.7.0": - version: 8.13.0 - resolution: "@sentry/types@npm:8.13.0" - checksum: 10c0/c17d0b1e530cc93330f8085b4d40baa5090c5fcf7b2a611eee50aae588299577ff86a8db8a0452e4b8ed1b84eb73fdff774c6d98d926f589b9dd0c85a1341cfb - languageName: node - linkType: hard - -"@sentry/utils@npm:8.13.0, @sentry/utils@npm:^8.7.0": - version: 8.13.0 - resolution: "@sentry/utils@npm:8.13.0" - dependencies: - "@sentry/types": "npm:8.13.0" - checksum: 10c0/95ade7ba583bdfde63c8a8f44726defd60a471af23431b74628dce7062d71ba90a0238190022ab49d1eb1386c6867734a3a03554047b86b896c676308f300d17 - languageName: node - linkType: hard - "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -10425,41 +10369,34 @@ __metadata: linkType: hard "@storybook/addon-docs@npm:^10.1.4": - version: 10.6.3 - resolution: "@storybook/addon-docs@npm:10.6.3" + version: 10.1.4 + resolution: "@storybook/addon-docs@npm:10.1.4" dependencies: "@mdx-js/react": "npm:^3.0.0" - "@storybook/icons": "npm:^2.0.2" - "@storybook/react-dom-shim": "npm:10.6.3" + "@storybook/csf-plugin": "npm:10.1.4" + "@storybook/icons": "npm:^2.0.0" + "@storybook/react-dom-shim": "npm:10.1.4" react: "npm:^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" react-dom: "npm:^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" ts-dedent: "npm:^2.0.0" - unplugin: "npm:^2.3.5" peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.3 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 10c0/75762cfc898cf581a3702fc46a3facd675640ef52896040bce016c30492a78684aa8579c9b0e231029262c5e82b0067796ecf32d620ff77deffb933f1b619f28 + storybook: ^10.1.4 + checksum: 10c0/5bcb31fcb6a14ef1c2147071a930684f2f33beddc0fa10a38d5c641779c0271285df7d6d7de97b5c72f4d33bf3554ba6126f7dbb24c495a655e873092ca19052 languageName: node linkType: hard "@storybook/addon-links@npm:^10.1.4": - version: 10.6.3 - resolution: "@storybook/addon-links@npm:10.6.3" + version: 10.1.4 + resolution: "@storybook/addon-links@npm:10.1.4" dependencies: "@storybook/global": "npm:^5.0.0" peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.3 + storybook: ^10.1.4 peerDependenciesMeta: - "@types/react": - optional: true react: optional: true - checksum: 10c0/6a08dd6d4e2af1f3e6e75c158a9b2bd094d065b3432caf646976b8f5535b6cfd459657807ef5ca0703f3fa31434d679cf4648527ac854af6a415185a029ec9a2 + checksum: 10c0/a980766a12b23405b1b6e1343a8397d00939572bbfcb6b326301fa4d01090cced9f3b0e50e91663ef65922ad8214a22c4922e89da2e4eed5c971e0f44885448a languageName: node linkType: hard @@ -10474,53 +10411,77 @@ __metadata: linkType: hard "@storybook/addon-themes@npm:^10.1.4": - version: 10.6.3 - resolution: "@storybook/addon-themes@npm:10.6.3" + version: 10.1.4 + resolution: "@storybook/addon-themes@npm:10.1.4" dependencies: ts-dedent: "npm:^2.0.0" peerDependencies: - storybook: ^10.6.3 - checksum: 10c0/288fcc6ba75a4fa262dfdabcef68a83dbd14b0d50fb539dc6e4c8c19533ec8b68da254a7feb8e41a986d256168f10b738ec00f5f3dccb300f97b271a2cb50efe + storybook: ^10.1.4 + checksum: 10c0/3d5b2321cc938a016befd98b7a8b94b21d59cca7423778f96178cd60d22b83deb4c0e825e6735eb304a705c5793e3451850679f97b80c2c125136aa8193ae71d languageName: node linkType: hard -"@storybook/builder-webpack5@npm:10.6.3": - version: 10.6.3 - resolution: "@storybook/builder-webpack5@npm:10.6.3" +"@storybook/builder-webpack5@npm:10.1.4": + version: 10.1.4 + resolution: "@storybook/builder-webpack5@npm:10.1.4" dependencies: - "@storybook/core-webpack": "npm:10.6.3" + "@storybook/core-webpack": "npm:10.1.4" + "@vitest/mocker": "npm:3.2.4" case-sensitive-paths-webpack-plugin: "npm:^2.4.0" cjs-module-lexer: "npm:^1.2.3" css-loader: "npm:^7.1.2" es-module-lexer: "npm:^1.5.0" fork-ts-checker-webpack-plugin: "npm:^9.1.0" html-webpack-plugin: "npm:^5.5.0" - magic-string: "npm:^1.1.0" - semver: "npm:^7.7.3" + magic-string: "npm:^0.30.5" style-loader: "npm:^4.0.0" - terser-webpack-plugin: "npm:^5.3.17" + terser-webpack-plugin: "npm:^5.3.14" ts-dedent: "npm:^2.0.0" webpack: "npm:5" webpack-dev-middleware: "npm:^6.1.2" webpack-hot-middleware: "npm:^2.25.1" webpack-virtual-modules: "npm:^0.6.0" peerDependencies: - storybook: ^10.6.3 + storybook: ^10.1.4 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/28eb38e4f1cd3343582e1f3b03c632d295790208e728081e9553c5ff7bc4f1769917ddba2f290e89fb2598b7313ea6fbb0c042d37131ea08b4f724de52b5d88f + checksum: 10c0/77a8c8c0a18e3e84d0436a9d56f8ce96cb6c6caa4bbd476cc928f48918a5fd8a150facee43e39962dd864f7c7fecad699a29617f1aacc6ba93b99ea23593426e languageName: node linkType: hard -"@storybook/core-webpack@npm:10.6.3": - version: 10.6.3 - resolution: "@storybook/core-webpack@npm:10.6.3" +"@storybook/core-webpack@npm:10.1.4": + version: 10.1.4 + resolution: "@storybook/core-webpack@npm:10.1.4" dependencies: ts-dedent: "npm:^2.0.0" peerDependencies: - storybook: ^10.6.3 - checksum: 10c0/cf35fa59dabab266fb1554215833ddb389de64fa0c7a9bb377b51b23dd7158fd0adc5a198f71de2add0a63f5b62439a1f91adcfbc51ad7f96f2e5f6e97be8c17 + storybook: ^10.1.4 + checksum: 10c0/7741c4986773a7ddeb23e1505ae5782d6803ca95b66646439953c28dc0797489c8b879250b004ed37dcab3e283bedcc45423c892304fff5a080f3f1051089cd7 + languageName: node + linkType: hard + +"@storybook/csf-plugin@npm:10.1.4": + version: 10.1.4 + resolution: "@storybook/csf-plugin@npm:10.1.4" + dependencies: + unplugin: "npm:^2.3.5" + peerDependencies: + esbuild: "*" + rollup: "*" + storybook: ^10.1.4 + vite: "*" + webpack: "*" + peerDependenciesMeta: + esbuild: + optional: true + rollup: + optional: true + vite: + optional: true + webpack: + optional: true + checksum: 10c0/e221dbf7209084f0a373c603750ecbea310a08fe1447cb9cdd8600e1dfbad17129f42de37b5b240c687385283ba5b4d60e793293fd4164704c112a955b32185e languageName: node linkType: hard @@ -10531,6 +10492,16 @@ __metadata: languageName: node linkType: hard +"@storybook/icons@npm:^2.0.0": + version: 2.0.1 + resolution: "@storybook/icons@npm:2.0.1" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10c0/df2bbf1a5b50f12ab1bf78cae6de4dbf7c49df0e3a5f845553b51b20adbe8386a09fd172ea60342379f9284bb528cba2d0e2659cae6eb8d015cf92c8b32f1222 + languageName: node + linkType: hard + "@storybook/icons@npm:^2.0.2": version: 2.2.0 resolution: "@storybook/icons@npm:2.2.0" @@ -10541,84 +10512,78 @@ __metadata: linkType: hard "@storybook/nextjs@npm:^10.1.4": - version: 10.6.3 - resolution: "@storybook/nextjs@npm:10.6.3" + version: 10.1.4 + resolution: "@storybook/nextjs@npm:10.1.4" dependencies: - "@babel/core": "npm:^7.28.5" + "@babel/core": "npm:^7.24.4" "@babel/plugin-syntax-bigint": "npm:^7.8.3" "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" - "@babel/plugin-syntax-import-assertions": "npm:^7.27.1" - "@babel/plugin-transform-class-properties": "npm:^7.27.1" - "@babel/plugin-transform-export-namespace-from": "npm:^7.27.1" - "@babel/plugin-transform-numeric-separator": "npm:^7.27.1" - "@babel/plugin-transform-object-rest-spread": "npm:^7.28.4" - "@babel/plugin-transform-runtime": "npm:^7.28.5" - "@babel/preset-env": "npm:^7.28.5" - "@babel/preset-react": "npm:^7.28.5" - "@babel/preset-typescript": "npm:^7.28.5" - "@babel/runtime": "npm:^7.28.4" + "@babel/plugin-syntax-import-assertions": "npm:^7.24.1" + "@babel/plugin-transform-class-properties": "npm:^7.24.1" + "@babel/plugin-transform-export-namespace-from": "npm:^7.24.1" + "@babel/plugin-transform-numeric-separator": "npm:^7.24.1" + "@babel/plugin-transform-object-rest-spread": "npm:^7.24.1" + "@babel/plugin-transform-runtime": "npm:^7.24.3" + "@babel/preset-env": "npm:^7.24.4" + "@babel/preset-react": "npm:^7.24.1" + "@babel/preset-typescript": "npm:^7.24.1" + "@babel/runtime": "npm:^7.24.4" "@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.11" - "@storybook/builder-webpack5": "npm:10.6.3" - "@storybook/preset-react-webpack": "npm:10.6.3" - "@storybook/react": "npm:10.6.3" - "@types/semver": "npm:^7.7.1" + "@storybook/builder-webpack5": "npm:10.1.4" + "@storybook/preset-react-webpack": "npm:10.1.4" + "@storybook/react": "npm:10.1.4" + "@types/semver": "npm:^7.3.4" babel-loader: "npm:^9.1.3" css-loader: "npm:^6.7.3" + image-size: "npm:^2.0.2" loader-utils: "npm:^3.2.1" node-polyfill-webpack-plugin: "npm:^2.0.1" postcss: "npm:^8.4.38" postcss-loader: "npm:^8.1.1" - probe-image-size: "npm:^7.3.0" react-refresh: "npm:^0.14.0" resolve-url-loader: "npm:^5.0.0" sass-loader: "npm:^16.0.5" - semver: "npm:^7.7.3" + semver: "npm:^7.3.5" style-loader: "npm:^3.3.1" styled-jsx: "npm:^5.1.6" tsconfig-paths: "npm:^4.0.0" tsconfig-paths-webpack-plugin: "npm:^4.0.1" peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - "@types/react-dom": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 next: ^14.1.0 || ^15.0.0 || ^16.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.3 + storybook: ^10.1.4 webpack: ^5.0.0 peerDependenciesMeta: - "@types/react": - optional: true - "@types/react-dom": - optional: true typescript: optional: true webpack: optional: true - checksum: 10c0/8e95bdad797e530e88d997becd6b0e3cb699f4a3bdecd20009198a14b44b9c89b4675743b505c45400752a4aec73f01631cef7f2272a5d03eed1230f9f68c461 + checksum: 10c0/0977d818befae73b2a7909415fc9710e3da61b5a73824022c5e14590ee4b4ce552f13077141de8d7e8fdbcd0c216645c18f47ceec3ba2761d549b6ce7d9f7602 languageName: node linkType: hard -"@storybook/preset-react-webpack@npm:10.6.3": - version: 10.6.3 - resolution: "@storybook/preset-react-webpack@npm:10.6.3" +"@storybook/preset-react-webpack@npm:10.1.4": + version: 10.1.4 + resolution: "@storybook/preset-react-webpack@npm:10.1.4" dependencies: - "@storybook/core-webpack": "npm:10.6.3" + "@storybook/core-webpack": "npm:10.1.4" "@storybook/react-docgen-typescript-plugin": "npm:1.0.6--canary.9.0c3f3b7.0" - "@types/semver": "npm:^7.7.1" - magic-string: "npm:^1.1.0" - react-docgen: "npm:^8.0.2" + "@types/semver": "npm:^7.3.4" + magic-string: "npm:^0.30.5" + react-docgen: "npm:^7.1.1" resolve: "npm:^1.22.8" - semver: "npm:^7.7.3" + semver: "npm:^7.3.7" tsconfig-paths: "npm:^4.2.0" webpack: "npm:5" peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.3 + storybook: ^10.1.4 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/28dec78f26140219e45c0fa1d98f2d9f76656f9b3464257eaf8ec6aa57de66d95ece40dc61b31bb23968653062a02b1537f2fcb6e734ca6a1404509652ef034c + checksum: 10c0/5bb045f7e2aa19f8e0d78cfd12ff35f97b40cda754bc322b243d4975fc75bd7f353fd4ba7357727c7551f775aeefbb3e81fba4aeb79ff7ac74d99ab0c2f6465a languageName: node linkType: hard @@ -10640,47 +10605,33 @@ __metadata: languageName: node linkType: hard -"@storybook/react-dom-shim@npm:10.6.3": - version: 10.6.3 - resolution: "@storybook/react-dom-shim@npm:10.6.3" +"@storybook/react-dom-shim@npm:10.1.4": + version: 10.1.4 + resolution: "@storybook/react-dom-shim@npm:10.1.4" peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - "@types/react-dom": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.3 - peerDependenciesMeta: - "@types/react": - optional: true - "@types/react-dom": - optional: true - checksum: 10c0/90f7d362b758026db006ca91cdec401b89fddde7974ba2b2907c15b68d3fec8109f2e6a065fbb32ee7b050935294df0bb6780e6f8da84a029cbf54ce98654b38 + storybook: ^10.1.4 + checksum: 10c0/0c08c3e6f74e8e24f960d8dec9552c2fc20a7b07cd34b1d7921f0d15a878700b66d4274c869271228db556963e062c45eaa457a20a8fc288347002b47a5e2bb6 languageName: node linkType: hard -"@storybook/react@npm:10.6.3": - version: 10.6.3 - resolution: "@storybook/react@npm:10.6.3" +"@storybook/react@npm:10.1.4": + version: 10.1.4 + resolution: "@storybook/react@npm:10.1.4" dependencies: "@storybook/global": "npm:^5.0.0" - "@storybook/react-dom-shim": "npm:10.6.3" + "@storybook/react-dom-shim": "npm:10.1.4" react-docgen: "npm:^8.0.2" - react-docgen-typescript: "npm:^2.2.2" peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - "@types/react-dom": ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - storybook: ^10.6.3 + storybook: ^10.1.4 typescript: ">= 4.9.x" peerDependenciesMeta: - "@types/react": - optional: true - "@types/react-dom": - optional: true typescript: optional: true - checksum: 10c0/fb870dd7823adbc19b812eb4797ac091e499642be0d839d346686e582e7c75c10d5c8926d8fd47d341375aeaf445926730c83f6412238a1892f712a28a2e4817 + checksum: 10c0/1fcbbf34874288b55eefdcfccc005f1deede4e06d2c24faec0121ba592d9a1274e2d0f55f96a39e2e38b5717173c98c75d0fd6940d3cb8c447a1ae32449b227d languageName: node linkType: hard @@ -11019,14 +10970,14 @@ __metadata: languageName: node linkType: hard -"@types/aws-lambda@npm:8.10.147": - version: 8.10.147 - resolution: "@types/aws-lambda@npm:8.10.147" - checksum: 10c0/c77bcb18a935fb26f5b1164aaadf46b3d11d6c001a95c6e9f2ff72f7d9ed4e7f28075a3abf9f9585cc75510acbc29c7a6441e66727902eae1bd39ac8dc28351e +"@types/aws-lambda@npm:^8.10.155": + version: 8.10.164 + resolution: "@types/aws-lambda@npm:8.10.164" + checksum: 10c0/cc78160e3b76e78a28cc232780777e3ca91cde0a021c14d816dcefeb45dfcd912f0ed409dbeb1516b08c1af1b764a6664e61838672cd6645f6387e57d682548b languageName: node linkType: hard -"@types/babel__core@npm:^7.20.5": +"@types/babel__core@npm:^7.18.0, @types/babel__core@npm:^7.20.5": version: 7.20.5 resolution: "@types/babel__core@npm:7.20.5" dependencies: @@ -11067,6 +11018,15 @@ __metadata: languageName: node linkType: hard +"@types/babel__traverse@npm:^7.18.0": + version: 7.20.6 + resolution: "@types/babel__traverse@npm:7.20.6" + dependencies: + "@babel/types": "npm:^7.20.7" + checksum: 10c0/7ba7db61a53e28cac955aa99af280d2600f15a8c056619c05b6fc911cbe02c61aa4f2823299221b23ce0cce00b294c0e5f618ec772aa3f247523c2e48cf7b888 + languageName: node + linkType: hard + "@types/body-parser@npm:*": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" @@ -11077,15 +11037,6 @@ __metadata: languageName: node linkType: hard -"@types/bunyan@npm:1.8.11": - version: 1.8.11 - resolution: "@types/bunyan@npm:1.8.11" - dependencies: - "@types/node": "npm:*" - checksum: 10c0/07d762499307a1c3f04f56f2c62417b909f86f6090cee29b73a00dde323a4463cfd2e78888598cb1cd3b1eb88e6c47ef2a58e17f119dae27ff04cd361c0a1d4c - languageName: node - linkType: hard - "@types/chai@npm:^5.2.2": version: 5.2.3 resolution: "@types/chai@npm:5.2.3" @@ -11513,13 +11464,6 @@ __metadata: languageName: node linkType: hard -"@types/long@npm:^4.0.1": - version: 4.0.2 - resolution: "@types/long@npm:4.0.2" - checksum: 10c0/42ec66ade1f72ff9d143c5a519a65efc7c1c77be7b1ac5455c530ae9acd87baba065542f8847522af2e3ace2cc999f3ad464ef86e6b7352eece34daf88f8c924 - languageName: node - linkType: hard - "@types/luxon@npm:~3.7.0": version: 3.7.1 resolution: "@types/luxon@npm:3.7.1" @@ -11596,15 +11540,6 @@ __metadata: languageName: node linkType: hard -"@types/mysql@npm:2.15.26": - version: 2.15.26 - resolution: "@types/mysql@npm:2.15.26" - dependencies: - "@types/node": "npm:*" - checksum: 10c0/3cf279e7db05d56c0544532a4380b9079f579092379a04c8138bd5cf88dda5b31208ac2d23ce7dbf4e3a3f43aaeed44e72f9f19f726518f308efe95a7435619a - languageName: node - linkType: hard - "@types/node@npm:*, @types/node@npm:^22.15.18": version: 22.15.18 resolution: "@types/node@npm:22.15.18" @@ -11706,12 +11641,12 @@ __metadata: languageName: node linkType: hard -"@types/pg-pool@npm:2.0.6": - version: 2.0.6 - resolution: "@types/pg-pool@npm:2.0.6" +"@types/pg-pool@npm:2.0.7": + version: 2.0.7 + resolution: "@types/pg-pool@npm:2.0.7" dependencies: "@types/pg": "npm:*" - checksum: 10c0/41965d4d0b677c54ce45d36add760e496d356b78019cb062d124af40287cf6b0fd4d86e3b0085f443856c185983a60c8b0795ff76d15683e2a93c62f5ac0125f + checksum: 10c0/4935bc2e5af3990f3f80abd83af5d38e2c3fb01edea4f301fe2ef2c07173646cd06ec361dd0231a4085be405bb54e924a861ae6d0a3bf88b907f331b5a79111a languageName: node linkType: hard @@ -11726,14 +11661,14 @@ __metadata: languageName: node linkType: hard -"@types/pg@npm:8.6.1": - version: 8.6.1 - resolution: "@types/pg@npm:8.6.1" +"@types/pg@npm:8.15.6": + version: 8.15.6 + resolution: "@types/pg@npm:8.15.6" dependencies: "@types/node": "npm:*" pg-protocol: "npm:*" pg-types: "npm:^2.2.0" - checksum: 10c0/8d16660c9a4f050d6d5e391c59f9a62e9d377a2a6a7eb5865f8828082dbdfeab700fd707e585f42d67b29e796b32863aea5bd6d5cbb8ceda2d598da5d0c61693 + checksum: 10c0/7f93f83a4da0dc6133918f824d826fa34e78fb8cf86392d28a0e095c836c6910c014ced5d4b364d83e8485a65ce369adeb9663b14ba301241d4c0f80073007f3 languageName: node linkType: hard @@ -11808,10 +11743,17 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.5.0, @types/semver@npm:^7.7.1": - version: 7.8.0 - resolution: "@types/semver@npm:7.8.0" - checksum: 10c0/46a1f38e36013448b279798e8b134e7e8de3b3630b1f40683903b9d57d36dd1d70838515570ed9a149fa09e9c381b9e39319b58d7b9f3b929b42ae2becff7aa3 +"@types/semver@npm:^7.3.4": + version: 7.5.8 + resolution: "@types/semver@npm:7.5.8" + checksum: 10c0/8663ff927234d1c5fcc04b33062cb2b9fcfbe0f5f351ed26c4d1e1581657deebd506b41ff7fdf89e787e3d33ce05854bc01686379b89e9c49b564c4cfa988efa + languageName: node + linkType: hard + +"@types/semver@npm:^7.5.0": + version: 7.5.2 + resolution: "@types/semver@npm:7.5.2" + checksum: 10c0/0d815fc82e43a3c54075bbb3ffc0a2b5b77f62ec22832c43354d58f480128e41206432446316578c6d3574a4dec10ec99e698ad77829c57a7b9936d248cf5b31 languageName: node linkType: hard @@ -11835,13 +11777,6 @@ __metadata: languageName: node linkType: hard -"@types/shimmer@npm:^1.0.2, @types/shimmer@npm:^1.2.0": - version: 1.2.0 - resolution: "@types/shimmer@npm:1.2.0" - checksum: 10c0/6f7bfe1b55601cfc3ae713fc74a03341f3834253b8b91cb2add926d5949e4a63f7e666f59c2a6e40a883a5f9e2f3e3af10f9d3aed9b60fced0bda87659e58d8d - languageName: node - linkType: hard - "@types/sqlstring@npm:^2.3.0, @types/sqlstring@npm:^2.3.2": version: 2.3.2 resolution: "@types/sqlstring@npm:2.3.2" @@ -11889,15 +11824,6 @@ __metadata: languageName: node linkType: hard -"@types/tedious@npm:^4.0.14": - version: 4.0.14 - resolution: "@types/tedious@npm:4.0.14" - dependencies: - "@types/node": "npm:*" - checksum: 10c0/d2914f8e9b5b998e4275ec5f0130cba1c2fb47e75616b5c125a65ef6c1db2f1dc3f978c7900693856a15d72bbb4f4e94f805537a4ecb6dc126c64415d31c0590 - languageName: node - linkType: hard - "@types/tough-cookie@npm:*": version: 4.0.5 resolution: "@types/tough-cookie@npm:4.0.5" @@ -11905,13 +11831,6 @@ __metadata: languageName: node linkType: hard -"@types/triple-beam@npm:^1.3.2": - version: 1.3.2 - resolution: "@types/triple-beam@npm:1.3.2" - checksum: 10c0/2e936cff7cde9df7da854a54a5f63e0a434b2ae1d6c1eb6de5f7a0b1107b023b3c272abecbba28614a54b8831226b29e37a49e3e34a7490a6a24d770a5b44eb9 - languageName: node - linkType: hard - "@types/ungap__structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@types/ungap__structured-clone@npm:1.2.0" @@ -12461,6 +12380,25 @@ __metadata: languageName: node linkType: hard +"@vitest/mocker@npm:3.2.4": + version: 3.2.4 + resolution: "@vitest/mocker@npm:3.2.4" + dependencies: + "@vitest/spy": "npm:3.2.4" + estree-walker: "npm:^3.0.3" + magic-string: "npm:^0.30.17" + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + checksum: 10c0/f7a4aea19bbbf8f15905847ee9143b6298b2c110f8b64789224cb0ffdc2e96f9802876aa2ca83f1ec1b6e1ff45e822abb34f0054c24d57b29ab18add06536ccd + languageName: node + linkType: hard + "@vitest/pretty-format@npm:3.2.4": version: 3.2.4 resolution: "@vitest/pretty-format@npm:3.2.4" @@ -12739,10 +12677,10 @@ __metadata: languageName: node linkType: hard -"abbrev@npm:^5.0.0": - version: 5.0.0 - resolution: "abbrev@npm:5.0.0" - checksum: 10c0/8e88f5c798ea4562d28c5a3e9ad69e3879890bc5d695d8f2dffb8609be4c890aacc8f80ef4553fdd2c6a62d70c2ce8bc57b38074e383beb7487bdafa9ed42ea5 +"abbrev@npm:^2.0.0": + version: 2.0.0 + resolution: "abbrev@npm:2.0.0" + checksum: 10c0/f742a5a107473946f426c691c08daba61a1d15942616f300b5d32fd735be88fef5cba24201757b6c407fd564555fb48c751cfa33519b2605c8a7aadd22baf372 languageName: node linkType: hard @@ -12765,15 +12703,6 @@ __metadata: languageName: node linkType: hard -"acorn-import-attributes@npm:^1.9.5": - version: 1.9.5 - resolution: "acorn-import-attributes@npm:1.9.5" - peerDependencies: - acorn: ^8 - checksum: 10c0/5926eaaead2326d5a86f322ff1b617b0f698aa61dc719a5baa0e9d955c9885cc71febac3fb5bacff71bbf2c4f9c12db2056883c68c53eb962c048b952e1e013d - languageName: node - linkType: hard - "acorn-import-phases@npm:^1.0.3": version: 1.0.4 resolution: "acorn-import-phases@npm:1.0.4" @@ -12799,15 +12728,6 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.14.0": - version: 8.14.1 - resolution: "acorn@npm:8.14.1" - bin: - acorn: bin/acorn - checksum: 10c0/dbd36c1ed1d2fa3550140000371fcf721578095b18777b85a79df231ca093b08edc6858d75d6e48c73e431c174dcf9214edbd7e6fa5911b93bd8abfa54e47123 - languageName: node - linkType: hard - "acorn@npm:^8.15.0": version: 8.15.0 resolution: "acorn@npm:8.15.0" @@ -12835,15 +12755,6 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.8.2": - version: 8.10.0 - resolution: "acorn@npm:8.10.0" - bin: - acorn: bin/acorn - checksum: 10c0/deaeebfbea6e40f6c0e1070e9b0e16e76ba484de54cbd735914d1d41d19169a450de8630b7a3a0c4e271a3b0c0b075a3427ad1a40d8a69f8747c0e8cb02ee3e2 - languageName: node - linkType: hard - "adjust-sourcemap-loader@npm:^4.0.0": version: 4.0.0 resolution: "adjust-sourcemap-loader@npm:4.0.0" @@ -12863,7 +12774,7 @@ __metadata: languageName: node linkType: hard -"agent-base@npm:^7.1.0, agent-base@npm:^7.1.2": +"agent-base@npm:^7.1.0, agent-base@npm:^7.1.1, agent-base@npm:^7.1.2": version: 7.1.4 resolution: "agent-base@npm:7.1.4" checksum: 10c0/c2c9ab7599692d594b6a161559ada307b7a624fa4c7b03e3afdb5a5e31cd0e53269115b620fcab024c5ac6a6f37fa5eb2e004f076ad30f5f7e6b8b671f7b35fe @@ -13511,7 +13422,7 @@ __metadata: languageName: node linkType: hard -"axios@npm:1.18.1": +"axios@npm:1.18.1, axios@npm:^1.13.5": version: 1.18.1 resolution: "axios@npm:1.18.1" dependencies: @@ -13523,18 +13434,6 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.13.5": - version: 1.20.0 - resolution: "axios@npm:1.20.0" - dependencies: - follow-redirects: "npm:^1.16.0" - form-data: "npm:^4.0.6" - https-proxy-agent: "npm:^5.0.1" - proxy-from-env: "npm:^2.1.0" - checksum: 10c0/976088acf532286356f4c2e65df1ef47ba7da3936d83e928d0d64357bbf5370456abd3eb5826c15df322335fcb1fe200d4a84b4fcf20ffccdd63b40d80fa495c - languageName: node - linkType: hard - "axobject-query@npm:^4.1.0": version: 4.1.0 resolution: "axobject-query@npm:4.1.0" @@ -13594,51 +13493,39 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.14, babel-plugin-polyfill-corejs2@npm:^0.4.15": - version: 0.4.17 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.17" +"babel-plugin-polyfill-corejs2@npm:^0.4.10": + version: 0.4.11 + resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" dependencies: - "@babel/compat-data": "npm:^7.28.6" - "@babel/helper-define-polyfill-provider": "npm:^0.6.8" + "@babel/compat-data": "npm:^7.22.6" + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" semver: "npm:^6.3.1" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/1284960ea403c63b0dd598f338666c4b17d489aefee30b4da6a7313eff1d91edffb0ccf26341a6e5d94231684b74e016eade66b3921ea112f8b0e4980fa08a5c - languageName: node - linkType: hard - -"babel-plugin-polyfill-corejs3@npm:^0.13.0": - version: 0.13.0 - resolution: "babel-plugin-polyfill-corejs3@npm:0.13.0" - dependencies: - "@babel/helper-define-polyfill-provider": "npm:^0.6.5" - core-js-compat: "npm:^3.43.0" - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/5d8e228da425edc040d8c868486fd01ba10b0440f841156a30d9f8986f330f723e2ee61553c180929519563ef5b64acce2caac36a5a847f095d708dda5d8206d + checksum: 10c0/b2217bc8d5976cf8142453ed44daabf0b2e0e75518f24eac83b54a8892e87a88f1bd9089daa92fd25df979ecd0acfd29b6bc28c4182c1c46344cee15ef9bce84 languageName: node linkType: hard -"babel-plugin-polyfill-corejs3@npm:^0.14.0": - version: 0.14.2 - resolution: "babel-plugin-polyfill-corejs3@npm:0.14.2" +"babel-plugin-polyfill-corejs3@npm:^0.10.1, babel-plugin-polyfill-corejs3@npm:^0.10.4": + version: 0.10.4 + resolution: "babel-plugin-polyfill-corejs3@npm:0.10.4" dependencies: - "@babel/helper-define-polyfill-provider": "npm:^0.6.8" - core-js-compat: "npm:^3.48.0" + "@babel/helper-define-polyfill-provider": "npm:^0.6.1" + core-js-compat: "npm:^3.36.1" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/32f70442f142d0f5607f4b57c121c573b106e09da8659c0f03108a85bf1d09ba5bdc89595a82b34ff76c19f1faf3d1c831b56166f03babf69c024f36da77c3bf + checksum: 10c0/31b92cd3dfb5b417da8dfcf0deaa4b8b032b476d7bb31ca51c66127cf25d41e89260e89d17bc004b2520faa38aa9515fafabf81d89f9d4976e9dc1163e4a7c41 languageName: node linkType: hard -"babel-plugin-polyfill-regenerator@npm:^0.6.5, babel-plugin-polyfill-regenerator@npm:^0.6.6": - version: 0.6.8 - resolution: "babel-plugin-polyfill-regenerator@npm:0.6.8" +"babel-plugin-polyfill-regenerator@npm:^0.6.1": + version: 0.6.2 + resolution: "babel-plugin-polyfill-regenerator@npm:0.6.2" dependencies: - "@babel/helper-define-polyfill-provider": "npm:^0.6.8" + "@babel/helper-define-polyfill-provider": "npm:^0.6.2" peerDependencies: "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/7c8b2497c29fa880e0acdc8e7b93e29b81b154179b83beb0476eb2c4e7a78b6b42fc35c2554ca250c9bd6d39941eaf75416254b8592ce50979f9a12e1d51c049 + checksum: 10c0/bc541037cf7620bc84ddb75a1c0ce3288f90e7d2799c070a53f8a495c8c8ae0316447becb06f958dd25dcce2a2fce855d318ecfa48036a1ddb218d55aa38a744 languageName: node linkType: hard @@ -13737,12 +13624,30 @@ __metadata: languageName: node linkType: hard -"baseline-browser-mapping@npm:^2.11.29, baseline-browser-mapping@npm:^2.9.19": - version: 2.11.32 - resolution: "baseline-browser-mapping@npm:2.11.32" +"baseline-browser-mapping@npm:^2.8.25": + version: 2.8.30 + resolution: "baseline-browser-mapping@npm:2.8.30" + bin: + baseline-browser-mapping: dist/cli.js + checksum: 10c0/724e2a71dc18af1555953278544d60d3677ad1413d19b4c68f0b1d16cb075186035125cad38d93c1ccc2df8dc8520e6d47452b76b265898ad7ac480630f12cae + languageName: node + linkType: hard + +"baseline-browser-mapping@npm:^2.9.0": + version: 2.10.0 + resolution: "baseline-browser-mapping@npm:2.10.0" bin: baseline-browser-mapping: dist/cli.cjs - checksum: 10c0/50aa1ebd997bf3fef7c3623c79c82f89217bf490debf291f9d7746366be50b5feb66e2404dabd8f374a2ada00f9b558f5961f1fee37691c858203bdefdb6c861 + checksum: 10c0/da9c3ec0fcd7f325226a47d2142794d41706b6e0a405718a2c15410bbdb72aacadd65738bedef558c6f1b106ed19458cb25b06f63b66df2c284799905dbbd003 + languageName: node + linkType: hard + +"baseline-browser-mapping@npm:^2.9.19": + version: 2.10.8 + resolution: "baseline-browser-mapping@npm:2.10.8" + bin: + baseline-browser-mapping: dist/cli.cjs + checksum: 10c0/a77882e8ac37a900a9a0757b9bf4e50f407829ed17ee7630273ab5da0ae10d9c64ed4c5a1e03afb3490e39713440092417ded4bb856eeb9bd44856eacbd97497 languageName: node linkType: hard @@ -13879,7 +13784,7 @@ __metadata: languageName: node linkType: hard -"brace-expansion@npm:5.0.8": +"brace-expansion@npm:5.0.8, brace-expansion@npm:^5.0.2, brace-expansion@npm:^5.0.5": version: 5.0.8 resolution: "brace-expansion@npm:5.0.8" dependencies: @@ -13889,25 +13794,34 @@ __metadata: linkType: hard "brace-expansion@npm:^1.1.7": - version: 1.1.21 - resolution: "brace-expansion@npm:1.1.21" + version: 1.1.17 + resolution: "brace-expansion@npm:1.1.17" dependencies: balanced-match: "npm:^1.0.0" concat-map: "npm:0.0.1" - checksum: 10c0/8f0a68a720f9cb28c2ecaea5cdaf15fafd686d6b6e4e722a81c9d4bd2f68c1fd0619731cac05875d842221eaf4d97d564d329a12eb3c4c22137502fb3c65be8b + checksum: 10c0/0bc6fe7e757999d3a2a9f26b9d60087643c055de8cc81a69d52ab256c1695a9d719b61731e19892281c6cf865700238d6328ffb98b6e2628b997227530a5ca54 languageName: node linkType: hard -"brace-expansion@npm:^2.0.1, brace-expansion@npm:^2.0.2": - version: 2.1.7 - resolution: "brace-expansion@npm:2.1.7" +"brace-expansion@npm:^2.0.1": + version: 2.1.3 + resolution: "brace-expansion@npm:2.1.3" + dependencies: + balanced-match: "npm:^1.0.0" + checksum: 10c0/62bef43c5755b4978662d66d0844635cc171610644da7d0266db8c0180c21c6e8ff7b969a27d2f2ec7893b6efd9c33dc73383d84a467669832f2da1fd3771f99 + languageName: node + linkType: hard + +"brace-expansion@npm:^2.0.2": + version: 2.1.4 + resolution: "brace-expansion@npm:2.1.4" dependencies: balanced-match: "npm:^1.0.0" - checksum: 10c0/17ee4194c85b05cde0a7b7c068eeef664440c027116ef42c3d35c13ebabdc9fd3eaf05c5c8a06dd0ca20ae012d652561d8ac2a699daa5cbee1f0510e5134ab4d + checksum: 10c0/6c0a0e2573eac1dc565b52b1e1bfbeba39bf1830d106ebbc61ff1eaefcf610e9111cd3baa091addd18e33292135c99e019d3184d966389d85dc958fdcdc1449f languageName: node linkType: hard -"brace-expansion@npm:^5.0.2, brace-expansion@npm:^5.0.5": +"brace-expansion@npm:^5.0.12": version: 5.0.12 resolution: "brace-expansion@npm:5.0.12" dependencies: @@ -14015,18 +13929,33 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.24.0, browserslist@npm:^4.28.1, browserslist@npm:^4.29.3": - version: 4.29.4 - resolution: "browserslist@npm:4.29.4" +"browserslist@npm:^4.23.0, browserslist@npm:^4.24.0": + version: 4.28.0 + resolution: "browserslist@npm:4.28.0" + dependencies: + baseline-browser-mapping: "npm:^2.8.25" + caniuse-lite: "npm:^1.0.30001754" + electron-to-chromium: "npm:^1.5.249" + node-releases: "npm:^2.0.27" + update-browserslist-db: "npm:^1.1.4" + bin: + browserslist: cli.js + checksum: 10c0/4284fd568f7d40a496963083860d488cb2a89fb055b6affd316bebc59441fec938e090b3e62c0ee065eb0bc88cd1bc145f4300a16c75f3f565621c5823715ae1 + languageName: node + linkType: hard + +"browserslist@npm:^4.28.1": + version: 4.28.1 + resolution: "browserslist@npm:4.28.1" dependencies: - baseline-browser-mapping: "npm:^2.11.29" - caniuse-lite: "npm:^1.0.30001816" - electron-to-chromium: "npm:^1.5.459" - node-releases: "npm:^2.0.59" - update-browserslist-db: "npm:^1.3.4" + baseline-browser-mapping: "npm:^2.9.0" + caniuse-lite: "npm:^1.0.30001759" + electron-to-chromium: "npm:^1.5.263" + node-releases: "npm:^2.0.27" + update-browserslist-db: "npm:^1.2.0" bin: browserslist: cli.js - checksum: 10c0/e706dfb56f89a78a3b5fef681d9793327779f5d30885606e49c4af788a7f60b92dd8c2ead153d780109e8fcc2529a784491854037b18c8b8700fb464b87f9f93 + checksum: 10c0/545a5fa9d7234e3777a7177ec1e9134bb2ba60a69e6b95683f6982b1473aad347c77c1264ccf2ac5dea609a9731fbfbda6b85782bdca70f80f86e28a402504bd languageName: node linkType: hard @@ -14176,6 +14105,26 @@ __metadata: languageName: node linkType: hard +"cacache@npm:^18.0.0": + version: 18.0.4 + resolution: "cacache@npm:18.0.4" + dependencies: + "@npmcli/fs": "npm:^3.1.0" + fs-minipass: "npm:^3.0.0" + glob: "npm:^10.2.2" + lru-cache: "npm:^10.0.1" + minipass: "npm:^7.0.3" + minipass-collect: "npm:^2.0.1" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + p-map: "npm:^4.0.0" + ssri: "npm:^10.0.0" + tar: "npm:^6.1.11" + unique-filename: "npm:^3.0.0" + checksum: 10c0/6c055bafed9de4f3dcc64ac3dc7dd24e863210902b7c470eb9ce55a806309b3efff78033e3d8b4f7dcc5d467f2db43c6a2857aaaf26f0094b8a351d44c42179f + languageName: node + linkType: hard + "cacheable@npm:^2.2.0": version: 2.3.0 resolution: "cacheable@npm:2.3.0" @@ -14297,10 +14246,17 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001579, caniuse-lite@npm:^1.0.30001816": - version: 1.0.30001819 - resolution: "caniuse-lite@npm:1.0.30001819" - checksum: 10c0/6842319cdb9c8ac950ef0910fc3cc7dac3320b96b150de83ac65162c6b4906d2721ca830943a9e5a833c265b186aa0c417402ddd4157108bbf5474d6fabdc843 +"caniuse-lite@npm:^1.0.30001579, caniuse-lite@npm:^1.0.30001754": + version: 1.0.30001756 + resolution: "caniuse-lite@npm:1.0.30001756" + checksum: 10c0/863df07bd8d5139371ce7d4e582f03fef38141726282dcd532421bbd95ea298c7f953a8e1a9790db89ca1816bd8ce3cce638a66361b769dd1f2dc8d4c721d546 + languageName: node + linkType: hard + +"caniuse-lite@npm:^1.0.30001759": + version: 1.0.30001775 + resolution: "caniuse-lite@npm:1.0.30001775" + checksum: 10c0/96e59a83abd171c729db80a93d7a50becebc145102e3c2d2ea4b3749385cae1e6e09155bada486f662fa070009989d043c4c60f1ee64a19eb50139c7e6dbe574 languageName: node linkType: hard @@ -14459,10 +14415,10 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^3.0.0": - version: 3.0.0 - resolution: "chownr@npm:3.0.0" - checksum: 10c0/43925b87700f7e3893296c8e9c56cc58f926411cce3a6e5898136daaf08f08b9a8eb76d37d3267e707d0dcc17aed2e2ebdf5848c0c3ce95cf910a919935c1b10 +"chownr@npm:^2.0.0": + version: 2.0.0 + resolution: "chownr@npm:2.0.0" + checksum: 10c0/594754e1303672171cc04e50f6c398ae16128eb134a88f801bf5354fd96f205320f23536a045d9abd8b51024a149696e51231565891d4efdab8846021ecf88e6 languageName: node linkType: hard @@ -14523,13 +14479,6 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.2.2": - version: 1.2.3 - resolution: "cjs-module-lexer@npm:1.2.3" - checksum: 10c0/0de9a9c3fad03a46804c0d38e7b712fb282584a9c7ef1ed44cae22fb71d9bb600309d66a9711ac36a596fd03422f5bb03e021e8f369c12a39fa1786ae531baab - languageName: node - linkType: hard - "cjs-module-lexer@npm:^1.2.3": version: 1.3.1 resolution: "cjs-module-lexer@npm:1.3.1" @@ -14544,6 +14493,13 @@ __metadata: languageName: node linkType: hard +"cjs-module-lexer@npm:^2.2.0": + version: 2.3.0 + resolution: "cjs-module-lexer@npm:2.3.0" + checksum: 10c0/9a6b9ca6f3c4734e108afa7a9cdf9ebf180329e1f94729a8a054102b2d66f5bbd62beb6a7b25ed8b0feca561c96542f34583fe5f0a72691751ff3ab718f5690f + languageName: node + linkType: hard + "class-variance-authority@npm:^0.7.1": version: 0.7.1 resolution: "class-variance-authority@npm:0.7.1" @@ -15141,12 +15097,12 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.43.0, core-js-compat@npm:^3.48.0": - version: 3.51.0 - resolution: "core-js-compat@npm:3.51.0" +"core-js-compat@npm:^3.31.0, core-js-compat@npm:^3.36.1": + version: 3.37.1 + resolution: "core-js-compat@npm:3.37.1" dependencies: - browserslist: "npm:^4.29.3" - checksum: 10c0/733fe5e8d4d5527ffb8ba8fbf815460d1275894387f68e923c3a6e4e7bedba5f8b3eb813ad3e18eeb3a3055094ca9de5c9b47fbf7acab173d5ed0bea6f2ec29a + browserslist: "npm:^4.23.0" + checksum: 10c0/4e2da9c900f2951a57947af7aeef4d16f2c75d7f7e966c0d0b62953f65225003ade5e84d3ae98847f65b24c109c606821d9dc925db8ca418fb761e7c81963c2a languageName: node linkType: hard @@ -15714,7 +15670,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:2, debug@npm:2.6.9": +"debug@npm:2.6.9": version: 2.6.9 resolution: "debug@npm:2.6.9" dependencies: @@ -15735,7 +15691,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4.4.3, debug@npm:^4.4.3": +"debug@npm:4.4.3, debug@npm:^4.3.5, debug@npm:^4.4.3": version: 4.4.3 resolution: "debug@npm:4.4.3" dependencies: @@ -15747,7 +15703,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^3.2.6, debug@npm:^3.2.7": +"debug@npm:^3.2.7": version: 3.2.7 resolution: "debug@npm:3.2.7" dependencies: @@ -15913,13 +15869,6 @@ __metadata: languageName: node linkType: hard -"define-lazy-prop@npm:^2.0.0": - version: 2.0.0 - resolution: "define-lazy-prop@npm:2.0.0" - checksum: 10c0/db6c63864a9d3b7dc9def55d52764968a5af296de87c1b2cc71d8be8142e445208071953649e0386a8cc37cfcf9a2067a47207f1eb9ff250c2a269658fdae422 - languageName: node - linkType: hard - "define-properties@npm:^1.1.3, define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" @@ -16295,10 +16244,17 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.459": - version: 1.5.464 - resolution: "electron-to-chromium@npm:1.5.464" - checksum: 10c0/65e6244c3b109942497ec6f7e8294258e74a7b410c804339fec39ecb2921926423e08f8f3a2a7979008c1a196a4c57145c1e76abe40ba374f60028fab23baa10 +"electron-to-chromium@npm:^1.5.249": + version: 1.5.259 + resolution: "electron-to-chromium@npm:1.5.259" + checksum: 10c0/a6600ff20d513e1acce29cd04af5fcb338295ebe5a13fa9802009464d9c269a4a092218c8ea8c9b85017a1efd75606fe0cdf5f36216979f7c8462af7df2f530d + languageName: node + linkType: hard + +"electron-to-chromium@npm:^1.5.263": + version: 1.5.302 + resolution: "electron-to-chromium@npm:1.5.302" + checksum: 10c0/014413f2b4ec3a0e043c68f6c07a760d230b14e36b8549c5b124f386a6318d9641e69be2aa0df1877395dd99922745c1722c8ecb3d72205f0f3b3b3dc44c8442 languageName: node linkType: hard @@ -16359,6 +16315,15 @@ __metadata: languageName: node linkType: hard +"encoding@npm:^0.1.13": + version: 0.1.13 + resolution: "encoding@npm:0.1.13" + dependencies: + iconv-lite: "npm:^0.6.2" + checksum: 10c0/36d938712ff00fe1f4bac88b43bcffb5930c1efa57bbcdca9d67e1d9d6c57cfb1200fb01efe0f3109b2ce99b231f90779532814a81370a1bd3274a0f58585039 + languageName: node + linkType: hard + "end-of-stream@npm:1.4.5": version: 1.4.5 resolution: "end-of-stream@npm:1.4.5" @@ -16465,6 +16430,13 @@ __metadata: languageName: node linkType: hard +"err-code@npm:^2.0.2": + version: 2.0.3 + resolution: "err-code@npm:2.0.3" + checksum: 10c0/b642f7b4dd4a376e954947550a3065a9ece6733ab8e51ad80db727aaae0817c2e99b02a97a3d6cecc648a97848305e728289cf312d09af395403a90c9d4d8a66 + languageName: node + linkType: hard + "error-ex@npm:^1.3.1": version: 1.3.2 resolution: "error-ex@npm:1.3.2" @@ -16654,6 +16626,13 @@ __metadata: languageName: node linkType: hard +"es-module-lexer@npm:^3.0.3": + version: 3.0.4 + resolution: "es-module-lexer@npm:3.0.4" + checksum: 10c0/6e89027c3ce2e78c577bee234d3cf9e41035b6622cc2d399bffda322556f09735a864b3c7729da8528c96ec8cf00d93d7d418cdedb6765e9e4d228954fbfde3d + languageName: node + linkType: hard + "es-object-atoms@npm:1.1.1, es-object-atoms@npm:^1.0.0, es-object-atoms@npm:^1.1.1": version: 1.1.1 resolution: "es-object-atoms@npm:1.1.1" @@ -17622,6 +17601,15 @@ __metadata: languageName: node linkType: hard +"estree-walker@npm:^3.0.3": + version: 3.0.3 + resolution: "estree-walker@npm:3.0.3" + dependencies: + "@types/estree": "npm:^1.0.0" + checksum: 10c0/c12e3c2b2642d2bcae7d5aa495c60fa2f299160946535763969a1c83fc74518ffa9c2cd3a8b69ac56aea547df6a8aac25f729a342992ef0bbac5f1c73e78995d + languageName: node + linkType: hard + "esutils@npm:^2.0.2": version: 2.0.3 resolution: "esutils@npm:2.0.3" @@ -17808,23 +17796,22 @@ __metadata: linkType: hard "express-rate-limit@npm:^6.7.1": - version: 6.11.2 - resolution: "express-rate-limit@npm:6.11.2" + version: 6.7.1 + resolution: "express-rate-limit@npm:6.7.1" peerDependencies: express: ^4 || ^5 - checksum: 10c0/1f92107fca92423b6311ca26cb79a3d5d79ac5f5eb81791c382c2323e331da0e993249225615003e2db91b617d69ba0d428ef60d212bfabb7a83244645f10e0a + checksum: 10c0/3c0c4f82aff125d3b04abb7dd02a51976e88153e0c6d57083040645fe08023cabf29bfcad1e51a4bb14f54ba0301f7bb1d421c86f078538e956efb2fea4f65bf languageName: node linkType: hard "express-rate-limit@npm:^8.2.1": - version: 8.7.1 - resolution: "express-rate-limit@npm:8.7.1" + version: 8.3.2 + resolution: "express-rate-limit@npm:8.3.2" dependencies: - debug: "npm:^4.4.3" - ip-address: "npm:^10.2.0" + ip-address: "npm:10.1.0" peerDependencies: express: ">= 4.11" - checksum: 10c0/575afb52d84242325450794ff2dc4fbe6e913e081fe6fe857541201b7c159661a9a7d5ac7573679b68b67bf9af8f0205b9539777373ad34617814dc6057a6b3b + checksum: 10c0/5b64d0691071086cdb8cfc6bcd5e761f5687cf4fabdebfe2a043ea5b4d31443637181e7be71e7ffabce76aee816daee62c1ca83250045847957da408a129f650 languageName: node linkType: hard @@ -17909,9 +17896,9 @@ __metadata: linkType: hard "fast-copy@npm:^3.0.2": - version: 3.1.0 - resolution: "fast-copy@npm:3.1.0" - checksum: 10c0/5eeb5c33a48a215d0600411f4c524f87f42bf8db9d875ef8b83c891bd84340c613e33e68475a11496b632a2008e97748ad7a60a2e82b5cad6f9cd7aa60c8def3 + version: 3.0.2 + resolution: "fast-copy@npm:3.0.2" + checksum: 10c0/02e8b9fd03c8c024d2987760ce126456a0e17470850b51e11a1c3254eed6832e4733ded2d93316c82bc0b36aeb991ad1ff48d1ba95effe7add7c3ab8d8eb554a languageName: node linkType: hard @@ -18114,13 +18101,6 @@ __metadata: languageName: node linkType: hard -"fecha@npm:^4.2.0": - version: 4.2.3 - resolution: "fecha@npm:4.2.3" - checksum: 10c0/0e895965959cf6a22bb7b00f0bf546f2783836310f510ddf63f463e1518d4c96dec61ab33fdfd8e79a71b4856a7c865478ce2ee8498d560fe125947703c9b1cf - languageName: node - linkType: hard - "fetch-blob@npm:^3.1.2, fetch-blob@npm:^3.1.4": version: 3.2.0 resolution: "fetch-blob@npm:3.2.0" @@ -18131,20 +18111,6 @@ __metadata: languageName: node linkType: hard -"fflate@npm:0.7.4": - version: 0.7.4 - resolution: "fflate@npm:0.7.4" - checksum: 10c0/5e749eb3a6ed61a0f6c55756abf9f4258f06f60505db689e22d18503dd252ca5af656d32668e4b7b20714adf8b313febf695d23863a8352f23e325baee0f672d - languageName: node - linkType: hard - -"fflate@npm:^0.4.4": - version: 0.4.8 - resolution: "fflate@npm:0.4.8" - checksum: 10c0/29d1eddaaa5deab61b1c6b0d21282adacadbc4d2c01e94d8b1ee784398151673b9c563e53f97a801bc410a1ae55e8de5378114a743430e643e7a0644ba8e5a42 - languageName: node - linkType: hard - "figures@npm:3.2.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -18344,12 +18310,12 @@ __metadata: linkType: hard "follow-redirects@npm:^1.16.2": - version: 1.16.2 - resolution: "follow-redirects@npm:1.16.2" + version: 1.16.3 + resolution: "follow-redirects@npm:1.16.3" peerDependenciesMeta: debug: optional: true - checksum: 10c0/ff38c8ceb904e505021057f58d395ea5f2e7c34257032960a76b21df1726395ce753f5678b6ee3b15210a557277c00b2607c67b682ee4dec1f33cb5147e08e90 + checksum: 10c0/0ad440d1d921ce8d7e8cbb3a2f25a15e682086209eb49a84cf2f1d5960d0f238b697d5613893f72e7deb9c915f0bc4c7924f04a0e0c5544b8b7d3b797af5121d languageName: node linkType: hard @@ -18395,7 +18361,7 @@ __metadata: languageName: node linkType: hard -"form-data@npm:4.0.6, form-data@npm:^4.0.0, form-data@npm:^4.0.5, form-data@npm:^4.0.6": +"form-data@npm:4.0.6, form-data@npm:^4.0.0, form-data@npm:^4.0.5": version: 4.0.6 resolution: "form-data@npm:4.0.6" dependencies: @@ -18508,6 +18474,24 @@ __metadata: languageName: node linkType: hard +"fs-minipass@npm:^2.0.0": + version: 2.1.0 + resolution: "fs-minipass@npm:2.1.0" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/703d16522b8282d7299337539c3ed6edddd1afe82435e4f5b76e34a79cd74e488a8a0e26a636afc2440e1a23b03878e2122e3a2cfe375a5cf63c37d92b86a004 + languageName: node + linkType: hard + +"fs-minipass@npm:^3.0.0": + version: 3.0.3 + resolution: "fs-minipass@npm:3.0.3" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/63e80da2ff9b621e2cb1596abcb9207f1cf82b968b116ccd7b959e3323144cce7fb141462200971c38bbf2ecca51695069db45265705bed09a7cd93ae5b89f94 + languageName: node + linkType: hard + "fs-monkey@npm:^1.0.4": version: 1.0.6 resolution: "fs-monkey@npm:1.0.6" @@ -18614,25 +18598,26 @@ __metadata: languageName: node linkType: hard -"gaxios@npm:^6.0.0": - version: 6.3.0 - resolution: "gaxios@npm:6.3.0" +"gaxios@npm:7.1.3": + version: 7.1.3 + resolution: "gaxios@npm:7.1.3" dependencies: extend: "npm:^3.0.2" https-proxy-agent: "npm:^7.0.1" - is-stream: "npm:^2.0.0" - node-fetch: "npm:^2.6.9" - checksum: 10c0/89b390d6a3776fcb706dc9ef9728c424595fca15afb6a7c6fb8a164a06708203189cd71e39f1617ece39e1d7ec6964f8882b2cafaf1b823a02175f758c1b8738 + node-fetch: "npm:^3.3.2" + rimraf: "npm:^5.0.1" + checksum: 10c0/a4a1cdf9a392c0c22e9734a40dca5a77a2903f505b939a50f1e68e312458b1289b7993d2f72d011426e89657cae77a3aa9fc62fb140e8ba90a1faa31fdbde4d2 languageName: node linkType: hard -"gcp-metadata@npm:^6.0.0": - version: 6.1.0 - resolution: "gcp-metadata@npm:6.1.0" +"gcp-metadata@npm:^8.0.0": + version: 8.1.4 + resolution: "gcp-metadata@npm:8.1.4" dependencies: - gaxios: "npm:^6.0.0" + gaxios: "npm:7.1.3" + google-logging-utils: "npm:1.1.3" json-bigint: "npm:^1.0.0" - checksum: 10c0/0f84f8c0b974e79d0da0f3063023486e53d7982ce86c4b5871e4ee3b1fc4e7f76fcc05f6342aa0ded5023f1a499c21ab97743a498b31f3aa299905226d1f66ab + checksum: 10c0/dffba44f5192d73c515f04fd9ce7da89e5d05403d75c93d308bb3909044721038eac581cd08652679eaf570b232c65fae8591ba06ec8370945e1ca94609ab8aa languageName: node linkType: hard @@ -18852,7 +18837,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.3.10": +"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7": version: 10.5.0 resolution: "glob@npm:10.5.0" dependencies: @@ -18868,14 +18853,14 @@ __metadata: languageName: node linkType: hard -"glob@npm:^13.0.6": - version: 13.0.6 - resolution: "glob@npm:13.0.6" +"glob@npm:^14.0.2": + version: 14.0.2 + resolution: "glob@npm:14.0.2" dependencies: - minimatch: "npm:^10.2.2" + minimatch: "npm:^11.0.0" minipass: "npm:^7.1.3" - path-scurry: "npm:^2.0.2" - checksum: 10c0/269c236f11a9b50357fe7a8c6aadac667e01deb5242b19c84975628f05f4438d8ee1354bb62c5d6c10f37fd59911b54d7799730633a2786660d8c69f1d18120a + path-scurry: "npm:^3.0.0" + checksum: 10c0/30e6d02930d281d1879048ac4631648491aa5e60d84fe4195b048f88545f341766a3e2ab05d0a9d59457bd8905720925d20a0491654feeb7fc68568177e8d8e4 languageName: node linkType: hard @@ -18932,6 +18917,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^11.1.0": + version: 11.12.0 + resolution: "globals@npm:11.12.0" + checksum: 10c0/758f9f258e7b19226bd8d4af5d3b0dcf7038780fb23d82e6f98932c44e239f884847f1766e8fa9cc5635ccb3204f7fa7314d4408dd4002a5e8ea827b4018f0a1 + languageName: node + linkType: hard + "globals@npm:^14.0.0": version: 14.0.0 resolution: "globals@npm:14.0.0" @@ -18986,6 +18978,13 @@ __metadata: languageName: node linkType: hard +"google-logging-utils@npm:1.1.3": + version: 1.1.3 + resolution: "google-logging-utils@npm:1.1.3" + checksum: 10c0/e65201c7e96543bd1423b9324013736646b9eed60941e0bfa47b9bfd146d2f09cf3df1c99ca60b7d80a726075263ead049ee72de53372cb8458c3bc55c2c1e59 + languageName: node + linkType: hard + "gopd@npm:1.2.0, gopd@npm:^1.0.1, gopd@npm:^1.2.0": version: 1.2.0 resolution: "gopd@npm:1.2.0" @@ -19199,6 +19198,15 @@ __metadata: languageName: node linkType: hard +"hasown@npm:^2.0.0": + version: 2.0.0 + resolution: "hasown@npm:2.0.0" + dependencies: + function-bind: "npm:^1.1.2" + checksum: 10c0/5d415b114f410661208c95e7ab4879f1cc2765b8daceff4dc8718317d1cb7b9ffa7c5d1eafd9a4389c9aab7445d6ea88e05f3096cb1e529618b55304956b87fc + languageName: node + linkType: hard + "hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" @@ -19327,9 +19335,9 @@ __metadata: linkType: hard "hono@npm:^4.11.4": - version: 4.13.13 - resolution: "hono@npm:4.13.13" - checksum: 10c0/c8524e685a59b4f23a9bea15385eeac5622218949db251cb871b20fd9ef673b751b44ccdee6c22b3df56e5ed4c1b1cebad17b518bdc1823039da39b53ef9c1cf + version: 4.13.16 + resolution: "hono@npm:4.13.16" + checksum: 10c0/8a06f1d49bb98fd38a2bc4d5c1f5410b4c5a9fbe2dff85fbad2191a1b55fde93b64b63b2deba97d3e241630aedd800c57d1f4dc539e5f93ece81809fa63cbed9 languageName: node linkType: hard @@ -19441,6 +19449,13 @@ __metadata: languageName: node linkType: hard +"http-cache-semantics@npm:^4.1.1": + version: 4.1.1 + resolution: "http-cache-semantics@npm:4.1.1" + checksum: 10c0/ce1319b8a382eb3cbb4a37c19f6bfe14e5bb5be3d09079e885e8c513ab2d3cd9214902f8a31c9dc4e37022633ceabfc2d697405deeaf1b8f3552bb4ed996fdfc + languageName: node + linkType: hard + "http-errors@npm:~2.0.0, http-errors@npm:~2.0.1": version: 2.0.1 resolution: "http-errors@npm:2.0.1" @@ -19463,7 +19478,7 @@ __metadata: languageName: node linkType: hard -"http-proxy-agent@npm:^7.0.2": +"http-proxy-agent@npm:^7.0.0, http-proxy-agent@npm:^7.0.2": version: 7.0.2 resolution: "http-proxy-agent@npm:7.0.2" dependencies: @@ -19588,7 +19603,7 @@ __metadata: languageName: unknown linkType: soft -"iconv-lite@npm:0.6.3": +"iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" dependencies: @@ -19597,7 +19612,7 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:^0.4.24, iconv-lite@npm:^0.4.4, iconv-lite@npm:~0.4.24": +"iconv-lite@npm:^0.4.24, iconv-lite@npm:~0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" dependencies: @@ -19684,6 +19699,15 @@ __metadata: languageName: node linkType: hard +"image-size@npm:^2.0.2": + version: 2.0.4 + resolution: "image-size@npm:2.0.4" + bin: + image-size: bin/image-size.js + checksum: 10c0/af01b8c2b7c536df1b866fc6daaa7e58ee909cde42fcae27562612ea77181f473445bc8acf0dfb5b9e8590e966a7a1f3f0fbf4c87ec6d1d4d60d68d87d529d76 + languageName: node + linkType: hard + "immer@npm:^11.0.0, immer@npm:^11.1.8": version: 11.1.9 resolution: "immer@npm:11.1.9" @@ -19715,27 +19739,14 @@ __metadata: languageName: node linkType: hard -"import-in-the-middle@npm:1.7.4": - version: 1.7.4 - resolution: "import-in-the-middle@npm:1.7.4" - dependencies: - acorn: "npm:^8.8.2" - acorn-import-attributes: "npm:^1.9.5" - cjs-module-lexer: "npm:^1.2.2" - module-details-from-path: "npm:^1.0.3" - checksum: 10c0/3ba4ce34c2f1287dcfab375179dcbc7af5358dced56fbe3713ff48780d2f0ca3a1778f1435af5f4e18f14c70a34013a344279a35a1b6e219eaa18fd959666058 - languageName: node - linkType: hard - -"import-in-the-middle@npm:^1.8.1": - version: 1.14.0 - resolution: "import-in-the-middle@npm:1.14.0" +"import-in-the-middle@npm:^3.0.0, import-in-the-middle@npm:^3.5.2": + version: 3.5.3 + resolution: "import-in-the-middle@npm:3.5.3" dependencies: - acorn: "npm:^8.14.0" - acorn-import-attributes: "npm:^1.9.5" - cjs-module-lexer: "npm:^1.2.2" - module-details-from-path: "npm:^1.0.3" - checksum: 10c0/7df8bff5cf8f3dc98d9e49b6e83b39bc5571d6afbeeaa7f783829e6f4a201329595f51f7c037ee7db395bb3866625d056edcd3f112a93f0e1f31930dbd8ec437 + cjs-module-lexer: "npm:^2.2.0" + es-module-lexer: "npm:^3.0.3" + module-details-from-path: "npm:^1.0.4" + checksum: 10c0/f342bb5b83d2c7e2e7c3f87832f6ee020c15b0c478895e4a597524d7827a51e206acba2755fedc346026eb9d7748bc89c7eda7b289a10e13a84f9f35eb60ea34 languageName: node linkType: hard @@ -19899,13 +19910,30 @@ __metadata: languageName: node linkType: hard -"ip-address@npm:^10.1.1, ip-address@npm:^10.2.0, ip-address@npm:^10.7.4": +"ip-address@npm:10.1.0": + version: 10.1.0 + resolution: "ip-address@npm:10.1.0" + checksum: 10c0/0103516cfa93f6433b3bd7333fa876eb21263912329bfa47010af5e16934eeeff86f3d2ae700a3744a137839ddfad62b900c7a445607884a49b5d1e32a3d7566 + languageName: node + linkType: hard + +"ip-address@npm:^10.7.4": version: 10.7.4 resolution: "ip-address@npm:10.7.4" checksum: 10c0/22401f5723acd96a8b261ff5b098857bee86a700f8f4f7e7afcf3645a5ddb74b961296577b03c53acbd3235c6424aab11087ff1da9dbce11a55e05af9dde5bbb languageName: node linkType: hard +"ip-address@npm:^9.0.5": + version: 9.0.5 + resolution: "ip-address@npm:9.0.5" + dependencies: + jsbn: "npm:1.1.0" + sprintf-js: "npm:^1.1.3" + checksum: 10c0/331cd07fafcb3b24100613e4b53e1a2b4feab11e671e655d46dc09ee233da5011284d09ca40c4ecbdfe1d0004f462958675c224a804259f2f78d2465a87824bc + languageName: node + linkType: hard + "ipaddr.js@npm:1.9.1": version: 1.9.1 resolution: "ipaddr.js@npm:1.9.1" @@ -20059,12 +20087,30 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.11.0, is-core-module@npm:^2.12.1, is-core-module@npm:^2.13.0, is-core-module@npm:^2.16.1, is-core-module@npm:^2.16.2, is-core-module@npm:^2.17.0": - version: 2.17.0 - resolution: "is-core-module@npm:2.17.0" +"is-core-module@npm:^2.11.0, is-core-module@npm:^2.9.0": + version: 2.11.0 + resolution: "is-core-module@npm:2.11.0" dependencies: - hasown: "npm:^2.0.4" - checksum: 10c0/3dc7c15ea42f846180cd2cdd57af62270e0a8d0ed31c17c85735d554089d39975e2e82e65fc7c8280a3c476ca3d0d09992d0860b4998abb769a277341feb6698 + has: "npm:^1.0.3" + checksum: 10c0/fd8f78ef4e243c295deafa809f89381d89aff5aaf38bb63266b17ee6e34b6a051baa5bdc2365456863336d56af6a59a4c1df1256b4eff7d6b4afac618586b004 + languageName: node + linkType: hard + +"is-core-module@npm:^2.12.1, is-core-module@npm:^2.13.0": + version: 2.13.1 + resolution: "is-core-module@npm:2.13.1" + dependencies: + hasown: "npm:^2.0.0" + checksum: 10c0/2cba9903aaa52718f11c4896dabc189bab980870aae86a62dc0d5cedb546896770ee946fb14c84b7adf0735f5eaea4277243f1b95f5cefa90054f92fbcac2518 + languageName: node + linkType: hard + +"is-core-module@npm:^2.16.1": + version: 2.16.1 + resolution: "is-core-module@npm:2.16.1" + dependencies: + hasown: "npm:^2.0.2" + checksum: 10c0/898443c14780a577e807618aaae2b6f745c8538eca5c7bc11388a3f2dc6de82b9902bcc7eb74f07be672b11bbe82dd6a6edded44a00cb3d8f933d0459905eedd languageName: node linkType: hard @@ -20114,7 +20160,7 @@ __metadata: languageName: node linkType: hard -"is-docker@npm:^2.0.0, is-docker@npm:^2.1.1": +"is-docker@npm:^2.0.0": version: 2.2.1 resolution: "is-docker@npm:2.2.1" bin: @@ -20221,6 +20267,13 @@ __metadata: languageName: node linkType: hard +"is-lambda@npm:^1.0.1": + version: 1.0.1 + resolution: "is-lambda@npm:1.0.1" + checksum: 10c0/85fee098ae62ba6f1e24cf22678805473c7afd0fb3978a3aa260e354cb7bcb3a5806cf0a98403188465efedec41ab4348e8e4e79305d409601323855b3839d4d + languageName: node + linkType: hard + "is-map@npm:^2.0.3": version: 2.0.3 resolution: "is-map@npm:2.0.3" @@ -20563,16 +20616,9 @@ __metadata: linkType: hard "isexe@npm:^3.1.1": - version: 3.1.5 - resolution: "isexe@npm:3.1.5" - checksum: 10c0/8be2973a09f2f804ea1f34bfccfd5ea219ef48083bdb12107fe5bcf96b3e36b85084409e1b09ddaf2fae8927fdd9f6d70d90baadb78caa1ca7c530935706c8a4 - languageName: node - linkType: hard - -"isexe@npm:^4.0.0": - version: 4.0.0 - resolution: "isexe@npm:4.0.0" - checksum: 10c0/5884815115bceac452877659a9c7726382531592f43dc29e5d48b7c4100661aed54018cb90bd36cb2eaeba521092570769167acbb95c18d39afdccbcca06c5ce + version: 3.1.1 + resolution: "isexe@npm:3.1.1" + checksum: 10c0/9ec257654093443eb0a528a9c8cbba9c0ca7616ccb40abd6dde7202734d96bb86e4ac0d764f0f8cd965856aacbff2f4ce23e730dc19dfb41e3b0d865ca6fdcc7 languageName: node linkType: hard @@ -21348,9 +21394,9 @@ __metadata: linkType: hard "jose@npm:^6.2.3": - version: 6.2.13 - resolution: "jose@npm:6.2.13" - checksum: 10c0/a7a175057fd42e129200026320d535deba5c869e764bdb130d4aecb7cc2a22c07eab2bf9fc848188b45b89d95f8e0ba4ce01a8259a4fa45c84bec34f66f2918e + version: 6.2.16 + resolution: "jose@npm:6.2.16" + checksum: 10c0/c2a12b4237cca45194d516377901f83a51c2045c7ac5dbff3c4d8f231f1e9a057bce1f8d1cb5b2943b1d28856d163a25491b593b6f342ac135250e31115c2978 languageName: node linkType: hard @@ -21424,6 +21470,13 @@ __metadata: languageName: node linkType: hard +"jsbn@npm:1.1.0": + version: 1.1.0 + resolution: "jsbn@npm:1.1.0" + checksum: 10c0/4f907fb78d7b712e11dea8c165fe0921f81a657d3443dde75359ed52eb2b5d33ce6773d97985a089f09a65edd80b11cb75c767b57ba47391fee4c969f7215c96 + languageName: node + linkType: hard + "jscpd-darwin-arm64@npm:5.1.2": version: 5.1.2 resolution: "jscpd-darwin-arm64@npm:5.1.2" @@ -21555,7 +21608,7 @@ __metadata: languageName: node linkType: hard -"jsesc@npm:^3.0.2, jsesc@npm:~3.1.0": +"jsesc@npm:^3.0.2": version: 3.1.0 resolution: "jsesc@npm:3.1.0" bin: @@ -21564,6 +21617,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:~0.5.0": + version: 0.5.0 + resolution: "jsesc@npm:0.5.0" + bin: + jsesc: bin/jsesc + checksum: 10c0/f93792440ae1d80f091b65f8ceddf8e55c4bb7f1a09dee5dcbdb0db5612c55c0f6045625aa6b7e8edb2e0a4feabd80ee48616dbe2d37055573a84db3d24f96d9 + languageName: node + linkType: hard + "json-bigint@npm:^1.0.0": version: 1.0.0 resolution: "json-bigint@npm:1.0.0" @@ -21629,13 +21691,6 @@ __metadata: languageName: node linkType: hard -"json-stringify-safe@npm:^5.0.1": - version: 5.0.1 - resolution: "json-stringify-safe@npm:5.0.1" - checksum: 10c0/7dbf35cd0411d1d648dceb6d59ce5857ec939e52e4afc37601aa3da611f0987d5cee5b38d58329ceddf3ed48bd7215229c8d52059ab01f2444a338bf24ed0f37 - languageName: node - linkType: hard - "json5@npm:2.2.3, json5@npm:^2.1.2, json5@npm:^2.2.2, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" @@ -22122,13 +22177,6 @@ __metadata: languageName: node linkType: hard -"lodash.isobject@npm:^3.0.2": - version: 3.0.2 - resolution: "lodash.isobject@npm:3.0.2" - checksum: 10c0/da4c8480d98b16835b59380b2fbd43c54081acd9466febb788ba77c434384349e0bec162d1c4e89f613f21687b2b6d8384d8a112b80da00c78d28d9915a5cdde - languageName: node - linkType: hard - "lodash.isplainobject@npm:^4.0.6": version: 4.0.6 resolution: "lodash.isplainobject@npm:4.0.6" @@ -22199,27 +22247,20 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.20, lodash@npm:^4.17.21": - version: 4.17.21 - resolution: "lodash@npm:4.17.21" - checksum: 10c0/d8cbea072bb08655bb4c989da418994b073a608dffa608b09ac04b43a791b12aeae7cd7ad919aa4c925f33b48490b5cfe6c1f71d827956071dae2e7bb3a6b74c +"lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.18.1": + version: 4.18.1 + resolution: "lodash@npm:4.18.1" + checksum: 10c0/757228fc68805c59789e82185135cf85f05d0b2d3d54631d680ca79ec21944ec8314d4533639a14b8bcfbd97a517e78960933041a5af17ecb693ec6eecb99a27 languageName: node linkType: hard -"lodash@npm:^4.17.23, lodash@npm:~4.17.21, lodash@npm:~4.17.23": +"lodash@npm:~4.17.21, lodash@npm:~4.17.23": version: 4.17.23 resolution: "lodash@npm:4.17.23" checksum: 10c0/1264a90469f5bb95d4739c43eb6277d15b6d9e186df4ac68c3620443160fc669e2f14c11e7d8b2ccf078b81d06147c01a8ccced9aab9f9f63d50dcf8cace6bf6 languageName: node linkType: hard -"lodash@npm:^4.18.1": - version: 4.18.1 - resolution: "lodash@npm:4.18.1" - checksum: 10c0/757228fc68805c59789e82185135cf85f05d0b2d3d54631d680ca79ec21944ec8314d4533639a14b8bcfbd97a517e78960933041a5af17ecb693ec6eecb99a27 - languageName: node - linkType: hard - "log-symbols@npm:4.1.0, log-symbols@npm:^4.1.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" @@ -22242,28 +22283,7 @@ __metadata: languageName: node linkType: hard -"logform@npm:^2.3.2": - version: 2.5.1 - resolution: "logform@npm:2.5.1" - dependencies: - "@colors/colors": "npm:1.5.0" - "@types/triple-beam": "npm:^1.3.2" - fecha: "npm:^4.2.0" - ms: "npm:^2.1.1" - safe-stable-stringify: "npm:^2.3.1" - triple-beam: "npm:^1.3.0" - checksum: 10c0/d11c36b4c42063abc816fda2fd149cff9969a9943d42afd95ddd1426804980b4e92e24f2ea6a9916fd490224b1c97578734a37d3b40ce3a9418495ce52e8ef23 - languageName: node - linkType: hard - -"long@npm:^4.0.0": - version: 4.0.0 - resolution: "long@npm:4.0.0" - checksum: 10c0/50a6417d15b06104dbe4e3d4a667c39b137f130a9108ea8752b352a4cfae047531a3ac351c181792f3f8768fe17cca6b0f406674a541a86fb638aaac560d83ed - languageName: node - linkType: hard - -"long@npm:^5.0.0, long@npm:^5.2.3": +"long@npm:^5.0.0": version: 5.2.3 resolution: "long@npm:5.2.3" checksum: 10c0/6a0da658f5ef683b90330b1af76f06790c623e148222da9d75b60e266bbf88f803232dd21464575681638894a84091616e7f89557aa087fd14116c0f4e0e43d9 @@ -22321,6 +22341,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^10.0.1, lru-cache@npm:^10.4.3": + version: 10.4.3 + resolution: "lru-cache@npm:10.4.3" + checksum: 10c0/ebd04fbca961e6c1d6c0af3799adcc966a1babe798f685bb84e6599266599cd95d94630b10262f5424539bc4640107e8a33aa28585374abf561d30d16f4b39fb + languageName: node + linkType: hard + "lru-cache@npm:^10.2.0": version: 10.2.2 resolution: "lru-cache@npm:10.2.2" @@ -22328,13 +22355,6 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^10.4.3": - version: 10.4.3 - resolution: "lru-cache@npm:10.4.3" - checksum: 10c0/ebd04fbca961e6c1d6c0af3799adcc966a1babe798f685bb84e6599266599cd95d94630b10262f5424539bc4640107e8a33aa28585374abf561d30d16f4b39fb - languageName: node - linkType: hard - "lru-cache@npm:^11.0.0": version: 11.2.7 resolution: "lru-cache@npm:11.2.7" @@ -22402,12 +22422,21 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^1.1.0": - version: 1.4.3 - resolution: "magic-string@npm:1.4.3" +"magic-string@npm:^0.30.17": + version: 0.30.21 + resolution: "magic-string@npm:0.30.21" + dependencies: + "@jridgewell/sourcemap-codec": "npm:^1.5.5" + checksum: 10c0/299378e38f9a270069fc62358522ddfb44e94244baa0d6a8980ab2a9b2490a1d03b236b447eee309e17eb3bddfa482c61259d47960eb018a904f0ded52780c4a + languageName: node + linkType: hard + +"magic-string@npm:^0.30.5": + version: 0.30.10 + resolution: "magic-string@npm:0.30.10" dependencies: - "@jridgewell/sourcemap-codec": "npm:^1.6.0" - checksum: 10c0/857743a1e7039d2e867505bb272a57cc605f610b90f6bf9ef6cbf9654e9cd64330ec35e564a58ca455350529872c3ecc01f37da934da130391237f9f593cc565 + "@jridgewell/sourcemap-codec": "npm:^1.4.15" + checksum: 10c0/aa9ca17eae571a19bce92c8221193b6f93ee8511abb10f085e55ffd398db8e4c089a208d9eac559deee96a08b7b24d636ea4ab92f09c6cf42a7d1af51f7fd62b languageName: node linkType: hard @@ -22427,6 +22456,26 @@ __metadata: languageName: node linkType: hard +"make-fetch-happen@npm:^13.0.0": + version: 13.0.1 + resolution: "make-fetch-happen@npm:13.0.1" + dependencies: + "@npmcli/agent": "npm:^2.0.0" + cacache: "npm:^18.0.0" + http-cache-semantics: "npm:^4.1.1" + is-lambda: "npm:^1.0.1" + minipass: "npm:^7.0.2" + minipass-fetch: "npm:^3.0.0" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + negotiator: "npm:^0.6.3" + proc-log: "npm:^4.2.0" + promise-retry: "npm:^2.0.1" + ssri: "npm:^10.0.0" + checksum: 10c0/df5f4dbb6d98153b751bccf4dc4cc500de85a96a9331db9805596c46aa9f99d9555983954e6c1266d9f981ae37a9e4647f42b9a4bb5466f867f4012e582c9e7e + languageName: node + linkType: hard + "makeerror@npm:1.0.12": version: 1.0.12 resolution: "makeerror@npm:1.0.12" @@ -23288,6 +23337,16 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^11.0.0": + version: 11.0.3 + resolution: "minimatch@npm:11.0.3" + dependencies: + "@isaacs/nonrecursive-glob-match": "npm:^1.0.3" + brace-expansion: "npm:^5.0.12" + checksum: 10c0/5e8f192102251981872d3c117b3804d4b2759a20b5d788e65af2263a7679d96692f00ca8784b245e38476d042472c818f10ceac06085dec23a22136931b76053 + languageName: node + linkType: hard + "minimatch@npm:^8.0.2": version: 8.0.4 resolution: "minimatch@npm:8.0.4" @@ -23333,6 +23392,66 @@ __metadata: languageName: node linkType: hard +"minipass-collect@npm:^2.0.1": + version: 2.0.1 + resolution: "minipass-collect@npm:2.0.1" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/5167e73f62bb74cc5019594709c77e6a742051a647fe9499abf03c71dca75515b7959d67a764bdc4f8b361cf897fbf25e2d9869ee039203ed45240f48b9aa06e + languageName: node + linkType: hard + +"minipass-fetch@npm:^3.0.0": + version: 3.0.5 + resolution: "minipass-fetch@npm:3.0.5" + dependencies: + encoding: "npm:^0.1.13" + minipass: "npm:^7.0.3" + minipass-sized: "npm:^1.0.3" + minizlib: "npm:^2.1.2" + dependenciesMeta: + encoding: + optional: true + checksum: 10c0/9d702d57f556274286fdd97e406fc38a2f5c8d15e158b498d7393b1105974b21249289ec571fa2b51e038a4872bfc82710111cf75fae98c662f3d6f95e72152b + languageName: node + linkType: hard + +"minipass-flush@npm:^1.0.5": + version: 1.0.5 + resolution: "minipass-flush@npm:1.0.5" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/2a51b63feb799d2bb34669205eee7c0eaf9dce01883261a5b77410c9408aa447e478efd191b4de6fc1101e796ff5892f8443ef20d9544385819093dbb32d36bd + languageName: node + linkType: hard + +"minipass-pipeline@npm:^1.2.4": + version: 1.2.4 + resolution: "minipass-pipeline@npm:1.2.4" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/cbda57cea20b140b797505dc2cac71581a70b3247b84480c1fed5ca5ba46c25ecc25f68bfc9e6dcb1a6e9017dab5c7ada5eab73ad4f0a49d84e35093e0c643f2 + languageName: node + linkType: hard + +"minipass-sized@npm:^1.0.3": + version: 1.0.3 + resolution: "minipass-sized@npm:1.0.3" + dependencies: + minipass: "npm:^3.0.0" + checksum: 10c0/298f124753efdc745cfe0f2bdfdd81ba25b9f4e753ca4a2066eb17c821f25d48acea607dfc997633ee5bf7b6dfffb4eee4f2051eb168663f0b99fad2fa4829cb + languageName: node + linkType: hard + +"minipass@npm:^3.0.0": + version: 3.3.6 + resolution: "minipass@npm:3.3.6" + dependencies: + yallist: "npm:^4.0.0" + checksum: 10c0/a114746943afa1dbbca8249e706d1d38b85ed1298b530f5808ce51f8e9e941962e2a5ad2e00eae7dd21d8a4aae6586a66d4216d1a259385e9d0358f0c1eba16c + languageName: node + linkType: hard + "minipass@npm:^4.2.4": version: 4.2.8 resolution: "minipass@npm:4.2.8" @@ -23340,33 +23459,34 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.1.2": +"minipass@npm:^5.0.0": + version: 5.0.0 + resolution: "minipass@npm:5.0.0" + checksum: 10c0/a91d8043f691796a8ac88df039da19933ef0f633e3d7f0d35dcd5373af49131cf2399bfc355f41515dc495e3990369c3858cd319e5c2722b4753c90bf3152462 + languageName: node + linkType: hard + +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.1.2": version: 7.1.2 resolution: "minipass@npm:7.1.2" checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 languageName: node linkType: hard -"minipass@npm:^7.0.4, minipass@npm:^7.1.3": +"minipass@npm:^7.1.3": version: 7.1.3 resolution: "minipass@npm:7.1.3" checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb languageName: node linkType: hard -"minizlib@npm:^3.1.0": - version: 3.1.0 - resolution: "minizlib@npm:3.1.0" +"minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": + version: 2.1.2 + resolution: "minizlib@npm:2.1.2" dependencies: - minipass: "npm:^7.1.2" - checksum: 10c0/5aad75ab0090b8266069c9aabe582c021ae53eb33c6c691054a13a45db3b4f91a7fb1bd79151e6b4e9e9a86727b522527c0a06ec7d45206b745d54cd3097bcec - languageName: node - linkType: hard - -"mitt@npm:^1.1.3": - version: 1.2.0 - resolution: "mitt@npm:1.2.0" - checksum: 10c0/81a0f22b7ac1a0ab5f17489e811641ad589b5e9d2a46a25adac19c8c0ba9c3b50bef7b287582357de25eaa0a47e5d4ced63ea8b8641ba6ca1d1f39d3ec47bb11 + minipass: "npm:^3.0.0" + yallist: "npm:^4.0.0" + checksum: 10c0/64fae024e1a7d0346a1102bb670085b17b7f95bf6cfdf5b128772ec8faf9ea211464ea4add406a3a6384a7d87a0cd1a96263692134323477b4fb43659a6cab78 languageName: node linkType: hard @@ -23384,6 +23504,15 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:^1.0.3": + version: 1.0.4 + resolution: "mkdirp@npm:1.0.4" + bin: + mkdirp: bin/cmd.js + checksum: 10c0/46ea0f3ffa8bc6a5bc0c7081ffc3907777f0ed6516888d40a518c5111f8366d97d2678911ad1a6882bf592fa9de6c784fea32e1687bb94e1f4944170af48a5cf + languageName: node + linkType: hard + "module-details-from-path@npm:^1.0.3": version: 1.0.3 resolution: "module-details-from-path@npm:1.0.3" @@ -23391,6 +23520,13 @@ __metadata: languageName: node linkType: hard +"module-details-from-path@npm:^1.0.4": + version: 1.0.4 + resolution: "module-details-from-path@npm:1.0.4" + checksum: 10c0/10863413e96dab07dee917eae07afe46f7bf853065cc75a7d2a718adf67574857fb64f8a2c0c9af12ac733a9a8cf652db7ed39b95f7a355d08106cb9cc50c83b + languageName: node + linkType: hard + "mongodb-connection-string-url@npm:^2.6.0": version: 2.6.0 resolution: "mongodb-connection-string-url@npm:2.6.0" @@ -23664,20 +23800,7 @@ __metadata: languageName: node linkType: hard -"needle@npm:^2.5.2": - version: 2.9.1 - resolution: "needle@npm:2.9.1" - dependencies: - debug: "npm:^3.2.6" - iconv-lite: "npm:^0.4.4" - sax: "npm:^1.2.4" - bin: - needle: ./bin/needle - checksum: 10c0/65a7eaeaf4ca3410de492957474592af9838e02875273d9232ff6cff331393c58a95e48c592bd9a05f575e5bb9b08543d6cfd19eb96595dbd3d7da2c5fe1accb - languageName: node - linkType: hard - -"negotiator@npm:0.6.3": +"negotiator@npm:0.6.3, negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" checksum: 10c0/3ec9fd413e7bf071c937ae60d572bc67155262068ed522cf4b3be5edbe6ddf67d095ec03a3a14ebf8fc8e95f8e1d61be4869db0dbb0de696f6b837358bd43fc2 @@ -23718,19 +23841,19 @@ __metadata: languageName: node linkType: hard -"next@npm:^16.4.2": - version: 16.4.2 - resolution: "next@npm:16.4.2" +"next@npm:^16.4.3": + version: 16.4.3 + resolution: "next@npm:16.4.3" dependencies: - "@next/env": "npm:16.4.2" - "@next/swc-darwin-arm64": "npm:16.4.2" - "@next/swc-darwin-x64": "npm:16.4.2" - "@next/swc-linux-arm64-gnu": "npm:16.4.2" - "@next/swc-linux-arm64-musl": "npm:16.4.2" - "@next/swc-linux-x64-gnu": "npm:16.4.2" - "@next/swc-linux-x64-musl": "npm:16.4.2" - "@next/swc-win32-arm64-msvc": "npm:16.4.2" - "@next/swc-win32-x64-msvc": "npm:16.4.2" + "@next/env": "npm:16.4.3" + "@next/swc-darwin-arm64": "npm:16.4.3" + "@next/swc-darwin-x64": "npm:16.4.3" + "@next/swc-linux-arm64-gnu": "npm:16.4.3" + "@next/swc-linux-arm64-musl": "npm:16.4.3" + "@next/swc-linux-x64-gnu": "npm:16.4.3" + "@next/swc-linux-x64-musl": "npm:16.4.3" + "@next/swc-win32-arm64-msvc": "npm:16.4.3" + "@next/swc-win32-x64-msvc": "npm:16.4.3" "@swc/helpers": "npm:0.5.23" baseline-browser-mapping: "npm:^2.9.19" caniuse-lite: "npm:^1.0.30001579" @@ -23774,7 +23897,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: 10c0/5d6c6949b1d5505ed2bb12c0adaa18ea608be47d1a70df172e204297c6e0080dc6bf675dce8bfa60962c0f28f2e2e75b21eef26e9fc39a8526cba383c51c273e + checksum: 10c0/a61625eb95fa29f15d84a71333d24ebb5a2666bf7a8235aa3d6eb3ac8c9ea1159c12ffbfe5f4c315646a34b6fcaf87b3b3f737222b364e331f7e6da16d1d857e languageName: node linkType: hard @@ -23821,19 +23944,7 @@ __metadata: languageName: node linkType: hard -"node-exports-info@npm:^1.6.0": - version: 1.6.2 - resolution: "node-exports-info@npm:1.6.2" - dependencies: - array.prototype.flatmap: "npm:^1.3.3" - es-errors: "npm:^1.3.0" - object.entries: "npm:^1.1.9" - semver: "npm:^6.3.1" - checksum: 10c0/5278fab18e8c97f45275c51819c3078ca9488361e875bc01b680776a339d2fee1ca9c6fcfb972df14945a1b184cc9924a1d9ba87e90f6cb3422c7f5b6900f4bc - languageName: node - linkType: hard - -"node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.9, node-fetch@npm:^2.7.0": +"node-fetch@npm:^2.6.0, node-fetch@npm:^2.7.0": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" dependencies: @@ -23858,23 +23969,34 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:^3.3.2": + version: 3.3.2 + resolution: "node-fetch@npm:3.3.2" + dependencies: + data-uri-to-buffer: "npm:^4.0.0" + fetch-blob: "npm:^3.1.4" + formdata-polyfill: "npm:^4.0.10" + checksum: 10c0/f3d5e56190562221398c9f5750198b34cf6113aa304e34ee97c94fd300ec578b25b2c2906edba922050fce983338fde0d5d34fcb0fc3336ade5bd0e429ad7538 + languageName: node + linkType: hard + "node-gyp@npm:latest": - version: 13.1.0 - resolution: "node-gyp@npm:13.1.0" + version: 10.2.0 + resolution: "node-gyp@npm:10.2.0" dependencies: env-paths: "npm:^2.2.0" exponential-backoff: "npm:^3.1.1" + glob: "npm:^10.3.10" graceful-fs: "npm:^4.2.6" - nopt: "npm:^10.0.0" - proc-log: "npm:^7.0.0" + make-fetch-happen: "npm:^13.0.0" + nopt: "npm:^7.0.0" + proc-log: "npm:^4.1.0" semver: "npm:^7.3.5" - tar: "npm:^7.5.7" - tinyglobby: "npm:^0.2.12" - undici: "npm:^8.4.1" - which: "npm:^7.0.0" + tar: "npm:^6.2.1" + which: "npm:^4.0.0" bin: node-gyp: bin/node-gyp.js - checksum: 10c0/c6693e52e0e111b21f5cd8ff303b41b51f40338adcc79ac5c6a02399eba7039d50dc816dcafcc485870291a641f7cb75db8887a9bdd0de537fe635a3a81cba5b + checksum: 10c0/00630d67dbd09a45aee0a5d55c05e3916ca9e6d427ee4f7bc392d2d3dc5fad7449b21fc098dd38260a53d9dcc9c879b36704a1994235d4707e7271af7e9a835b languageName: node linkType: hard @@ -23920,10 +24042,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.59": - version: 2.0.60 - resolution: "node-releases@npm:2.0.60" - checksum: 10c0/f0c7b37cf83405291c0de87e15b5cef4af167248f8cc91b7c1c2281338c0e7e9aebfb77e0153ba335bb4c6ec5b1563431cfba93e8c83292760856012d93cb93e +"node-releases@npm:^2.0.27": + version: 2.0.27 + resolution: "node-releases@npm:2.0.27" + checksum: 10c0/f1e6583b7833ea81880627748d28a3a7ff5703d5409328c216ae57befbced10ce2c991bea86434e8ec39003bd017f70481e2e5f8c1f7e0a7663241f81d6e00e2 languageName: node linkType: hard @@ -23967,14 +24089,14 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^10.0.0": - version: 10.0.1 - resolution: "nopt@npm:10.0.1" +"nopt@npm:^7.0.0": + version: 7.2.1 + resolution: "nopt@npm:7.2.1" dependencies: - abbrev: "npm:^5.0.0" + abbrev: "npm:^2.0.0" bin: nopt: bin/nopt.js - checksum: 10c0/980d89257f9587f3e1f77877ddbf905d6aa3b738ec33e49a4fa1a059a0dd82eb28063982b150654a7ae9de386f2ead60e56172db7d37cf56de545f7392a2a26a + checksum: 10c0/a069c7c736767121242037a22a788863accfa932ab285a1eb569eb8cd534b09d17206f68c37f096ae785647435e0c5a5a0a67b42ec743e481a455e5ae6a6df81 languageName: node linkType: hard @@ -24438,17 +24560,6 @@ __metadata: languageName: node linkType: hard -"open@npm:^8.4.2": - version: 8.4.2 - resolution: "open@npm:8.4.2" - dependencies: - define-lazy-prop: "npm:^2.0.0" - is-docker: "npm:^2.1.1" - is-wsl: "npm:^2.2.0" - checksum: 10c0/bb6b3a58401dacdb0aad14360626faf3fb7fba4b77816b373495988b724fb48941cad80c1b65d62bb31a17609b2cd91c41a181602caea597ca80dfbcc27e84c9 - languageName: node - linkType: hard - "optionator@npm:^0.9.3": version: 0.9.3 resolution: "optionator@npm:0.9.3" @@ -24463,7 +24574,7 @@ __metadata: languageName: node linkType: hard -"ora@npm:5.4.1, ora@npm:^5.4.1": +"ora@npm:5.4.1": version: 5.4.1 resolution: "ora@npm:5.4.1" dependencies: @@ -25099,13 +25210,13 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^2.0.2": - version: 2.0.2 - resolution: "path-scurry@npm:2.0.2" +"path-scurry@npm:^3.0.0": + version: 3.0.0 + resolution: "path-scurry@npm:3.0.0" dependencies: lru-cache: "npm:^11.0.0" minipass: "npm:^7.1.2" - checksum: 10c0/b35ad37cf6557a87fd057121ce2be7695380c9138d93e87ae928609da259ea0a170fac6f3ef1eb3ece8a068e8b7f2f3adf5bb2374cf4d4a57fe484954fcc9482 + checksum: 10c0/3256223b51952732bc5460f574143d7d9904cd6d68fac3072906162c90e9f27fdf6f3fe812287e65a876f92d73c12a58368b28749ed07a58bdb04dc76f60a938 languageName: node linkType: hard @@ -25243,16 +25354,6 @@ __metadata: languageName: node linkType: hard -"pino-abstract-transport@npm:^1.2.0": - version: 1.2.0 - resolution: "pino-abstract-transport@npm:1.2.0" - dependencies: - readable-stream: "npm:^4.0.0" - split2: "npm:^4.0.0" - checksum: 10c0/b4ab59529b7a91f488440147fc58ee0827a6c1c5ca3627292339354b1381072c1a6bfa9b46d03ad27872589e8477ecf74da12cf286e1e6b665ac64a3b806bf07 - languageName: node - linkType: hard - "pino-abstract-transport@npm:^2.0.0": version: 2.0.0 resolution: "pino-abstract-transport@npm:2.0.0" @@ -25579,22 +25680,22 @@ __metadata: linkType: hard "postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4": - version: 6.1.5 - resolution: "postcss-selector-parser@npm:6.1.5" + version: 6.1.4 + resolution: "postcss-selector-parser@npm:6.1.4" dependencies: cssesc: "npm:^3.0.0" util-deprecate: "npm:^1.0.2" - checksum: 10c0/1b328959d68b90a680979cfb99501fe3781f2da61e56748a912c9a9c8c20f9644a0bd510ac820d74d94ed0990bce747aea75cc5b17b966ea3a70c7c1932d31fd + checksum: 10c0/996f3290dee08ecb073d5f396d1134e619494cfd83140aec07a29618ee1e76d370769a8959d4c0cfefb24aa96dcffa4e7c4937dd881e03b735d50cba959ceb19 languageName: node linkType: hard "postcss-selector-parser@npm:^7.0.0, postcss-selector-parser@npm:^7.1.0, postcss-selector-parser@npm:^7.1.1": - version: 7.1.7 - resolution: "postcss-selector-parser@npm:7.1.7" + version: 7.1.1 + resolution: "postcss-selector-parser@npm:7.1.1" dependencies: cssesc: "npm:^3.0.0" util-deprecate: "npm:^1.0.2" - checksum: 10c0/94db1cfb838957729dd632a229f86cc631cee98f0418026a8460ba3d24feb47da0a28f295a2ae4be37b548ffa6e61eff0f74fbc2ae309c48a6dd3fe1cb25e396 + checksum: 10c0/02d3b1589ddcddceed4b583b098b95a7266dacd5135f041e5d913ebb48e874fd333a36e564cc9a2ec426a464cb18db11cb192ac76247aced5eba8c951bf59507 languageName: node linkType: hard @@ -25810,21 +25911,10 @@ __metadata: languageName: node linkType: hard -"probe-image-size@npm:^7.3.0": - version: 7.4.0 - resolution: "probe-image-size@npm:7.4.0" - dependencies: - lodash.merge: "npm:^4.6.2" - needle: "npm:^2.5.2" - stream-parser: "npm:~0.3.1" - checksum: 10c0/2746be804dc265eec58a0f48c1e78b13e7504700e9c4e924dedc95bdc45d801fd8279ba3bea29dcf1bb743b536fd5c80b0103cb1d1a4d34e2f4d035093b68166 - languageName: node - linkType: hard - -"proc-log@npm:^7.0.0": - version: 7.0.0 - resolution: "proc-log@npm:7.0.0" - checksum: 10c0/b89c2d862604f35fec795477b0c7e376feab3ba0d4f4d291c4e959567442697cf451ac557d0623c1cc38af45a78128b983410f397a10c5d3a67f76c33de4754b +"proc-log@npm:^4.1.0, proc-log@npm:^4.2.0": + version: 4.2.0 + resolution: "proc-log@npm:4.2.0" + checksum: 10c0/17db4757c2a5c44c1e545170e6c70a26f7de58feb985091fb1763f5081cab3d01b181fb2dd240c9f4a4255a1d9227d163d5771b7e69c9e49a561692db865efb9 languageName: node linkType: hard @@ -25866,6 +25956,16 @@ __metadata: languageName: node linkType: hard +"promise-retry@npm:^2.0.1": + version: 2.0.1 + resolution: "promise-retry@npm:2.0.1" + dependencies: + err-code: "npm:^2.0.2" + retry: "npm:^0.12.0" + checksum: 10c0/9c7045a1a2928094b5b9b15336dcd2a7b1c052f674550df63cc3f36cd44028e5080448175b6f6ca32b642de81150f5e7b1a98b728f15cb069f2dd60ac2616b96 + languageName: node + linkType: hard + "promised-handlebars@npm:^2.0.1": version: 2.0.1 resolution: "promised-handlebars@npm:2.0.1" @@ -25895,9 +25995,9 @@ __metadata: languageName: node linkType: hard -"protobufjs@npm:^7.3.0, protobufjs@npm:^7.5.5, protobufjs@npm:^7.6.5": - version: 7.6.6 - resolution: "protobufjs@npm:7.6.6" +"protobufjs@npm:^7.5.5": + version: 7.6.2 + resolution: "protobufjs@npm:7.6.2" dependencies: "@protobufjs/aspromise": "npm:^1.1.2" "@protobufjs/base64": "npm:^1.1.2" @@ -25905,36 +26005,32 @@ __metadata: "@protobufjs/eventemitter": "npm:^1.1.1" "@protobufjs/fetch": "npm:^1.1.1" "@protobufjs/float": "npm:^1.0.2" + "@protobufjs/inquire": "npm:^1.1.2" "@protobufjs/path": "npm:^1.1.2" "@protobufjs/pool": "npm:^1.1.0" "@protobufjs/utf8": "npm:^1.1.1" "@types/node": "npm:>=13.7.0" long: "npm:^5.3.2" - checksum: 10c0/6c0dc6d4a2801825e39417bc116297d5261c0cf28892a5e28adafc13432331c0cb75603bbe50ad6f2715f3b0a9ce2896591ad6b51fdc8eae2d05b9ac2e4a8ec1 + checksum: 10c0/3c552dfe3cbcfad2d6c312a76cd189cf5be9fb36b203f6292f79c6020d675f7f33d5531ce312441c42ae75deb24ced32760e64fe4aa3d5b3c2295fd67cea270c languageName: node linkType: hard -"protobufjs@npm:~6.11.2": - version: 6.11.6 - resolution: "protobufjs@npm:6.11.6" +"protobufjs@npm:^7.6.5": + version: 7.6.5 + resolution: "protobufjs@npm:7.6.5" dependencies: "@protobufjs/aspromise": "npm:^1.1.2" "@protobufjs/base64": "npm:^1.1.2" - "@protobufjs/codegen": "npm:^2.0.4" - "@protobufjs/eventemitter": "npm:^1.1.0" - "@protobufjs/fetch": "npm:^1.1.0" + "@protobufjs/codegen": "npm:^2.0.5" + "@protobufjs/eventemitter": "npm:^1.1.1" + "@protobufjs/fetch": "npm:^1.1.1" "@protobufjs/float": "npm:^1.0.2" - "@protobufjs/inquire": "npm:^1.1.0" "@protobufjs/path": "npm:^1.1.2" "@protobufjs/pool": "npm:^1.1.0" - "@protobufjs/utf8": "npm:^1.1.0" - "@types/long": "npm:^4.0.1" + "@protobufjs/utf8": "npm:^1.1.1" "@types/node": "npm:>=13.7.0" - long: "npm:^4.0.0" - bin: - pbjs: bin/pbjs - pbts: bin/pbts - checksum: 10c0/a7ed63a75b86c7d22abdfef48e9775f373befbaad4beceadf5bd047066365d735386d57851b35f89ae2c1afdea2da1c93a17682aa9a4a8f3df7ca54ccdce309b + long: "npm:^5.3.2" + checksum: 10c0/863eaca9c6f45bfcfb8787c545f53e9c6696507e328e3981b4643c12d35df7f2826021c10e3fd30bef342c13a8e9d306547bac9c0849ee3bf50f770a12f01dc5 languageName: node linkType: hard @@ -26042,12 +26138,12 @@ __metadata: linkType: hard "qs@npm:~6.16.0": - version: 6.16.1 - resolution: "qs@npm:6.16.1" + version: 6.16.2 + resolution: "qs@npm:6.16.2" dependencies: es-define-property: "npm:^1.0.1" side-channel: "npm:^1.1.1" - checksum: 10c0/84ee9124b251ab2953132fbea1d70c966aa6e6496cccabedbbb83afa412bf4177bddebc779ca3ddafe23da83b2f593d530b41be6a726e971404fabb20ff22c94 + checksum: 10c0/945e933f943e419bcd0ca54eeacff7d7bb5a098de886249425cbba3b5ed1be10e177b84b97d7d2c4099e90afa09bb3489112672b89dfa56edc0b5bcb829c456b languageName: node linkType: hard @@ -26110,7 +26206,7 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5": +"randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5, randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" dependencies: @@ -26224,6 +26320,24 @@ __metadata: languageName: node linkType: hard +"react-docgen@npm:^7.1.1": + version: 7.1.1 + resolution: "react-docgen@npm:7.1.1" + dependencies: + "@babel/core": "npm:^7.18.9" + "@babel/traverse": "npm:^7.18.9" + "@babel/types": "npm:^7.18.9" + "@types/babel__core": "npm:^7.18.0" + "@types/babel__traverse": "npm:^7.18.0" + "@types/doctrine": "npm:^0.0.9" + "@types/resolve": "npm:^1.20.2" + doctrine: "npm:^3.0.0" + resolve: "npm:^1.22.1" + strip-indent: "npm:^4.0.0" + checksum: 10c0/961e69487f6acbd9110afbda31f5a0c7fa7ab8b1ebe09fc0138c17efd297fa0b69518df873e937cac108732cd8125433bf939115d23ff99c1c171844140705a7 + languageName: node + linkType: hard + "react-docgen@npm:^8.0.2": version: 8.0.2 resolution: "react-docgen@npm:8.0.2" @@ -26803,26 +26917,19 @@ __metadata: languageName: node linkType: hard -"regenerate-unicode-properties@npm:^10.3.0": - version: 10.3.0 - resolution: "regenerate-unicode-properties@npm:10.3.0" +"regenerate-unicode-properties@npm:^10.1.0": + version: 10.1.1 + resolution: "regenerate-unicode-properties@npm:10.1.1" dependencies: regenerate: "npm:^1.4.2" - checksum: 10c0/3408a81fc84af7222c5b18886854c0d47e4ed474d94eb5fc37c3f2b11596f2200662dc6573666f651114144407c045ae062ebe2a91d80ed5c348786b1d705264 - languageName: node - linkType: hard - -"regenerate@npm:^1.4.2, regenerate@npm:^1.5.0": - version: 1.5.0 - resolution: "regenerate@npm:1.5.0" - checksum: 10c0/b2627a1fcb66474dcde8c60a243dd1da6d416fbd887d8346f81b8732df625751924d48175eb0982b555d5f8f8de45bc9537d0572e9190058c61e87aa2e546daf + checksum: 10c0/89adb5ee5ba081380c78f9057c02e156a8181969f6fcca72451efc45612e0c3df767b4333f8d8479c274d9c6fe52ec4854f0d8a22ef95dccbe87da8e5f2ac77d languageName: node linkType: hard -"regenerator-runtime@npm:^0.13.11, regenerator-runtime@npm:^0.13.4": - version: 0.13.11 - resolution: "regenerator-runtime@npm:0.13.11" - checksum: 10c0/12b069dc774001fbb0014f6a28f11c09ebfe3c0d984d88c9bced77fdb6fedbacbca434d24da9ae9371bfbf23f754869307fb51a4c98a8b8b18e5ef748677ca24 +"regenerate@npm:^1.4.2": + version: 1.4.2 + resolution: "regenerate@npm:1.4.2" + checksum: 10c0/f73c9eba5d398c818edc71d1c6979eaa05af7a808682749dd079f8df2a6d91a9b913db216c2c9b03e0a8ba2bba8701244a93f45211afbff691c32c7b275db1b8 languageName: node linkType: hard @@ -26833,6 +26940,15 @@ __metadata: languageName: node linkType: hard +"regenerator-transform@npm:^0.15.2": + version: 0.15.2 + resolution: "regenerator-transform@npm:0.15.2" + dependencies: + "@babel/runtime": "npm:^7.8.4" + checksum: 10c0/7cfe6931ec793269701994a93bab89c0cc95379191fad866270a7fea2adfec67ea62bb5b374db77058b60ba4509319d9b608664d0d288bd9989ca8dbd08fae90 + languageName: node + linkType: hard + "regex-parser@npm:^2.2.11": version: 2.3.0 resolution: "regex-parser@npm:2.3.0" @@ -26874,17 +26990,17 @@ __metadata: languageName: node linkType: hard -"regexpu-core@npm:^6.5.3": - version: 6.5.3 - resolution: "regexpu-core@npm:6.5.3" +"regexpu-core@npm:^5.3.1": + version: 5.3.2 + resolution: "regexpu-core@npm:5.3.2" dependencies: - regenerate: "npm:^1.5.0" - regenerate-unicode-properties: "npm:^10.3.0" - regjsgen: "npm:^0.8.0" - regjsparser: "npm:^0.13.0" + "@babel/regjsgen": "npm:^0.8.0" + regenerate: "npm:^1.4.2" + regenerate-unicode-properties: "npm:^10.1.0" + regjsparser: "npm:^0.9.1" unicode-match-property-ecmascript: "npm:^2.0.0" - unicode-match-property-value-ecmascript: "npm:^2.2.1" - checksum: 10c0/d99b9526ae40d2268b0d3c1e8ab42d0aca3000dd424fadf5cc2d7c4260e108587420c9868adaf3f6b1ebc155e3cb95225eeda72ce28a8645c6a5fedeb47cde14 + unicode-match-property-value-ecmascript: "npm:^2.1.0" + checksum: 10c0/7945d5ab10c8bbed3ca383d4274687ea825aee4ab93a9c51c6e31e1365edd5ea807f6908f800ba017b66c462944ba68011164e7055207747ab651f8111ef3770 languageName: node linkType: hard @@ -26907,21 +27023,14 @@ __metadata: languageName: node linkType: hard -"regjsgen@npm:^0.8.0": - version: 0.8.0 - resolution: "regjsgen@npm:0.8.0" - checksum: 10c0/44f526c4fdbf0b29286101a282189e4dbb303f4013cf3fea058668d96d113b9180d3d03d1e13f6d4cbde38b7728bf951aecd9dc199938c080093a9a6f0d7a6bd - languageName: node - linkType: hard - -"regjsparser@npm:^0.13.0": - version: 0.13.4 - resolution: "regjsparser@npm:0.13.4" +"regjsparser@npm:^0.9.1": + version: 0.9.1 + resolution: "regjsparser@npm:0.9.1" dependencies: - jsesc: "npm:~3.1.0" + jsesc: "npm:~0.5.0" bin: regjsparser: bin/parser - checksum: 10c0/7a623e13bef4041c9e870e7a2bd97fe09d41bbcc960590edc7866e9c8e9a14ae5512ae19ca73bf8d022473c3cb386bef595d13462ff6d0b81da91bfabd8790f3 + checksum: 10c0/fe44fcf19a99fe4f92809b0b6179530e5ef313ff7f87df143b08ce9a2eb3c4b6189b43735d645be6e8f4033bfb015ed1ca54f0583bc7561bed53fd379feb8225 languageName: node linkType: hard @@ -27009,14 +27118,13 @@ __metadata: languageName: node linkType: hard -"require-in-the-middle@npm:^7.1.1": - version: 7.1.1 - resolution: "require-in-the-middle@npm:7.1.1" +"require-in-the-middle@npm:^8.0.0": + version: 8.0.1 + resolution: "require-in-the-middle@npm:8.0.1" dependencies: - debug: "npm:^4.1.1" + debug: "npm:^4.3.5" module-details-from-path: "npm:^1.0.3" - resolve: "npm:^1.22.1" - checksum: 10c0/45c7b9e2dcc534c9ebd70d7e1cf3dfe135dede70a5740867fcb7f1bc930479096a36c9e9f57fd0949f7010724d8cf503144bdfbdd1b69296a45b49fc78c32abf + checksum: 10c0/4b3d29adfff873585dceffa9ddb8f33bb6599001ddff758503e0e5ade2ae6d20d691314125bb13679fa75a19893338e11953d4702dd2fea181e95c0f8316b29b languageName: node linkType: hard @@ -27098,63 +27206,107 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.10.0, resolve@npm:^1.17.0, resolve@npm:^1.22.1, resolve@npm:^1.22.11, resolve@npm:^1.22.2, resolve@npm:^1.22.4, resolve@npm:^1.22.8": - version: 1.22.13 - resolution: "resolve@npm:1.22.13" +"resolve@npm:^1.10.0, resolve@npm:^1.22.1": + version: 1.22.1 + resolution: "resolve@npm:1.22.1" dependencies: - es-errors: "npm:^1.3.0" - is-core-module: "npm:^2.17.0" + is-core-module: "npm:^2.9.0" + path-parse: "npm:^1.0.7" + supports-preserve-symlinks-flag: "npm:^1.0.0" + bin: + resolve: bin/resolve + checksum: 10c0/6d58b1cb40f3fc80b9e45dd799d84cdc3829a993e4b9fa3b59d331e1dfacd0870e1851f4d0eb549d68c796e0b7087b43d1aec162653ccccff9e18191221a6e7d + languageName: node + linkType: hard + +"resolve@npm:^1.14.2, resolve@npm:^1.22.2, resolve@npm:^1.22.4, resolve@npm:^1.22.8": + version: 1.22.8 + resolution: "resolve@npm:1.22.8" + dependencies: + is-core-module: "npm:^2.13.0" + path-parse: "npm:^1.0.7" + supports-preserve-symlinks-flag: "npm:^1.0.0" + bin: + resolve: bin/resolve + checksum: 10c0/07e179f4375e1fd072cfb72ad66d78547f86e6196c4014b31cb0b8bb1db5f7ca871f922d08da0fbc05b94e9fd42206f819648fa3b5b873ebbc8e1dc68fec433a + languageName: node + linkType: hard + +"resolve@npm:^1.17.0": + version: 1.22.11 + resolution: "resolve@npm:1.22.11" + dependencies: + is-core-module: "npm:^2.16.1" path-parse: "npm:^1.0.7" supports-preserve-symlinks-flag: "npm:^1.0.0" bin: resolve: bin/resolve - checksum: 10c0/8dac5b33a1f9f241500fcaf42f9033cdcaf3738c908a60a50a976ff2f6129063cbc5368b4092e42d2d264ad22aa94aaff207f3efa8d0185c68454439b11a1973 + checksum: 10c0/f657191507530f2cbecb5815b1ee99b20741ea6ee02a59c57028e9ec4c2c8d7681afcc35febbd554ac0ded459db6f2d8153382c53a2f266cee2575e512674409 languageName: node linkType: hard "resolve@npm:^2.0.0-next.5": - version: 2.0.0-next.7 - resolution: "resolve@npm:2.0.0-next.7" + version: 2.0.0-next.5 + resolution: "resolve@npm:2.0.0-next.5" dependencies: - es-errors: "npm:^1.3.0" - is-core-module: "npm:^2.16.2" - node-exports-info: "npm:^1.6.0" - object-keys: "npm:^1.1.1" + is-core-module: "npm:^2.13.0" path-parse: "npm:^1.0.7" supports-preserve-symlinks-flag: "npm:^1.0.0" bin: resolve: bin/resolve - checksum: 10c0/8c6fa17ccdb826a3a52387ed8c42bf705dbc19d5494da52a86661b124b5b88fad5d8edbbb4434a1b563ecf7768368b7da9fb9489e20f36e02f7551a4ea87d707 + checksum: 10c0/a6c33555e3482ea2ec4c6e3d3bf0d78128abf69dca99ae468e64f1e30acaa318fd267fb66c8836b04d558d3e2d6ed875fe388067e7d8e0de647d3c21af21c43a languageName: node linkType: hard -"resolve@patch:resolve@npm%3A^1.10.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.17.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.11#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.8#optional!builtin<compat/resolve>": - version: 1.22.13 - resolution: "resolve@patch:resolve@npm%3A1.22.13#optional!builtin<compat/resolve>::version=1.22.13&hash=c3c19d" +"resolve@patch:resolve@npm%3A^1.10.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin<compat/resolve>": + version: 1.22.1 + resolution: "resolve@patch:resolve@npm%3A1.22.1#optional!builtin<compat/resolve>::version=1.22.1&hash=c3c19d" dependencies: - es-errors: "npm:^1.3.0" - is-core-module: "npm:^2.17.0" + is-core-module: "npm:^2.9.0" + path-parse: "npm:^1.0.7" + supports-preserve-symlinks-flag: "npm:^1.0.0" + bin: + resolve: bin/resolve + checksum: 10c0/0d8ccceba5537769c42aa75e4aa75ae854aac866a11d7e9ffdb1663f0158ee646a0d48fc2818ed5e7fb364d64220a1fb9092a160e11e00cbdd5fbab39a13092c + languageName: node + linkType: hard + +"resolve@patch:resolve@npm%3A^1.14.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.4#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.8#optional!builtin<compat/resolve>": + version: 1.22.8 + resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d" + dependencies: + is-core-module: "npm:^2.13.0" + path-parse: "npm:^1.0.7" + supports-preserve-symlinks-flag: "npm:^1.0.0" + bin: + resolve: bin/resolve + checksum: 10c0/0446f024439cd2e50c6c8fa8ba77eaa8370b4180f401a96abf3d1ebc770ac51c1955e12764cde449fde3fff480a61f84388e3505ecdbab778f4bef5f8212c729 + languageName: node + linkType: hard + +"resolve@patch:resolve@npm%3A^1.17.0#optional!builtin<compat/resolve>": + version: 1.22.11 + resolution: "resolve@patch:resolve@npm%3A1.22.11#optional!builtin<compat/resolve>::version=1.22.11&hash=c3c19d" + dependencies: + is-core-module: "npm:^2.16.1" path-parse: "npm:^1.0.7" supports-preserve-symlinks-flag: "npm:^1.0.0" bin: resolve: bin/resolve - checksum: 10c0/6f10a5245bc8203b5c4d42528c2e221d32b6d3d9f07bb6c264205459ef7dae8318783f0f06a0add8b5e23a9101fdbd2e56267324bf3cb151578e91cf2e00febb + checksum: 10c0/ee5b182f2e37cb1165465e58c6abc797fec0a80b5ba3231607beb4677db0c9291ac010c47cf092b6daa2b7f518d69a0e21888e7e2b633f68d501a874212a8c63 languageName: node linkType: hard "resolve@patch:resolve@npm%3A^2.0.0-next.5#optional!builtin<compat/resolve>": - version: 2.0.0-next.7 - resolution: "resolve@patch:resolve@npm%3A2.0.0-next.7#optional!builtin<compat/resolve>::version=2.0.0-next.7&hash=c3c19d" + version: 2.0.0-next.5 + resolution: "resolve@patch:resolve@npm%3A2.0.0-next.5#optional!builtin<compat/resolve>::version=2.0.0-next.5&hash=c3c19d" dependencies: - es-errors: "npm:^1.3.0" - is-core-module: "npm:^2.16.2" - node-exports-info: "npm:^1.6.0" - object-keys: "npm:^1.1.1" + is-core-module: "npm:^2.13.0" path-parse: "npm:^1.0.7" supports-preserve-symlinks-flag: "npm:^1.0.0" bin: resolve: bin/resolve - checksum: 10c0/6bb6f1d8a1789f7a5b4e35d950e76bc0ba632ff7d51fe86b6f34fb5f41e1ce0f7b884ec166828cfc0728ddffeaee49527711d752d12398297f90c51acd22195e + checksum: 10c0/78ad6edb8309a2bfb720c2c1898f7907a37f858866ce11a5974643af1203a6a6e05b2fa9c53d8064a673a447b83d42569260c306d43628bff5bb101969708355 languageName: node linkType: hard @@ -27185,6 +27337,13 @@ __metadata: languageName: node linkType: hard +"retry@npm:^0.12.0": + version: 0.12.0 + resolution: "retry@npm:0.12.0" + checksum: 10c0/59933e8501727ba13ad73ef4a04d5280b3717fd650408460c987392efe9d7be2040778ed8ebe933c5cbd63da3dcc37919c141ef8af0a54a6e4fca5a2af177bfe + languageName: node + linkType: hard + "reusify@npm:^1.0.4": version: 1.0.4 resolution: "reusify@npm:1.0.4" @@ -27221,6 +27380,17 @@ __metadata: languageName: node linkType: hard +"rimraf@npm:^5.0.1": + version: 5.0.10 + resolution: "rimraf@npm:5.0.10" + dependencies: + glob: "npm:^10.3.7" + bin: + rimraf: dist/esm/bin.mjs + checksum: 10c0/7da4fd0e15118ee05b918359462cfa1e7fe4b1228c7765195a45b55576e8c15b95db513b8466ec89129666f4af45ad978a3057a02139afba1a63512a2d9644cc + languageName: node + linkType: hard + "ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": version: 2.0.2 resolution: "ripemd160@npm:2.0.2" @@ -27354,6 +27524,15 @@ __metadata: languageName: node linkType: hard +"rrdom@npm:^2.2.0": + version: 2.2.0 + resolution: "rrdom@npm:2.2.0" + dependencies: + rrweb-snapshot: "npm:^2.2.0" + checksum: 10c0/8b8ba98f06c2c82d16a25da31cc15a51c7111f64e8eb27a664ae85f3f46581549321a3ffc0d4cfb66c381414869b30db23963a2e6d228ed107c53e64791be240 + languageName: node + linkType: hard + "rrweb-cssom@npm:^0.8.0": version: 0.8.0 resolution: "rrweb-cssom@npm:0.8.0" @@ -27361,13 +27540,6 @@ __metadata: languageName: node linkType: hard -"rrweb-snapshot@npm:^1.1.14": - version: 1.1.14 - resolution: "rrweb-snapshot@npm:1.1.14" - checksum: 10c0/1b4bbd801ec7bb68a720dd6e6112f49184e34f017f4516509506b25b04ff820922770f386e4945fcfeab4a35de68c6f278c14acd61bf48daf8654dc0de00dc85 - languageName: node - linkType: hard - "rrweb-snapshot@npm:^2.1.1": version: 2.1.1 resolution: "rrweb-snapshot@npm:2.1.1" @@ -27377,17 +27549,12 @@ __metadata: languageName: node linkType: hard -"rrweb@npm:1.1.3": - version: 1.1.3 - resolution: "rrweb@npm:1.1.3" +"rrweb-snapshot@npm:^2.2.0": + version: 2.2.0 + resolution: "rrweb-snapshot@npm:2.2.0" dependencies: - "@types/css-font-loading-module": "npm:0.0.7" - "@xstate/fsm": "npm:^1.4.0" - base64-arraybuffer: "npm:^1.0.1" - fflate: "npm:^0.4.4" - mitt: "npm:^1.1.3" - rrweb-snapshot: "npm:^1.1.14" - checksum: 10c0/fc4555a29d59f9800b545d2a14e8903c8e5928a62aa7d66f39310490219970dd6ab0e5205c0eb5fef8248c17d19c23358c03a25ce1c094c7b5d42d813e3cf2b8 + postcss: "npm:^8.4.38" + checksum: 10c0/ee8b8d8184a53ac6b17e56c89536817665bdc9a10e950bec905b9a4143e81880f1fc65ee03e72b025923afe5fcac587a9c202243907f8526bd9b4d39d673f558 languageName: node linkType: hard @@ -27407,6 +27574,22 @@ __metadata: languageName: node linkType: hard +"rrweb@npm:^2.2.0": + version: 2.2.0 + resolution: "rrweb@npm:2.2.0" + dependencies: + "@rrweb/types": "npm:^2.2.0" + "@rrweb/utils": "npm:^2.2.0" + "@types/css-font-loading-module": "npm:0.0.7" + "@xstate/fsm": "npm:^1.4.0" + base64-arraybuffer: "npm:^1.0.1" + mitt: "npm:^3.0.0" + rrdom: "npm:^2.2.0" + rrweb-snapshot: "npm:^2.2.0" + checksum: 10c0/d6517d5085390b3eb2a4557fc4353e8417ef438f35a71a5f4065f5f1a8f418bcd090d342586e6f55aa606f86c9f51ad0ee3d648018dabcc445f3622d90e6d10b + languageName: node + linkType: hard + "run-applescript@npm:7.0.0": version: 7.0.0 resolution: "run-applescript@npm:7.0.0" @@ -27576,13 +27759,6 @@ __metadata: languageName: node linkType: hard -"sax@npm:^1.2.4": - version: 1.6.1 - resolution: "sax@npm:1.6.1" - checksum: 10c0/c91a71043d60da50fdf1e2cee936fc7ad4c9376afb8d1022aef5655f279433640859ec06b3b49abfcbe578fc7da2828cc1661e45aaedf835f5393496193437fa - languageName: node - linkType: hard - "saxes@npm:^6.0.0": version: 6.0.0 resolution: "saxes@npm:6.0.0" @@ -27674,7 +27850,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.5, semver@npm:^7.3.8, semver@npm:^7.5.2": +"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": version: 7.5.2 resolution: "semver@npm:7.5.2" dependencies: @@ -27685,7 +27861,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.6.0, semver@npm:^7.6.2": +"semver@npm:^7.6.0": version: 7.6.2 resolution: "semver@npm:7.6.2" bin: @@ -27760,6 +27936,15 @@ __metadata: languageName: node linkType: hard +"serialize-javascript@npm:^6.0.2": + version: 6.0.2 + resolution: "serialize-javascript@npm:6.0.2" + dependencies: + randombytes: "npm:^2.1.0" + checksum: 10c0/2dd09ef4b65a1289ba24a788b1423a035581bef60817bea1f01eda8e3bda623f86357665fe7ac1b50f6d4f583f97db9615b3f07b2a2e8cbcb75033965f771dd2 + languageName: node + linkType: hard + "serve-handler@npm:6.1.7": version: 6.1.7 resolution: "serve-handler@npm:6.1.7" @@ -28008,13 +28193,6 @@ __metadata: languageName: node linkType: hard -"shimmer@npm:^1.2.1": - version: 1.2.1 - resolution: "shimmer@npm:1.2.1" - checksum: 10c0/ae8b27c389db2a00acfc8da90240f11577685a8f3e40008f826a3bea8b4f3b3ecd305c26be024b4a0fd3b123d132c1569d6e238097960a9a543b6c60760fb46a - languageName: node - linkType: hard - "side-channel-list@npm:^1.0.0": version: 1.0.0 resolution: "side-channel-list@npm:1.0.0" @@ -28221,19 +28399,30 @@ __metadata: linkType: hard "smol-toml@npm:^1.6.1": - version: 1.9.1 - resolution: "smol-toml@npm:1.9.1" - checksum: 10c0/8acccf7bbc063f29405f58f5014ab39bf4eb9d7f0e000e5e3f140f7d4d6ead5696681a7c15260d1f2910213012c0af43b31a05bf94f704b0bdf39989fba08c02 + version: 1.7.0 + resolution: "smol-toml@npm:1.7.0" + checksum: 10c0/8eef246b9b96f278a181f6dd2a90c754304cb4cf92ccdfe1d2f714fb980fb3f539ba00283609e8fd2fbcf7c0d48a4ae76b36bc0de556ed286b2c865827a778e8 + languageName: node + linkType: hard + +"socks-proxy-agent@npm:^8.0.3": + version: 8.0.4 + resolution: "socks-proxy-agent@npm:8.0.4" + dependencies: + agent-base: "npm:^7.1.1" + debug: "npm:^4.3.4" + socks: "npm:^2.8.3" + checksum: 10c0/345593bb21b95b0508e63e703c84da11549f0a2657d6b4e3ee3612c312cb3a907eac10e53b23ede3557c6601d63252103494caa306b66560f43af7b98f53957a languageName: node linkType: hard -"socks@npm:^2.7.1": - version: 2.8.10 - resolution: "socks@npm:2.8.10" +"socks@npm:^2.7.1, socks@npm:^2.8.3": + version: 2.8.3 + resolution: "socks@npm:2.8.3" dependencies: - ip-address: "npm:^10.1.1" + ip-address: "npm:^9.0.5" smart-buffer: "npm:^4.2.0" - checksum: 10c0/9ac7f4329ed064585975206d9582119a1f168b249dd6119a939f839e0ea7a590d4fdccff9a4112f13b478177207959096f70224f021eaeb3ce69bc8129f80ef4 + checksum: 10c0/d54a52bf9325165770b674a67241143a3d8b4e4c8884560c4e0e078aace2a728dffc7f70150660f51b85797c4e1a3b82f9b7aa25e0a0ceae1a243365da5c51a7 languageName: node linkType: hard @@ -28384,6 +28573,13 @@ __metadata: languageName: node linkType: hard +"sprintf-js@npm:^1.1.3": + version: 1.1.3 + resolution: "sprintf-js@npm:1.1.3" + checksum: 10c0/09270dc4f30d479e666aee820eacd9e464215cdff53848b443964202bf4051490538e5dd1b42e1a65cf7296916ca17640aebf63dae9812749c7542ee5f288dec + languageName: node + linkType: hard + "sprintf-js@npm:~1.0.2": version: 1.0.3 resolution: "sprintf-js@npm:1.0.3" @@ -28410,6 +28606,15 @@ __metadata: languageName: node linkType: hard +"ssri@npm:^10.0.0": + version: 10.0.6 + resolution: "ssri@npm:10.0.6" + dependencies: + minipass: "npm:^7.0.3" + checksum: 10c0/e5a1e23a4057a86a97971465418f22ea89bd439ac36ade88812dd920e4e61873e8abd6a9b72a03a67ef50faa00a2daf1ab745c5a15b46d03e0544a0296354227 + languageName: node + linkType: hard + "stack-utils@npm:^2.0.3, stack-utils@npm:^2.0.6": version: 2.0.6 resolution: "stack-utils@npm:2.0.6" @@ -28527,15 +28732,6 @@ __metadata: languageName: node linkType: hard -"stream-parser@npm:~0.3.1": - version: 0.3.1 - resolution: "stream-parser@npm:0.3.1" - dependencies: - debug: "npm:2" - checksum: 10c0/585508801423bd6c53f6dda9d78e4b743a08ab72e8e2680431fa855ef950e59c849ec2838f2a00c59af655ff8463e90f660f9169a816e63a3ca159cf713bae5c - languageName: node - linkType: hard - "stream-transform@npm:^2.1.3": version: 2.1.3 resolution: "stream-transform@npm:2.1.3" @@ -29241,12 +29437,12 @@ __metadata: languageName: node linkType: hard -"systeminformation@npm:^5.33.16": - version: 5.33.16 - resolution: "systeminformation@npm:5.33.16" +"systeminformation@npm:^5.33.19": + version: 5.33.19 + resolution: "systeminformation@npm:5.33.19" bin: systeminformation: lib/cli.js - checksum: 10c0/b63a2d7eafed679d7541de3dbcad4b0fd4384774c7c506a2847f62b5eb38ef55f81b55fce9d29a0308e0922c25adbcbc120129009819911aeb0b2985b4ab1335 + checksum: 10c0/cb95464c1ab9b5deabd0141d0ae22db29ced520f321c2b5cbcdea84eff5d0cf65fbb521a9945f8dc98e560bc9fc57cbe06e68dd2d34c53a4c3a59eb61d0535b3 conditions: (os=darwin | os=linux | os=win32 | os=freebsd | os=openbsd | os=netbsd | os=sunos | os=android) languageName: node linkType: hard @@ -29305,16 +29501,17 @@ __metadata: languageName: node linkType: hard -"tar@npm:^7.5.7": - version: 7.5.22 - resolution: "tar@npm:7.5.22" +"tar@npm:^6.1.11, tar@npm:^6.2.1": + version: 6.2.1 + resolution: "tar@npm:6.2.1" dependencies: - "@isaacs/fs-minipass": "npm:^4.0.0" - chownr: "npm:^3.0.0" - minipass: "npm:^7.1.2" - minizlib: "npm:^3.1.0" - yallist: "npm:^5.0.0" - checksum: 10c0/1311f6be85a8157ac4c9147bae43e13923d2a1aae15e4aa1bd5239e4e03d2cf53cfe103dde7f35832fbb4c938b042856bc8e9a0afd29abd05e2d1608788c4fea + chownr: "npm:^2.0.0" + fs-minipass: "npm:^2.0.0" + minipass: "npm:^5.0.0" + minizlib: "npm:^2.1.1" + mkdirp: "npm:^1.0.3" + yallist: "npm:^4.0.0" + checksum: 10c0/a5eca3eb50bc11552d453488344e6507156b9193efd7635e98e867fab275d527af53d8866e2370cd09dfe74378a18111622ace35af6a608e5223a7d27fe99537 languageName: node linkType: hard @@ -29341,42 +29538,47 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.3.16, terser-webpack-plugin@npm:^5.3.17": - version: 5.6.1 - resolution: "terser-webpack-plugin@npm:5.6.1" +"terser-webpack-plugin@npm:^5.3.14": + version: 5.3.14 + resolution: "terser-webpack-plugin@npm:5.3.14" dependencies: "@jridgewell/trace-mapping": "npm:^0.3.25" jest-worker: "npm:^27.4.5" schema-utils: "npm:^4.3.0" + serialize-javascript: "npm:^6.0.2" terser: "npm:^5.31.1" peerDependencies: webpack: ^5.1.0 peerDependenciesMeta: - "@minify-html/node": - optional: true "@swc/core": optional: true - "@swc/css": - optional: true - "@swc/html": - optional: true - clean-css: - optional: true - cssnano: - optional: true - csso: - optional: true esbuild: optional: true - html-minifier-terser: + uglify-js: optional: true - lightningcss: + checksum: 10c0/9b060947241af43bd6fd728456f60e646186aef492163672a35ad49be6fbc7f63b54a7356c3f6ff40a8f83f00a977edc26f044b8e106cc611c053c8c0eaf8569 + languageName: node + linkType: hard + +"terser-webpack-plugin@npm:^5.3.16": + version: 5.3.16 + resolution: "terser-webpack-plugin@npm:5.3.16" + dependencies: + "@jridgewell/trace-mapping": "npm:^0.3.25" + jest-worker: "npm:^27.4.5" + schema-utils: "npm:^4.3.0" + serialize-javascript: "npm:^6.0.2" + terser: "npm:^5.31.1" + peerDependencies: + webpack: ^5.1.0 + peerDependenciesMeta: + "@swc/core": optional: true - postcss: + esbuild: optional: true uglify-js: optional: true - checksum: 10c0/841674dab9b58ee242a64a548f2797f83eca3debc010afb2aa1a4be7149e7195a6a546a746324803ba05f72d0c9dc4357e34f17e4b6d6c054bd49a0913c413b9 + checksum: 10c0/39e37c5b3015c1a5354a3633f77235677bfa06eac2608ce26d258b1d1a74070a99910319a6f2f2c437eb61dc321f66434febe01d78e73fa96b4d4393b813f4cf languageName: node linkType: hard @@ -29493,7 +29695,7 @@ __metadata: languageName: node linkType: hard -"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.17": +"tinyglobby@npm:^0.2.17": version: 0.2.17 resolution: "tinyglobby@npm:0.2.17" dependencies: @@ -29580,6 +29782,13 @@ __metadata: languageName: node linkType: hard +"to-fast-properties@npm:^2.0.0": + version: 2.0.0 + resolution: "to-fast-properties@npm:2.0.0" + checksum: 10c0/b214d21dbfb4bce3452b6244b336806ffea9c05297148d32ebb428d5c43ce7545bdfc65a1ceb58c9ef4376a65c0cb2854d645f33961658b3e3b4f84910ddcdd7 + languageName: node + linkType: hard + "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1" @@ -29689,13 +29898,6 @@ __metadata: languageName: node linkType: hard -"triple-beam@npm:^1.3.0": - version: 1.3.0 - resolution: "triple-beam@npm:1.3.0" - checksum: 10c0/a6da96495f25b6c04b3629df5161c7eb84760927943f16665fd8dcd3a643daadf73d69eee78306b4b68d606937f22f8703afe763bc8d3723632ffb1f3a798493 - languageName: node - linkType: hard - "trough@npm:^2.0.0": version: 2.1.0 resolution: "trough@npm:2.1.0" @@ -29902,13 +30104,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.5.3": - version: 2.6.0 - resolution: "tslib@npm:2.6.0" - checksum: 10c0/8d18020a8b9e70ecc529a744c883c095f177805efdbc9786bd50bd82a46c17547923133c5444fbcaf1f7f1c44e0e29c89f73ecf6d8fd1039668024a073a81dc6 - languageName: node - linkType: hard - "tslib@npm:^2.6.2": version: 2.7.0 resolution: "tslib@npm:2.7.0" @@ -30020,13 +30215,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:4.20.1": - version: 4.20.1 - resolution: "type-fest@npm:4.20.1" - checksum: 10c0/c31da16fe170a74c5b7e102e70e764ba8ec6ade128e782a56f842aefa07307df5a6353e6b5601d3b30ff2d856d8b955f89813df639e4758fedcf8e426b2d854e - languageName: node - linkType: hard - "type-fest@npm:^0.13.1": version: 0.13.1 resolution: "type-fest@npm:0.13.1" @@ -30312,13 +30500,6 @@ __metadata: languageName: node linkType: hard -"undici@npm:^8.4.1": - version: 8.12.3 - resolution: "undici@npm:8.12.3" - checksum: 10c0/714919e62b4160eea195fb35c7f5c4907235741e47bfde8a014ac58f6d24df13434e23400d7f48e2c455fd2b259d27f07fce514f04a5b4e99936ba62cbc4bb71 - languageName: node - linkType: hard - "unicode-canonical-property-names-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0" @@ -30336,10 +30517,10 @@ __metadata: languageName: node linkType: hard -"unicode-match-property-value-ecmascript@npm:^2.2.1": - version: 2.2.1 - resolution: "unicode-match-property-value-ecmascript@npm:2.2.1" - checksum: 10c0/93acd1ad9496b600e5379d1aaca154cf551c5d6d4a0aefaf0984fc2e6288e99220adbeb82c935cde461457fb6af0264a1774b8dfd4d9a9e31548df3352a4194d +"unicode-match-property-value-ecmascript@npm:^2.1.0": + version: 2.1.0 + resolution: "unicode-match-property-value-ecmascript@npm:2.1.0" + checksum: 10c0/f5b9499b9e0ffdc6027b744d528f17ec27dd7c15da03254ed06851feec47e0531f20d410910c8a49af4a6a190f4978413794c8d75ce112950b56d583b5d5c7f2 languageName: node linkType: hard @@ -30372,6 +30553,24 @@ __metadata: languageName: node linkType: hard +"unique-filename@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-filename@npm:3.0.0" + dependencies: + unique-slug: "npm:^4.0.0" + checksum: 10c0/6363e40b2fa758eb5ec5e21b3c7fb83e5da8dcfbd866cc0c199d5534c42f03b9ea9ab069769cc388e1d7ab93b4eeef28ef506ab5f18d910ef29617715101884f + languageName: node + linkType: hard + +"unique-slug@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-slug@npm:4.0.0" + dependencies: + imurmurhash: "npm:^0.1.4" + checksum: 10c0/cb811d9d54eb5821b81b18205750be84cb015c20a4a44280794e915f5a0a70223ce39066781a354e872df3572e8155c228f43ff0cce94c7cbf4da2cc7cbdd635 + languageName: node + linkType: hard + "unist-util-is@npm:^6.0.0": version: 6.0.0 resolution: "unist-util-is@npm:6.0.0" @@ -30520,9 +30719,23 @@ __metadata: languageName: node linkType: hard -"update-browserslist-db@npm:^1.3.4": - version: 1.3.4 - resolution: "update-browserslist-db@npm:1.3.4" +"update-browserslist-db@npm:^1.1.4": + version: 1.1.4 + resolution: "update-browserslist-db@npm:1.1.4" + dependencies: + escalade: "npm:^3.2.0" + picocolors: "npm:^1.1.1" + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 10c0/db0c9aaecf1258a6acda5e937fc27a7996ccca7a7580a1b4aa8bba6a9b0e283e5e65c49ebbd74ec29288ef083f1b88d4da13e3d4d326c1e5fc55bf72d7390702 + languageName: node + linkType: hard + +"update-browserslist-db@npm:^1.2.0": + version: 1.2.3 + resolution: "update-browserslist-db@npm:1.2.3" dependencies: escalade: "npm:^3.2.0" picocolors: "npm:^1.1.1" @@ -30530,7 +30743,7 @@ __metadata: browserslist: ">= 4.21.0" bin: update-browserslist-db: cli.js - checksum: 10c0/5c0769472715b57371208c3146cc07a4f0917c1d18cc34f60325bc4234f4a28f332e50b99f675999ff311315231ff19beb22a815dfe04ccc1e798e1d389514d7 + checksum: 10c0/13a00355ea822388f68af57410ce3255941d5fb9b7c49342c4709a07c9f230bbef7f7499ae0ca7e0de532e79a82cc0c4edbd125f1a323a1845bf914efddf8bec languageName: node linkType: hard @@ -30554,13 +30767,20 @@ __metadata: languageName: node linkType: hard -"uplot@npm:^1.6.31": +"uplot@npm:1.6.32": version: 1.6.32 resolution: "uplot@npm:1.6.32" checksum: 10c0/4d9cdd5f53371656cfc178ea4ae0d8c9bdbe4c98c99df847926d7e5f5a5bcb8043561219da2979fee7616aabe3619d80fee093befdfe39aae65e6621284c39b1 languageName: node linkType: hard +"uplot@patch:uplot@npm%3A1.6.32#~/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch": + version: 1.6.32 + resolution: "uplot@patch:uplot@npm%3A1.6.32#~/.yarn/patches/uplot-npm-1.6.32-350d2da00d.patch::version=1.6.32&hash=d25b41" + checksum: 10c0/8eac8ee3e294a2834f6295eea230bd6dba6c7031a0d67f79f02eacec15ceaada5e82accd9ef1b6462326ec35e9475779f072b9be7625550a3e2f1d8fc70d2470 + languageName: node + linkType: hard + "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -30842,10 +31062,10 @@ __metadata: languageName: node linkType: hard -"web-vitals@npm:^3.3.2": - version: 3.3.2 - resolution: "web-vitals@npm:3.3.2" - checksum: 10c0/fabfc58eedcee59741958e09bcb365facbb8b229521762e374fd9ab7c64e29f80ddf3a70e7959388f455936c3aca416c24b8dd938de5e56d5fcb2691aea5c4c8 +"web-vitals@npm:^6.2.3": + version: 6.2.3 + resolution: "web-vitals@npm:6.2.3" + checksum: 10c0/d7db74ab8503f069db0f697b1b1318670062616a1b46464abde98dc599ffbf71c0080f39bfe739ed122da12f6980fe882d471e86a78fedad61a4bfa1abffa32c languageName: node linkType: hard @@ -31180,17 +31400,6 @@ __metadata: languageName: node linkType: hard -"which@npm:^7.0.0": - version: 7.0.0 - resolution: "which@npm:7.0.0" - dependencies: - isexe: "npm:^4.0.0" - bin: - node-which: bin/which.js - checksum: 10c0/ca0b54f198f78bbc4b7c02e34bda8d335cb352e0adb4cbca1c37b1a957af3a879a82c4c27ca6525bc942f548d8b64f816ef6528360af9f3de55ffb9b979b620d - languageName: node - linkType: hard - "widest-line@npm:^4.0.1": version: 4.0.1 resolution: "widest-line@npm:4.0.1" @@ -31209,17 +31418,6 @@ __metadata: languageName: node linkType: hard -"winston-transport@npm:^4.7.0": - version: 4.7.0 - resolution: "winston-transport@npm:4.7.0" - dependencies: - logform: "npm:^2.3.2" - readable-stream: "npm:^3.6.0" - triple-beam: "npm:^1.3.0" - checksum: 10c0/cd16f3d0ab56697f93c4899e0eb5f89690f291bb6cf309194819789326a7c7ed943ef00f0b2fab513b114d371314368bde1a7ae6252ad1516181a79f90199cd2 - languageName: node - linkType: hard - "wordwrap@npm:^1.0.0": version: 1.0.0 resolution: "wordwrap@npm:1.0.0" @@ -31398,13 +31596,6 @@ __metadata: languageName: node linkType: hard -"yallist@npm:^5.0.0": - version: 5.0.0 - resolution: "yallist@npm:5.0.0" - checksum: 10c0/a499c81ce6d4a1d260d4ea0f6d49ab4da09681e32c3f0472dee16667ed69d01dae63a3b81745a24bd78476ec4fcf856114cb4896ace738e01da34b2c42235416 - languageName: node - linkType: hard - "yaml@npm:2.0.0-1": version: 2.0.0-1 resolution: "yaml@npm:2.0.0-1" @@ -31430,6 +31621,15 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.8.3": + version: 2.9.1 + resolution: "yaml@npm:2.9.1" + bin: + yaml: bin.mjs + checksum: 10c0/9d06676ef02b89559a8b10a71882bd2cdae81e8393dc8dbc871615c3259475d9609ad973d19cb3c9e71e72d6206e3d1e7aa241c7e55f3d16fd2e77db305827d6 + languageName: node + linkType: hard + "yargs-parser@npm:21.1.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1"