adds service name in the trace when visiting from error

This commit is contained in:
dhrubesh 2021-05-02 20:02:44 +05:30
parent 00c3342b4d
commit 62ad8433bf

View File

@ -62,6 +62,10 @@ const _TraceFilter = (props: TraceFilterProps) => {
setServiceList(response.data); setServiceList(response.data);
}) })
.then(() => { .then(() => {
/*
Todo
revisit this flow post refactoring store
*/
const operationName = urlParams.get(METRICS_PAGE_QUERY_PARAM.operation); const operationName = urlParams.get(METRICS_PAGE_QUERY_PARAM.operation);
const serviceName = urlParams.get(METRICS_PAGE_QUERY_PARAM.service); const serviceName = urlParams.get(METRICS_PAGE_QUERY_PARAM.service);
const errorTag = urlParams.get(METRICS_PAGE_QUERY_PARAM.error); const errorTag = urlParams.get(METRICS_PAGE_QUERY_PARAM.error);
@ -72,6 +76,18 @@ const _TraceFilter = (props: TraceFilterProps) => {
service: serviceName, service: serviceName,
}); });
populateData(serviceName); populateData(serviceName);
} else if (serviceName && errorTag) {
props.updateTraceFilters({
...props.traceFilters,
service: serviceName,
tags: [
{
key: METRICS_PAGE_QUERY_PARAM.error,
value: errorTag,
operator: "EQUAL",
},
],
});
} else { } else {
if (operationName) { if (operationName) {
handleChangeOperation(operationName); handleChangeOperation(operationName);
@ -79,7 +95,6 @@ const _TraceFilter = (props: TraceFilterProps) => {
if (serviceName) { if (serviceName) {
handleChangeService(serviceName); handleChangeService(serviceName);
} }
}
if (errorTag) { if (errorTag) {
onTagFormSubmit({ onTagFormSubmit({
tag_key: METRICS_PAGE_QUERY_PARAM.error, tag_key: METRICS_PAGE_QUERY_PARAM.error,
@ -87,6 +102,7 @@ const _TraceFilter = (props: TraceFilterProps) => {
operator: "EQUAL", operator: "EQUAL",
}); });
} }
}
}); });
}, []); }, []);