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.

729 B
Raw Blame
import type { DashboardtypesQueryDTO } from 'api/generated/services/sigNoz.schemas';
import { listViewInitialLogQuery } from 'constants/queryBuilder';

import { toPerses } from '../../queryV5/persesQueryAdapters';
import { toPanelType, type PanelKind } from '../types/panelKind';

/** Seed query for a new panel. Only a list panel needs one (logs, timestamp desc) so its
 * preview runs on open; other kinds start empty and seed from the builder. */
export function buildDefaultQueries(kind: PanelKind): DashboardtypesQueryDTO[] {
	if (kind !== 'signoz/ListPanel') {
		return [];
	}
	// `toPerses` pivots through the V1 `Query`, which is still keyed by panel type.
	return toPerses(listViewInitialLogQuery, toPanelType(kind));
}