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.

4.7 KB
Raw Blame
import { ReduceOperators } from 'types/common/queryBuilder';

export const valuePanelWidget = {
	id: 'b8b93086-ef01-47bf-9044-1e7abd583be4',
	title: 'signoz latency in ms',
	description: '',
	nullZeroValues: 'zero',
	opacity: '1',
	panelTypes: 'value',
	query: {
		clickhouse_sql: [
			{
				name: 'A',
				legend: '',
				disabled: false,
				query: '',
			},
		],
		promql: [
			{
				name: 'A',
				query: '',
				legend: '',
				disabled: false,
			},
		],
		builder: {
			queryData: [
				{
					dataSource: 'metrics',
					queryName: 'A',
					aggregateOperator: 'count',
					aggregateAttribute: {
						key: 'signoz_latency',
						dataType: 'float64',
						type: 'ExponentialHistogram',
						id: 'signoz_latency--float64--ExponentialHistogram--true',
					},
					timeAggregation: '',
					spaceAggregation: 'p90',
					functions: [],
					filters: {
						items: [],
						op: 'AND',
					},
					expression: 'A',
					disabled: false,
					stepInterval: 60,
					having: [],
					limit: null,
					orderBy: [],
					groupBy: [],
					legend: '',
					reduceTo: ReduceOperators.AVG,
				},
			],
			queryFormulas: [],
		},
		id: '3bec289c-49c3-4d7e-98bb-84d47c79909c',
		queryType: 'builder',
	},
	timePreferance: 'GLOBAL_TIME',
	softMax: null,
	softMin: null,
	selectedLogFields: [
		{
			dataType: 'string',
			type: '',
			name: 'body',
		},
		{
			dataType: 'string',
			type: '',
			name: 'timestamp',
		},
	],
	selectedTracesFields: [
		{
			key: 'serviceName',
			dataType: 'string',
			type: 'tag',
			id: 'serviceName--string--tag--true',
		},
		{
			key: 'name',
			dataType: 'string',
			type: 'tag',
			id: 'name--string--tag--true',
		},
		{
			key: 'durationNano',
			dataType: 'float64',
			type: 'tag',
			id: 'durationNano--float64--tag--true',
		},
		{
			key: 'httpMethod',
			dataType: 'string',
			type: 'tag',
			id: 'httpMethod--string--tag--true',
		},
		{
			key: 'responseStatusCode',
			dataType: 'string',
			type: 'tag',
			id: 'responseStatusCode--string--tag--true',
		},
	],
	yAxisUnit: 'ms',
	thresholds: [],
	fillSpans: false,
	columnUnits: {},
	bucketCount: 30,
	stackedBarChart: false,
	bucketWidth: 0,
	mergeAllActiveQueries: false,
};

export const thresholds = [
	{
		index: '8eb16a3a-b4f1-47c8-943a-4b1786884583',
		isEditEnabled: false,
		thresholdColor: 'Blue',
		thresholdFormat: 'Text',
		thresholdOperator: '>',
		thresholdUnit: 'none',
		thresholdValue: 100,
		keyIndex: 1,
		selectedGraph: 'value',
		thresholdTableOptions: '',
		thresholdLabel: '',
	},
	{
		index: 'eb9c1186-ad7d-42dd-8e7f-3913a321d7cf',
		isEditEnabled: false,
		thresholdColor: 'Red',
		thresholdFormat: 'Text',
		thresholdOperator: '>',
		thresholdUnit: 'none',
		thresholdValue: 0,
		keyIndex: 0,
		selectedGraph: 'value',
		thresholdTableOptions: '',
		thresholdLabel: '',
	},
];

export const valuePanelQueryResponse = {
	status: 'success',
	isLoading: false,
	isSuccess: true,
	isError: false,
	isIdle: false,
	data: {
		statusCode: 200,
		error: null,
		message: 'success',
		payload: {
			data: {
				result: [
					{
						metric: {
							A: 'A',
						},
						values: [[0, '295.4299833508185']],
						queryName: 'A',
						legend: 'A',
					},
				],
				resultType: '',
				newResult: {
					status: 'success',
					data: {
						resultType: '',
						result: [
							{
								queryName: 'A',
								series: [
									{
										labels: {
											A: 'A',
										},
										labelsArray: null,
										values: [
											{
												timestamp: 0,
												value: '295.4299833508185',
											},
										],
									},
								],
							},
						],
					},
				},
			},
		},
		params: {
			start: 1721203451000,
			end: 1721203751000,
			step: 60,
			variables: {},
			formatForWeb: false,
			compositeQuery: {
				queryType: 'builder',
				panelType: 'value',
				fillGaps: false,
				builderQueries: {
					A: {
						dataSource: 'metrics',
						queryName: 'A',
						aggregateOperator: 'count',
						aggregateAttribute: {
							key: 'signoz_latency',
							dataType: 'float64',
							type: 'ExponentialHistogram',
							id: 'signoz_latency--float64--ExponentialHistogram--true',
						},
						timeAggregation: '',
						spaceAggregation: 'p90',
						functions: [],
						filters: {
							items: [],
							op: 'AND',
						},
						expression: 'A',
						disabled: false,
						stepInterval: 60,
						having: [],
						limit: null,
						orderBy: [],
						groupBy: [],
						legend: '',
						reduceTo: ReduceOperators.AVG,
					},
				},
			},
		},
	},
	dataUpdatedAt: 1721203751775,
	error: null,
	errorUpdatedAt: 0,
	failureCount: 0,
	errorUpdateCount: 0,
	isFetched: true,
	isFetchedAfterMount: true,
	isFetching: false,
	isRefetching: false,
	isLoadingError: false,
	isPlaceholderData: false,
	isPreviousData: false,
	isRefetchError: false,
	isStale: true,
};