|
@@ -15,8 +15,14 @@ type Options = {
|
|
column: GridColumnHeader<string>;
|
|
column: GridColumnHeader<string>;
|
|
location?: Location;
|
|
location?: Location;
|
|
sort?: Sort;
|
|
sort?: Sort;
|
|
|
|
+ sortParameterName?:
|
|
|
|
+ | QueryParameterNames.ENDPOINTS_SORT
|
|
|
|
+ | QueryParameterNames.SPANS_SORT
|
|
|
|
+ | typeof DEFAULT_SORT_PARAMETER_NAME;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const DEFAULT_SORT_PARAMETER_NAME = 'sort';
|
|
|
|
+
|
|
const {SPAN_SELF_TIME} = SpanMetricsField;
|
|
const {SPAN_SELF_TIME} = SpanMetricsField;
|
|
const {TIME_SPENT_PERCENTAGE, SPS, SPM, HTTP_ERROR_COUNT} = SpanFunction;
|
|
const {TIME_SPENT_PERCENTAGE, SPS, SPM, HTTP_ERROR_COUNT} = SpanFunction;
|
|
|
|
|
|
@@ -30,7 +36,7 @@ export const SORTABLE_FIELDS = new Set([
|
|
`${HTTP_ERROR_COUNT}()`,
|
|
`${HTTP_ERROR_COUNT}()`,
|
|
]);
|
|
]);
|
|
|
|
|
|
-export const renderHeadCell = ({column, location, sort}: Options) => {
|
|
|
|
|
|
+export const renderHeadCell = ({column, location, sort, sortParameterName}: Options) => {
|
|
const {key, name} = column;
|
|
const {key, name} = column;
|
|
const alignment = getAlignment(key);
|
|
const alignment = getAlignment(key);
|
|
|
|
|
|
@@ -54,7 +60,7 @@ export const renderHeadCell = ({column, location, sort}: Options) => {
|
|
...location,
|
|
...location,
|
|
query: {
|
|
query: {
|
|
...location?.query,
|
|
...location?.query,
|
|
- [QueryParameterNames.SPANS_SORT]: newSort,
|
|
|
|
|
|
+ [sortParameterName ?? DEFAULT_SORT_PARAMETER_NAME]: newSort,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
}}
|
|
}}
|