Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: remove unused api files (#11041)

Prakhar Dewan705ff439c486
diff --git a/frontend/src/api/dashboard/queryRangeFormat.ts b/frontend/src/api/dashboard/queryRangeFormat.ts
deleted file mode 100644
index 02e020bfb5..0000000000
--- a/frontend/src/api/dashboard/queryRangeFormat.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { ApiV3Instance as axios } from 'api';
-import { ApiResponse } from 'types/api';
-import { ICompositeMetricQuery } from 'types/api/alerts/compositeQuery';
-import { QueryRangePayload } from 'types/api/metrics/getQueryRange';
-
-interface IQueryRangeFormat {
- compositeQuery: ICompositeMetricQuery;
-}
-
-export const getQueryRangeFormat = (
- props?: Partial<QueryRangePayload>,
-): Promise<IQueryRangeFormat> =>
- axios
- .post<ApiResponse<IQueryRangeFormat>>('/query_range/format', props)
- .then((res) => res.data.data);
diff --git a/frontend/src/api/dynamicConfigs/getDynamicConfigs.ts b/frontend/src/api/dynamicConfigs/getDynamicConfigs.ts
deleted file mode 100644
index 149c113119..0000000000
--- a/frontend/src/api/dynamicConfigs/getDynamicConfigs.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import { PayloadProps } from 'types/api/dynamicConfigs/getDynamicConfigs';
-
-const getDynamicConfigs = async (): Promise<
- SuccessResponse<PayloadProps> | ErrorResponse
-> => {
- try {
- const response = await axios.get(`/configs`);
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
-
-export default getDynamicConfigs;
diff --git a/frontend/src/api/infra/getHostAttributeKeys.ts b/frontend/src/api/infra/getHostAttributeKeys.ts
deleted file mode 100644
index de66be23d1..0000000000
--- a/frontend/src/api/infra/getHostAttributeKeys.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError, AxiosResponse } from 'axios';
-import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
-import { InfraMonitoringEntity } from 'container/InfraMonitoringK8s/constants';
-import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import {
- BaseAutocompleteData,
- IQueryAutocompleteResponse,
-} from 'types/api/queryBuilder/queryAutocompleteResponse';
-
-export const getHostAttributeKeys = async (
- searchText = '',
- entity: InfraMonitoringEntity,
-): Promise<SuccessResponse<IQueryAutocompleteResponse> | ErrorResponse> => {
- try {
- const response: AxiosResponse<{
- data: IQueryAutocompleteResponse;
- }> = await axios.get(
- `/${entity}/attribute_keys?dataSource=metrics&searchText=${searchText}`,
- {
- params: {
- limit: 500,
- },
- },
- );
-
- const payload: BaseAutocompleteData[] =
- response.data.data.attributeKeys?.map(({ id: _, ...item }) => ({
- ...item,
- id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
- })) || [];
-
- return {
- statusCode: 200,
- error: null,
- message: response.statusText,
- payload: { attributeKeys: payload },
- };
- } catch (e) {
- return ErrorResponseHandler(e as AxiosError);
- }
-};
diff --git a/frontend/src/api/infraMonitoring/getInfraAttributeValues.ts b/frontend/src/api/infraMonitoring/getInfraAttributeValues.ts
deleted file mode 100644
index 0e6b17ce11..0000000000
--- a/frontend/src/api/infraMonitoring/getInfraAttributeValues.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import createQueryParams from 'lib/createQueryParams';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import {
- IAttributeValuesResponse,
- IGetAttributeValuesPayload,
-} from 'types/api/queryBuilder/getAttributesValues';
-
-export const getInfraAttributesValues = async ({
- dataSource,
- attributeKey,
- filterAttributeKeyDataType,
- tagType,
- searchText,
- aggregateAttribute,
-}: IGetAttributeValuesPayload): Promise<
- SuccessResponse<IAttributeValuesResponse> | ErrorResponse
-> => {
- try {
- const response = await axios.get(
- `/hosts/attribute_values?${createQueryParams({
- dataSource,
- attributeKey,
- searchText,
- aggregateAttribute,
- })}&filterAttributeKeyDataType=${filterAttributeKeyDataType}&tagType=${tagType}`,
- );
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
diff --git a/frontend/src/api/metrics/getDBOverView.ts b/frontend/src/api/metrics/getDBOverView.ts
deleted file mode 100644
index 7afd56d75d..0000000000
--- a/frontend/src/api/metrics/getDBOverView.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import { PayloadProps, Props } from 'types/api/metrics/getDBOverview';
-
-const getDBOverView = async (
- props: Props,
-): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
- try {
- const response = await axios.get(
- `/service/dbOverview?&start=${props.start}&end=${props.end}&service=${props.service}&step=${props.step}`,
- );
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
-
-export default getDBOverView;
diff --git a/frontend/src/api/metrics/getExternalAverageDuration.ts b/frontend/src/api/metrics/getExternalAverageDuration.ts
deleted file mode 100644
index 51be375d94..0000000000
--- a/frontend/src/api/metrics/getExternalAverageDuration.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import {
- PayloadProps,
- Props,
-} from 'types/api/metrics/getExternalAverageDuration';
-
-const getExternalAverageDuration = async (
- props: Props,
-): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
- try {
- const response = await axios.get(
- `/service/externalAvgDuration?&start=${props.start}&end=${props.end}&service=${props.service}&step=${props.step}`,
- );
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
-
-export default getExternalAverageDuration;
diff --git a/frontend/src/api/metrics/getExternalError.ts b/frontend/src/api/metrics/getExternalError.ts
deleted file mode 100644
index 3587639bb9..0000000000
--- a/frontend/src/api/metrics/getExternalError.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import { PayloadProps, Props } from 'types/api/metrics/getExternalError';
-
-const getExternalError = async (
- props: Props,
-): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
- try {
- const response = await axios.get(
- `/service/externalErrors?&start=${props.start}&end=${props.end}&service=${props.service}&step=${props.step}`,
- );
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
-
-export default getExternalError;
diff --git a/frontend/src/api/metrics/getExternalService.ts b/frontend/src/api/metrics/getExternalService.ts
deleted file mode 100644
index de9bf65173..0000000000
--- a/frontend/src/api/metrics/getExternalService.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import { PayloadProps, Props } from 'types/api/metrics/getExternalService';
-
-const getExternalService = async (
- props: Props,
-): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
- try {
- const response = await axios.get(
- `/service/external?&start=${props.start}&end=${props.end}&service=${props.service}&step=${props.step}`,
- );
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
-
-export default getExternalService;
diff --git a/frontend/src/api/metrics/getServiceOverview.ts b/frontend/src/api/metrics/getServiceOverview.ts
deleted file mode 100644
index 47febaa3d8..0000000000
--- a/frontend/src/api/metrics/getServiceOverview.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import axios from 'api';
-import { PayloadProps, Props } from 'types/api/metrics/getServiceOverview';
-
-const getServiceOverview = async (props: Props): Promise<PayloadProps> => {
- const response = await axios.post(`/service/overview`, {
- start: `${props.start}`,
- end: `${props.end}`,
- service: props.service,
- step: props.step,
- tags: props.selectedTags,
- });
-
- return response.data;
-};
-
-export default getServiceOverview;
diff --git a/frontend/src/api/trace/getTraceItem.ts b/frontend/src/api/trace/getTraceItem.ts
deleted file mode 100644
index 054c809b33..0000000000
--- a/frontend/src/api/trace/getTraceItem.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-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;
diff --git a/frontend/src/api/v1/org/preferences/name/get.ts b/frontend/src/api/v1/org/preferences/name/get.ts
deleted file mode 100644
index 48e746d2a1..0000000000
--- a/frontend/src/api/v1/org/preferences/name/get.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandlerV2 } from 'api/ErrorResponseHandlerV2';
-import { AxiosError } from 'axios';
-import { ErrorV2Resp, SuccessResponseV2 } from 'types/api';
-import { PayloadProps, Props } from 'types/api/preferences/get';
-import { OrgPreference } from 'types/api/preferences/preference';
-
-const getPreference = async (
- props: Props,
-): Promise<SuccessResponseV2<OrgPreference>> => {
- try {
- const response = await axios.get<PayloadProps>(
- `/org/preferences/${props.name}`,
- );
-
- return {
- httpStatusCode: response.status,
- data: response.data.data,
- };
- } catch (error) {
- ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
- }
-};
-
-export default getPreference;
diff --git a/frontend/src/api/widgets/getQuery.ts b/frontend/src/api/widgets/getQuery.ts
deleted file mode 100644
index a706db3b77..0000000000
--- a/frontend/src/api/widgets/getQuery.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import axios from 'api';
-import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
-import { AxiosError } from 'axios';
-import { ErrorResponse, SuccessResponse } from 'types/api';
-import { PayloadProps, Props } from 'types/api/widgets/getQuery';
-
-const getQuery = async (
- props: Props,
-): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
- try {
- const response = await axios.get(
- `/query_range?query=${props.query}&start=${props.start}&end=${props.end}&step=${props.step}`,
- );
-
- return {
- statusCode: 200,
- error: null,
- message: response.data.status,
- payload: response.data.data,
- };
- } catch (error) {
- return ErrorResponseHandler(error as AxiosError);
- }
-};
-
-export default getQuery;