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.

fix: update query suggestion hook to accept options (#9894)

Aditya Singhab8b42fbbe39
diff --git a/frontend/src/hooks/querySuggestions/useGetQueryKeyValueSuggestions.ts b/frontend/src/hooks/querySuggestions/useGetQueryKeyValueSuggestions.ts
index aceaa1d174..a42b7efa80 100644
--- a/frontend/src/hooks/querySuggestions/useGetQueryKeyValueSuggestions.ts
+++ b/frontend/src/hooks/querySuggestions/useGetQueryKeyValueSuggestions.ts
@@ -1,8 +1,6 @@
import { getValueSuggestions } from 'api/querySuggestions/getValueSuggestion';
import { AxiosError, AxiosResponse } from 'axios';
import { useQuery, UseQueryOptions, UseQueryResult } from 'react-query';
-import { ErrorResponse } from 'react-router-dom-v5-compat';
-import { SuccessResponse } from 'types/api';
import { QueryKeyValueSuggestionsResponseProps } from 'types/api/querySuggestions/types';
export const useGetQueryKeyValueSuggestions = ({
@@ -11,13 +9,15 @@ export const useGetQueryKeyValueSuggestions = ({
searchText,
signalSource,
metricName,
+ options,
}: {
key: string;
signal: 'traces' | 'logs' | 'metrics';
searchText?: string;
signalSource?: 'meter' | '';
options?: UseQueryOptions<
- SuccessResponse<QueryKeyValueSuggestionsResponseProps> | ErrorResponse
+ AxiosResponse<QueryKeyValueSuggestionsResponseProps>,
+ AxiosError
>;
metricName?: string;
}): UseQueryResult<
@@ -41,4 +41,5 @@ export const useGetQueryKeyValueSuggestions = ({
signalSource: signalSource as 'meter' | '',
metricName: metricName || '',
}),
+ ...options,
});