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.

903 B
Raw Blame
import type { DashboardtypesPanelDTO } from 'api/generated/services/sigNoz.schemas';

import { isAIBuilderEnvelope } from 'lib/query/builderEnvelope';
import { toQueryEnvelopes } from '../../../queryV5/buildQueryRangeRequest';
import type { PanelActionId } from '../PanelActionsMenu/panelActionMeta';

//TODO: @tewarig will enable these actions for AI Observability Panels
const AI_PANEL_REASON = 'Coming Soon For AI Observability Panels';

export type BlockedPanelActions = Partial<Record<PanelActionId, string>>;

/** Actions the panel's queries don't support yet, mapped to the disabled reason. */
export function getBlockedPanelActions(
	panel: DashboardtypesPanelDTO,
): BlockedPanelActions {
	// The alert builder has no AI query mode. View in Logs/Traces stays on.
	if (toQueryEnvelopes(panel.spec.queries).some(isAIBuilderEnvelope)) {
		return { createAlert: AI_PANEL_REASON };
	}
	return {};
}