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.

feat(llm-observability): add ai o11y analytics events (#12952)

Gaurav Tewarif1c9e0f1d0b6
diff --git a/frontend/src/container/LLMObservability/AttributeMapping/LLMObservabilityAttributeMapping.tsx b/frontend/src/container/LLMObservability/AttributeMapping/LLMObservabilityAttributeMapping.tsx
index bce18e129a..bbee544d15 100644
--- a/frontend/src/container/LLMObservability/AttributeMapping/LLMObservabilityAttributeMapping.tsx
+++ b/frontend/src/container/LLMObservability/AttributeMapping/LLMObservabilityAttributeMapping.tsx
@@ -1,5 +1,6 @@
-import { useCallback } from 'react';
+import { useCallback, useEffect } from 'react';
import { Tabs } from 'antd';
+import logEvent from 'api/common/logEvent';
import { useConfirmableAction } from 'hooks/useConfirmableAction';
import AttributeMappingActions from './components/AttributeMappingActions/AttributeMappingActions';
@@ -20,6 +21,10 @@ function LLMObservabilityAttributeMapping(): JSX.Element {
const groupDrawer = useGroupFormDrawer();
const spanTest = useTestSpanMapper(editor.snapshot, editor.groups);
+ useEffect(() => {
+ void logEvent('AI Observability Attribute Mapping: Page visited', {});
+ }, []);
+
const { discard } = editor;
// Discarding wipes the whole working copy, so gate it behind a confirm
// prompt rather than firing straight from the button.
diff --git a/frontend/src/container/LLMObservability/AttributeMapping/TestTab/useTestSpanMapper.ts b/frontend/src/container/LLMObservability/AttributeMapping/TestTab/useTestSpanMapper.ts
index e2c1dcf4c0..a5dde0207a 100644
--- a/frontend/src/container/LLMObservability/AttributeMapping/TestTab/useTestSpanMapper.ts
+++ b/frontend/src/container/LLMObservability/AttributeMapping/TestTab/useTestSpanMapper.ts
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
+import logEvent from 'api/common/logEvent';
import {
RenderErrorResponseDTO,
SpantypesSpanMapperTestSpanDTO,
@@ -126,6 +127,7 @@ export function useTestSpanMapper(
{ data: body },
{
onSuccess: (response) => {
+ void logEvent('AI Observability Attribute Mapping: Test run', {});
setTestedAttributes(submittedAttributes);
setTestedResource(submittedResource);
setResult(response.data?.spans ?? []);
diff --git a/frontend/src/container/LLMObservability/AttributeMapping/hooks/useAttributeMappingEditor.ts b/frontend/src/container/LLMObservability/AttributeMapping/hooks/useAttributeMappingEditor.ts
index 1e33ac43fa..e590a5e404 100644
--- a/frontend/src/container/LLMObservability/AttributeMapping/hooks/useAttributeMappingEditor.ts
+++ b/frontend/src/container/LLMObservability/AttributeMapping/hooks/useAttributeMappingEditor.ts
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { cloneDeep, isEqual } from 'lodash-es';
import { toast } from '@signozhq/ui/sonner';
import { useQueryClient } from 'react-query';
+import logEvent from 'api/common/logEvent';
import {
useCreateSpanMapper,
useCreateSpanMapperGroup,
@@ -262,6 +263,7 @@ export function useAttributeMappingEditor(): AttributeMappingEditor {
setSaveError(null);
try {
await persistDraft(snapshot, draft, mutations);
+ void logEvent('AI Observability Attribute Mapping: Changes saved', {});
// Refresh the groups list in place — it stays mounted, so this just
// swaps in fresh data without a loading flash. Using the query's own
// refetch keeps it scoped to the groups list; the per-group mapper
diff --git a/frontend/src/container/LLMObservability/Explorer/Explorer.tsx b/frontend/src/container/LLMObservability/Explorer/Explorer.tsx
index 3ae78b4fea..7166ec23dd 100644
--- a/frontend/src/container/LLMObservability/Explorer/Explorer.tsx
+++ b/frontend/src/container/LLMObservability/Explorer/Explorer.tsx
@@ -173,7 +173,7 @@ function Explorer(): JSX.Element {
useEffect(() => {
if (!logEventCalledRef.current) {
- logEvent('Traces Explorer: Page visited', {});
+ logEvent('AI Observability Explorer: Page visited', {});
logEventCalledRef.current = true;
}
}, []);
diff --git a/frontend/src/container/LLMObservability/Explorer/ListView/ListView.tsx b/frontend/src/container/LLMObservability/Explorer/ListView/ListView.tsx
index 1e545bce20..ca31f6870a 100644
--- a/frontend/src/container/LLMObservability/Explorer/ListView/ListView.tsx
+++ b/frontend/src/container/LLMObservability/Explorer/ListView/ListView.tsx
@@ -173,7 +173,7 @@ function ListView({
useEffect(() => {
if (!isLoading && !isFetching && !isError && rows.length !== 0) {
- void logEvent('Traces Explorer: Data present', {
+ void logEvent('AI Observability Explorer: Data present', {
panelType,
});
}
diff --git a/frontend/src/container/LLMObservability/Explorer/TracesView/TracesView.tsx b/frontend/src/container/LLMObservability/Explorer/TracesView/TracesView.tsx
index efa18bc863..05322e6d57 100644
--- a/frontend/src/container/LLMObservability/Explorer/TracesView/TracesView.tsx
+++ b/frontend/src/container/LLMObservability/Explorer/TracesView/TracesView.tsx
@@ -159,7 +159,7 @@ function TracesView({
useEffect(() => {
if (!isLoading && !isFetching && !isError && rows.length !== 0) {
- void logEvent('Traces Explorer: Data present', {
+ void logEvent('AI Observability Explorer: Data present', {
panelType: 'TRACE',
});
}
diff --git a/frontend/src/container/LLMObservability/Overview/Overview.tsx b/frontend/src/container/LLMObservability/Overview/Overview.tsx
index 93e7f33453..e1022ba1e4 100644
--- a/frontend/src/container/LLMObservability/Overview/Overview.tsx
+++ b/frontend/src/container/LLMObservability/Overview/Overview.tsx
@@ -1,4 +1,6 @@
+import { useEffect } from 'react';
import { Typography } from '@signozhq/ui/typography';
+import logEvent from 'api/common/logEvent';
import Spinner from 'components/Spinner';
import DashboardContainer from 'pages/DashboardPage/DashboardContainer';
@@ -8,6 +10,10 @@ import styles from './Overview.module.scss';
function Overview(): JSX.Element {
const { dashboard, isLoading, isError, error, refetch } = useSystemDashboard();
+ useEffect(() => {
+ void logEvent('AI Observability Overview: Page visited', {});
+ }, []);
+
const renderContent = (): JSX.Element => {
if (isLoading) {
return <Spinner tip="Loading dashboard..." />;
diff --git a/frontend/src/container/LLMObservability/Settings/ModelPricing/LLMObservabilityModelPricing.tsx b/frontend/src/container/LLMObservability/Settings/ModelPricing/LLMObservabilityModelPricing.tsx
index 25343b3d74..61cccf4ad5 100644
--- a/frontend/src/container/LLMObservability/Settings/ModelPricing/LLMObservabilityModelPricing.tsx
+++ b/frontend/src/container/LLMObservability/Settings/ModelPricing/LLMObservabilityModelPricing.tsx
@@ -1,5 +1,7 @@
+import { useEffect } from 'react';
import { Badge } from '@signozhq/ui/badge';
import { Tabs } from 'antd';
+import logEvent from 'api/common/logEvent';
import { useListUnmappedLLMModels } from 'api/generated/services/llmpricingrules';
import { parseAsStringEnum, useQueryState } from 'nuqs';
@@ -20,6 +22,10 @@ function LLMObservabilityModelPricing(): JSX.Element {
const { data } = useListUnmappedLLMModels();
const unpricedCount = data?.data?.items?.length ?? 0;
+ useEffect(() => {
+ void logEvent('AI Observability Model Pricing: Page visited', {});
+ }, []);
+
return (
<div
className={styles.llmObservabilityModelPricing}
diff --git a/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/components/ModelCostDrawer/hooks/useModelCostDrawer.ts b/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/components/ModelCostDrawer/hooks/useModelCostDrawer.ts
index 613dbcfdfd..63e5516ea1 100644
--- a/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/components/ModelCostDrawer/hooks/useModelCostDrawer.ts
+++ b/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/components/ModelCostDrawer/hooks/useModelCostDrawer.ts
@@ -1,6 +1,7 @@
import { useCallback, useState } from 'react';
import { toast } from '@signozhq/ui/sonner';
import { useQueryClient } from 'react-query';
+import logEvent from 'api/common/logEvent';
import {
getListLLMPricingRulesQueryKey,
getListUnmappedLLMModelsQueryKey,
@@ -94,6 +95,10 @@ export function useModelCostDrawer(): UseModelCostDrawerResult {
await createOrUpdate({
data: { rules: [buildRulePayload(draft)] },
});
+ void logEvent('AI Observability Model Pricing: Model cost saved', {
+ mode,
+ modelName: draft.modelName,
+ });
await invalidateList();
setIsOpen(false);
setSelectedRuleId(null);
diff --git a/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/hooks/useModelCostDelete.ts b/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/hooks/useModelCostDelete.ts
index 0bae90b02f..15d2ce53c6 100644
--- a/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/hooks/useModelCostDelete.ts
+++ b/frontend/src/container/LLMObservability/Settings/ModelPricing/ModelCostTabPanel/hooks/useModelCostDelete.ts
@@ -1,6 +1,7 @@
import { useCallback, useState } from 'react';
import { toast } from '@signozhq/ui/sonner';
import { useQueryClient } from 'react-query';
+import logEvent from 'api/common/logEvent';
import {
getListLLMPricingRulesQueryKey,
useDeleteLLMPricingRule,
@@ -46,6 +47,9 @@ export function useModelCostDelete(): UseModelCostDeleteResult {
}
try {
await deleteRuleApi({ pathParams: { id: pendingDelete.id } });
+ void logEvent('AI Observability Model Pricing: Model cost deleted', {
+ modelName: pendingDelete.modelName,
+ });
await queryClient.invalidateQueries({
queryKey: getListLLMPricingRulesQueryKey(),
});
diff --git a/frontend/src/container/LLMObservability/Settings/ModelPricing/UnpricedModelsTab/hooks/useUnpricedModelMapping.ts b/frontend/src/container/LLMObservability/Settings/ModelPricing/UnpricedModelsTab/hooks/useUnpricedModelMapping.ts
index be955567d0..a6381bbe2c 100644
--- a/frontend/src/container/LLMObservability/Settings/ModelPricing/UnpricedModelsTab/hooks/useUnpricedModelMapping.ts
+++ b/frontend/src/container/LLMObservability/Settings/ModelPricing/UnpricedModelsTab/hooks/useUnpricedModelMapping.ts
@@ -1,6 +1,7 @@
import { useCallback, useState } from 'react';
import { toast } from '@signozhq/ui/sonner';
import { useQueryClient } from 'react-query';
+import logEvent from 'api/common/logEvent';
import {
getListLLMPricingRulesQueryKey,
getListUnmappedLLMModelsQueryKey,
@@ -45,6 +46,10 @@ export function useUnpricedModelMapping(): UseUnpricedModelMappingResult {
setIsSaving(true);
try {
await createOrUpdate({ data: { rules: [payload] } });
+ void logEvent('AI Observability Model Pricing: Unpriced model mapped', {
+ modelName: model.modelName,
+ billingModelName: rule.modelName,
+ });
await Promise.all([
queryClient.invalidateQueries({
queryKey: getListUnmappedLLMModelsQueryKey(),