mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-13 04:01:30 +08:00
feat: add resource_deployment_environment as fast filter in traces page (#5864)
* feat: add resource_deployment_environment as fast filter in traces page * chore: directly use deployment.environment, rather than converting resource_deployment_environment * chore: make environment filter expanded by default * chore: add deployment.environment to defaultOpenSections to pass the test --------- Co-authored-by: Ankit Nayan <ankit@signoz.io>
This commit is contained in:
parent
47d42e6a57
commit
2cc2a43e17
@ -37,6 +37,7 @@ export function Section(props: SectionProps): JSX.Element {
|
||||
'hasError',
|
||||
'durationNano',
|
||||
'serviceName',
|
||||
'deployment.environment',
|
||||
]),
|
||||
),
|
||||
[selectedFilters],
|
||||
|
@ -8,10 +8,11 @@ import {
|
||||
import { TagFilterItem } from 'types/api/queryBuilder/queryBuilderData';
|
||||
import { DataSource } from 'types/common/queryBuilder';
|
||||
|
||||
export const AllTraceFilterKeyValue = {
|
||||
export const AllTraceFilterKeyValue: Record<string, string> = {
|
||||
durationNanoMin: 'Duration',
|
||||
durationNano: 'Duration',
|
||||
durationNanoMax: 'Duration',
|
||||
'deployment.environment': 'Environment',
|
||||
hasError: 'Status',
|
||||
serviceName: 'Service Name',
|
||||
name: 'Operation / Name',
|
||||
@ -22,7 +23,7 @@ export const AllTraceFilterKeyValue = {
|
||||
httpRoute: 'HTTP Route',
|
||||
httpUrl: 'HTTP URL',
|
||||
traceID: 'Trace ID',
|
||||
};
|
||||
} as const;
|
||||
|
||||
export type AllTraceFilterKeys = keyof typeof AllTraceFilterKeyValue;
|
||||
|
||||
@ -64,7 +65,7 @@ export const addFilter = (
|
||||
| undefined
|
||||
>
|
||||
>,
|
||||
keys?: BaseAutocompleteData,
|
||||
keys: BaseAutocompleteData,
|
||||
): void => {
|
||||
setSelectedFilters((prevFilters) => {
|
||||
const isDuration = [
|
||||
@ -122,7 +123,7 @@ export const removeFilter = (
|
||||
| undefined
|
||||
>
|
||||
>,
|
||||
keys?: BaseAutocompleteData,
|
||||
keys: BaseAutocompleteData,
|
||||
): void => {
|
||||
setSelectedFilters((prevFilters) => {
|
||||
if (!prevFilters || !prevFilters[filterType]?.values.length) {
|
||||
@ -202,6 +203,15 @@ export const traceFilterKeys: Record<
|
||||
isJSON: false,
|
||||
id: 'serviceName--string--tag--true',
|
||||
},
|
||||
|
||||
'deployment.environment': {
|
||||
key: 'deployment.environment',
|
||||
dataType: DataTypes.String,
|
||||
type: 'resource',
|
||||
isColumn: false,
|
||||
isJSON: false,
|
||||
id: 'deployment.environment--string--resource--false',
|
||||
},
|
||||
name: {
|
||||
key: 'name',
|
||||
dataType: DataTypes.String,
|
||||
@ -282,7 +292,7 @@ export const traceFilterKeys: Record<
|
||||
isJSON: false,
|
||||
id: 'durationNanoMax--float64--tag--true',
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
interface AggregateValuesProps {
|
||||
value: AllTraceFilterKeys;
|
||||
|
@ -244,7 +244,12 @@ export function checkIfSectionIsNotOpen(
|
||||
expect(section.querySelector('.ant-collapse-item-active')).toBeNull();
|
||||
}
|
||||
|
||||
export const defaultOpenSections = ['hasError', 'durationNano', 'serviceName'];
|
||||
export const defaultOpenSections = [
|
||||
'hasError',
|
||||
'durationNano',
|
||||
'serviceName',
|
||||
'deployment.environment',
|
||||
];
|
||||
|
||||
export const defaultClosedSections = Object.keys(AllTraceFilterKeyValue).filter(
|
||||
(section) =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user