Compare commits

...

13 Commits

Author SHA1 Message Date
Gaurav Tewari
d3b573be22 feat(frontend): select unit, storybook and e2e tests from the diff
E2E specs import no app code, so pages map to specs through the router's URLs.
2026-12-03 14:40:57 +05:30
Abhi kumar
86d9862462 fix(dashboard): drilldown and variable seeding fixes found while embedding (#13764)
#### Description

- A panel whose builder queries are all disabled draws only formulas, so
it offers no drilldown.
- Drilldown offers "Create variable" only when the viewer can edit the
dashboard.
- A custom variable keeps link-seeded values its list doesn't offer, as
typed values, and an auto-fill computed before the seed landed no longer
overwrites it a frame later.

#### Additional Information

Split out of #13568, which now stacks on this.
2026-12-03 05:23:11 +00:00
Gaurav Tewari
c2c0f0a766 fix(query-builder): catch a failed key suggestions request (#13846)
#### Description

- The query search loads key suggestions 300 ms after it mounts, with no
`catch`, so a failed keys request became an unhandled rejection. The
value suggestions already catch theirs.
- A failed key lookup now goes to Sentry and leaves the current
suggestions in place.
- This made `Pages/AI Observability/Explorer › QuickFiltersSettings`
flaky in Storybook CI. The `Failed` story answers every request with a
500. On a fast runner the rejection lands while `Failed` is still
showing, and it has no play to fail. On a slow one it lands during the
next story's play. Same failure on #13824, a backend-only PR: [storybook
(1)](https://github.com/SigNoz/signoz/actions/runs/46659077018/job/142683375286?pr=13824).

#### Issues closed by this PR

Closes SigNoz/nerve-pod#709

#### Screenshots / Screen Recordings

#### Additional Information

Co-authored-by: Gaurav Tewari <tewarig@users.noreply.github.com>
2026-12-03 05:15:56 +00:00
Nityananda Gohain
455e667378 feat(trace-details): implement the span list routes (#13667)
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
- Implements the four list routes: `/spans`, `/spans/{spanID}/children`,
`/descendants` and `/ancestors`.
- They share one path: the route decides which spans are listed, `view`
keeps the ones of its kind in its own order, then `offset` and `limit`
cut the page. It is the picker highlights use, so a highlights list
equals the first page of the same view.
- Two queries, the trace bounds and the tree. `selectFields` adds a read
by ID of the page's spans, at most 1,000; a name without a context is
looked up in both attributes and resource attributes, and a field no
returned span has is reported in `warnings`.
- `ai_usage` ranks by cost, or by tokens when none of the listed spans
has a cost.
  - `query` returns "not implemented" until the next PR.

  #### Additional Information

- Measured locally: 20 ms on a small trace, 45 ms on 30,000 spans, 0.43
s on 1 million spans.
- Measured locally: 20 ms on a small trace, 45 ms on 30,000 spans, 0.43
s on 1 million spans.
  Refs SigNoz/nerve-pod#651
2026-12-03 05:10:08 +00:00
Nityananda Gohain
e1346d7e9c feat(trace-details): open a span in the trace inspect endpoint (#13664)
#### Description

- Implements `GET /api/v1/traces/{traceID}/spans/{spanID}`. The four
list routes still return "not implemented".
- The response is the span itself: the stored fields, every attribute,
every resource attribute and every event. Values are returned whole.
- It makes two queries: the trace bounds, and the span's full row
through the existing `GetTraceSpansByIDs`. It does not load the trace's
tree, so its cost does not grow with the size of the trace.
- It returns no `treeStats` and no other span. A caller gets the tree
stats with the span in any span list, and the spans around it from the
children, descendants and ancestors routes.
- A span ID that is not in the trace returns 404 with code
`trace_span_not_found`. A span whose parent was never received keeps the
parent ID it was sent with.

  #### Additional Information

- There is no unit test for this route.
`tests/integration/tests/tracedetail/06_span.py` covers it: every field
of a span in both attribute layouts, a long value returned whole, a span
with no attributes or events, a root, a span with a missing parent, and
both 404s.

  Refs SigNoz/nerve-pod#651
2026-12-03 04:27:25 +00:00
Nityananda Gohain
fe0f68589a feat(trace-details): implement the trace highlights route (#13657)
- Implements `GET /api/v1/traces/{traceID}/highlights`.
- One query reads a small row for every span into an in-memory tree
(`TraceSkeleton`). The lists, the per-service totals and `treeStats` all
come from it; there is no second read.
- A new tree and not the waterfall's: on 1 million spans it holds about
125 MB against 1,073 MB.
- A span's references are read only when they hold more than the one to
its parent; the rest are rebuilt from the two ids.
  - gen_ai usage is read from the JSON attributes column only.
- `links` is about 97 bytes on every span and almost always holds only
the reference to the parent. The query compares it with that expected
text and sends it only when it differs (a span link, or a root); the
rest are rebuilt from the trace id and the parent id.

  #### Additional Information

- Measured locally: 25 ms on a small trace, 45 ms on 30,000 spans, 0.5 s
on 1 million spans. The tree is not cached.

  Refs SigNoz/nerve-pod#651
2026-12-03 03:56:54 +00:00
Manika Malhotra
f927b80f64 chore(frontend): remove dead code from storybook, roles and service accounts (#13800)
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
#### Description

- Removes dead code owned by @H4ad: storybook, roles, authz and service
accounts. Part of #13738, split by code owner into #13797–#13802 so each
needs one reviewer; this one merges on its own. No change in behavior or
visuals is intended.
- 24 files, +14 / −500.
- The `MessageTip` state in the feedback foundation, and the v3
autocomplete storybook handlers; nothing calls those endpoints.
  - Radix leftovers in the storybook README and comments.
- Exported code nothing imports, and CSS rules for classes nothing
renders.

#### Additional Information

**Verification**

| Check | Result |
|---|---|
| `tsgo`, `oxlint`, `stylelint` | Run on every commit by the pre-commit
hooks; 0 errors on the head |
| `vite build` | Passes |
| jest, every test that imports a changed file | 848 test files, 7,337
tests, 0 failed |
| **All six PRs merged on `main`:** | |
| full jest, 10 shards | 1,171 test files, 10,950 tests, 0 failed, 15
skipped |
| Storybook interaction runner | 137 story files, 1,428 tests pass |
| Playwright e2e, Chromium, CI settings, one backend built from `main` |
768 passed, 1 failed (it fails on `main` too), 6 passed on retry. The 8
spec files behind every failure in either run, rerun back to back on an
idle machine: 44 of 44 pass on this build, and on `main` (3 there on
retry) |
| CSS a direct visit loads, per lazily loaded page (384) | Same global
rules as `main` wherever one can apply |

**Found while auditing, not changed here**

- `PermissionDeniedCallout` reads `styles.permissionCode`, which its
module never defined.
2026-12-02 15:52:17 +00:00
Aditya Singh
7a480086c7 fix(frontend): fix span details, quick filter and drawer header issues from the release sanity check (#13815)
#### Description

- Opening the Events tab in span details made the panel jump. The search
box used `autoFocus`, and the browser scrolled the panel to it. The box
now takes focus without a scroll.
- In log details and the span drawer, the "…" menu and "View full trace"
touched the ↑/↓ buttons. A shared `HeaderActions` wrapper adds a 4px
gap.
- The span percentile time range list was see-through over the
percentile table. The panel's `backdrop-filter` and shadow caused it, so
this PR removes them.
- In Edit quick filters, a long filter name scrolled the list sideways
and pushed Remove out of view. The name now ends in "…" and shows the
full name on hover.
- A long span event value opened its preview and a tooltip together. The
preview is now a `@signozhq/ui` popover, so one card opens. Expand
closes the card and opens the full value.

#### Issues closed by this PR

Part of https://github.com/SigNoz/events-pod/issues/306

#### Screenshots / Screen Recordings

**Event jump**

Before


https://github.com/user-attachments/assets/a618e7ad-5199-4146-b247-65f1d3d0430e


After



https://github.com/user-attachments/assets/9730adfc-1e3d-498c-b21c-d1c5de819a18



**Quick filter overflow**

Before



https://github.com/user-attachments/assets/238eafa9-0dd3-4cf2-b636-553f162f6b1f



After



https://github.com/user-attachments/assets/ef83e7e9-6091-4d64-879b-f2c05a7cfc90



Before and after screenshots, `main` on the left and this branch on the
right, in dark and light themes:
https://claude.ai/artifact/WXKCu7MuQsTVR24aYSZdUP

| Screen | On `main` | On this branch |
| --- | --- | --- |
| Span percentile time range list | The list is see-through. The
percentile table shows through the options. | The list is solid. |
| Edit quick filters, long filter name | The name runs past the row with
no "…". | The name ends in "…". The grip keeps its size, and Remove
stays in view. |
| Log details header | The "…" menu touches ↑/↓. | A 4px gap separates
them. |
| Span drawer header | "View full trace" touches ↑/↓. | A 4px gap
separates them. |
| Span event value, hover | The antd preview card opens. | The
`@signozhq/ui` preview card opens. |
| Span event value, Expand | The preview card stays on top of the
full-value dialog until the mouse moves. | The preview card closes. |

#### Additional Information

- New stories cover the time range list, long filter names and Expand.
With the fixes reverted, the long name and the span event plays fail.
- The existing log details and span drawer stories already show the
header gap.
- The Events jump does not show in a screenshot, because the screenshot
tool grows every scroller. A unit test covers it.
- Filter names in Edit quick filters are a little smaller now. They use
the same text size as the checkbox list next to them.
2026-12-02 15:36:54 +00:00
Shivam Gupta
a343edecdf chore(alertmanager): mark the v1 notification channel routes deprecated (#13847)
#### Description

- Marks the six `/api/v1/channels*` routes (list, get, create, update,
delete, test) `Deprecated: true` and names the
`/api/v2/notification_channels` replacement in each description.
- These routes are already documented as deprecated ([migration
guide](https://signoz.io/docs/alerts-management/migrate-notification-channel-api-v1-to-v2/)),
and the UI calls only the v2 routes. The spec still said `deprecated:
false`, so the API reference didn't flag them, and people (and Noz) kept
using v1.
- Regenerated `docs/api/openapi.yml` and the frontend client. The client
changes are doc comments and `@deprecated` tags only, and no app code
calls the v1 hooks.
- No behavior change: the routes keep working.

#### Issues closed by this PR

Refs SigNoz/echo-pod#995. The matching docs change is
SigNoz/signoz.io#4601.



🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 15:15:58 +00:00
Vinicius Lourenço
8d728170ce perf(frontend): split vendor chunks per package behind a chunk import map (#13809)
#### Description

After an upgrade, the browser now keeps most of the frontend it already
downloaded. Today almost any code change renames nearly every chunk, so
users fetch the whole app again after each release.

##### Why every chunk changed

Third-party code shared one big chunk with the app code it loads with,
so any app change re-hashed it. And a chunk's file name depends on the
names of the chunks it imports, so one change ripples through every
importer.

##### What changes

Packages over 100 KB in the first load now get their own chunk, and
Vite's chunk import map lets chunks import each other through stable
keys while `index.html` maps each key to the current hashed file. A
small boot guard, inlined into the production build from
`vite-plugins/boot-guard/`, shows "SigNoz failed to load" with a Reload
button if any file of the entry fails to download. The Sentry plugin no
longer bakes the release name into every chunk, since `Sentry.init`
already sets it.

##### Results

I simulated a release by changing one line in `src/index.tsx` and
building again. On main, 4% of the first-load bytes keep their file
name; with this PR, 84%. Across all assets it goes from 42% to 98%. The
first load is the same size (852 KB vs 854 KB gzip) in 19 files instead
of 3. The browser only skips the download once #13724 serves these files
as immutable.

##### Browser support

Import maps need Chrome 89, Firefox 108 and Safari 16.4. Vite 8 already
builds for Chrome 111, Firefox 114 and Safari 16.4 by default, so this
does not raise the minimum browser.

In PostHog, no user is on a browser without import maps. Under 0.01% are
on Chrome 109, below what Vite 8 already requires, or on Safari 16,
which may be older than 16.4: the export only has the major version.

On a browser without import map support, the boot guard shows a message
asking to update the browser instead of a blank page.

Part of #10192

#### Screenshots / Screen Recordings

JS requests on `/home`, main:

![JS requests on /home,
main](https://github.com/user-attachments/assets/5570f072-2c96-434b-a57a-232685e3462c)

JS requests on `/home`, this PR, one entry chunk plus one chunk per
large package:

![JS requests on /home, this
PR](https://github.com/user-attachments/assets/ca9e2f0c-6f3c-4270-9c0d-c3e1375e5004)

What a browser without import map support shows instead of a blank page:

![Your browser is not
supported](https://github.com/user-attachments/assets/e0782d1b-c5e9-4484-8e19-52096a3700a2)

#### Additional Information

#12079 is similar: it also splits vendors per package, without the
import map, so a changed chunk still renames every chunk that imports
it.

`build.chunkImportMap` is still experimental in Vite. Rolldown's own
option of the same name drops the CSS of lazy routes, which is why this
uses Vite's.

`index.html` grows from 2 KB to 25 KB gzip, since it carries the map.
2026-12-02 13:19:51 +00:00
Aditya Singh
bec18c6abf refactor(query-builder): drop the version argument from query range calls (#13777)
#### Description

- After #13757, the query range hooks and `getQueryRangeV5` still take a
`version` argument. Every caller passes v5, so the argument has no
effect.
- This PR removes the argument from the API function, the hooks and the
WidgetCard components, and from every caller.
- It removes WidgetCard's error-text checks. They matched error strings
that only the removed legacy path produced, so they never ran on v5.
- It removes the `isNewQueryV2` prop and the old option list from the
order by filter. Every caller already got the v5 options.

#### Issues closed by this PR

Part of https://github.com/SigNoz/events-pod/issues/161

#### Additional Information

- Part of https://github.com/SigNoz/events-pod/issues/156.
- This PR builds on #13757.
- No screen renders differently, so no story changes.
- It types the `DomainMetrics` test's query range mock, so the test no
longer casts with `as jest.Mock`.
- The Celery task graphs had a hint for missing Flower metrics. It has
not shown since #13644 moved Celery to v5, because it depended on one of
the removed error-text checks.
- I did not test a dashboard panel whose query fails, because staging
has no broken panel. The panel still gets its error message from
`errorDetails`, as before.
2026-12-02 13:19:47 +00:00
Ashwin Bhatkal
f8a5e11dfb fix(sentry): ignore Safari's stale chunk MIME type error (#13843)
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
#### Description

- Sentry now ignores Safari's `'text/html' is not a valid JavaScript
MIME type` error, like the other stale-chunk errors.
- A tab that outlived a deploy asks for an old hashed chunk (here
`AIAssistantModal`), the server answers with `index.html`, and Safari
rejects it with this message. `lazyRetry` already recovers by reloading
once, so the event is noise.
- Chromium and Firefox already report this case with wordings the list
ignores. So does Safari's network-failure wording.
- PagerDuty: https://signoz-1.pagerduty.com/incidents/Q095A4QSMLC0T8
- Sentry: https://signoz-io.sentry.io/issues/7878025086/ (v0.152.0,
Mobile Safari on iOS, dashboard page)

#### Issues closed by this PR

Closes https://github.com/SigNoz/pulse-pod/issues/804
2026-12-02 11:18:45 +00:00
ashu8912
1f6b0e6acc test(e2e): fix alerts flakes after rule FGA (#13823)
#### Description

Fixes two alerts e2e flakes introduced by the rule FGA merges.

- `alerts/views` TC-03 (failing most merge-queue runs): since #13756 a
view link applies its filter after the permission check, later than the
first rows. The spec now waits for the view's query before editing it.
- `alerts/planned-downtime` TC-01: since #13516 picker options are
disabled while their `attach` check runs, and Playwright clicks the
role-less option div anyway. `pickRule` and `antd.pickByName` now click
only enabled options.

Evidence for both is in `docs/flake-notes.md`.
2026-12-02 10:22:08 +00:00
170 changed files with 4084 additions and 934 deletions

View File

@@ -113,10 +113,11 @@ CI runs each play once, with its story's own args. Anyone can flip a control in
Before writing the clicks, list what has to be on screen for the play's target to exist. Then walk every control the story exposes, the page's own as well as the shared ones, and return early for each value that takes something on that list away. These are the cases plays have missed:
- An arg the story sets. The story sets it because the play needs what that value renders, and the panel can flip it. On the `mine` view the dashboards Created-by filter opens with a tag to remove; on the other views it opens empty and there is no × to click. Check the tag is there by parsing the route the view resolves to.
- The controls every story has. `State` on loading or error renders no rows and no filter suggestions. `Access`, `Permissions` and `Revoked` remove rows, row actions and gated buttons, and the `editor` and `viewer` presets grant telemetry reads only, so a page gated on its own resource shows them nothing. `Check state` on loading disables every gated control, and on error an `AuthZButton` stays enabled while an `AuthZGuardContent` set to fail closed hides what it wraps. `License` and `Banner` decide the plan, so a cloud-only form is gone on the others. `Hold tooltips open` shows a label a second time, inside its tooltip.
- The controls every story has. `State` on loading or error renders no rows and no filter suggestions. `Access`, `Permissions` and `Revoked` remove rows, row actions and gated buttons, and the `editor` and `viewer` presets grant telemetry reads only, so a page gated on its own resource shows them nothing. `Check state` on loading disables every gated control, and on error an `AuthZButton` stays enabled while an `AuthZGuardContent` set to fail closed hides what it wraps. `License` and `Banner` decide the plan, so a cloud-only form is gone on the others. `Hold tooltips open` shows a label a second time, inside its tooltip, and fails any check that no tooltip is open.
- A count at 0. The page can swap its whole list for an empty state, and the header, filters and column picker go with it.
- A view, filter or invalid query that leaves no rows, even when the count is above 0.
- A tab without the widget. A filter box that one tab has is not on the next.
- A control that moves the widget out of the canvas. Trace details with `Panel position` on dialog renders span details in a floating panel under `document.body`, so a lookup `within(canvasElement)` never finds its tabs. Return early for that value, or search with `screen`.
- A second list beside the main one, such as saved views. At 0, loading or failed, its actions are gone.
- Text that depends on an arg. A disabled rule offers Enable, not Disable. A write that fails raises a different toast from one that lands, and one left loading raises none. Pick the expected text from the args.
- Rows that move. A view, a sort or pinning changes which row is locked, pinned or legacy, so find the row by what it is, not by its index.

View File

@@ -13065,6 +13065,12 @@ components:
additionalProperties: {}
description: All of them for a span read by ID; the selected ones in a list.
type: object
db_name:
description: Omitted when empty, and in a list unless selected.
type: string
db_operation:
description: Omitted when empty, and in a list unless selected.
type: string
duration_nano:
minimum: 0
type: integer
@@ -13073,8 +13079,26 @@ components:
items:
$ref: '#/components/schemas/SpantypesEvent'
type: array
external_http_method:
description: Method of an outgoing HTTP call. Omitted when empty, and in
a list unless selected.
type: string
external_http_url:
description: Host of an outgoing HTTP call. Omitted when empty, and in a
list unless selected.
type: string
has_error:
type: boolean
http_host:
description: Host or server address. Omitted when empty, and in a list unless
selected.
type: string
http_method:
description: Omitted when empty, and in a list unless selected.
type: string
http_url:
description: Omitted when empty, and in a list unless selected.
type: string
kind_string:
description: For example Server, Client or Internal.
type: string
@@ -13097,6 +13121,11 @@ components:
response_status_code:
description: HTTP or gRPC status code, for example 404.
type: string
scope:
allOf:
- $ref: '#/components/schemas/SpantypesScope'
description: Instrumentation scope. Omitted when empty, and in a list unless
selected.
span_id:
type: string
status_code_string:
@@ -13110,6 +13139,9 @@ components:
type: integer
trace_id:
type: string
trace_state:
description: W3C trace state. Omitted when empty, and in a list unless selected.
type: string
required:
- span_id
- trace_id
@@ -14496,8 +14528,9 @@ paths:
x-signoz-stability: alpha
/api/v1/channels:
get:
deprecated: false
description: This endpoint lists all notification channels for the organization
deprecated: true
description: 'Deprecated: use GET /api/v2/notification_channels instead. This
endpoint lists all notification channels for the organization'
operationId: ListChannels
responses:
"200":
@@ -14544,8 +14577,9 @@ paths:
- channels
x-signoz-stability: alpha
post:
deprecated: false
description: This endpoint creates a notification channel
deprecated: true
description: 'Deprecated: use POST /api/v2/notification_channels instead. This
endpoint creates a notification channel'
operationId: CreateChannel
requestBody:
content:
@@ -14602,8 +14636,9 @@ paths:
x-signoz-stability: alpha
/api/v1/channels/{id}:
delete:
deprecated: false
description: This endpoint deletes a notification channel by ID
deprecated: true
description: 'Deprecated: use DELETE /api/v2/notification_channels/{id} instead.
This endpoint deletes a notification channel by ID'
operationId: DeleteChannelByID
parameters:
- in: path
@@ -14648,8 +14683,9 @@ paths:
- channels
x-signoz-stability: alpha
get:
deprecated: false
description: This endpoint returns a notification channel by ID
deprecated: true
description: 'Deprecated: use GET /api/v2/notification_channels/{id} instead.
This endpoint returns a notification channel by ID'
operationId: GetChannelByID
parameters:
- in: path
@@ -14706,8 +14742,9 @@ paths:
- channels
x-signoz-stability: alpha
put:
deprecated: false
description: This endpoint updates a notification channel by ID
deprecated: true
description: 'Deprecated: use PUT /api/v2/notification_channels/{id} instead.
This endpoint updates a notification channel by ID'
operationId: UpdateChannelByID
parameters:
- in: path
@@ -14764,8 +14801,9 @@ paths:
x-signoz-stability: alpha
/api/v1/channels/test:
post:
deprecated: false
description: This endpoint tests a notification channel by sending a test notification
deprecated: true
description: 'Deprecated: use POST /api/v2/notification_channels/test instead.
This endpoint tests a notification channel by sending a test notification'
operationId: TestChannel
requestBody:
content:

View File

@@ -53,6 +53,7 @@ const EXCLUDED_PLUGINS = [
'vite-plugin-checker',
'dev-base-path',
'dev-boot-data',
'signoz:inline-boot-guard',
'vite-plugin-compression',
];

View File

@@ -42,7 +42,10 @@ const config: Config.InitialOptions = {
'<rootDir>/node_modules/@signozhq/$1/dist/$1.js',
},
extensionsToTreatAsEsm: ['.ts'],
testMatch: ['<rootDir>/src/**/*?(*.)(test).(ts|js)?(x)'],
testMatch: [
'<rootDir>/src/**/*?(*.)(test).(ts|js)?(x)',
'<rootDir>/vite-plugins/**/*.test.ts',
],
preset: 'ts-jest/presets/js-with-ts-esm',
transform: {
'^.+\\.(ts|tsx)?$': [

View File

@@ -29,6 +29,7 @@
"commitlint": "commitlint --edit $1",
"test": "jest",
"test:changedsince": "jest --changedSince=main --coverage --silent",
"test:affected": "node scripts/affected-tests.mjs",
"generate:api": "orval --config ./orval.config.ts && sh scripts/post-types-generation.sh",
"generate:config:web-settings": "json2ts ./src/schemas/generated/webSettings.schema.json -o src/types/generated/webSettings.ts --style.useTabs --style.tabWidth=1 --style.singleQuote --bannerComment '/* AUTO GENERATED FILE - DO NOT EDIT - GENERATED FROM frontend/src/schemas/generated/webSettings.schema.json */'",
"build:geo-outlines": "node scripts/geo-outlines/build.mjs"

View File

@@ -0,0 +1,210 @@
#!/usr/bin/env node
// Usage: node scripts/affected-tests.mjs [--suite unit|storybook|e2e|all] [--base <ref>] [--list] [-- <runner args>]
import path from 'node:path';
import {
E2E,
e2eIndex,
specsImporting,
specsVisiting,
} from './affected/e2e.mjs';
import {
REPO,
changedFiles,
changedPackages,
git,
importersOf,
} from './affected/git.mjs';
import { FRONTEND, pnpm, relatedFiles } from './affected/jestGraph.mjs';
import { log } from './affected/log.mjs';
import { SHELL_ENTRY, pageEntries } from './affected/routes.mjs';
const SHARED = String.raw`^frontend/(pnpm-lock\.yaml|pnpm-workspace\.yaml|tsconfig.*\.json)$`;
// Any change here can affect every test of the suite, so the import graph cannot narrow it.
const RUN_ALL = {
unit: [
SHARED,
String.raw`^frontend/(jest\.\w+\.\w+|babel\.config\.cjs)$`,
'^frontend/(__mocks__|src/__tests__)/',
],
storybook: [
SHARED,
String.raw`^frontend/vite\.config\.ts$`,
'^frontend/(\\.storybook|src/storybook/mocks|vite-plugins)/',
],
e2e: [
SHARED,
String.raw`^frontend/(vite\.config\.ts|index\.html)$`,
'^frontend/vite-plugins/',
String.raw`^tests/e2e/(package\.json|pnpm-lock\.yaml|playwright\.config\.ts|tsconfig\.json)$`,
'^tests/e2e/bootstrap/',
],
};
const STORY_MATCH = [
'<rootDir>/src/**/*.stories.ts',
'<rootDir>/src/**/*.stories.tsx',
];
const SHELL_SPEC_DIRS = ['app-shell', 'routing'];
function parseArgs(argv) {
const sep = argv.indexOf('--');
const own = sep === -1 ? argv : argv.slice(0, sep);
const opts = {
base: 'origin/main',
list: false,
suite: 'unit',
extra: sep === -1 ? [] : argv.slice(sep + 1),
};
for (let i = 0; i < own.length; i++) {
if (own[i] === '--base') {
opts.base = own[++i];
} else if (own[i] === '--suite') {
opts.suite = own[++i];
} else if (own[i] === '--list') {
opts.list = true;
}
}
return opts;
}
// src/pages/DashboardPage/x/y.test.tsx -> pages/DashboardPage
function srcFeature(file) {
const parts = path.relative(path.join(FRONTEND, 'src'), file).split(path.sep);
return parts.length > 2 ? `${parts[0]}/${parts[1]}` : parts[0];
}
function printGroups(title, files, feature) {
const groups = Object.entries(Object.groupBy(files, feature)).sort(
(a, b) => b[1].length - a[1].length,
);
log(`\n[${title}] ${groups.length} features, ${files.length} files:`);
groups.forEach(([name, list]) =>
log(` ${String(list.length).padStart(4)} ${name}`),
);
}
// Swaps a dependency-only package.json bump for the source files that import the bumped packages.
function expandBumps(files, mergeBase) {
if (!files.includes('frontend/package.json')) {
return { files };
}
const pkgs = changedPackages(mergeBase, 'frontend/package.json');
if (!pkgs) {
return {
files,
reason: 'frontend/package.json changed beyond dependency versions',
};
}
log(`\nBumped packages: ${pkgs.join(', ')}`);
const rest = files.filter(
(f) => f !== 'frontend/package.json' && f !== 'frontend/pnpm-lock.yaml',
);
return {
files: [
...new Set([
...rest,
...pkgs.flatMap((p) => importersOf(p, 'frontend/src')),
]),
],
};
}
const planners = {
unit: (src) => ({ files: relatedFiles(src), feature: srcFeature }),
storybook: (src) => ({
files: relatedFiles(src, STORY_MATCH),
feature: srcFeature,
}),
e2e: (src, changed) => {
const pages = pageEntries();
const hit = new Set(
relatedFiles(src, [...pages.map((p) => p.file), SHELL_ENTRY]),
);
const routes = pages.filter((p) => hit.has(p.file)).flatMap((p) => p.paths);
log(
`\n[e2e] routes reached: ${routes.join(' ') || 'none'}${hit.has(SHELL_ENTRY) ? ' + app shell' : ''}`,
);
const index = e2eIndex(pages.flatMap((p) => p.paths));
const shell = hit.has(SHELL_ENTRY)
? index.specs.filter((s) => SHELL_SPEC_DIRS.includes(index.feature(s)))
: [];
const own = specsImporting(
index,
changed.filter((f) => f.startsWith('tests/e2e/')),
);
return {
files: [...new Set([...specsVisiting(index, routes), ...own, ...shell])],
feature: index.feature,
};
},
};
const runners = {
unit: (files, extra) =>
pnpm(
['exec', 'jest', ...(files ? ['--runTestsByPath', ...files] : []), ...extra],
FRONTEND,
),
storybook: (files, extra) =>
pnpm(
[
'test:storybook',
...(files ?? []).map((f) => path.relative(FRONTEND, f)),
...extra,
],
FRONTEND,
),
e2e: (files, extra) =>
pnpm(
[
'exec',
'playwright',
'test',
...(files ?? []).map((f) => path.relative(E2E, f)),
...extra,
],
E2E,
),
};
function runSuite(suite, changed, bumpReason, src, opts) {
const trigger = changed.find((f) =>
RUN_ALL[suite].some((re) => new RegExp(re).test(f)),
);
const reason = bumpReason ?? (trigger && `${trigger} affects every test`);
if (reason) {
log(`\n[${suite}] ${reason}; running the full suite.`);
return opts.list ? 0 : runners[suite](null, opts.extra).status;
}
const { files, feature } = planners[suite](src, changed);
printGroups(suite, files, feature);
if (opts.list || !files.length) {
return 0;
}
return runners[suite](files, opts.extra).status;
}
const opts = parseArgs(process.argv.slice(2));
const mergeBase = git('merge-base', opts.base, 'HEAD');
const original = changedFiles(mergeBase);
if (!original.length) {
log(`No frontend or e2e changes since ${opts.base}.`);
process.exit(0);
}
log(`Changed files since ${opts.base} (${original.length}):`);
original.forEach((f) => log(` ${f}`));
const { files: changed, reason: bumpReason } = expandBumps(original, mergeBase);
const src = changed
.filter((f) => f.startsWith('frontend/'))
.map((f) => path.join(REPO, f));
const suites = opts.suite === 'all' ? Object.keys(planners) : [opts.suite];
const failed = suites.filter(
(s) => runSuite(s, changed, bumpReason, src, opts) !== 0,
);
if (failed.length) {
log(`\nFailed: ${failed.join(', ')}`);
}
process.exit(failed.length ? 1 : 0);

View File

@@ -0,0 +1,107 @@
import { existsSync, readdirSync, readFileSync } from 'node:fs';
import path from 'node:path';
import { REPO } from './git.mjs';
export const E2E = path.join(REPO, 'tests/e2e');
// A driver used by this many features is infrastructure; its URLs say nothing about a spec's pages.
const SHARED_FEATURE_COUNT = 5;
const feature = (spec) =>
path.relative(path.join(E2E, 'tests'), spec).split(path.sep)[0];
function listSpecs(dir = path.join(E2E, 'tests')) {
return readdirSync(dir, { withFileTypes: true }).flatMap((d) => {
const full = path.join(dir, d.name);
if (d.isDirectory()) {
return listSpecs(full);
}
return d.name.endsWith('.spec.ts') ? [full] : [];
});
}
function localImports(file) {
const body = readFileSync(file, 'utf8');
return [...body.matchAll(/(?:from|import)\s+'(\.[^']+)'/g)]
.map(([, spec]) => path.resolve(path.dirname(file), spec))
.map((base) =>
[base, `${base}.ts`, `${base}/index.ts`].find(
(f) => f.endsWith('.ts') && existsSync(f),
),
)
.filter((f) => f?.startsWith(E2E));
}
function closure(spec) {
const seen = new Set();
const visit = (f) => {
if (seen.has(f)) {
return;
}
seen.add(f);
localImports(f).forEach(visit);
};
visit(spec);
return seen;
}
function routeRegex(route, nested) {
const body = route.replace(/\/$/, '').replace(/:[^/]+/g, '[^/]+');
return new RegExp(`^${body}${nested ? '(/.*)?' : '/?'}$`);
}
// The routes a URL literal from a spec lands on; `/dashboard/` comes from `/dashboard/${id}`.
function routesFor(literal, routes) {
const probe = literal.endsWith('/') ? `${literal}x` : literal;
const exact = routes.filter((r) => routeRegex(r, false).test(probe));
if (exact.length) {
return exact;
}
const nested = routes.filter((r) => routeRegex(r, true).test(probe));
return nested.sort((a, b) => b.length - a.length).slice(0, 1);
}
export function e2eIndex(routes) {
const specs = listSpecs();
const deps = new Map(specs.map((s) => [s, closure(s)]));
const users = new Map();
for (const [spec, files] of deps) {
files.forEach((f) =>
users.set(f, new Set([...(users.get(f) ?? []), feature(spec)])),
);
}
const shared = new Set(
[...users]
.filter(([, feats]) => feats.size >= SHARED_FEATURE_COUNT)
.map(([f]) => f),
);
const specRoutes = new Map(
specs.map((spec) => {
const own = [...deps.get(spec)].filter((f) => f === spec || !shared.has(f));
const literals = own.flatMap((f) =>
[...readFileSync(f, 'utf8').matchAll(/['"`](\/[a-z][a-z0-9/_-]*)/gi)].map(
([, l]) => l,
),
);
const hit = literals
.filter((l) => !l.startsWith('/api/'))
.flatMap((l) => routesFor(l, routes));
return [spec, new Set(hit)];
}),
);
return { specs, deps, specRoutes, feature };
}
export function specsImporting(index, files) {
const abs = new Set(files.map((f) => path.join(REPO, f)));
return index.specs.filter((s) =>
[...index.deps.get(s)].some((f) => abs.has(f)),
);
}
export function specsVisiting(index, routes) {
return index.specs.filter((s) =>
routes.some((r) => index.specRoutes.get(s).has(r)),
);
}

View File

@@ -0,0 +1,60 @@
import { execFileSync, spawnSync } from 'node:child_process';
import { existsSync, readFileSync } from 'node:fs';
import path from 'node:path';
export const REPO = execFileSync('git', ['rev-parse', '--show-toplevel'], {
cwd: import.meta.dirname,
encoding: 'utf8',
}).trim();
const DEP_FIELDS = ['dependencies', 'devDependencies'];
export function git(...args) {
return execFileSync('git', args, { cwd: REPO, encoding: 'utf8' }).trim();
}
const lines = (out) => out.split('\n').filter(Boolean);
// Repo-relative paths under frontend/ and tests/e2e/ that differ from mergeBase, uncommitted included.
export function changedFiles(mergeBase) {
const scope = ['frontend', 'tests/e2e'];
const tracked = lines(git('diff', '--name-only', mergeBase, '--', ...scope));
const untracked = lines(
git('ls-files', '--others', '--exclude-standard', '--', ...scope),
);
return [...new Set([...tracked, ...untracked])].filter((f) =>
existsSync(path.join(REPO, f)),
);
}
// Changed package names, or null when anything besides dependency versions changed.
export function changedPackages(mergeBase, pkgJson) {
const before = JSON.parse(git('show', `${mergeBase}:${pkgJson}`));
const after = JSON.parse(readFileSync(path.join(REPO, pkgJson), 'utf8'));
const strip = (pkg) =>
JSON.stringify({
...pkg,
...Object.fromEntries(DEP_FIELDS.map((k) => [k, null])),
});
if (strip(before) !== strip(after)) {
return null;
}
const names = new Set(
DEP_FIELDS.flatMap((k) => Object.keys({ ...before[k], ...after[k] })),
);
return [...names].filter((n) =>
DEP_FIELDS.some((k) => before[k]?.[n] !== after[k]?.[n]),
);
}
export function importersOf(pkg, dir) {
const out = spawnSync(
'git',
['grep', '-lE', `['"]${pkg}(/[^'"]*)?['"]`, '--', dir],
{
cwd: REPO,
encoding: 'utf8',
},
).stdout;
return lines(out);
}

View File

@@ -0,0 +1,30 @@
import { spawnSync } from 'node:child_process';
import path from 'node:path';
export const FRONTEND = path.resolve(import.meta.dirname, '../..');
export function pnpm(args, cwd, stdio = 'inherit') {
return spawnSync('pnpm', args, {
cwd,
encoding: 'utf8',
stdio,
maxBuffer: 64 * 1024 * 1024,
});
}
// Absolute paths of files matching testMatch whose import graph reaches any of files.
export function relatedFiles(files, testMatch) {
if (!files.length) {
return [];
}
const match = testMatch ? ['--testMatch', ...testMatch] : [];
const res = pnpm(
['exec', 'jest', '--listTests', '--findRelatedTests', ...files, ...match],
FRONTEND,
'pipe',
);
if (res.status !== 0) {
throw new Error(`jest --listTests failed:\n${res.stderr}`);
}
return res.stdout.split('\n').filter((l) => l.startsWith('/'));
}

View File

@@ -0,0 +1 @@
export const log = (message) => process.stdout.write(`${message}\n`);

View File

@@ -0,0 +1,57 @@
import { existsSync, readFileSync } from 'node:fs';
import path from 'node:path';
import { FRONTEND } from './jestGraph.mjs';
const SRC = path.join(FRONTEND, 'src');
const read = (rel) => readFileSync(path.join(SRC, rel), 'utf8');
// Mounted around every page, so a change it reaches shows up as the shell, not as a page.
export const SHELL_ENTRY = path.join(SRC, 'container/AppLayout/index.tsx');
function resolveModule(spec) {
const base = path.join(SRC, spec);
const candidates = ['.tsx', '.ts', '/index.tsx', '/index.ts'].map(
(ext) => base + ext,
);
return candidates.find(existsSync);
}
function routePaths() {
const body = read('constants/routes.ts');
return Object.fromEntries(
[...body.matchAll(/^\s*(\w+):\s*'([^']+)'/gm)].map(([, k, v]) => [
k,
v.split('?')[0],
]),
);
}
function componentModules() {
const body = read('AppRoutes/pageComponents.ts');
const re =
/export const (\w+) = Loadable\(\s*\(\)\s*=>\s*import\(\s*(?:\/\*[\s\S]*?\*\/\s*)?'([^']+)'/g;
return Object.fromEntries(
[...body.matchAll(re)].map(([, name, spec]) => [name, resolveModule(spec)]),
);
}
// [{ file, paths }] for every page module the router mounts.
export function pageEntries() {
const paths = routePaths();
const modules = componentModules();
const byFile = new Map();
for (const [block] of read('AppRoutes/routes.ts').matchAll(/\{[^{}]*\}/g)) {
const component = block.match(/component:\s*(\w+)/)?.[1];
const pathLine = block.match(/path:\s*([^\n]+)/)?.[1] ?? '';
const file = modules[component];
if (!file) {
continue;
}
const routeKeys = [...pathLine.matchAll(/ROUTES\.(\w+)/g)]
.map(([, k]) => paths[k])
.filter(Boolean);
byFile.set(file, [...(byFile.get(file) ?? []), ...routeKeys]);
}
return [...byFile].map(([file, p]) => ({ file, paths: [...new Set(p)] }));
}

View File

@@ -162,6 +162,16 @@ describe('SENTRY_IGNORE_ERRORS', () => {
),
).toBe(true);
});
it('ignores Safari loading a stale chunk served as index.html', () => {
expect(
SENTRY_IGNORE_ERRORS.some((pattern) =>
pattern.test(
"TypeError: 'text/html' is not a valid JavaScript MIME type for module script 'https://example.us.signoz.cloud/assets/AIAssistantModal-cna5ncpr.js'.",
),
),
).toBe(true);
});
});
describe('isExpectedRequestFailure', () => {

View File

@@ -5,11 +5,14 @@ export const SENTRY_IGNORE_ERRORS = [
// A tab that outlived a deploy requests hashed assets the new build no longer
// has. `lazyRetry` recovers by reloading once, so this class is not worth
// reporting. The stylesheet message is Vite's own; the module ones are the
// same failure worded differently by Chromium, Firefox and Safari.
// same failure worded differently by Chromium, Firefox and Safari. Safari
// reports the MIME type one when the server answers the missing asset with
// index.html.
/Unable to preload CSS for/,
/Failed to fetch dynamically imported module/,
/error loading dynamically imported module/,
/Importing a module script failed/,
/is not a valid JavaScript MIME type/,
// Thrown by the bundled posthog-js when its recorder script fails to load, so
// its frames point at our own bundle and the URL check below misses it.
/Called on script loaded before session recording is available/,

View File

@@ -68,7 +68,8 @@ const withQueryKey = <T extends object, K>(
};
/**
* This endpoint lists all notification channels for the organization
* Deprecated: use GET /api/v2/notification_channels instead. This endpoint lists all notification channels for the organization
* @deprecated
* @summary List notification channels
*/
export const listChannels = (signal?: AbortSignal) => {
@@ -114,6 +115,7 @@ export type ListChannelsQueryResult = NonNullable<
export type ListChannelsQueryError = ErrorType<RenderErrorResponseDTO>;
/**
* @deprecated
* @summary List notification channels
*/
@@ -137,6 +139,7 @@ export function useListChannels<
}
/**
* @deprecated
* @summary List notification channels
*/
export const invalidateListChannels = async (
@@ -152,7 +155,8 @@ export const invalidateListChannels = async (
};
/**
* This endpoint creates a notification channel
* Deprecated: use POST /api/v2/notification_channels instead. This endpoint creates a notification channel
* @deprecated
* @summary Create notification channel
*/
export const createChannel = (
@@ -214,6 +218,7 @@ export type CreateChannelMutationBody =
export type CreateChannelMutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @deprecated
* @summary Create notification channel
*/
export const useCreateChannel = <
@@ -235,7 +240,8 @@ export const useCreateChannel = <
return useMutation(getCreateChannelMutationOptions(options));
};
/**
* This endpoint deletes a notification channel by ID
* Deprecated: use DELETE /api/v2/notification_channels/{id} instead. This endpoint deletes a notification channel by ID
* @deprecated
* @summary Delete notification channel
*/
export const deleteChannelByID = (
@@ -293,6 +299,7 @@ export type DeleteChannelByIDMutationResult = NonNullable<
export type DeleteChannelByIDMutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @deprecated
* @summary Delete notification channel
*/
export const useDeleteChannelByID = <
@@ -314,7 +321,8 @@ export const useDeleteChannelByID = <
return useMutation(getDeleteChannelByIDMutationOptions(options));
};
/**
* This endpoint returns a notification channel by ID
* Deprecated: use GET /api/v2/notification_channels/{id} instead. This endpoint returns a notification channel by ID
* @deprecated
* @summary Get notification channel by ID
*/
export const getChannelByID = (
@@ -373,6 +381,7 @@ export type GetChannelByIDQueryResult = NonNullable<
export type GetChannelByIDQueryError = ErrorType<RenderErrorResponseDTO>;
/**
* @deprecated
* @summary Get notification channel by ID
*/
@@ -399,6 +408,7 @@ export function useGetChannelByID<
}
/**
* @deprecated
* @summary Get notification channel by ID
*/
export const invalidateGetChannelByID = async (
@@ -415,7 +425,8 @@ export const invalidateGetChannelByID = async (
};
/**
* This endpoint updates a notification channel by ID
* Deprecated: use PUT /api/v2/notification_channels/{id} instead. This endpoint updates a notification channel by ID
* @deprecated
* @summary Update notification channel
*/
export const updateChannelByID = (
@@ -487,6 +498,7 @@ export type UpdateChannelByIDMutationBody =
export type UpdateChannelByIDMutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @deprecated
* @summary Update notification channel
*/
export const useUpdateChannelByID = <
@@ -514,7 +526,8 @@ export const useUpdateChannelByID = <
return useMutation(getUpdateChannelByIDMutationOptions(options));
};
/**
* This endpoint tests a notification channel by sending a test notification
* Deprecated: use POST /api/v2/notification_channels/test instead. This endpoint tests a notification channel by sending a test notification
* @deprecated
* @summary Test notification channel
*/
export const testChannel = (
@@ -576,6 +589,7 @@ export type TestChannelMutationBody =
export type TestChannelMutationError = ErrorType<RenderErrorResponseDTO>;
/**
* @deprecated
* @summary Test notification channel
*/
export const useTestChannel = <

View File

@@ -14681,6 +14681,16 @@ export interface SpantypesSpanDTO {
* @description All of them for a span read by ID; the selected ones in a list.
*/
attributes: SpantypesSpanDTOAttributes;
/**
* @type string
* @description Omitted when empty, and in a list unless selected.
*/
db_name?: string;
/**
* @type string
* @description Omitted when empty, and in a list unless selected.
*/
db_operation?: string;
/**
* @type integer
* @minimum 0
@@ -14691,10 +14701,35 @@ export interface SpantypesSpanDTO {
* @description All of them for a span read by ID; none in a list.
*/
events: SpantypesEventDTO[];
/**
* @type string
* @description Method of an outgoing HTTP call. Omitted when empty, and in a list unless selected.
*/
external_http_method?: string;
/**
* @type string
* @description Host of an outgoing HTTP call. Omitted when empty, and in a list unless selected.
*/
external_http_url?: string;
/**
* @type boolean
*/
has_error: boolean;
/**
* @type string
* @description Host or server address. Omitted when empty, and in a list unless selected.
*/
http_host?: string;
/**
* @type string
* @description Omitted when empty, and in a list unless selected.
*/
http_method?: string;
/**
* @type string
* @description Omitted when empty, and in a list unless selected.
*/
http_url?: string;
/**
* @type string
* @description For example Server, Client or Internal.
@@ -14724,6 +14759,10 @@ export interface SpantypesSpanDTO {
* @description HTTP or gRPC status code, for example 404.
*/
response_status_code: string;
/**
* @description Instrumentation scope. Omitted when empty, and in a list unless selected.
*/
scope?: SpantypesScopeDTO;
/**
* @type string
*/
@@ -14747,6 +14786,11 @@ export interface SpantypesSpanDTO {
* @type string
*/
trace_id: string;
/**
* @type string
* @description W3C trace state. Omitted when empty, and in a list unless selected.
*/
trace_state?: string;
}
export interface SpantypesSpanTextMatchDTO {

View File

@@ -1,7 +1,6 @@
import { ApiV5Instance } from 'api';
import { ErrorResponseHandlerV2 } from 'api/ErrorResponseHandlerV2';
import { AxiosError } from 'axios';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { ErrorV2Resp, SuccessResponseV2 } from 'types/api';
import {
MetricRangePayloadV5,
@@ -17,24 +16,10 @@ import {
*/
export const getQueryRangeV5 = async (
props: QueryRangePayloadV5,
version: string,
signal?: AbortSignal,
headers?: Record<string, string>,
): Promise<SuccessResponseV2<MetricRangePayloadV5>> => {
try {
if (version && version === ENTITY_VERSION_V5) {
const response = await ApiV5Instance.post('/query_range', props, {
signal,
headers,
});
return {
httpStatusCode: response.status,
data: response.data,
};
}
// Default V5 behavior
const response = await ApiV5Instance.post('/query_range', props, {
signal,
headers,
@@ -42,7 +27,7 @@ export const getQueryRangeV5 = async (
return {
httpStatusCode: response.status,
data: response.data.data,
data: response.data,
};
} catch (error) {
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);

View File

@@ -7,7 +7,6 @@ import { useAppLocation } from 'lib/router/useAppLocation';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { ViewMenuAction } from 'container/WidgetCard/config';
import { ENTITY_VERSION_V5 } from 'constants/app';
import GridCard from 'container/WidgetCard/Card';
import { Card } from 'container/WidgetCard/styles';
import { useIsDarkMode } from 'hooks/useDarkMode';
@@ -179,7 +178,6 @@ function CeleryTaskBar({
{barState === CeleryTaskState.All && (
<GridCard
widget={celeryAllStateFilteredData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
isQueryEnabled={queryEnabled}
@@ -201,7 +199,6 @@ function CeleryTaskBar({
{barState === CeleryTaskState.Failed && (
<GridCard
widget={celeryFailedStateFilteredData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
isQueryEnabled={queryEnabled}
@@ -222,7 +219,6 @@ function CeleryTaskBar({
{barState === CeleryTaskState.Retry && (
<GridCard
widget={celeryRetryStateFilteredData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
isQueryEnabled={queryEnabled}
@@ -243,7 +239,6 @@ function CeleryTaskBar({
{barState === CeleryTaskState.Successful && (
<GridCard
widget={celerySuccessStateFilteredData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
isQueryEnabled={queryEnabled}

View File

@@ -1,7 +1,6 @@
import { useCallback, useMemo } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useDispatch } from 'react-redux';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { navigate } from 'lib/router/navigation';
import { useAppLocation } from 'lib/router/useAppLocation';
import { QueryParams } from 'constants/query';
@@ -137,7 +136,6 @@ function CeleryTaskGraph({
isQueryEnabled={queryEnabled}
openTracesButton={openTracesButton}
onOpenTraceBtnClick={onOpenTraceBtnClick}
version={ENTITY_VERSION_V5}
customErrorMessage={customErrorMessage}
start={start}
end={end}

View File

@@ -9,7 +9,6 @@ import logEvent from 'api/common/logEvent';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { ViewMenuAction } from 'container/WidgetCard/config';
import { ENTITY_VERSION_V5 } from 'constants/app';
import GridCard from 'container/WidgetCard/Card';
import { Card } from 'container/WidgetCard/styles';
import { Button } from 'container/MetricsApplication/Tabs/styles';
@@ -202,7 +201,6 @@ function CeleryTaskLatencyGraph({
</Button>
<GridCard
widget={updatedWidgetData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
onClickHandler={onGraphClick('Celery_p99_latency')}
@@ -224,7 +222,6 @@ function CeleryTaskLatencyGraph({
</Button>
<GridCard
widget={updatedWidgetData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
onClickHandler={onGraphClick('Celery_p95_latency')}
@@ -245,7 +242,6 @@ function CeleryTaskLatencyGraph({
</Button>
<GridCard
widget={updatedWidgetData}
version={ENTITY_VERSION_V5}
headerMenuList={[...ViewMenuAction]}
onDragSelect={onDragSelect}
onClickHandler={onGraphClick('Celery_p90_latency')}

View File

@@ -2,7 +2,6 @@ import { useCallback } from 'react';
import { useQueries } from 'react-query';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
import {
@@ -42,9 +41,9 @@ export const useGetValueFromWidget = (
const queries = useQueries(
queryPayloads().map((payload) => ({
queryKey: [...queryKey, payload, ENTITY_VERSION_V5],
queryKey: [...queryKey, payload],
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
GetMetricQueryRange(payload),
enabled: !!payload,
})),
);

View File

@@ -21,9 +21,4 @@
line-height: var(--paragraph-small-400-line-height);
margin: 0;
}
&__helper {
color: var(--l3-foreground);
margin: calc(var(--spacing-2) * -1) 0 var(--spacing-4) 0;
}
}

View File

@@ -0,0 +1,6 @@
.actions {
display: flex;
align-items: center;
gap: var(--spacing-4);
flex-shrink: 0;
}

View File

@@ -0,0 +1,21 @@
import { Fragment } from 'react';
import type { HeaderAction } from './DetailsHeader';
import styles from './HeaderActions.module.scss';
interface HeaderActionsProps {
actions: HeaderAction[];
}
function HeaderActions({ actions }: HeaderActionsProps): JSX.Element {
return (
<div className={styles.actions}>
{actions.map((action) => (
<Fragment key={action.key}>{action.component}</Fragment>
))}
</div>
);
}
export default HeaderActions;

View File

@@ -1,4 +1,6 @@
import { Drawer } from '@signozhq/ui/drawer';
import type { HeaderAction } from 'components/DetailsPanel/DetailsHeader/DetailsHeader';
import HeaderActions from 'components/DetailsPanel/DetailsHeader/HeaderActions';
import { LogDetailProps } from './LogDetail.interfaces';
import LogDetailBody from './LogDetailBody';
@@ -34,6 +36,34 @@ function LogDetail({
const title = useLogTimestamp(shownLog);
const headerActions: HeaderAction[] = [
...(shownLog
? [
{
key: 'log-actions',
component: (
<LogActions
log={shownLog}
showOpenInExplorer={!!handleOpenInExplorer}
onOpenInExplorer={handleOpenInExplorer}
/>
),
},
]
: []),
{
key: 'navigation',
component: (
<LogNavigation
onNavigatePrev={goToPrev}
onNavigateNext={goToNext}
isPrevDisabled={isPrevDisabled}
isNextDisabled={isNextDisabled}
/>
),
},
];
return (
<Drawer
type="inspector"
@@ -43,23 +73,7 @@ function LogDetail({
title={title}
width="extra-wide"
closePosition="start"
headerSuffix={
<>
{shownLog && (
<LogActions
log={shownLog}
showOpenInExplorer={!!handleOpenInExplorer}
onOpenInExplorer={handleOpenInExplorer}
/>
)}
<LogNavigation
onNavigatePrev={goToPrev}
onNavigateNext={goToNext}
isPrevDisabled={isPrevDisabled}
isNextDisabled={isNextDisabled}
/>
</>
}
headerSuffix={<HeaderActions actions={headerActions} />}
testId="log-detail-drawer"
>
{shownLog && (

View File

@@ -433,7 +433,6 @@ function QueryAddOns({
query={query}
onChange={handleChangeOrderByKeys}
isRawQuery={isRawQuery}
isNewQueryV2
panelType={panelType ?? undefined}
placeholder={placeholderOf(QueryBuilderField.OrderBy)}
/>

View File

@@ -16,6 +16,7 @@ import {
startCompletion,
} from '@codemirror/autocomplete';
import { javascript } from '@codemirror/lang-javascript';
import * as Sentry from '@sentry/react';
import { Color } from '@signozhq/design-tokens';
import { copilot } from '@uiw/codemirror-theme-copilot';
import { githubLight } from '@uiw/codemirror-theme-github';
@@ -361,9 +362,12 @@ function QuerySearch({
metricNamespace,
},
builderQueryType,
);
).catch((error: unknown) => {
Sentry.captureException(error);
return null;
});
if (response.data.keys) {
if (response?.data.keys) {
const { keys } = response.data;
const options = generateOptions(keys);
// Deduplicate by full variant identity (name + context + data type), NOT by

View File

@@ -192,8 +192,7 @@ export const QueryV2 = forwardRef(function QueryV2(
!functions.hidden &&
(query.dataSource === DataSource.LOGS ||
query.dataSource === DataSource.METRICS ||
hasQueryFunctions ||
false)
hasQueryFunctions)
}
areFunctionsDisabled={functions.disabled}
functionsDisabledReason={functions.reason}

View File

@@ -15,6 +15,7 @@ import {
} from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import { Button } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import OverlayScrollbar from 'components/OverlayScrollbar/OverlayScrollbar';
import { GripVertical } from '@signozhq/icons';
import { TelemetryFieldKey } from 'types/api/v5/queryRange';
@@ -46,7 +47,17 @@ function SortableFilter({
>
<div {...attributes} {...listeners} className="drag-handle">
{allowDrag && <GripVertical size={16} />}
{filter.name}
<Typography
variant="paragraph"
size="base"
weight="regular"
color="inherit"
as="span"
display="block"
textOverflow="ellipsis"
>
{filter.name}
</Typography>
</div>
{allowRemove && (
<Button

View File

@@ -1,5 +1,6 @@
import { useMemo } from 'react';
import { Button, Skeleton } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import {
QuickfiltertypesSourceDTO,
TelemetrytypesSourceDTO,
@@ -98,7 +99,17 @@ function OtherFilters({
return otherFilters.map((filter) => (
<div key={filter.key} className="qf-filter-item other-filters-item">
<div className="qf-filter-key">{filter.name}</div>
<Typography
variant="paragraph"
size="base"
weight="regular"
color="inherit"
as="span"
display="block"
textOverflow="ellipsis"
>
{filter.name}
</Typography>
<Button
className="add-filter-btn periscope-btn"
size="small"

View File

@@ -132,6 +132,11 @@
align-items: center;
gap: 8px;
flex-grow: 1;
min-width: 0;
> svg {
flex-shrink: 0;
}
}
.qf-filter-content {
@@ -158,6 +163,7 @@
.remove-filter-btn,
.add-filter-btn {
flex-shrink: 0;
padding: 6px 12px;
opacity: 0;
transition: opacity 0.2s ease-in-out;

View File

@@ -90,6 +90,35 @@ export const handlers = [
fieldValuesHandler(['checkout', 'frontend', 'payments']),
];
const LONG_FILTER_NAME =
'gen_ai.response.tool_calls.0.tool_call.function.arguments';
/** One added and one other filter whose names are wider than the settings panel. */
export const longFilterNameHandlers = [
rest.get('http://localhost/api/v2/quick_filters/logs', (_req, res, ctx) =>
res(
ctx.status(200),
ctx.json(
quickFiltersResponse(QuickfiltertypesSourceDTO.logs, [
...customFilters,
{
name: LONG_FILTER_NAME,
fieldDataType: TelemetrytypesFieldDataTypeDTO.string,
fieldContext: TelemetrytypesFieldContextDTO.attribute,
},
]),
),
),
),
rest.get('http://localhost/api/v1/fields/keys', (_req, res, ctx) =>
res(
ctx.status(200),
ctx.json(fieldKeysResponse([`${LONG_FILTER_NAME}.raw`])),
),
),
...handlers,
];
export const noSavedFiltersHandler = rest.get(
'http://localhost/api/v2/quick_filters/logs',
(_req, res, ctx) =>

View File

@@ -11,6 +11,7 @@ import {
hoverTruncatedTitle,
openQueryPicker,
openSettings,
showsLongFilterNames,
} from './__story_mockdata__/quickFilters.play';
import {
checkboxConfig,
@@ -19,6 +20,7 @@ import {
handlers,
LONG_FILTER_VALUES,
loadingFiltersHandlers,
longFilterNameHandlers,
longTitleConfig,
MANY_FILTER_VALUES,
queryBuilder,
@@ -65,6 +67,12 @@ export const SettingsOpen: GlobalArgsStory = {
play: openSettings,
};
/** Settings with filter names wider than the panel: each name is cut with an ellipsis and its action stays in view. */
export const SettingsLongFilterNames: GlobalArgsStory = {
parameters: { msw: { handlers: longFilterNameHandlers } },
play: showsLongFilterNames,
};
/** Mutation: changing the settings list reveals the fixed save and discard footer. */
export const SettingsDirtyFooter: GlobalArgsStory = {
play: dirtySettings,

View File

@@ -64,6 +64,32 @@ export const dirtySettings = async (context: PlayContext): Promise<void> => {
await screen.findByRole('button', { name: 'Save changes' });
};
/** Every Add and Remove sits inside its list: a long name is cut, not scrolled. */
export const showsLongFilterNames = async (
context: PlayContext,
): Promise<void> => {
if (!canManageQuickFilters(context.args)) {
return;
}
await openSettings(context);
await Promise.all(
['quick-filters-added', 'quick-filters-other'].map(async (testId) => {
const list = await screen.findByTestId(testId);
const actions = await within(list).findAllByRole(
'button',
{ name: /^(Add|Remove)$/ },
UNTIL_LOADED,
);
const listRight = list.getBoundingClientRect().right;
actions.forEach((action) => {
expect(action.getBoundingClientRect().right).toBeLessThanOrEqual(listRight);
});
}),
);
};
export const hoverTruncatedTitle = async ({
canvasElement,
args,

View File

@@ -18,18 +18,6 @@
letter-spacing: -0.07px;
}
&__input {
height: 32px;
background: var(--l2-background);
border-color: var(--l1-border);
color: var(--l1-foreground);
box-shadow: none;
&::placeholder {
color: var(--l3-foreground);
}
}
&__datepicker {
width: 100%;
height: 32px;
@@ -100,11 +88,4 @@
text-transform: uppercase;
margin-bottom: var(--spacing-4);
}
&__learn-more {
display: inline-flex;
align-items: center;
gap: var(--spacing-1);
color: var(--primary);
}
}

View File

@@ -1,7 +1,6 @@
import { useCallback, useEffect, useMemo } from 'react';
import QuerySearch from 'components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch';
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
import { ENTITY_VERSION_V5 } from 'constants/app';
import {
getAllEndpointsWidgetData,
getGroupByExpressionFromRowData,
@@ -156,7 +155,6 @@ function AllEndPoints({
customOnDragSelect={(): void => {}}
customTimeRange={timeRange}
customOnRowClick={onRowClick}
version={ENTITY_VERSION_V5}
/>
</div>
</div>

View File

@@ -2,7 +2,6 @@ import { useCallback, useMemo } from 'react';
import { useQueries } from 'react-query';
import QuerySearch from 'components/QueryBuilderV2/QueryV2/QuerySearch/QuerySearch';
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import {
END_POINT_DETAILS_QUERY_KEYS_ARRAY,
@@ -93,13 +92,9 @@ function EndPointDetails({
const endPointDetailsDataQueries = useQueries(
endPointDetailsQueryPayload.map((payload, index) => ({
queryKey: [
END_POINT_DETAILS_QUERY_KEYS_ARRAY[index],
payload,
ENTITY_VERSION_V5,
],
queryKey: [END_POINT_DETAILS_QUERY_KEYS_ARRAY[index], payload],
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
GetMetricQueryRange(payload),
enabled: !!payload,
// Keeps the table's rows, and so its height, while a new filter loads
keepPreviousData:

View File

@@ -9,7 +9,6 @@ import { MetricRangePayloadV5, ScalarData } from 'api/v5/v5';
import { useNavigateToExplorer } from 'components/CeleryTask/useNavigateToExplorer';
import { combineInitialAndUserExpression } from 'components/QueryBuilderV2/QueryV2/QuerySearch/utils';
import { withErrorBoundary } from 'components/ErrorBoundaryHOC';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import {
formatTopErrorsDataForTable,
@@ -76,13 +75,12 @@ function TopErrors({
queryKey: [
REACT_QUERY_KEY.GET_TOP_ERRORS_BY_DOMAIN,
queryPayload,
ENTITY_VERSION_V5,
showStatusCodeErrors,
],
queryFn: ({
signal,
}: QueryFunctionContext): Promise<SuccessResponseV2<MetricRangePayloadV5>> =>
getQueryRangeV5(queryPayload, ENTITY_VERSION_V5, signal),
getQueryRangeV5(queryPayload, signal),
enabled: !!queryPayload,
staleTime: 0,
cacheTime: 0,

View File

@@ -1,8 +1,9 @@
import { QueryClient, QueryClientProvider } from 'react-query';
import { render, screen, waitFor } from 'tests/test-utils';
import { TraceAggregation } from 'api/v5/v5';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
import { MetricQueryRangeSuccessResponse } from 'types/api/metrics/getQueryRange';
import { IBuilderQuery } from 'types/api/queryBuilder/queryBuilderData';
import { SPAN_ATTRIBUTES } from '../constants';
import DomainMetrics from './DomainMetrics';
@@ -12,6 +13,33 @@ jest.mock('lib/dashboard/getQueryResults', () => ({
GetMetricQueryRange: jest.fn(),
}));
const mockGetMetricQueryRange = jest.mocked(GetMetricQueryRange);
const buildResponse = (
rows: { data: Record<string, string> }[],
): MetricQueryRangeSuccessResponse => ({
statusCode: 200,
message: 'success',
error: null,
payload: {
data: {
resultType: '',
newResult: { data: { result: [], resultType: '' } },
result: [
{ queryName: 'A', metric: {}, values: [], table: { rows, columns: [] } },
],
},
},
});
const findQuery = (queryData: IBuilderQuery[], name: string): IBuilderQuery => {
const query = queryData.find((q) => q.queryName === name);
if (!query) {
throw new Error(`Query ${name} missing from the payload`);
}
return query;
};
// Mock ErrorState component
jest.mock('./ErrorState', () => ({
__esModule: true,
@@ -36,30 +64,16 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
domainListFilterExpression: '',
};
const mockSuccessResponse = {
statusCode: 200,
error: null,
payload: {
const mockSuccessResponse = buildResponse([
{
data: {
result: [
{
table: {
rows: [
{
data: {
A: '150',
B: '125000000',
D: '2021-01-01T23:00:00Z',
F1: '5.5',
},
},
],
},
},
],
A: '150',
B: '125000000',
D: '2021-01-01T23:00:00Z',
F1: '5.5',
},
},
};
]);
beforeEach(() => {
queryClient = new QueryClient({
@@ -86,7 +100,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
describe('1. V5 Query Payload with Filters', () => {
it('sends correct V5 payload structure with domain name filters', async () => {
(GetMetricQueryRange as jest.Mock).mockResolvedValue(mockSuccessResponse);
mockGetMetricQueryRange.mockResolvedValue(mockSuccessResponse);
renderComponent();
@@ -94,10 +108,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
expect(GetMetricQueryRange).toHaveBeenCalledTimes(1);
});
const [payload, version] = (GetMetricQueryRange as jest.Mock).mock.calls[0];
// Verify it's using V5
expect(version).toBe(ENTITY_VERSION_V5);
const [payload] = mockGetMetricQueryRange.mock.calls[0];
// Verify time range
expect(payload.start).toBe(1758259531000);
@@ -111,64 +122,60 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
const queryData = payload.query.builder.queryData;
// Verify Query A - count with URL filter
const queryA = queryData.find((q: any) => q.queryName === 'A');
expect(queryA).toBeDefined();
const queryA = findQuery(queryData, 'A');
expect(queryA.dataSource).toBe('traces');
expect(queryA.aggregations?.[0]).toBeDefined();
expect((queryA.aggregations?.[0] as TraceAggregation)?.expression).toBe(
'count()',
);
// Verify exact domain filter expression structure
expect(queryA.filter.expression).toContain("http_host = '0.0.0.0'");
expect(queryA.filter.expression).toContain(
expect(queryA.filter?.expression).toContain("http_host = '0.0.0.0'");
expect(queryA.filter?.expression).toContain(
`${SPAN_ATTRIBUTES.HTTP_URL} EXISTS`,
);
// Verify Query B - p99 latency
const queryB = queryData.find((q: any) => q.queryName === 'B');
expect(queryB).toBeDefined();
const queryB = findQuery(queryData, 'B');
expect(queryB.aggregateOperator).toBe('p99');
expect(queryB.aggregations?.[0]).toBeDefined();
expect((queryB.aggregations?.[0] as TraceAggregation)?.expression).toBe(
'p99(duration_nano)',
);
// Verify exact domain filter expression structure
expect(queryB.filter.expression).toContain("http_host = '0.0.0.0'");
expect(queryB.filter?.expression).toContain("http_host = '0.0.0.0'");
// Verify Query C - error count (disabled)
const queryC = queryData.find((q: any) => q.queryName === 'C');
expect(queryC).toBeDefined();
const queryC = findQuery(queryData, 'C');
expect(queryC.disabled).toBe(true);
expect(queryC.filter.expression).toContain("http_host = '0.0.0.0'");
expect(queryC.filter?.expression).toContain("http_host = '0.0.0.0'");
expect(queryC.aggregations?.[0]).toBeDefined();
expect((queryC.aggregations?.[0] as TraceAggregation)?.expression).toBe(
'count()',
);
expect(queryC.filter.expression).toContain('has_error = true');
expect(queryC.filter?.expression).toContain('has_error = true');
// Verify Query D - max timestamp
const queryD = queryData.find((q: any) => q.queryName === 'D');
expect(queryD).toBeDefined();
const queryD = findQuery(queryData, 'D');
expect(queryD.aggregateOperator).toBe('max');
expect(queryD.aggregations?.[0]).toBeDefined();
expect((queryD.aggregations?.[0] as TraceAggregation)?.expression).toBe(
'max(timestamp)',
);
// Verify exact domain filter expression structure
expect(queryD.filter.expression).toContain("http_host = '0.0.0.0'");
expect(queryD.filter?.expression).toContain("http_host = '0.0.0.0'");
// Verify Formula F1 - error rate calculation
const formulas = payload.query.builder.queryFormulas;
expect(formulas).toBeDefined();
expect(formulas.length).toBeGreaterThan(0);
const formulaF1 = formulas.find((f: any) => f.queryName === 'F1');
const formulaF1 = formulas.find((f) => f.queryName === 'F1');
expect(formulaF1).toBeDefined();
expect(formulaF1.expression).toBe('(C/A)*100');
expect(formulaF1?.expression).toBe('(C/A)*100');
});
it('includes custom filters in filter expressions', async () => {
(GetMetricQueryRange as jest.Mock).mockResolvedValue(mockSuccessResponse);
mockGetMetricQueryRange.mockResolvedValue(mockSuccessResponse);
const customFilterExpression =
"service.name = 'my-service' AND deployment.environment = 'production'";
@@ -182,24 +189,21 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
expect(GetMetricQueryRange).toHaveBeenCalled();
});
const [payload] = (GetMetricQueryRange as jest.Mock).mock.calls[0];
const [payload] = mockGetMetricQueryRange.mock.calls[0];
const queryData = payload.query.builder.queryData;
// Verify all queries include the custom filters
queryData.forEach((query: any) => {
if (query.filter && query.filter.expression) {
expect(query.filter.expression).toContain('service.name');
expect(query.filter.expression).toContain('my-service');
expect(query.filter.expression).toContain('deployment.environment');
expect(query.filter.expression).toContain('production');
}
const expressions = queryData.map((query) => query.filter?.expression);
expect(expressions).toHaveLength(4);
expressions.forEach((expression) => {
expect(expression).toContain(customFilterExpression);
});
});
});
describe('2. Data Display State', () => {
it('displays metrics when data is successfully loaded', async () => {
(GetMetricQueryRange as jest.Mock).mockResolvedValue(mockSuccessResponse);
mockGetMetricQueryRange.mockResolvedValue(mockSuccessResponse);
renderComponent();
@@ -220,23 +224,9 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
describe('3. Empty/Missing Data State', () => {
it('displays "-" for missing data values', async () => {
const emptyResponse = {
statusCode: 200,
error: null,
payload: {
data: {
result: [
{
table: {
rows: [],
},
},
],
},
},
};
const emptyResponse = buildResponse([]);
(GetMetricQueryRange as jest.Mock).mockResolvedValue(emptyResponse);
mockGetMetricQueryRange.mockResolvedValue(emptyResponse);
renderComponent();
@@ -248,7 +238,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
describe('4. Error State', () => {
it('displays error state when API call fails', async () => {
(GetMetricQueryRange as jest.Mock).mockRejectedValue(new Error('API Error'));
mockGetMetricQueryRange.mockRejectedValue(new Error('API Error'));
renderComponent();
@@ -261,7 +251,7 @@ describe('DomainMetrics - V5 Query Payload Tests', () => {
it('retries API call when retry button is clicked', async () => {
let callCount = 0;
(GetMetricQueryRange as jest.Mock).mockImplementation(() => {
mockGetMetricQueryRange.mockImplementation(() => {
callCount += 1;
if (callCount === 1) {
return Promise.reject(new Error('API Error'));

View File

@@ -3,7 +3,6 @@ import { useQueries } from 'react-query';
import { Skeleton, Tooltip } from 'antd';
import { Progress } from '@signozhq/ui/progress';
import { Typography } from '@signozhq/ui/typography';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import {
DomainMetricsResponseRow,
@@ -41,13 +40,9 @@ function DomainMetrics({
// Since only one query here
const domainMetricsDataQueries = useQueries(
queryPayloads.map((payload) => ({
queryKey: [
REACT_QUERY_KEY.GET_DOMAIN_METRICS_DATA,
payload,
ENTITY_VERSION_V5,
],
queryKey: [REACT_QUERY_KEY.GET_DOMAIN_METRICS_DATA, payload],
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
GetMetricQueryRange(payload),
enabled: !!payload,
staleTime: 60 * 1000, // 1 minute stale time : optimize this part
})),

View File

@@ -1,7 +1,6 @@
import { useMemo } from 'react';
import { useQuery } from 'react-query';
import { Combobox, type ComboboxItemType } from '@signozhq/ui/combobox';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import {
getEndPointDropDownQueryPayload,
@@ -44,12 +43,8 @@ function EndPointPicker({
);
const { data, isLoading, isFetching } = useQuery({
queryKey: [
REACT_QUERY_KEY.GET_ENDPOINT_DROPDOWN_DATA,
payload,
ENTITY_VERSION_V5,
],
queryFn: () => GetMetricQueryRange(payload, ENTITY_VERSION_V5),
queryKey: [REACT_QUERY_KEY.GET_ENDPOINT_DROPDOWN_DATA, payload],
queryFn: () => GetMetricQueryRange(payload),
staleTime: 60 * 1000,
});

View File

@@ -1,5 +1,4 @@
import { Card } from 'antd';
import { ENTITY_VERSION_V5 } from 'constants/app';
import GridCard from 'container/WidgetCard/Card';
import { Widgets } from 'types/api/widgets/widget';
@@ -23,7 +22,6 @@ function MetricOverTimeGraph({
customOnDragSelect={(): void => {}}
customTimeRange={timeRange}
customTimeRangeWindowForCoRelation="5m"
version={ENTITY_VERSION_V5}
/>
</div>
</Card>

View File

@@ -8,7 +8,6 @@ import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
import Spinner from 'components/Spinner';
import WarningPopover from 'components/WarningPopover/WarningPopover';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { QueryParams } from 'constants/query';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
@@ -177,7 +176,6 @@ function ChartPreview({
},
originalGraphType: graphType,
},
ENTITY_VERSION_V5,
{
queryKey: [
REACT_QUERY_KEY.ALERT_RULES_CHART_PREVIEW,

View File

@@ -20,7 +20,6 @@ import Header from 'components/Header/Header';
import HeaderRightSection from 'components/HeaderRightSection/HeaderRightSection';
import NoAuthBanner from 'components/NoAuthBanner/NoAuthBanner';
import { getIsNoAuthMode } from 'utils/noAuthMode';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { ORG_PREFERENCES } from 'constants/orgPreferences';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
@@ -102,7 +101,6 @@ export default function Home(): JSX.Element {
},
formatForWeb: false,
},
ENTITY_VERSION_V5,
{
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,
@@ -127,7 +125,6 @@ export default function Home(): JSX.Element {
},
formatForWeb: false,
},
ENTITY_VERSION_V5,
{
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,

View File

@@ -4,7 +4,6 @@ import { QueryKey } from 'react-query';
import { useSelector } from 'react-redux';
import { Button, Select, Skeleton, Table } from 'antd';
import logEvent from 'api/common/logEvent';
import { ENTITY_VERSION_V5 } from 'constants/app';
import ROUTES from 'constants/routes';
import {
getQueryRangeRequestData,
@@ -226,27 +225,23 @@ function ServiceMetrics({
[globalSelectedInterval, topLevelOperations],
);
const dataQueries = useGetQueriesRange(
queryRangeRequestData,
ENTITY_VERSION_V5,
{
queryKey: useMemo(
() => [
`GetMetricsQueryRange-home-${globalSelectedInterval}`,
timeRange.endTime,
timeRange.startTime,
globalSelectedInterval,
],
[globalSelectedInterval, timeRange.endTime, timeRange.startTime],
),
keepPreviousData: true,
enabled: true,
refetchOnMount: false,
onError: () => {
setIsError(true);
},
const dataQueries = useGetQueriesRange(queryRangeRequestData, {
queryKey: useMemo(
() => [
`GetMetricsQueryRange-home-${globalSelectedInterval}`,
timeRange.endTime,
timeRange.startTime,
globalSelectedInterval,
],
[globalSelectedInterval, timeRange.endTime, timeRange.startTime],
),
keepPreviousData: true,
enabled: true,
refetchOnMount: false,
onError: () => {
setIsError(true);
},
);
});
const isLoading = useMemo(
() => dataQueries.some((query) => query.isLoading),

View File

@@ -1,6 +1,5 @@
import { useCallback, useMemo } from 'react';
import { useQuery, useQueryClient } from 'react-query';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
import { ILog } from 'types/api/logs/log';
@@ -77,7 +76,7 @@ export function useEntityEvents({
offset,
pageSize,
});
return GetMetricQueryRange(query, ENTITY_VERSION_V5, undefined, signal);
return GetMetricQueryRange(query, undefined, signal);
},
enabled: !!expression?.trim(),
});

View File

@@ -1,6 +1,5 @@
import { useCallback, useMemo } from 'react';
import { useInfiniteQuery, useQueryClient } from 'react-query';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { DEFAULT_PER_PAGE_VALUE } from 'container/Controls/config';
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
@@ -63,7 +62,7 @@ export function useInfiniteEntityLogs({
offset: pageParam as number,
pageSize: DEFAULT_PER_PAGE_VALUE,
});
return GetMetricQueryRange(query, ENTITY_VERSION_V5, undefined, signal);
return GetMetricQueryRange(query, undefined, signal);
},
getNextPageParam: (lastPage, allPages) => {
const list = lastPage?.payload?.data?.newResult?.data?.result?.[0]?.list;

View File

@@ -1,6 +1,5 @@
import { useMemo } from 'react';
import { QueryFunctionContext, useQueries, UseQueryResult } from 'react-query';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { InfraMonitoringEntity } from 'container/InfraMonitoringK8sV2/constants';
@@ -51,18 +50,12 @@ export function useEntityMetrics<T>({
const queries = useQueries(
queryPayloads.map((payload, index) => ({
// TODO: remove AUTO_REFRESH_QUERY when migrating to date time selection v3
queryKey: [
REACT_QUERY_KEY.AUTO_REFRESH_QUERY,
queryKey,
payload,
ENTITY_VERSION_V5,
category,
],
queryKey: [REACT_QUERY_KEY.AUTO_REFRESH_QUERY, queryKey, payload, category],
queryFn: ({
signal,
}: QueryFunctionContext): Promise<
SuccessResponse<MetricRangePayloadProps>
> => GetMetricQueryRange(payload, ENTITY_VERSION_V5, undefined, signal),
> => GetMetricQueryRange(payload, undefined, signal),
enabled: !!payload && visibilities[index],
keepPreviousData: true,
})),

View File

@@ -1,6 +1,5 @@
import { useCallback, useMemo } from 'react';
import { useQuery, useQueryClient } from 'react-query';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
@@ -68,7 +67,7 @@ export function useEntityTraces({
offset,
pageSize,
});
return GetMetricQueryRange(query, ENTITY_VERSION_V5, undefined, signal);
return GetMetricQueryRange(query, undefined, signal);
},
enabled: !!expression?.trim(),
});

View File

@@ -14,7 +14,6 @@ import logEvent from 'api/common/logEvent';
import ListViewOrderBy from 'components/OrderBy/ListViewOrderBy';
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
import type { TableColumnDef } from 'components/TanStackTableView/types';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
import { QueryParams } from 'constants/query';
import { initialQueryAIWithType, PANEL_TYPES } from 'constants/queryBuilder';
@@ -145,7 +144,6 @@ function ListView({
selectColumns,
},
},
ENTITY_VERSION_V5,
{
queryKey,
enabled:

View File

@@ -12,7 +12,6 @@ import { useSelector } from 'react-redux';
import Space from 'periscope/components/Space/Space';
import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
import ExportMenu from 'components/ExportMenu/ExportMenu';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { QueryTable } from 'container/QueryTable';
@@ -71,7 +70,6 @@ function TableView({
dataSource: 'traces',
},
},
ENTITY_VERSION_V5,
{
queryKey,
enabled: !!stagedQuery && panelType === PANEL_TYPES.TABLE,

View File

@@ -8,7 +8,6 @@ import {
import { QueryKey } from 'react-query';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import TimeSeriesView from 'container/TimeSeriesView/TimeSeriesView';
@@ -89,7 +88,6 @@ function TimeSeriesViewContainer({
dataSource,
},
},
ENTITY_VERSION_V5,
{
queryKey,
enabled: !!stagedQuery && panelType === PANEL_TYPES.TIME_SERIES,

View File

@@ -14,7 +14,6 @@ import logEvent from 'api/common/logEvent';
import ListViewOrderBy from 'components/OrderBy/ListViewOrderBy';
import { SavedviewtypesSourceDTO } from 'api/generated/services/sigNoz.schemas';
import type { TableColumnDef } from 'components/TanStackTableView/types';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
import { QueryParams } from 'constants/query';
import { initialQueryAIWithType, PANEL_TYPES } from 'constants/queryBuilder';
@@ -140,7 +139,6 @@ function TracesView({
pagination: paginationQueryData,
},
},
ENTITY_VERSION_V5,
{
queryKey,
enabled: !!stagedQuery && panelType === PANEL_TYPES.TRACE,

View File

@@ -1,5 +1,4 @@
import { useMemo } from 'react';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LIVE_TAIL_GRAPH_INTERVAL } from 'constants/liveTail';
import { PANEL_TYPES } from 'constants/queryBuilder';
import LogsExplorerChart from 'container/LogsExplorerChart';
@@ -57,7 +56,6 @@ function LiveLogsListChart({
const { data, isFetching } = useGetExplorerQueryRange(
listChartQuery,
PANEL_TYPES.TIME_SERIES,
ENTITY_VERSION_V5,
{
enabled: isConnectionOpen,
refetchInterval: LIVE_TAIL_GRAPH_INTERVAL,

View File

@@ -7,7 +7,6 @@ import {
useMemo,
useState,
} from 'react';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import {
getOrderByTimestamp,
@@ -131,7 +130,6 @@ export const useContextLogData = ({
const { isError, isFetching } = useGetExplorerQueryRange(
requestData,
PANEL_TYPES.LIST,
ENTITY_VERSION_V5,
{
keepPreviousData: true,
enabled: !!requestData,

View File

@@ -4,7 +4,6 @@ import { Card, Skeleton } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import cx from 'classnames';
import Uplot from 'components/Uplot';
import { ENTITY_VERSION_V5 } from 'constants/app';
import dayjs from 'dayjs';
import { useIsDarkMode } from 'hooks/useDarkMode';
import { useResizeObserver } from 'hooks/useDimensions';
@@ -60,9 +59,9 @@ function NodeMetrics({
const widgetInfo = nodeName ? nodeWidgetInfo : hostWidgetInfo;
const queries = useQueries(
queryPayloads.map((payload) => ({
queryKey: ['metrics', payload, ENTITY_VERSION_V5, 'NODE'],
queryKey: ['metrics', payload, 'NODE'],
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
GetMetricQueryRange(payload),
enabled: !!payload,
})),
);

View File

@@ -4,7 +4,6 @@ import { Card, Skeleton } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import cx from 'classnames';
import Uplot from 'components/Uplot';
import { ENTITY_VERSION_V5 } from 'constants/app';
import dayjs from 'dayjs';
import { useIsDarkMode } from 'hooks/useDarkMode';
import { useResizeObserver } from 'hooks/useDimensions';
@@ -57,9 +56,9 @@ function PodMetrics({
);
const queries = useQueries(
queryPayloads.map((payload) => ({
queryKey: ['metrics', payload, ENTITY_VERSION_V5, 'POD'],
queryKey: ['metrics', payload, 'POD'],
queryFn: (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
GetMetricQueryRange(payload, ENTITY_VERSION_V5),
GetMetricQueryRange(payload),
enabled: !!payload,
})),
);

View File

@@ -14,7 +14,6 @@ import { useSelector } from 'react-redux';
import getFromLocalstorage from 'api/browser/localstorage/get';
import setToLocalstorage from 'api/browser/localstorage/set';
import logEvent from 'api/common/logEvent';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
import { QueryParams } from 'constants/query';
import {
@@ -152,7 +151,6 @@ function LogsExplorerViewsContainer({
} = useGetExplorerQueryRange(
listChartQuery,
PANEL_TYPES.TIME_SERIES,
ENTITY_VERSION_V5,
{
enabled:
showFrequencyChart &&
@@ -170,7 +168,6 @@ function LogsExplorerViewsContainer({
useGetExplorerQueryRange(
requestData,
selectedPanelType,
ENTITY_VERSION_V5,
{
keepPreviousData: true,
enabled: !isLimit && !!requestData,

View File

@@ -118,7 +118,7 @@ function Section(section: MetricSection): JSX.Element {
$panelType={PANEL_TYPES.BAR}
className="meter-graph"
>
<GridCard widget={widget} onDragSelect={onDragSelect} version="v5" />
<GridCard widget={widget} onDragSelect={onDragSelect} />
</Card>
))}
</div>

View File

@@ -1,7 +1,6 @@
import { useEffect, useMemo } from 'react';
import { useQueries } from 'react-query';
import { isAxiosError } from 'axios';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueryMeterWithType, PANEL_TYPES } from 'constants/queryBuilder';
import { MAX_QUERY_RETRIES } from 'constants/reactQuery';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
@@ -72,7 +71,6 @@ export function useTimeSeriesQueries({
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,
payload,
ENTITY_VERSION_V5,
globalSelectedTime,
maxTime,
minTime,
@@ -93,7 +91,6 @@ export function useTimeSeriesQueries({
dataSource: DataSource.METRICS,
},
},
ENTITY_VERSION_V5,
undefined,
signal,
),

View File

@@ -5,7 +5,6 @@ import { useAppLocation } from 'lib/router/useAppLocation';
import { useAppParams } from 'lib/router/useAppParams';
import Col from 'periscope/components/Col/Col';
import logEvent from 'api/common/logEvent';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import Graph from 'container/WidgetCard/Card';
@@ -201,7 +200,6 @@ function DBCall(): JSX.Element {
);
}}
onDragSelect={onDragSelect}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>
@@ -240,7 +238,6 @@ function DBCall(): JSX.Element {
);
}}
onDragSelect={onDragSelect}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>

View File

@@ -5,7 +5,6 @@ import { useAppLocation } from 'lib/router/useAppLocation';
import { useAppParams } from 'lib/router/useAppParams';
import Col from 'periscope/components/Col/Col';
import logEvent from 'api/common/logEvent';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import Graph from 'container/WidgetCard/Card';
@@ -273,7 +272,6 @@ function External(): JSX.Element {
);
}}
onDragSelect={onDragSelect}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>
@@ -317,7 +315,6 @@ function External(): JSX.Element {
);
}}
onDragSelect={onDragSelect}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>
@@ -362,7 +359,6 @@ function External(): JSX.Element {
)
}
onDragSelect={onDragSelect}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>
@@ -406,7 +402,6 @@ function External(): JSX.Element {
);
}}
onDragSelect={onDragSelect}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>

View File

@@ -8,7 +8,6 @@ import {
apDexToolTipUrl,
apDexToolTipUrlText,
} from 'constants/apDex';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import Graph from 'container/WidgetCard/Card';
import DisplayThreshold from 'container/WidgetCard/Header/DisplayThreshold';
@@ -98,7 +97,6 @@ function ApDexMetrics({
onClickHandler={handleGraphClick('ApDex')}
threshold={threshold}
isQueryEnabled={isQueryEnabled}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
);

View File

@@ -1,6 +1,5 @@
import { useMemo } from 'react';
import { useAppParams } from 'lib/router/useAppParams';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { FeatureKeys } from 'constants/features';
import { PANEL_TYPES } from 'constants/queryBuilder';
import Graph from 'container/WidgetCard/Card';
@@ -119,7 +118,6 @@ function ServiceOverview({
widget={latencyWidget}
onClickHandler={handleGraphClick('Service')}
isQueryEnabled={isQueryEnabled}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>

View File

@@ -1,7 +1,6 @@
import { Typography } from '@signozhq/ui/typography';
import axios from 'axios';
import { SOMETHING_WENT_WRONG } from 'constants/api';
import { ENTITY_VERSION_V5 } from 'constants/app';
import Graph from 'container/WidgetCard/Card';
import { SERVICE_DETAIL_DRILLDOWN_ENABLED } from 'container/MetricsApplication/constant';
import { Card, GraphContainer } from 'container/MetricsApplication/styles';
@@ -40,7 +39,6 @@ function TopLevelOperation({
onClickHandler={handleGraphClick(opName)}
onDragSelect={onDragSelect}
isQueryEnabled={!topLevelOperationsIsLoading}
version={ENTITY_VERSION_V5}
enableDrillDown={SERVICE_DETAIL_DRILLDOWN_ENABLED}
/>
</GraphContainer>

View File

@@ -2,7 +2,6 @@ import { ReactNode, useMemo } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { useAppParams } from 'lib/router/useAppParams';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { topOperationMetricsDownloadOptions } from 'container/MetricsApplication/constant';
import { getWidgetQueryBuilder } from 'container/MetricsApplication/MetricsApplication.factory';
@@ -71,7 +70,6 @@ function TopOperationMetrics(): JSX.Element {
globalSelectedInterval,
variables: {},
},
ENTITY_VERSION_V5,
{
queryKey: [
`GetMetricsQueryRange-${keyOperationWidget?.timePreferance}-${globalSelectedInterval}-${keyOperationWidget?.id}`,

View File

@@ -16,7 +16,6 @@ import classNames from 'classnames';
import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
import YAxisUnitSelector from 'components/YAxisUnitSelector';
import { YAxisSource } from 'components/YAxisUnitSelector/types';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { MAX_QUERY_RETRIES } from 'constants/reactQuery';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
@@ -102,7 +101,6 @@ function TimeSeries({
queryKey: [
REACT_QUERY_KEY.GET_QUERY_RANGE,
payload,
ENTITY_VERSION_V5,
globalSelectedTime,
maxTime,
minTime,
@@ -123,7 +121,6 @@ function TimeSeries({
dataSource: DataSource.METRICS,
},
},
ENTITY_VERSION_V5,
undefined,
signal,
),

View File

@@ -1,5 +1,4 @@
import { useMemo } from 'react';
import { ENTITY_VERSION_V5 } from 'constants/app';
import {
initialFilters,
initialQueriesMap,
@@ -27,15 +26,12 @@ function LogsCountInInterval({
return q;
}, [filter]);
const result = useGetQueryRange(
{
graphType: PANEL_TYPES.TABLE,
query,
selectedTime: 'GLOBAL_TIME',
globalSelectedInterval: timeInterval,
},
ENTITY_VERSION_V5,
);
const result = useGetQueryRange({
graphType: PANEL_TYPES.TABLE,
query,
selectedTime: 'GLOBAL_TIME',
globalSelectedInterval: timeInterval,
});
const count = useMemo(() => {
const table = result.data?.payload?.data?.result?.[0]?.table;

View File

@@ -1,5 +1,4 @@
import { useMemo } from 'react';
import { ENTITY_VERSION_V5 } from 'constants/app';
import {
initialFilters,
initialQueriesMap,
@@ -43,15 +42,12 @@ const useSampleLogs = ({
return q;
}, [count, filter]);
const response = useGetQueryRange(
{
graphType: PANEL_TYPES.LIST,
query,
selectedTime: 'GLOBAL_TIME',
globalSelectedInterval: timeInterval,
},
ENTITY_VERSION_V5,
);
const response = useGetQueryRange({
graphType: PANEL_TYPES.LIST,
query,
selectedTime: 'GLOBAL_TIME',
globalSelectedInterval: timeInterval,
});
const { isFetching: isLoading, data } = response;

View File

@@ -8,7 +8,6 @@ export type OrderByFilterProps = {
query: IBuilderQuery;
onChange: (values: OrderByPayload[]) => void;
isRawQuery?: boolean;
isNewQueryV2?: boolean;
placeholder?: string;
/** A logs or traces heatmap aggregates a field, which Order by then offers. */
panelType?: PANEL_TYPES;

View File

@@ -20,7 +20,6 @@ export function OrderByFilter({
query,
onChange,
isRawQuery = false,
isNewQueryV2 = false,
placeholder,
panelType,
}: OrderByFilterProps): JSX.Element {
@@ -28,7 +27,6 @@ export function OrderByFilter({
const {
debouncedSearchText,
selectedValue,
aggregationOptions,
generateOptions,
createOptions,
handleChange,
@@ -50,11 +48,10 @@ export function OrderByFilter({
},
);
// Get parsed aggregation options using createAggregation only for QueryV2
// Get parsed aggregation options using createAggregation
const parsedAggregationOptions = useMemo(
() =>
isNewQueryV2 ? getParsedAggregationOptionsForOrderBy(query, panelType) : [],
[query, isNewQueryV2, panelType],
() => getParsedAggregationOptionsForOrderBy(query, panelType),
[query, panelType],
);
const optionsData = useMemo(() => {
@@ -67,10 +64,7 @@ export function OrderByFilter({
const options =
query.aggregateOperator === MetricAggregateOperator.NOOP
? keyOptions
: [
...groupByOptions,
...(isNewQueryV2 ? aggregationOptionsFromParsed : aggregationOptions),
];
: [...groupByOptions, ...aggregationOptionsFromParsed];
return generateOptions(options);
}, [
@@ -79,9 +73,7 @@ export function OrderByFilter({
query.groupBy,
query.aggregateOperator,
parsedAggregationOptions,
aggregationOptions,
generateOptions,
isNewQueryV2,
]);
const isDisabledSelect =

View File

@@ -39,7 +39,6 @@ function setup(query: Partial<IBuilderQuery>): { onChange: jest.Mock } {
}
onChange={onChange}
isRawQuery
isNewQueryV2
/>,
);
return { onChange };

View File

@@ -22,7 +22,6 @@ export type UseOrderByFilterResult = {
searchText: string;
debouncedSearchText: string;
selectedValue: IOption[];
aggregationOptions: IOption[];
generateOptions: (options: IOption[]) => IOption[];
createOptions: (keys: string[]) => IOption[];
handleChange: (values: IOption[]) => void;
@@ -123,29 +122,10 @@ export const useOrderByFilter = ({
[],
);
const aggregationOptions = useMemo(
() => [
{
label: `${query.aggregateOperator}(${query.aggregateAttribute?.key}) ${
ORDERBY_FILTERS.ASC
}`,
value: `${SIGNOZ_VALUE}${orderByValueDelimiter}${ORDERBY_FILTERS.ASC}`,
},
{
label: `${query.aggregateOperator}(${query.aggregateAttribute?.key}) ${
ORDERBY_FILTERS.DESC
}`,
value: `${SIGNOZ_VALUE}${orderByValueDelimiter}${ORDERBY_FILTERS.DESC}`,
},
],
[query],
);
return {
searchText,
debouncedSearchText,
selectedValue,
aggregationOptions,
createOptions,
handleChange,
handleSearchKeys,

View File

@@ -36,7 +36,3 @@
border: 1px solid var(--danger-background);
border-radius: 4px;
}
.jsonEditorErrorMessage {
word-break: break-word;
}

View File

@@ -39,45 +39,6 @@
padding-bottom: var(--spacing-8);
}
.permissionEditorCollapsedSection {
display: flex;
flex-direction: column;
}
.permissionEditorCollapsedHeader {
display: flex;
align-items: center;
gap: var(--spacing-4);
width: 100%;
padding: var(--spacing-4) var(--spacing-6);
background: var(--l3-background);
border: 1px dashed var(--l2-border);
border-radius: 4px;
cursor: pointer;
transition: background 0.15s ease;
&:hover {
background: var(--l2-background);
}
&:focus {
outline: 2px solid var(--primary);
outline-offset: -2px;
}
}
.permissionEditorCollapsedLabel {
color: var(--l2-foreground);
flex: 1;
white-space: nowrap;
overflow: hidden;
}
.permissionEditorCollapsedCount {
color: var(--primary);
flex-shrink: 0;
}
.permissionEditorCollapseAction {
display: flex;
justify-content: flex-start;

View File

@@ -139,19 +139,6 @@
:global(.ant-pagination-total-text) {
margin-right: auto;
.numbers {
font-family: Inter;
font-size: 12px;
color: var(--foreground);
}
.total {
font-family: Inter;
font-size: 12px;
color: var(--foreground);
opacity: 0.5;
}
}
}

View File

@@ -47,141 +47,3 @@
flex: 1;
min-width: 0;
}
.rolesDescriptionTooltip {
max-height: none;
overflow-y: visible;
}
.rolesListingTable {
margin-top: 12px;
border-radius: 4px;
overflow: hidden;
}
.rolesTableScrollContainer {
overflow-x: auto;
}
.rolesTableInner {
min-width: 850px;
}
.rolesTableHeader {
display: flex;
align-items: center;
padding: 8px 16px;
gap: 24px;
}
.rolesTableHeaderCell {
color: var(--foreground);
}
.rolesTableHeaderCellName {
flex: 0 0 180px;
}
.rolesTableHeaderCellDescription {
flex: 1;
min-width: 0;
}
.rolesTableHeaderCellCreatedAt {
flex: 0 0 180px;
}
.rolesTableHeaderCellUpdatedAt {
flex: 0 0 180px;
}
.rolesTableSectionHeader {
display: flex;
align-items: center;
gap: 8px;
height: 32px;
padding: 0 16px;
background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
border-top: 1px solid var(--secondary);
border-bottom: 1px solid var(--secondary);
color: var(--foreground);
margin: 0;
}
.rolesTableSectionHeaderCount {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 20px;
height: 18px;
padding: 0 6px;
border-radius: 9px;
background: var(--l3-background);
color: var(--foreground);
}
.rolesTableRow {
display: flex;
align-items: center;
padding: 8px 16px;
background: color-mix(in srgb, var(--bg-robin-200) 2%, transparent);
border-bottom: 1px solid var(--secondary);
gap: 24px;
}
.rolesTableRowClickable {
cursor: pointer;
&:hover {
background: color-mix(in srgb, var(--bg-robin-200) 5%, transparent);
}
}
.rolesTableCell {
color: var(--foreground);
}
.rolesTableCellName {
flex: 0 0 180px;
}
.rolesTableCellDescription {
flex: 1;
min-width: 0;
overflow: hidden;
}
.rolesTableCellCreatedAt {
flex: 0 0 180px;
white-space: nowrap;
}
.rolesTableCellUpdatedAt {
flex: 0 0 180px;
white-space: nowrap;
}
.rolesTableEmpty {
padding: 24px 16px;
color: var(--foreground);
}
.rolesTablePagination {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 8px 16px;
:global(.ant-pagination-total-text) {
margin-right: auto;
}
:global(.ant-pagination-total-text .numbers) {
color: var(--foreground);
}
:global(.ant-pagination-total-text .total) {
color: var(--foreground);
opacity: 0.5;
}
}

View File

@@ -29,10 +29,6 @@
gap: var(--spacing-6);
}
.unsavedText {
color: var(--primary);
}
.viewRolePageContent {
display: flex;
flex-direction: column;
@@ -68,12 +64,6 @@
color: var(--l2-foreground);
}
.viewRolePageDivider {
width: 100%;
height: 1px;
background: var(--l1-border);
}
// The one grid row stretches the Tabs root to the height left on the page.
.roleTabs {
display: grid;

View File

@@ -15,7 +15,3 @@
flex-direction: column;
gap: var(--spacing-10);
}
.errorText {
padding: var(--spacing-4);
}

View File

@@ -29,13 +29,3 @@ export interface RolePermissionsData {
roleDescription: string;
resources: ResourcePermissions[];
}
export interface SelectableItem {
id: string;
label: string;
}
export interface ResourceItemsResult {
items: SelectableItem[];
isLoading: boolean;
}

View File

@@ -7,7 +7,6 @@ import { SolidAlertTriangle } from '@signozhq/icons';
import Flex from 'periscope/components/Flex/Flex';
import { Typography } from '@signozhq/ui/typography';
import { ResizeTable } from 'components/ResizeTable';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { MAX_RPS_LIMIT } from 'constants/global';
import ResourceAttributesFilter from 'container/ResourceAttributesFilter';
import { useGetQueriesRange } from 'hooks/queryBuilder/useGetQueriesRange';
@@ -40,7 +39,7 @@ function ServiceMetricTable({
const { isFetchingActiveLicense, trialInfo } = useAppContext();
const { isCloudUser: isCloudUserVal } = useGetTenantLicense();
const queries = useGetQueriesRange(queryRangeRequestData, ENTITY_VERSION_V5, {
const queries = useGetQueriesRange(queryRangeRequestData, {
queryKey: [
`GetMetricsQueryRange-${queryRangeRequestData[0]?.selectedTime}-${globalSelectedInterval}`,
maxTime,

View File

@@ -1,6 +1,5 @@
import { useCallback, useMemo } from 'react';
import { QueryKey, useInfiniteQuery } from 'react-query';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { DEFAULT_PER_PAGE_VALUE } from 'container/Controls/config';
import { TracesTableRow } from 'container/TracesExplorer/TracesTable/getFieldColumn';
@@ -64,7 +63,6 @@ export function useListViewInfiniteQuery({
},
},
},
ENTITY_VERSION_V5,
undefined,
signal,
),

View File

@@ -12,7 +12,6 @@ import { useSelector } from 'react-redux';
import Space from 'periscope/components/Space/Space';
import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';
import ExportMenu from 'components/ExportMenu/ExportMenu';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { QueryTable } from 'container/QueryTable';
@@ -71,7 +70,6 @@ function TableView({
dataSource: 'traces',
},
},
ENTITY_VERSION_V5,
{
queryKey,
enabled: !!stagedQuery && panelType === PANEL_TYPES.TABLE,

View File

@@ -12,7 +12,6 @@ import { useSelector } from 'react-redux';
import { Typography } from '@signozhq/ui/typography';
import logEvent from 'api/common/logEvent';
import DownloadOptionsMenu from 'components/DownloadOptionsMenu/DownloadOptionsMenu';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { LOCALSTORAGE } from 'constants/localStorage';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
@@ -102,7 +101,6 @@ function TracesView({
pagination: pagination.request,
},
},
ENTITY_VERSION_V5,
{
queryKey,
keepPreviousData: true,

View File

@@ -19,7 +19,6 @@ import QueryCancelledPlaceholder from 'components/QueryCancelledPlaceholder';
import Spinner from 'components/Spinner';
import TimePreference from 'components/TimePreferenceDropDown';
import WarningPopover from 'components/WarningPopover/WarningPopover';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { PanelMode } from 'lib/visualization/panels/types';
@@ -55,7 +54,6 @@ import 'container/WidgetCard/Card/FullView/WidgetFullView.styles.scss';
function FullView({
widget,
fullViewOptions = true,
version,
originalName,
tableProcessedDataRef,
isDependedDataLoaded = false,
@@ -170,18 +168,11 @@ function FullView({
}, [selectedPanelType]);
const queryRangeKey = useMemo(
() => [
widget?.query,
selectedPanelType,
requestData,
version,
minTime,
maxTime,
],
[widget?.query, selectedPanelType, requestData, version, minTime, maxTime],
() => [widget?.query, selectedPanelType, requestData, minTime, maxTime],
[widget?.query, selectedPanelType, requestData, minTime, maxTime],
);
const response = useGetQueryRange(requestData, ENTITY_VERSION_V5, {
const response = useGetQueryRange(requestData, {
queryKey: queryRangeKey,
enabled: !isDependedDataLoaded,
keepPreviousData: true,

View File

@@ -24,7 +24,6 @@ export interface FullViewProps {
customOnDragSelect?: (start: number, end: number) => void;
name: string;
tableProcessedDataRef: MutableRefObject<RowData[]>;
version?: string;
originalName: string;
yAxisUnit?: string;
isDependedDataLoaded?: boolean;

View File

@@ -141,7 +141,6 @@ const mockProps: WidgetGraphComponentProps = {
remove: jest.fn(),
},
errorMessage: '',
version: 'v4',
headerMenuList: [
MenuItemKeys.View,
MenuItemKeys.Clone,
@@ -170,7 +169,6 @@ describe('WidgetGraphComponent', () => {
widget={mockProps.widget}
queryResponse={mockProps.queryResponse}
errorMessage={mockProps.errorMessage}
version={mockProps.version}
headerMenuList={mockProps.headerMenuList}
isWarning={mockProps.isWarning}
isFetchingResponse={mockProps.isFetchingResponse}

View File

@@ -1,7 +1,6 @@
import { RefObject, useEffect, useRef, useState } from 'react';
import { useAppLocation } from 'lib/router/useAppLocation';
import { Skeleton, Tooltip } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import cx from 'classnames';
import { useNavigateToExplorer } from 'components/CeleryTask/useNavigateToExplorer';
import { ToggleGraphProps } from 'components/Graph/types';
@@ -38,7 +37,6 @@ import 'container/WidgetCard/WidgetCard.styles.scss';
function WidgetGraphComponent({
widget,
queryResponse,
version,
threshold,
headerMenuList,
isWarning,
@@ -51,7 +49,6 @@ function WidgetGraphComponent({
openTracesButton,
onOpenTraceBtnClick,
customSeries,
customErrorMessage,
customOnRowClick,
customTimeRangeWindowForCoRelation,
enableDrillDown,
@@ -209,7 +206,6 @@ function WidgetGraphComponent({
>
<FullView
name={`${widget.id}expanded`}
version={version}
originalName={widget.id}
widget={widget}
yAxisUnit={widget.yAxisUnit}
@@ -239,21 +235,6 @@ function WidgetGraphComponent({
/>
</div>
{queryResponse.error && customErrorMessage && (
<div className="error-message-container">
<Typography
variant="paragraph"
size="base"
weight="regular"
color="warning"
as="span"
textOverflow="wrap"
>
{customErrorMessage}
</Typography>
</div>
)}
{queryResponse.isLoading && widget.panelTypes !== PANEL_TYPES.LIST && (
<div data-testid="widget-graph-loading">
<Skeleton />

View File

@@ -1,5 +1,4 @@
import { prepareQueryRangePayloadV5 } from 'api/v5/queryRange/prepareQueryRangePayloadV5';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { getWidgetQueryBuilder } from 'container/MetricsApplication/MetricsApplication.factory';
import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
@@ -87,7 +86,6 @@ describe('GridCardGraph', () => {
<GridCardGraph
widget={widgetFiltering('name in []')}
isQueryEnabled={enabledBefore}
version={ENTITY_VERSION_V5}
/>,
);
@@ -95,7 +93,6 @@ describe('GridCardGraph', () => {
<GridCardGraph
widget={widgetFiltering("name in ['GET /']")}
isQueryEnabled
version={ENTITY_VERSION_V5}
/>,
);
@@ -113,10 +110,7 @@ describe('GridCardGraph', () => {
widgetFiltering(expression, DataSource.LOGS, PANEL_TYPES.LIST);
const { rerender } = render(
<GridCardGraph
widget={logsList("severity_text = 'ERROR'")}
version={ENTITY_VERSION_V5}
/>,
<GridCardGraph widget={logsList("severity_text = 'ERROR'")} />,
);
await user.click(
@@ -127,12 +121,7 @@ describe('GridCardGraph', () => {
await user.click(await screen.findByText('50 / page'));
await waitFor(() => expect(lastRequestedLimit()).toBe(50));
rerender(
<GridCardGraph
widget={logsList("severity_text = 'WARN'")}
version={ENTITY_VERSION_V5}
/>,
);
rerender(<GridCardGraph widget={logsList("severity_text = 'WARN'")} />);
await waitFor(() =>
expect(requestedFilters()).toContain("severity_text = 'WARN'"),

View File

@@ -2,7 +2,6 @@ import { memo, useEffect, useMemo, useRef, useState } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useDispatch, useSelector } from 'react-redux';
import logEvent from 'api/common/logEvent';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { QueryParams } from 'constants/query';
import { PANEL_TYPES } from 'constants/queryBuilder';
import { useScrollWidgetIntoView } from 'lib/visualization/hooks/useScrollWidgetIntoView';
@@ -15,7 +14,6 @@ import getTimeString from 'lib/getTimeString';
import isEmpty from 'lodash-es/isEmpty';
import { UpdateTimeInterval } from 'store/actions';
import { AppState } from 'store/reducers';
import APIError from 'types/api/error';
import { DataSource } from 'types/common/queryBuilder';
import { GlobalReducer } from 'types/reducer/globalTime';
import { getGraphType } from 'utils/getGraphType';
@@ -41,7 +39,6 @@ function GridCardGraph({
headerMenuList = [MenuItemKeys.View],
isQueryEnabled,
threshold,
version,
onClickHandler,
onDragSelect,
customOnDragSelect,
@@ -62,8 +59,6 @@ function GridCardGraph({
}: GridCardGraphProps): JSX.Element {
const dispatch = useDispatch();
const [errorMessage, setErrorMessage] = useState<string>();
const [isInternalServerError, setIsInternalServerError] =
useState<boolean>(false);
const {
minTime,
maxTime,
@@ -171,7 +166,6 @@ function GridCardGraph({
end: customTimeRange?.endTime || end,
originalGraphType: widget?.panelTypes,
},
version || ENTITY_VERSION_V5,
{
queryKey: [
REACT_QUERY_KEY.DASHBOARD_GRID_CARD_QUERY_RANGE,
@@ -188,16 +182,7 @@ function GridCardGraph({
? [customTimeRange.startTime, customTimeRange.endTime]
: []),
],
retry(failureCount, error): boolean {
if (
String(error).includes('status: error') &&
String(error).includes('i/o timeout')
) {
return false;
}
return failureCount < 2;
},
retry: 2,
keepPreviousData: true,
cacheTime: isAutoRefreshDisabled
? DASHBOARD_CACHE_TIME
@@ -205,21 +190,11 @@ function GridCardGraph({
enabled: queryEnabledCondition,
refetchOnMount: false,
onError: (error) => {
const errorMessage =
version === ENTITY_VERSION_V5
? errorDetails(error as APIError)
: error.message;
setErrorMessage(errorMessage);
if (customErrorMessage) {
setIsInternalServerError(
String(error.message).includes('API responded with 500'),
);
if (analyticsEvent) {
void logEvent(analyticsEvent, {
error: error.message,
});
}
setErrorMessage(errorDetails(error));
if (customErrorMessage && analyticsEvent) {
void logEvent(analyticsEvent, {
error: error.message,
});
}
},
onSettled: (data) => {
@@ -262,7 +237,6 @@ function GridCardGraph({
queryResponse={queryResponse}
errorMessage={errorMessage}
isWarning={!isEmpty(queryResponse.data?.warning)}
version={version}
threshold={threshold}
headerMenuList={menuList}
isFetchingResponse={queryResponse.isFetching}
@@ -274,7 +248,6 @@ function GridCardGraph({
openTracesButton={openTracesButton}
onOpenTraceBtnClick={onOpenTraceBtnClick}
customSeries={customSeries}
customErrorMessage={isInternalServerError ? customErrorMessage : undefined}
customOnRowClick={customOnRowClick}
customTimeRangeWindowForCoRelation={customTimeRangeWindowForCoRelation}
enableDrillDown={enableDrillDown}
@@ -290,7 +263,6 @@ GridCardGraph.defaultProps = {
isQueryEnabled: true,
threshold: undefined,
headerMenuList: [MenuItemKeys.View],
version: ENTITY_VERSION_V5,
analyticsEvent: undefined,
customTimeRangeWindowForCoRelation: undefined,
enableDrillDown: false,

View File

@@ -23,7 +23,6 @@ export interface WidgetGraphComponentProps {
widget: Widgets;
queryResponse: UseQueryResult<MetricQueryRangeSuccessResponse, Error>;
errorMessage: string | undefined;
version?: string;
threshold?: ReactNode;
headerMenuList: MenuItemKeys[];
isWarning: boolean;
@@ -36,7 +35,6 @@ export interface WidgetGraphComponentProps {
openTracesButton?: boolean;
onOpenTraceBtnClick?: (record: RowData) => void;
customSeries?: (data: QueryData[]) => uPlot.Series[];
customErrorMessage?: string;
customOnRowClick?: (record: RowData) => void;
customTimeRangeWindowForCoRelation?: string | undefined;
enableDrillDown?: boolean;
@@ -50,7 +48,6 @@ export interface GridCardGraphProps {
headerMenuList?: WidgetGraphComponentProps['headerMenuList'];
onClickHandler?: OnClickPluginOpts['onClick'];
isQueryEnabled: boolean;
version?: string;
onDragSelect: (start: number, end: number) => void;
customOnDragSelect?: (start: number, end: number) => void;
customTooltipElement?: HTMLDivElement;

View File

@@ -15,7 +15,7 @@ function ValuePanelWrapper({
?.rows?.[0]?.data || {},
);
// this is for handling both query_range v3 and v5 responses
// a value panel gets a scalar response, which has no series, only a table row
const gridValueData = data?.[0].length > 0 ? data : [[0], dataNew];
return (

View File

@@ -24,16 +24,6 @@
}
}
.error-message-container {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
padding-top: 0;
padding-bottom: 32px;
}
.row-settings {
.ant-popover-inner {
width: 191px;

View File

@@ -2,7 +2,6 @@ import { MutableRefObject, useMemo } from 'react';
import { UseQueryOptions, UseQueryResult } from 'react-query';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
@@ -17,7 +16,6 @@ import { useQueryBuilder } from './useQueryBuilder';
export const useGetExplorerQueryRange = (
requestData: Query | null,
panelType: PANEL_TYPES | null,
version: string,
options?: UseQueryOptions<MetricQueryRangeSuccessResponse, Error>,
params?: Record<string, unknown>,
isDependentOnQB = true,
@@ -61,8 +59,6 @@ export const useGetExplorerQueryRange = (
query: requestData || initialQueriesMap.metrics,
params,
},
// version,
ENTITY_VERSION_V5,
{
...options,
queryKey: [key, globalSelectedInterval, requestData, minTime, maxTime],

View File

@@ -15,7 +15,6 @@ import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
export const useGetQueriesRange = (
requestData: GetQueryResultsProps[],
version: string,
options: UseQueryOptions<SuccessResponse<MetricRangePayloadProps>, Error>,
): UseQueryResult<SuccessResponse<MetricRangePayloadProps>, Error>[] => {
const queryKey = useMemo(() => {
@@ -27,7 +26,7 @@ export const useGetQueriesRange = (
const queryData = requestData.map((request, index) => ({
queryFn: async (): Promise<SuccessResponse<MetricRangePayloadProps>> =>
GetMetricQueryRange(request, version),
GetMetricQueryRange(request),
...options,
queryKey: [...queryKey, index] as QueryKey,
}));

View File

@@ -22,14 +22,12 @@ type UseGetQueryRangeOptions = UseQueryOptions<
type UseGetQueryRange = (
requestData: GetQueryResultsProps,
version: string,
options?: UseGetQueryRangeOptions,
headers?: Record<string, string>,
) => UseQueryResult<MetricQueryRangeSuccessResponse, Error>;
export const useGetQueryRange: UseGetQueryRange = (
requestData,
version,
options,
headers,
) => {
@@ -150,7 +148,6 @@ export const useGetQueryRange: UseGetQueryRange = (
queryFn: async ({ signal }) =>
GetMetricQueryRange(
modifiedRequestData,
version,
dashboardDynamicVariables,
signal,
headers,

View File

@@ -1,7 +1,6 @@
import { useEffect, useMemo, useState } from 'react';
// eslint-disable-next-line no-restricted-imports
import { useSelector } from 'react-redux';
import { ENTITY_VERSION_V5 } from 'constants/app';
import { QueryParams } from 'constants/query';
import {
initialQueryBuilderFormValues,
@@ -141,7 +140,6 @@ export const useLogsData = ({
const { data, isFetching } = useGetExplorerQueryRange(
requestData,
panelType,
ENTITY_VERSION_V5,
{
keepPreviousData: true,
enabled: !isLimit && !!requestData,

View File

@@ -2,7 +2,3 @@
box-sizing: border-box;
width: 100%;
}
.permission {
color: var(--l2-foreground);
}

View File

@@ -88,8 +88,3 @@
align-items: center;
gap: var(--spacing-2);
}
.count {
flex: 0 0 auto;
white-space: nowrap;
}

View File

@@ -47,15 +47,6 @@
--typography-color: var(--accent-primary);
}
.separator {
flex: 0 0 auto;
}
.object {
flex: 0 1 auto;
min-width: 0;
}
.permissionMeta {
display: flex;
flex: 0 0 auto;

View File

@@ -14,11 +14,6 @@ export type ObservedPermission = {
lastSeen: number;
};
export type PermissionOverride = {
permission: BrandedPermission;
state: OverrideState;
};
export type AuthZDevStore = {
isModalOpen: boolean;
observed: Record<string, ObservedPermission>;

Some files were not shown because too many files have changed in this diff Show More