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.

674 B
Raw Blame
import { create } from 'zustand';

/**
 * A dynamic dashboard variable reduced to what query-builder autocomplete needs:
 * `attribute` is the filter key it backs, `name` is the `$name` offered as a value.
 */
export interface DynamicVariableSuggestion {
	name: string;
	attribute: string;
}

interface DynamicVariableSuggestionsState {
	suggestions: DynamicVariableSuggestion[];
}

export const useDynamicVariableSuggestionsStore =
	create<DynamicVariableSuggestionsState>(() => ({
		suggestions: [],
	}));

export function setDynamicVariableSuggestions(
	suggestions: DynamicVariableSuggestion[],
): void {
	useDynamicVariableSuggestionsStore.setState({ suggestions });
}