mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-24 19:07:47 +00:00
fix: added metricName to the metric where clause keys api
This commit is contained in:
parent
2997fd9cfb
commit
7ff97586be
@ -8,4 +8,6 @@ import {
|
||||
export const getKeySuggestions = (
|
||||
props: QueryKeyRequestProps,
|
||||
): Promise<AxiosResponse<QueryKeySuggestionsResponseProps>> =>
|
||||
axios.get(`/fields/keys?signal=${props.signal}&name=${props.name}`);
|
||||
axios.get(
|
||||
`/fields/keys?signal=${props.signal}&name=${props.name}&metricName=${props.metricName}`,
|
||||
);
|
||||
|
||||
@ -37,7 +37,6 @@ const MetricsAggregateSection = memo(function MetricsAggregateSection({
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
console.log('query', query);
|
||||
setAggregationOptions([
|
||||
{
|
||||
func: query.spaceAggregation || 'count',
|
||||
|
||||
@ -144,6 +144,7 @@ function QuerySearch({
|
||||
const response = await getKeySuggestions({
|
||||
signal: dataSource,
|
||||
name: searchText || '',
|
||||
metricName: queryData.aggregateAttribute.key ?? undefined,
|
||||
});
|
||||
|
||||
if (response.data.data) {
|
||||
@ -158,7 +159,7 @@ function QuerySearch({
|
||||
setKeySuggestions([]);
|
||||
fetchKeySuggestions();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [dataSource]);
|
||||
}, [dataSource, queryData.aggregateAttribute.key]);
|
||||
|
||||
// Add a state for tracking editing mode
|
||||
const [editingMode, setEditingMode] = useState<
|
||||
|
||||
@ -6,14 +6,16 @@ import { QueryKeySuggestionsResponseProps } from 'types/api/querySuggestions/typ
|
||||
export const useGetQueryKeySuggestions = ({
|
||||
signal,
|
||||
name,
|
||||
metricName,
|
||||
}: {
|
||||
signal: string;
|
||||
name: string;
|
||||
metricName?: string;
|
||||
}): UseQueryResult<
|
||||
AxiosResponse<QueryKeySuggestionsResponseProps>,
|
||||
AxiosError
|
||||
> =>
|
||||
useQuery<AxiosResponse<QueryKeySuggestionsResponseProps>, AxiosError>({
|
||||
queryKey: ['queryKeySuggestions', signal, name],
|
||||
queryFn: () => getKeySuggestions({ signal, name }),
|
||||
queryKey: ['queryKeySuggestions', signal, name, metricName],
|
||||
queryFn: () => getKeySuggestions({ signal, name, metricName }),
|
||||
});
|
||||
|
||||
@ -23,6 +23,7 @@ export interface QueryKeySuggestionsResponseProps {
|
||||
export interface QueryKeyRequestProps {
|
||||
signal: string;
|
||||
name: string;
|
||||
metricName?: string;
|
||||
}
|
||||
|
||||
export interface QueryKeyValueSuggestionsProps {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user