mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-13 04:51:28 +08:00

* perf: introduce smart trace detail algorithm * fix: remove hardcoded levels and handle null levels * feat: add support for broken trees * feat: use spanLimit env variable * fix: handle missing root span * add root spanId and root name * use permanent table * add kind, events and tagmap support * fix query formation * increase context timeout to 600s * perf improvement * handle error * return tableName as response to query * support multiple queries tableName * perf: improve memory and latency * feat: add getSubTree custom func and smart trace detail algo to ee * fix: create new functions for ee * chore: refactor codebase * chore: refactor frontend code Co-authored-by: Ankit Nayan <ankit@signoz.io> Co-authored-by: Palash Gupta <palashgdev@gmail.com>
33 lines
884 B
TypeScript
33 lines
884 B
TypeScript
import axios from 'api';
|
|
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
|
import { AxiosError } from 'axios';
|
|
import { formUrlParams } from 'container/TraceDetail/utils';
|
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
|
import { GetTraceItemProps, PayloadProps } from 'types/api/trace/getTraceItem';
|
|
|
|
const getTraceItem = async (
|
|
props: GetTraceItemProps,
|
|
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
|
|
try {
|
|
const response = await axios.request<PayloadProps>({
|
|
url: `/traces/${props.id}${formUrlParams({
|
|
spanId: props.spanId,
|
|
levelUp: props.levelUp,
|
|
levelDown: props.levelDown,
|
|
})}`,
|
|
method: 'get',
|
|
});
|
|
|
|
return {
|
|
statusCode: 200,
|
|
error: null,
|
|
message: 'Success',
|
|
payload: response.data,
|
|
};
|
|
} catch (error) {
|
|
return ErrorResponseHandler(error as AxiosError);
|
|
}
|
|
};
|
|
|
|
export default getTraceItem;
|