Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: use endpoint for fetching data (#12926)

Gaurav Tewarib071610a2772
diff --git a/frontend/src/container/LLMObservability/Overview/Overview.module.scss b/frontend/src/container/LLMObservability/Overview/Overview.module.scss
index 488cdaef6f..b2b3f2c09e 100644
--- a/frontend/src/container/LLMObservability/Overview/Overview.module.scss
+++ b/frontend/src/container/LLMObservability/Overview/Overview.module.scss
@@ -10,3 +10,11 @@
display: none;
}
}
+
+.errorState {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: var(--spacing-2);
+ padding: var(--spacing-8);
+}
diff --git a/frontend/src/container/LLMObservability/Overview/Overview.tsx b/frontend/src/container/LLMObservability/Overview/Overview.tsx
index d4073ce1d4..93e7f33453 100644
--- a/frontend/src/container/LLMObservability/Overview/Overview.tsx
+++ b/frontend/src/container/LLMObservability/Overview/Overview.tsx
@@ -1,19 +1,41 @@
+import { Typography } from '@signozhq/ui/typography';
+import Spinner from 'components/Spinner';
import DashboardContainer from 'pages/DashboardPage/DashboardContainer';
-import { useSeededDashboardV2 } from './hooks/useSeededDashboardV2';
+import { useSystemDashboard } from './hooks/useSystemDashboard';
import styles from './Overview.module.scss';
function Overview(): JSX.Element {
- //TODO: this is a temporary solution to get the seeded dashboard. We should fetch this json from the backend.
- const { dashboard, refetch } = useSeededDashboardV2();
+ const { dashboard, isLoading, isError, error, refetch } = useSystemDashboard();
- return (
- <div className={styles.overview} data-testid="llm-observability-overview">
+ const renderContent = (): JSX.Element => {
+ if (isLoading) {
+ return <Spinner tip="Loading dashboard..." />;
+ }
+
+ if (isError || !dashboard) {
+ return (
+ <div className={styles.errorState}>
+ <Typography.Title>Failed to load dashboard</Typography.Title>
+ <Typography.Text>
+ {error?.response?.data?.error?.message ?? error?.message}
+ </Typography.Text>
+ </div>
+ );
+ }
+
+ return (
<DashboardContainer
dashboard={dashboard}
refetch={refetch}
canEditDashboardOverride={false}
/>
+ );
+ };
+
+ return (
+ <div className={styles.overview} data-testid="llm-observability-overview">
+ {renderContent()}
</div>
);
}
diff --git a/frontend/src/container/LLMObservability/Overview/hooks/useSeededDashboardV2.ts b/frontend/src/container/LLMObservability/Overview/hooks/useSeededDashboardV2.ts
deleted file mode 100644
index ce8a8ca993..0000000000
--- a/frontend/src/container/LLMObservability/Overview/hooks/useSeededDashboardV2.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { useQueryClient } from 'react-query';
-
-import { getGetDashboardV2QueryKey } from 'api/generated/services/dashboard';
-import type {
- DashboardtypesGettableDashboardV2DTO,
- GetDashboardV2200,
-} from 'api/generated/services/sigNoz.schemas';
-
-import dashboardV2Json from '../json/dashboard.json';
-
-const dashboard =
- dashboardV2Json as unknown as DashboardtypesGettableDashboardV2DTO;
-
-export interface UseSeededDashboardV2Result {
- dashboard: DashboardtypesGettableDashboardV2DTO;
- refetch: () => void;
-}
-
-const noop = (): void => {};
-
-export function useSeededDashboardV2(): UseSeededDashboardV2Result {
- const queryClient = useQueryClient();
-
- const key = getGetDashboardV2QueryKey({ id: dashboard.id });
- if (queryClient.getQueryData<GetDashboardV2200>(key) === undefined) {
- queryClient.setQueryData<GetDashboardV2200>(key, {
- data: dashboard,
- status: 'success',
- });
- }
-
- return { dashboard, refetch: noop };
-}
diff --git a/frontend/src/container/LLMObservability/Overview/hooks/useSystemDashboard.ts b/frontend/src/container/LLMObservability/Overview/hooks/useSystemDashboard.ts
new file mode 100644
index 0000000000..072bd8b05a
--- /dev/null
+++ b/frontend/src/container/LLMObservability/Overview/hooks/useSystemDashboard.ts
@@ -0,0 +1,56 @@
+import { useCallback, useMemo } from 'react';
+import { useQueryClient } from 'react-query';
+
+import {
+ getGetDashboardV2QueryKey,
+ useGetSystemDashboard,
+} from 'api/generated/services/dashboard';
+import type { GetSystemDashboardQueryError } from 'api/generated/services/dashboard';
+import type {
+ DashboardtypesGettableDashboardV2DTO,
+ GetDashboardV2200,
+} from 'api/generated/services/sigNoz.schemas';
+
+const SYSTEM_DASHBOARD_NAME = 'ai-o11y-overview';
+
+const DASHBOARD_ID = 'llm-observability-overview';
+
+export interface UseSystemDashboardResult {
+ dashboard: DashboardtypesGettableDashboardV2DTO | undefined;
+ isLoading: boolean;
+ isError: boolean;
+ error: GetSystemDashboardQueryError | null;
+ refetch: () => void;
+}
+
+export function useSystemDashboard(): UseSystemDashboardResult {
+ const queryClient = useQueryClient();
+ const { data, isLoading, isError, error, refetch } = useGetSystemDashboard(
+ { name: SYSTEM_DASHBOARD_NAME },
+ { query: { staleTime: Infinity, refetchOnMount: false } },
+ );
+
+ const dashboard = useMemo(
+ () =>
+ data
+ ? ({
+ ...data.data,
+ id: DASHBOARD_ID,
+ } as DashboardtypesGettableDashboardV2DTO)
+ : undefined,
+ [data],
+ );
+
+ if (dashboard) {
+ queryClient.setQueryData<GetDashboardV2200>(
+ getGetDashboardV2QueryKey({ id: DASHBOARD_ID }),
+ { data: dashboard, status: 'success' },
+ );
+ }
+
+ const refetchDashboard = useCallback((): void => {
+ void refetch();
+ }, [refetch]);
+
+ return { dashboard, isLoading, isError, error, refetch: refetchDashboard };
+}
diff --git a/frontend/src/container/LLMObservability/Overview/json/dashboard.json b/frontend/src/container/LLMObservability/Overview/json/dashboard.json
deleted file mode 100644
index 5b9b55382f..0000000000
--- a/frontend/src/container/LLMObservability/Overview/json/dashboard.json
+++ /dev/null
@@ -1,1149 +0,0 @@
-{
- "id": "llm-observability-overview",
- "orgId": "",
- "locked": false,
- "name": "AI Observability Overview",
- "schemaVersion": "v6",
- "source": "system",
- "tags": null,
- "spec": {
- "display": {
- "name": "AI Observability Overview",
- "description": "AI / LLM observability overview — cost, tokens, latency, errors, RED for tool calls, and time to first token. Scoped by model, environment and service (apply via the variable bar)."
- },
- "layouts": [
- {
- "kind": "Grid",
- "spec": {
- "items": [
- {
- "x": 0,
- "y": 0,
- "width": 3,
- "height": 3,
- "content": {
- "$ref": "#/spec/panels/11111111-1111-1111-1111-111111111111"
- }
- },
- {
- "x": 3,
- "y": 0,
- "width": 3,
- "height": 3,
- "content": {
- "$ref": "#/spec/panels/22222222-2222-2222-2222-222222222222"
- }
- },
- {
- "x": 6,
- "y": 0,
- "width": 2,
- "height": 3,
- "content": {
- "$ref": "#/spec/panels/33333333-3333-3333-3333-333333333333"
- }
- },
- {
- "x": 8,
- "y": 0,
- "width": 2,
- "height": 3,
- "content": {
- "$ref": "#/spec/panels/44444444-4444-4444-4444-444444444444"
- }
- },
- {
- "x": 10,
- "y": 0,
- "width": 2,
- "height": 3,
- "content": {
- "$ref": "#/spec/panels/55555555-5555-5555-5555-555555555555"
- }
- },
- {
- "x": 0,
- "y": 3,
- "width": 6,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/66666666-6666-6666-6666-666666666666"
- }
- },
- {
- "x": 6,
- "y": 3,
- "width": 6,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/77777777-7777-7777-7777-777777777777"
- }
- },
- {
- "x": 0,
- "y": 7,
- "width": 6,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/88888888-8888-8888-8888-888888888888"
- }
- },
- {
- "x": 6,
- "y": 7,
- "width": 6,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/99999999-9999-9999-9999-999999999999"
- }
- },
- {
- "x": 0,
- "y": 11,
- "width": 4,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
- }
- },
- {
- "x": 4,
- "y": 11,
- "width": 4,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"
- }
- },
- {
- "x": 8,
- "y": 11,
- "width": 4,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/cccccccc-cccc-cccc-cccc-cccccccccccc"
- }
- },
- {
- "x": 0,
- "y": 15,
- "width": 4,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/dddddddd-dddd-dddd-dddd-dddddddddddd"
- }
- },
- {
- "x": 4,
- "y": 15,
- "width": 4,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee"
- }
- },
- {
- "x": 8,
- "y": 15,
- "width": 4,
- "height": 4,
- "content": {
- "$ref": "#/spec/panels/ffffffff-ffff-ffff-ffff-ffffffffffff"
- }
- }
- ]
- }
- }
- ],
- "panels": {
- "11111111-1111-1111-1111-111111111111": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Total cost",
- "description": "Total LLM cost across all calls. Requires gen_ai.usage.cost attribute."
- },
- "plugin": {
- "kind": "signoz/NumberPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "sum(gen_ai.usage.cost)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "22222222-2222-2222-2222-222222222222": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Total tokens",
- "description": "Sum of input + output tokens."
- },
- "plugin": {
- "kind": "signoz/NumberPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "sum(gen_ai.usage.input_tokens)"
- },
- {
- "expression": "sum(gen_ai.usage.output_tokens)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "33333333-3333-3333-3333-333333333333": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Avg latency (p95)",
- "description": "p95 latency of LLM spans."
- },
- "plugin": {
- "kind": "signoz/NumberPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "gen_ai.system != ''"
- },
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "p95(duration_nano)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "44444444-4444-4444-4444-444444444444": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Error rate",
- "description": "Error rate as a percentage of total LLM calls."
- },
- "plugin": {
- "kind": "signoz/NumberPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "gen_ai.system != ''"
- },
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "countIf(has_error = true)"
- },
- {
- "expression": "count()"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "55555555-5555-5555-5555-555555555555": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "TTFT (p95)",
- "description": "p95 time to first token."
- },
- "plugin": {
- "kind": "signoz/NumberPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "p95(gen_ai.server.ttft)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "66666666-6666-6666-6666-666666666666": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Cost over time",
- "description": "Cost by model over time."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "groupBy": [
- {
- "name": "gen_ai.request.model",
- "fieldDataType": "string",
- "fieldContext": "tag"
- }
- ],
- "legend": "{{gen_ai.request.model}}",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "sum(gen_ai.usage.cost)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "77777777-7777-7777-7777-777777777777": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Token usage over time",
- "description": "Input vs output tokens over time."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "legend": "Input",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "sum(gen_ai.usage.input_tokens)"
- }
- ]
- }
- },
- {
- "type": "builder_query",
- "spec": {
- "name": "B",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "legend": "Output",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "sum(gen_ai.usage.output_tokens)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "88888888-8888-8888-8888-888888888888": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "LLM call latency percentiles",
- "description": "p50, p90, p95, p99 latency by model."
- },
- "plugin": {
- "kind": "signoz/TablePanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "gen_ai.system != ''"
- },
- "groupBy": [
- {
- "name": "gen_ai.request.model",
- "fieldDataType": "string",
- "fieldContext": "tag"
- }
- ],
- "legend": "{{gen_ai.request.model}}",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "p50(duration_nano)"
- },
- {
- "expression": "p90(duration_nano)"
- },
- {
- "expression": "p95(duration_nano)"
- },
- {
- "expression": "p99(duration_nano)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "99999999-9999-9999-9999-999999999999": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "LLM call latency over time",
- "description": "p95 latency trend by model."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "gen_ai.system != ''"
- },
- "groupBy": [
- {
- "name": "gen_ai.request.model",
- "fieldDataType": "string",
- "fieldContext": "tag"
- }
- ],
- "legend": "{{gen_ai.request.model}}",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "p95(duration_nano)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Error count",
- "description": "Errors grouped by error type."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "has_error = true AND gen_ai.system != ''"
- },
- "groupBy": [
- {
- "name": "gen_ai.error.type",
- "fieldDataType": "string",
- "fieldContext": "tag"
- }
- ],
- "legend": "{{gen_ai.error.type}}",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "count()"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Time to first token",
- "description": "p95 TTFT by model."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": ""
- },
- "groupBy": [
- {
- "name": "gen_ai.request.model",
- "fieldDataType": "string",
- "fieldContext": "tag"
- }
- ],
- "legend": "{{gen_ai.request.model}}",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "p95(gen_ai.server.ttft)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "cccccccc-cccc-cccc-cccc-cccccccccccc": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Top 10 span names",
- "description": "Top span names by count across GenAI spans."
- },
- "plugin": {
- "kind": "signoz/TablePanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- }
- }
- },
- "queries": [
- {
- "kind": "scalar",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "gen_ai.system != ''"
- },
- "groupBy": [
- {
- "name": "name",
- "fieldDataType": "string",
- "fieldContext": "tag"
- }
- ],
- "limit": 10,
- "order": [
- {
- "key": {
- "name": "count()"
- },
- "direction": "desc"
- }
- ],
- "legend": "{{name}}",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "count()"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "dddddddd-dddd-dddd-dddd-dddddddddddd": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Tool call rate",
- "description": "Tool call rate per second."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "name = 'execute_tool'"
- },
- "legend": "req/s",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "rate()"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Tool error rate",
- "description": "Percentage of tool calls that errored."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "name = 'execute_tool'"
- },
- "legend": "error %",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "countIf(has_error = true)"
- },
- {
- "expression": "count()"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- },
- "ffffffff-ffff-ffff-ffff-ffffffffffff": {
- "kind": "Panel",
- "spec": {
- "display": {
- "name": "Tool duration (p50)",
- "description": "Median tool call duration."
- },
- "plugin": {
- "kind": "signoz/TimeSeriesPanel",
- "spec": {
- "visualization": {
- "timePreference": "global_time"
- },
- "legend": {
- "position": "bottom"
- },
- "chartAppearance": {
- "lineStyle": "solid",
- "lineInterpolation": "spline",
- "fillMode": "none"
- }
- }
- },
- "queries": [
- {
- "kind": "time_series",
- "spec": {
- "plugin": {
- "kind": "signoz/CompositeQuery",
- "spec": {
- "queries": [
- {
- "type": "builder_query",
- "spec": {
- "name": "A",
- "signal": "traces",
- "stepInterval": 60,
- "disabled": false,
- "filter": {
- "expression": "name = 'execute_tool'"
- },
- "legend": "p50",
- "having": {
- "expression": ""
- },
- "aggregations": [
- {
- "expression": "p50(duration_nano)"
- }
- ]
- }
- }
- ]
- }
- }
- }
- }
- ]
- }
- }
- },
- "variables": [
- {
- "kind": "ListVariable",
- "spec": {
- "name": "model",
- "display": {
- "name": "model",
- "description": "LLM model"
- },
- "allowMultiple": true,
- "allowAllValue": true,
- "sort": "alphabetical-asc",
- "plugin": {
- "kind": "signoz/QueryVariable",
- "spec": {
- "queryValue": "SELECT DISTINCT attributes_string['gen_ai.request.model'] AS model FROM signoz_traces.distributed_signoz_index_v3 WHERE mapContains(attributes_string, 'gen_ai.request.model') AND timestamp >= now() - INTERVAL 1 DAY"
- }
- }
- }
- },
- {
- "kind": "ListVariable",
- "spec": {
- "name": "environment",
- "display": {
- "name": "environment",
- "description": "Deployment environment"
- },
- "allowMultiple": true,
- "allowAllValue": true,
- "sort": "alphabetical-asc",
- "plugin": {
- "kind": "signoz/QueryVariable",
- "spec": {
- "queryValue": "SELECT DISTINCT resources_string['deployment.environment'] AS environment FROM signoz_traces.distributed_signoz_index_v3 WHERE mapContains(resources_string, 'deployment.environment') AND timestamp >= now() - INTERVAL 1 DAY"
- }
- }
- }
- },
- {
- "kind": "ListVariable",
- "spec": {
- "name": "service_name",
- "display": {
- "name": "service_name",
- "description": "Service name"
- },
- "allowMultiple": true,
- "allowAllValue": true,
- "sort": "alphabetical-asc",
- "plugin": {
- "kind": "signoz/QueryVariable",
- "spec": {
- "queryValue": "SELECT DISTINCT resources_string['service.name'] AS service_name FROM signoz_traces.distributed_signoz_index_v3 WHERE mapContains(resources_string, 'service.name') AND timestamp >= now() - INTERVAL 1 DAY"
- }
- }
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/frontend/src/container/LLMObservability/__tests__/LLMObservability.test.tsx b/frontend/src/container/LLMObservability/__tests__/LLMObservability.test.tsx
index f419cc03dd..b8dbbb905e 100644
--- a/frontend/src/container/LLMObservability/__tests__/LLMObservability.test.tsx
+++ b/frontend/src/container/LLMObservability/__tests__/LLMObservability.test.tsx
@@ -24,6 +24,35 @@ jest.mock('container/LLMObservability/Explorer/Explorer', () => ({
default: (): JSX.Element => <div data-testid="llm-observability-explorer" />,
}));
+const SYSTEM_DASHBOARD_ENDPOINT = '*/api/v2/dashboards/system/ai-o11y-overview';
+
+function setupSystemDashboard(): void {
+ server.use(
+ rest.get(SYSTEM_DASHBOARD_ENDPOINT, (_req, res, ctx) =>
+ res(
+ ctx.status(200),
+ ctx.json({
+ status: 'success',
+ data: {
+ orgId: 'org',
+ locked: true,
+ name: 'signoz---ai-o11y-overview',
+ schemaVersion: 'v6',
+ source: 'system',
+ tags: null,
+ spec: {
+ display: { name: 'AI Observability Overview' },
+ variables: [],
+ panels: {},
+ layouts: [],
+ },
+ },
+ }),
+ ),
+ ),
+ );
+}
+
function setupList(items = mockRules): void {
server.use(
rest.get(LLM_PRICING_ENDPOINT, (_req, res, ctx) =>
@@ -41,14 +70,17 @@ describe('LLMObservability (integration)', () => {
server.resetHandlers();
});
- it('renders the overview panel and the tab bar on the overview route', () => {
+ it('renders the overview panel and the tab bar on the overview route', async () => {
+ setupSystemDashboard();
render(<LLMObservability />, undefined, {
initialRoute: ROUTES.AI_OBSERVABILITY_OVERVIEW,
});
expect(screen.getByTestId('llm-observability-tabs')).toBeInTheDocument();
expect(screen.getByTestId('llm-observability-overview')).toBeInTheDocument();
- expect(screen.getByTestId('llm-overview-dashboard')).toBeInTheDocument();
+ await waitFor(() =>
+ expect(screen.getByTestId('llm-overview-dashboard')).toBeInTheDocument(),
+ );
expect(screen.getByRole('tab', { name: 'Overview' })).toBeInTheDocument();
expect(screen.getByRole('tab', { name: 'Explorer' })).toBeInTheDocument();
expect(