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.

refactor: merge tracedetail typse with spantypes (#11417)

Nikhil Soni9ba57d323dad
diff --git a/docs/api/openapi.yml b/docs/api/openapi.yml
index 54bf88be2f..ba7ec267a1 100644
--- a/docs/api/openapi.yml
+++ b/docs/api/openapi.yml
@@ -5641,6 +5641,19 @@ components:
type: object
Sigv4SigV4Config:
type: object
+ SpantypesEvent:
+ properties:
+ attributeMap:
+ additionalProperties: {}
+ type: object
+ isError:
+ type: boolean
+ name:
+ type: string
+ timeUnixNano:
+ minimum: 0
+ type: integer
+ type: object
SpantypesFieldContext:
enum:
- attribute
@@ -5655,6 +5668,50 @@ components:
required:
- items
type: object
+ SpantypesGettableWaterfallTrace:
+ properties:
+ aggregations:
+ items:
+ $ref: '#/components/schemas/SpantypesSpanAggregationResult'
+ nullable: true
+ type: array
+ endTimestampMillis:
+ minimum: 0
+ type: integer
+ hasMissingSpans:
+ type: boolean
+ hasMore:
+ type: boolean
+ rootServiceEntryPoint:
+ type: string
+ rootServiceName:
+ type: string
+ serviceNameToTotalDurationMap:
+ additionalProperties:
+ minimum: 0
+ type: integer
+ nullable: true
+ type: object
+ spans:
+ items:
+ $ref: '#/components/schemas/SpantypesWaterfallSpan'
+ nullable: true
+ type: array
+ startTimestampMillis:
+ minimum: 0
+ type: integer
+ totalErrorSpansCount:
+ minimum: 0
+ type: integer
+ totalSpansCount:
+ minimum: 0
+ type: integer
+ uncollapsedSpans:
+ items:
+ type: string
+ nullable: true
+ type: array
+ type: object
SpantypesPostableSpanMapper:
properties:
config:
@@ -5682,6 +5739,50 @@ components:
- name
- condition
type: object
+ SpantypesPostableWaterfall:
+ properties:
+ aggregations:
+ items:
+ $ref: '#/components/schemas/SpantypesSpanAggregation'
+ nullable: true
+ type: array
+ limit:
+ minimum: 0
+ type: integer
+ selectedSpanId:
+ type: string
+ uncollapsedSpans:
+ items:
+ type: string
+ nullable: true
+ type: array
+ type: object
+ SpantypesSpanAggregation:
+ properties:
+ aggregation:
+ $ref: '#/components/schemas/SpantypesSpanAggregationType'
+ field:
+ $ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
+ type: object
+ SpantypesSpanAggregationResult:
+ properties:
+ aggregation:
+ $ref: '#/components/schemas/SpantypesSpanAggregationType'
+ field:
+ $ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
+ value:
+ additionalProperties:
+ minimum: 0
+ type: integer
+ nullable: true
+ type: object
+ type: object
+ SpantypesSpanAggregationType:
+ enum:
+ - span_count
+ - execution_time_percentage
+ - duration
+ type: string
SpantypesSpanMapper:
properties:
config:
@@ -5812,6 +5913,78 @@ components:
nullable: true
type: string
type: object
+ SpantypesWaterfallSpan:
+ properties:
+ attributes:
+ additionalProperties: {}
+ nullable: true
+ type: object
+ db_name:
+ type: string
+ db_operation:
+ type: string
+ duration_nano:
+ minimum: 0
+ type: integer
+ events:
+ items:
+ $ref: '#/components/schemas/SpantypesEvent'
+ nullable: true
+ type: array
+ external_http_method:
+ type: string
+ external_http_url:
+ type: string
+ flags:
+ minimum: 0
+ type: integer
+ has_children:
+ type: boolean
+ has_error:
+ type: boolean
+ http_host:
+ type: string
+ http_method:
+ type: string
+ http_url:
+ type: string
+ is_remote:
+ type: string
+ kind_string:
+ type: string
+ level:
+ minimum: 0
+ type: integer
+ name:
+ type: string
+ parent_span_id:
+ type: string
+ resource:
+ additionalProperties:
+ type: string
+ nullable: true
+ type: object
+ response_status_code:
+ type: string
+ span_id:
+ type: string
+ status_code:
+ type: integer
+ status_code_string:
+ type: string
+ status_message:
+ type: string
+ sub_tree_node_count:
+ minimum: 0
+ type: integer
+ time_unix:
+ minimum: 0
+ type: integer
+ trace_id:
+ type: string
+ trace_state:
+ type: string
+ type: object
TelemetrytypesFieldContext:
enum:
- metric
@@ -5904,179 +6077,6 @@ components:
TimeDuration:
format: int64
type: integer
- TracedetailtypesEvent:
- properties:
- attributeMap:
- additionalProperties: {}
- type: object
- isError:
- type: boolean
- name:
- type: string
- timeUnixNano:
- minimum: 0
- type: integer
- type: object
- TracedetailtypesGettableWaterfallTrace:
- properties:
- aggregations:
- items:
- $ref: '#/components/schemas/TracedetailtypesSpanAggregationResult'
- nullable: true
- type: array
- endTimestampMillis:
- minimum: 0
- type: integer
- hasMissingSpans:
- type: boolean
- hasMore:
- type: boolean
- rootServiceEntryPoint:
- type: string
- rootServiceName:
- type: string
- serviceNameToTotalDurationMap:
- additionalProperties:
- minimum: 0
- type: integer
- nullable: true
- type: object
- spans:
- items:
- $ref: '#/components/schemas/TracedetailtypesWaterfallSpan'
- nullable: true
- type: array
- startTimestampMillis:
- minimum: 0
- type: integer
- totalErrorSpansCount:
- minimum: 0
- type: integer
- totalSpansCount:
- minimum: 0
- type: integer
- uncollapsedSpans:
- items:
- type: string
- nullable: true
- type: array
- type: object
- TracedetailtypesPostableWaterfall:
- properties:
- aggregations:
- items:
- $ref: '#/components/schemas/TracedetailtypesSpanAggregation'
- nullable: true
- type: array
- limit:
- minimum: 0
- type: integer
- selectedSpanId:
- type: string
- uncollapsedSpans:
- items:
- type: string
- nullable: true
- type: array
- type: object
- TracedetailtypesSpanAggregation:
- properties:
- aggregation:
- $ref: '#/components/schemas/TracedetailtypesSpanAggregationType'
- field:
- $ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
- type: object
- TracedetailtypesSpanAggregationResult:
- properties:
- aggregation:
- $ref: '#/components/schemas/TracedetailtypesSpanAggregationType'
- field:
- $ref: '#/components/schemas/TelemetrytypesTelemetryFieldKey'
- value:
- additionalProperties:
- minimum: 0
- type: integer
- nullable: true
- type: object
- type: object
- TracedetailtypesSpanAggregationType:
- enum:
- - span_count
- - execution_time_percentage
- - duration
- type: string
- TracedetailtypesWaterfallSpan:
- properties:
- attributes:
- additionalProperties: {}
- nullable: true
- type: object
- db_name:
- type: string
- db_operation:
- type: string
- duration_nano:
- minimum: 0
- type: integer
- events:
- items:
- $ref: '#/components/schemas/TracedetailtypesEvent'
- nullable: true
- type: array
- external_http_method:
- type: string
- external_http_url:
- type: string
- flags:
- minimum: 0
- type: integer
- has_children:
- type: boolean
- has_error:
- type: boolean
- http_host:
- type: string
- http_method:
- type: string
- http_url:
- type: string
- is_remote:
- type: string
- kind_string:
- type: string
- level:
- minimum: 0
- type: integer
- name:
- type: string
- parent_span_id:
- type: string
- resource:
- additionalProperties:
- type: string
- nullable: true
- type: object
- response_status_code:
- type: string
- span_id:
- type: string
- status_code:
- type: integer
- status_code_string:
- type: string
- status_message:
- type: string
- sub_tree_node_count:
- minimum: 0
- type: integer
- time_unix:
- minimum: 0
- type: integer
- trace_id:
- type: string
- trace_state:
- type: string
- type: object
TypesAlertStatus:
properties:
inhibitedBy:
@@ -18896,7 +18896,7 @@ paths:
content:
application/json:
schema:
- $ref: '#/components/schemas/TracedetailtypesPostableWaterfall'
+ $ref: '#/components/schemas/SpantypesPostableWaterfall'
responses:
"200":
content:
@@ -18904,7 +18904,7 @@ paths:
schema:
properties:
data:
- $ref: '#/components/schemas/TracedetailtypesGettableWaterfallTrace'
+ $ref: '#/components/schemas/SpantypesGettableWaterfallTrace'
status:
type: string
required:
diff --git a/frontend/src/api/generated/services/sigNoz.schemas.ts b/frontend/src/api/generated/services/sigNoz.schemas.ts
index 5d4dc447cb..6b1d9a45be 100644
--- a/frontend/src/api/generated/services/sigNoz.schemas.ts
+++ b/frontend/src/api/generated/services/sigNoz.schemas.ts
@@ -6655,6 +6655,28 @@ export interface ServiceaccounttypesUpdatableFactorAPIKeyDTO {
name: string;
}
+export type SpantypesEventDTOAttributeMap = { [key: string]: unknown };
+
+export interface SpantypesEventDTO {
+ /**
+ * @type object
+ */
+ attributeMap?: SpantypesEventDTOAttributeMap;
+ /**
+ * @type boolean
+ */
+ isError?: boolean;
+ /**
+ * @type string
+ */
+ name?: string;
+ /**
+ * @type integer
+ * @minimum 0
+ */
+ timeUnixNano?: number;
+}
+
export enum SpantypesFieldContextDTO {
attribute = 'attribute',
resource = 'resource',
@@ -6721,243 +6743,62 @@ export interface SpantypesGettableSpanMapperGroupsDTO {
items: SpantypesSpanMapperGroupDTO[];
}
-export enum SpantypesSpanMapperOperationDTO {
- move = 'move',
- copy = 'copy',
-}
-export interface SpantypesSpanMapperSourceDTO {
- context: SpantypesFieldContextDTO;
- /**
- * @type string
- */
- key: string;
- operation: SpantypesSpanMapperOperationDTO;
- /**
- * @type integer
- */
- priority: number;
-}
-
-export interface SpantypesSpanMapperConfigDTO {
- /**
- * @type array,null
- */
- sources: SpantypesSpanMapperSourceDTO[] | null;
-}
-
-export interface SpantypesPostableSpanMapperDTO {
- config: SpantypesSpanMapperConfigDTO;
- /**
- * @type boolean
- */
- enabled?: boolean;
- fieldContext: SpantypesFieldContextDTO;
- /**
- * @type string
- */
- name: string;
-}
-
-export interface SpantypesPostableSpanMapperGroupDTO {
- condition: SpantypesSpanMapperGroupConditionDTO | null;
- /**
- * @type boolean
- */
- enabled?: boolean;
- /**
- * @type string
- */
- name: string;
-}
-
-export interface SpantypesSpanMapperDTO {
- config: SpantypesSpanMapperConfigDTO;
- /**
- * @type string
- * @format date-time
- */
- createdAt?: string;
- /**
- * @type string
- */
- createdBy?: string;
- /**
- * @type boolean
- */
- enabled: boolean;
- fieldContext: SpantypesFieldContextDTO;
- /**
- * @type string
- */
- group_id: string;
- /**
- * @type string
- */
- id: string;
- /**
- * @type string
- */
- name: string;
- /**
- * @type string
- * @format date-time
- */
- updatedAt?: string;
- /**
- * @type string
- */
- updatedBy?: string;
-}
-
-export interface SpantypesUpdatableSpanMapperDTO {
- config?: SpantypesSpanMapperConfigDTO;
- /**
- * @type boolean,null
- */
- enabled?: boolean | null;
- fieldContext?: SpantypesFieldContextDTO;
-}
-
-export interface SpantypesUpdatableSpanMapperGroupDTO {
- condition?: SpantypesSpanMapperGroupConditionDTO | null;
- /**
- * @type boolean,null
- */
- enabled?: boolean | null;
- /**
- * @type string,null
- */
- name?: string | null;
-}
-
-export type TelemetrytypesGettableFieldKeysDTOKeysAnyOf = {
- [key: string]: TelemetrytypesTelemetryFieldKeyDTO[];
-};
-
-/**
- * @nullable
- */
-export type TelemetrytypesGettableFieldKeysDTOKeys =
- TelemetrytypesGettableFieldKeysDTOKeysAnyOf | null;
-
-export interface TelemetrytypesGettableFieldKeysDTO {
- /**
- * @type boolean
- */
- complete: boolean;
- /**
- * @type object,null
- */
- keys: TelemetrytypesGettableFieldKeysDTOKeys;
-}
-
-export interface TelemetrytypesTelemetryFieldValuesDTO {
- /**
- * @type array
- */
- boolValues?: boolean[];
- /**
- * @type array
- */
- numberValues?: number[];
- /**
- * @type array
- */
- relatedValues?: string[];
- /**
- * @type array
- */
- stringValues?: string[];
-}
-
-export interface TelemetrytypesGettableFieldValuesDTO {
- /**
- * @type boolean
- */
- complete: boolean;
- values: TelemetrytypesTelemetryFieldValuesDTO;
-}
-
-export type TracedetailtypesEventDTOAttributeMap = { [key: string]: unknown };
-
-export interface TracedetailtypesEventDTO {
- /**
- * @type object
- */
- attributeMap?: TracedetailtypesEventDTOAttributeMap;
- /**
- * @type boolean
- */
- isError?: boolean;
- /**
- * @type string
- */
- name?: string;
- /**
- * @type integer
- * @minimum 0
- */
- timeUnixNano?: number;
-}
-
-export type TracedetailtypesGettableWaterfallTraceDTOServiceNameToTotalDurationMapAnyOf =
+export type SpantypesGettableWaterfallTraceDTOServiceNameToTotalDurationMapAnyOf =
{ [key: string]: number };
/**
* @nullable
*/
-export type TracedetailtypesGettableWaterfallTraceDTOServiceNameToTotalDurationMap =
- TracedetailtypesGettableWaterfallTraceDTOServiceNameToTotalDurationMapAnyOf | null;
+export type SpantypesGettableWaterfallTraceDTOServiceNameToTotalDurationMap =
+ SpantypesGettableWaterfallTraceDTOServiceNameToTotalDurationMapAnyOf | null;
-export enum TracedetailtypesSpanAggregationTypeDTO {
+export enum SpantypesSpanAggregationTypeDTO {
span_count = 'span_count',
execution_time_percentage = 'execution_time_percentage',
duration = 'duration',
}
-export type TracedetailtypesSpanAggregationResultDTOValueAnyOf = {
+export type SpantypesSpanAggregationResultDTOValueAnyOf = {
[key: string]: number;
};
/**
* @nullable
*/
-export type TracedetailtypesSpanAggregationResultDTOValue =
- TracedetailtypesSpanAggregationResultDTOValueAnyOf | null;
+export type SpantypesSpanAggregationResultDTOValue =
+ SpantypesSpanAggregationResultDTOValueAnyOf | null;
-export interface TracedetailtypesSpanAggregationResultDTO {
- aggregation?: TracedetailtypesSpanAggregationTypeDTO;
+export interface SpantypesSpanAggregationResultDTO {
+ aggregation?: SpantypesSpanAggregationTypeDTO;
field?: TelemetrytypesTelemetryFieldKeyDTO;
/**
* @type object,null
*/
- value?: TracedetailtypesSpanAggregationResultDTOValue;
+ value?: SpantypesSpanAggregationResultDTOValue;
}
-export type TracedetailtypesWaterfallSpanDTOAttributesAnyOf = {
+export type SpantypesWaterfallSpanDTOAttributesAnyOf = {
[key: string]: unknown;
};
/**
* @nullable
*/
-export type TracedetailtypesWaterfallSpanDTOAttributes =
- TracedetailtypesWaterfallSpanDTOAttributesAnyOf | null;
+export type SpantypesWaterfallSpanDTOAttributes =
+ SpantypesWaterfallSpanDTOAttributesAnyOf | null;
-export type TracedetailtypesWaterfallSpanDTOResourceAnyOf = {
- [key: string]: string;
-};
+export type SpantypesWaterfallSpanDTOResourceAnyOf = { [key: string]: string };
/**
* @nullable
*/
-export type TracedetailtypesWaterfallSpanDTOResource =
- TracedetailtypesWaterfallSpanDTOResourceAnyOf | null;
+export type SpantypesWaterfallSpanDTOResource =
+ SpantypesWaterfallSpanDTOResourceAnyOf | null;
-export interface TracedetailtypesWaterfallSpanDTO {
+export interface SpantypesWaterfallSpanDTO {
/**
* @type object,null
*/
- attributes?: TracedetailtypesWaterfallSpanDTOAttributes;
+ attributes?: SpantypesWaterfallSpanDTOAttributes;
/**
* @type string
*/
@@ -6974,7 +6815,7 @@ export interface TracedetailtypesWaterfallSpanDTO {
/**
* @type array,null
*/
- events?: TracedetailtypesEventDTO[] | null;
+ events?: SpantypesEventDTO[] | null;
/**
* @type string
*/
@@ -7032,7 +6873,7 @@ export interface TracedetailtypesWaterfallSpanDTO {
/**
* @type object,null
*/
- resource?: TracedetailtypesWaterfallSpanDTOResource;
+ resource?: SpantypesWaterfallSpanDTOResource;
/**
* @type string
*/
@@ -7073,11 +6914,11 @@ export interface TracedetailtypesWaterfallSpanDTO {
trace_state?: string;
}
-export interface TracedetailtypesGettableWaterfallTraceDTO {
+export interface SpantypesGettableWaterfallTraceDTO {
/**
* @type array,null
*/
- aggregations?: TracedetailtypesSpanAggregationResultDTO[] | null;
+ aggregations?: SpantypesSpanAggregationResultDTO[] | null;
/**
* @type integer
* @minimum 0
@@ -7102,11 +6943,11 @@ export interface TracedetailtypesGettableWaterfallTraceDTO {
/**
* @type object,null
*/
- serviceNameToTotalDurationMap?: TracedetailtypesGettableWaterfallTraceDTOServiceNameToTotalDurationMap;
+ serviceNameToTotalDurationMap?: SpantypesGettableWaterfallTraceDTOServiceNameToTotalDurationMap;
/**
* @type array,null
*/
- spans?: TracedetailtypesWaterfallSpanDTO[] | null;
+ spans?: SpantypesWaterfallSpanDTO[] | null;
/**
* @type integer
* @minimum 0
@@ -7128,16 +6969,65 @@ export interface TracedetailtypesGettableWaterfallTraceDTO {
uncollapsedSpans?: string[] | null;
}
-export interface TracedetailtypesSpanAggregationDTO {
- aggregation?: TracedetailtypesSpanAggregationTypeDTO;
+export enum SpantypesSpanMapperOperationDTO {
+ move = 'move',
+ copy = 'copy',
+}
+export interface SpantypesSpanMapperSourceDTO {
+ context: SpantypesFieldContextDTO;
+ /**
+ * @type string
+ */
+ key: string;
+ operation: SpantypesSpanMapperOperationDTO;
+ /**
+ * @type integer
+ */
+ priority: number;
+}
+
+export interface SpantypesSpanMapperConfigDTO {
+ /**
+ * @type array,null
+ */
+ sources: SpantypesSpanMapperSourceDTO[] | null;
+}
+
+export interface SpantypesPostableSpanMapperDTO {
+ config: SpantypesSpanMapperConfigDTO;
+ /**
+ * @type boolean
+ */
+ enabled?: boolean;
+ fieldContext: SpantypesFieldContextDTO;
+ /**
+ * @type string
+ */
+ name: string;
+}
+
+export interface SpantypesPostableSpanMapperGroupDTO {
+ condition: SpantypesSpanMapperGroupConditionDTO | null;
+ /**
+ * @type boolean
+ */
+ enabled?: boolean;
+ /**
+ * @type string
+ */
+ name: string;
+}
+
+export interface SpantypesSpanAggregationDTO {
+ aggregation?: SpantypesSpanAggregationTypeDTO;
field?: TelemetrytypesTelemetryFieldKeyDTO;
}
-export interface TracedetailtypesPostableWaterfallDTO {
+export interface SpantypesPostableWaterfallDTO {
/**
* @type array,null
*/
- aggregations?: TracedetailtypesSpanAggregationDTO[] | null;
+ aggregations?: SpantypesSpanAggregationDTO[] | null;
/**
* @type integer
* @minimum 0
@@ -7153,6 +7043,114 @@ export interface TracedetailtypesPostableWaterfallDTO {
uncollapsedSpans?: string[] | null;
}
+export interface SpantypesSpanMapperDTO {
+ config: SpantypesSpanMapperConfigDTO;
+ /**
+ * @type string
+ * @format date-time
+ */
+ createdAt?: string;
+ /**
+ * @type string
+ */
+ createdBy?: string;
+ /**
+ * @type boolean
+ */
+ enabled: boolean;
+ fieldContext: SpantypesFieldContextDTO;
+ /**
+ * @type string
+ */
+ group_id: string;
+ /**
+ * @type string
+ */
+ id: string;
+ /**
+ * @type string
+ */
+ name: string;
+ /**
+ * @type string
+ * @format date-time
+ */
+ updatedAt?: string;
+ /**
+ * @type string
+ */
+ updatedBy?: string;
+}
+
+export interface SpantypesUpdatableSpanMapperDTO {
+ config?: SpantypesSpanMapperConfigDTO;
+ /**
+ * @type boolean,null
+ */
+ enabled?: boolean | null;
+ fieldContext?: SpantypesFieldContextDTO;
+}
+
+export interface SpantypesUpdatableSpanMapperGroupDTO {
+ condition?: SpantypesSpanMapperGroupConditionDTO | null;
+ /**
+ * @type boolean,null
+ */
+ enabled?: boolean | null;
+ /**
+ * @type string,null
+ */
+ name?: string | null;
+}
+
+export type TelemetrytypesGettableFieldKeysDTOKeysAnyOf = {
+ [key: string]: TelemetrytypesTelemetryFieldKeyDTO[];
+};
+
+/**
+ * @nullable
+ */
+export type TelemetrytypesGettableFieldKeysDTOKeys =
+ TelemetrytypesGettableFieldKeysDTOKeysAnyOf | null;
+
+export interface TelemetrytypesGettableFieldKeysDTO {
+ /**
+ * @type boolean
+ */
+ complete: boolean;
+ /**
+ * @type object,null
+ */
+ keys: TelemetrytypesGettableFieldKeysDTOKeys;
+}
+
+export interface TelemetrytypesTelemetryFieldValuesDTO {
+ /**
+ * @type array
+ */
+ boolValues?: boolean[];
+ /**
+ * @type array
+ */
+ numberValues?: number[];
+ /**
+ * @type array
+ */
+ relatedValues?: string[];
+ /**
+ * @type array
+ */
+ stringValues?: string[];
+}
+
+export interface TelemetrytypesGettableFieldValuesDTO {
+ /**
+ * @type boolean
+ */
+ complete: boolean;
+ values: TelemetrytypesTelemetryFieldValuesDTO;
+}
+
export interface TypesChangePasswordRequestDTO {
/**
* @type string
@@ -9232,7 +9230,7 @@ export type GetWaterfallPathParameters = {
traceID: string;
};
export type GetWaterfall200 = {
- data: TracedetailtypesGettableWaterfallTraceDTO;
+ data: SpantypesGettableWaterfallTraceDTO;
/**
* @type string
*/
diff --git a/frontend/src/api/generated/services/tracedetail/index.ts b/frontend/src/api/generated/services/tracedetail/index.ts
index 8821ca1000..39a9e54448 100644
--- a/frontend/src/api/generated/services/tracedetail/index.ts
+++ b/frontend/src/api/generated/services/tracedetail/index.ts
@@ -15,7 +15,7 @@ import type {
GetWaterfall200,
GetWaterfallPathParameters,
RenderErrorResponseDTO,
- TracedetailtypesPostableWaterfallDTO,
+ SpantypesPostableWaterfallDTO,
} from '../sigNoz.schemas';
import { GeneratedAPIInstance } from '../../../generatedAPIInstance';
@@ -27,14 +27,14 @@ import type { ErrorType, BodyType } from '../../../generatedAPIInstance';
*/
export const getWaterfall = (
{ traceID }: GetWaterfallPathParameters,
- tracedetailtypesPostableWaterfallDTO?: BodyType<TracedetailtypesPostableWaterfallDTO>,
+ spantypesPostableWaterfallDTO?: BodyType<SpantypesPostableWaterfallDTO>,
signal?: AbortSignal,
) => {
return GeneratedAPIInstance<GetWaterfall200>({
url: `/api/v3/traces/${traceID}/waterfall`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
- data: tracedetailtypesPostableWaterfallDTO,
+ data: spantypesPostableWaterfallDTO,
signal,
});
};
@@ -48,7 +48,7 @@ export const getGetWaterfallMutationOptions = <
TError,
{
pathParams: GetWaterfallPathParameters;
- data?: BodyType<TracedetailtypesPostableWaterfallDTO>;
+ data?: BodyType<SpantypesPostableWaterfallDTO>;
},
TContext
>;
@@ -57,7 +57,7 @@ export const getGetWaterfallMutationOptions = <
TError,
{
pathParams: GetWaterfallPathParameters;
- data?: BodyType<TracedetailtypesPostableWaterfallDTO>;
+ data?: BodyType<SpantypesPostableWaterfallDTO>;
},
TContext
> => {
@@ -74,7 +74,7 @@ export const getGetWaterfallMutationOptions = <
Awaited<ReturnType<typeof getWaterfall>>,
{
pathParams: GetWaterfallPathParameters;
- data?: BodyType<TracedetailtypesPostableWaterfallDTO>;
+ data?: BodyType<SpantypesPostableWaterfallDTO>;
}
> = (props) => {
const { pathParams, data } = props ?? {};
@@ -89,7 +89,7 @@ export type GetWaterfallMutationResult = NonNullable<
Awaited<ReturnType<typeof getWaterfall>>
>;
export type GetWaterfallMutationBody =
- | BodyType<TracedetailtypesPostableWaterfallDTO>
+ | BodyType<SpantypesPostableWaterfallDTO>
| undefined;
export type GetWaterfallMutationError = ErrorType<RenderErrorResponseDTO>;
@@ -105,7 +105,7 @@ export const useGetWaterfall = <
TError,
{
pathParams: GetWaterfallPathParameters;
- data?: BodyType<TracedetailtypesPostableWaterfallDTO>;
+ data?: BodyType<SpantypesPostableWaterfallDTO>;
},
TContext
>;
@@ -114,7 +114,7 @@ export const useGetWaterfall = <
TError,
{
pathParams: GetWaterfallPathParameters;
- data?: BodyType<TracedetailtypesPostableWaterfallDTO>;
+ data?: BodyType<SpantypesPostableWaterfallDTO>;
},
TContext
> => {
diff --git a/pkg/apiserver/signozapiserver/tracedetail.go b/pkg/apiserver/signozapiserver/tracedetail.go
index db39edaa29..b7c3fec10c 100644
--- a/pkg/apiserver/signozapiserver/tracedetail.go
+++ b/pkg/apiserver/signozapiserver/tracedetail.go
@@ -5,7 +5,7 @@ import (
"github.com/SigNoz/signoz/pkg/http/handler"
"github.com/SigNoz/signoz/pkg/types"
- "github.com/SigNoz/signoz/pkg/types/tracedetailtypes"
+ "github.com/SigNoz/signoz/pkg/types/spantypes"
"github.com/gorilla/mux"
)
@@ -17,9 +17,9 @@ func (provider *provider) addTraceDetailRoutes(router *mux.Router) error {
Tags: []string{"tracedetail"},
Summary: "Get waterfall view for a trace",
Description: "Returns the waterfall view of spans for a given trace ID with tree structure, metadata, and windowed pagination",
- Request: new(tracedetailtypes.PostableWaterfall),
+ Request: new(spantypes.PostableWaterfall),
RequestContentType: "application/json",
- Response: new(tracedetailtypes.GettableWaterfallTrace),
+ Response: new(spantypes.GettableWaterfallTrace),
ResponseContentType: "application/json",
SuccessStatusCode: http.StatusOK,
ErrorStatusCodes: []int{http.StatusBadRequest, http.StatusNotFound},
diff --git a/pkg/modules/tracedetail/impltracedetail/handler.go b/pkg/modules/tracedetail/impltracedetail/handler.go
index 768ac09995..ca650bc714 100644
--- a/pkg/modules/tracedetail/impltracedetail/handler.go
+++ b/pkg/modules/tracedetail/impltracedetail/handler.go
@@ -6,7 +6,7 @@ import (
"github.com/SigNoz/signoz/pkg/http/binding"
"github.com/SigNoz/signoz/pkg/http/render"
"github.com/SigNoz/signoz/pkg/modules/tracedetail"
- "github.com/SigNoz/signoz/pkg/types/tracedetailtypes"
+ "github.com/SigNoz/signoz/pkg/types/spantypes"
"github.com/gorilla/mux"
)
@@ -19,7 +19,7 @@ func NewHandler(module tracedetail.Module) tracedetail.Handler {
}
func (h *handler) GetWaterfall(rw http.ResponseWriter, r *http.Request) {
- req := new(tracedetailtypes.PostableWaterfall)
+ req := new(spantypes.PostableWaterfall)
if err := binding.JSON.BindBody(r.Body, req); err != nil {
render.Error(rw, err)
return
diff --git a/pkg/modules/tracedetail/impltracedetail/module.go b/pkg/modules/tracedetail/impltracedetail/module.go
index 1de06107f0..3ff47d7492 100644
--- a/pkg/modules/tracedetail/impltracedetail/module.go
+++ b/pkg/modules/tracedetail/impltracedetail/module.go
@@ -5,16 +5,16 @@ import (
"github.com/SigNoz/signoz/pkg/factory"
"github.com/SigNoz/signoz/pkg/modules/tracedetail"
- "github.com/SigNoz/signoz/pkg/types/tracedetailtypes"
+ "github.com/SigNoz/signoz/pkg/types/spantypes"
)
type module struct {
- store tracedetailtypes.TraceStore
+ store spantypes.TraceStore
settings factory.ScopedProviderSettings
config tracedetail.Config
}
-func NewModule(traceStore tracedetailtypes.TraceStore, providerSettings factory.ProviderSettings, cfg tracedetail.Config) *module {
+func NewModule(traceStore spantypes.TraceStore, providerSettings factory.ProviderSettings, cfg tracedetail.Config) *module {
scopedProviderSettings := factory.NewScopedProviderSettings(providerSettings, "github.com/SigNoz/signoz/pkg/modules/tracedetail/impltracedetail")
return &module{
config: cfg,
@@ -23,7 +23,7 @@ func NewModule(traceStore tracedetailtypes.TraceStore, providerSettings factory.
}
}
-func (m *module) GetWaterfall(ctx context.Context, traceID string, req *tracedetailtypes.PostableWaterfall) (*tracedetailtypes.GettableWaterfallTrace, error) {
+func (m *module) GetWaterfall(ctx context.Context, traceID string, req *spantypes.PostableWaterfall) (*spantypes.GettableWaterfallTrace, error) {
waterfallTrace, err := m.getTraceData(ctx, traceID)
if err != nil {
return nil, err
@@ -37,16 +37,16 @@ func (m *module) GetWaterfall(ctx context.Context, traceID string, req *tracedet
m.config.Waterfall.MaxDepthToAutoExpand,
)
- aggregationResults := make([]tracedetailtypes.SpanAggregationResult, 0, len(req.Aggregations))
+ aggregationResults := make([]spantypes.SpanAggregationResult, 0, len(req.Aggregations))
for _, a := range req.Aggregations {
aggregationResults = append(aggregationResults, waterfallTrace.GetSpanAggregation(a.Aggregation, a.Field))
}
- return tracedetailtypes.NewGettableWaterfallTrace(waterfallTrace, selectedSpans, uncollapsedSpans, selectedAllSpans, aggregationResults), nil
+ return spantypes.NewGettableWaterfallTrace(waterfallTrace, selectedSpans, uncollapsedSpans, selectedAllSpans, aggregationResults), nil
}
// getTraceData returns the waterfall cache for the given traceID with fallback on DB.
-func (m *module) getTraceData(ctx context.Context, traceID string) (*tracedetailtypes.WaterfallTrace, error) {
+func (m *module) getTraceData(ctx context.Context, traceID string) (*spantypes.WaterfallTrace, error) {
summary, err := m.store.GetTraceSummary(ctx, traceID)
if err != nil {
return nil, err
@@ -58,9 +58,9 @@ func (m *module) getTraceData(ctx context.Context, traceID string) (*tracedetail
}
if len(spanItems) == 0 {
- return nil, tracedetailtypes.ErrTraceNotFound
+ return nil, spantypes.ErrTraceNotFound
}
- traceData := tracedetailtypes.NewWaterfallTraceFromSpans(spanItems)
+ traceData := spantypes.NewWaterfallTraceFromSpans(spanItems)
return traceData, nil
}
diff --git a/pkg/modules/tracedetail/impltracedetail/store.go b/pkg/modules/tracedetail/impltracedetail/store.go
index 4bb4b815b7..adbdb34761 100644
--- a/pkg/modules/tracedetail/impltracedetail/store.go
+++ b/pkg/modules/tracedetail/impltracedetail/store.go
@@ -9,7 +9,7 @@ import (
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/telemetrystore"
- "github.com/SigNoz/signoz/pkg/types/tracedetailtypes"
+ "github.com/SigNoz/signoz/pkg/types/spantypes"
)
type traceStore struct {
@@ -20,28 +20,28 @@ func NewTraceStore(ts telemetrystore.TelemetryStore) *traceStore {
return &traceStore{telemetryStore: ts}
}
-func (s *traceStore) GetTraceSummary(ctx context.Context, traceID string) (*tracedetailtypes.TraceSummary, error) {
+func (s *traceStore) GetTraceSummary(ctx context.Context, traceID string) (*spantypes.TraceSummary, error) {
sb := sqlbuilder.NewSelectBuilder()
sb.Select("trace_id", "min(start) AS start", "max(end) AS end", "sum(num_spans) AS num_spans")
- sb.From(fmt.Sprintf("%s.%s", tracedetailtypes.TraceDB, tracedetailtypes.TraceSummaryTable))
+ sb.From(fmt.Sprintf("%s.%s", spantypes.TraceDB, spantypes.TraceSummaryTable))
sb.Where(sb.E("trace_id", traceID))
sb.GroupBy("trace_id")
query, args := sb.BuildWithFlavor(sqlbuilder.ClickHouse)
- var summary tracedetailtypes.TraceSummary
+ var summary spantypes.TraceSummary
err := s.telemetryStore.ClickhouseDB().QueryRow(ctx, query, args...).Scan(
&summary.TraceID, &summary.Start, &summary.End, &summary.NumSpans,
)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
- return nil, tracedetailtypes.ErrTraceNotFound
+ return nil, spantypes.ErrTraceNotFound
}
return nil, errors.WrapInternalf(err, errors.CodeInternal, "error querying trace summary")
}
return &summary, nil
}
-func (s *traceStore) GetTraceSpans(ctx context.Context, traceID string, summary *tracedetailtypes.TraceSummary) ([]tracedetailtypes.StorableSpan, error) {
+func (s *traceStore) GetTraceSpans(ctx context.Context, traceID string, summary *spantypes.TraceSummary) ([]spantypes.StorableSpan, error) {
// DISTINCT ON (span_id) is ClickHouse-specific syntax not supported by sqlbuilder
query := fmt.Sprintf(`
SELECT DISTINCT ON (span_id)
@@ -55,9 +55,9 @@ func (s *traceStore) GetTraceSpans(ctx context.Context, traceID string, summary
FROM %s.%s
WHERE trace_id=? AND ts_bucket_start>=? AND ts_bucket_start<=?
ORDER BY timestamp ASC, name ASC`,
- tracedetailtypes.TraceDB, tracedetailtypes.TraceTable,
+ spantypes.TraceDB, spantypes.TraceTable,
)
- var spanItems []tracedetailtypes.StorableSpan
+ var spanItems []spantypes.StorableSpan
err := s.telemetryStore.ClickhouseDB().Select(
ctx, &spanItems, query,
traceID,
diff --git a/pkg/modules/tracedetail/impltracedetail/waterfall_test.go b/pkg/modules/tracedetail/impltracedetail/waterfall_test.go
index bee3193da6..8f1fa5de7a 100644
--- a/pkg/modules/tracedetail/impltracedetail/waterfall_test.go
+++ b/pkg/modules/tracedetail/impltracedetail/waterfall_test.go
@@ -37,7 +37,7 @@ import (
"fmt"
"testing"
- "github.com/SigNoz/signoz/pkg/types/tracedetailtypes"
+ "github.com/SigNoz/signoz/pkg/types/spantypes"
"github.com/stretchr/testify/assert"
)
@@ -45,8 +45,8 @@ import (
// Helpers
// ─────────────────────────────────────────────────────────────────────────────
-func mkSpan(id, service string, children ...*tracedetailtypes.WaterfallSpan) *tracedetailtypes.WaterfallSpan {
- return &tracedetailtypes.WaterfallSpan{
+func mkSpan(id, service string, children ...*spantypes.WaterfallSpan) *spantypes.WaterfallSpan {
+ return &spantypes.WaterfallSpan{
SpanID: id,
ServiceName: service,
Name: id + "-op",
@@ -54,7 +54,7 @@ func mkSpan(id, service string, children ...*tracedetailtypes.WaterfallSpan) *tr
}
}
-func spanIDs(spans []*tracedetailtypes.WaterfallSpan) []string {
+func spanIDs(spans []*spantypes.WaterfallSpan) []string {
ids := make([]string, len(spans))
for i, s := range spans {
ids[i] = s.SpanID
@@ -62,10 +62,10 @@ func spanIDs(spans []*tracedetailtypes.WaterfallSpan) []string {
return ids
}
-func buildSpanMap(roots ...*tracedetailtypes.WaterfallSpan) map[string]*tracedetailtypes.WaterfallSpan {
- m := map[string]*tracedetailtypes.WaterfallSpan{}
- var walk func(*tracedetailtypes.WaterfallSpan)
- walk = func(s *tracedetailtypes.WaterfallSpan) {
+func buildSpanMap(roots ...*spantypes.WaterfallSpan) map[string]*spantypes.WaterfallSpan {
+ m := map[string]*spantypes.WaterfallSpan{}
+ var walk func(*spantypes.WaterfallSpan)
+ walk = func(s *spantypes.WaterfallSpan) {
m[s.SpanID] = s
for _, c := range s.Children {
walk(c)
@@ -80,8 +80,8 @@ func buildSpanMap(roots ...*tracedetailtypes.WaterfallSpan) map[string]*tracedet
}
// makeChain builds a linear trace: span0 → span1 → … → span(n-1).
-func makeChain(n int) (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan, []string) {
- spans := make([]*tracedetailtypes.WaterfallSpan, n)
+func makeChain(n int) (*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan, []string) {
+ spans := make([]*spantypes.WaterfallSpan, n)
for i := n - 1; i >= 0; i-- {
if i == n-1 {
spans[i] = mkSpan(fmt.Sprintf("span%d", i), "svc")
@@ -96,8 +96,8 @@ func makeChain(n int) (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailt
return spans[0], buildSpanMap(spans[0]), uncollapsed
}
-func getWaterfallTrace(roots []*tracedetailtypes.WaterfallSpan, spanMap map[string]*tracedetailtypes.WaterfallSpan) *tracedetailtypes.WaterfallTrace {
- return tracedetailtypes.NewWaterfallTrace(0, 0, uint64(len(spanMap)), 0, spanMap, nil, roots, false)
+func getWaterfallTrace(roots []*spantypes.WaterfallSpan, spanMap map[string]*spantypes.WaterfallSpan) *spantypes.WaterfallTrace {
+ return spantypes.NewWaterfallTrace(0, 0, uint64(len(spanMap)), 0, spanMap, nil, roots, false)
}
// ─────────────────────────────────────────────────────────────────────────────
@@ -107,7 +107,7 @@ func getWaterfallTrace(roots []*tracedetailtypes.WaterfallSpan, spanMap map[stri
func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
tests := []struct {
name string
- buildRoots func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan)
+ buildRoots func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan)
uncollapsedSpans []string
selectedSpanID string
wantSpanIDs []string
@@ -115,12 +115,12 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
{
// Pre-order traversal is preserved: parent before children, siblings left-to-right.
name: "pre_order_traversal",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("child1", "svc", mkSpan("grandchild", "svc")),
mkSpan("child2", "svc"),
)
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{"root", "child1"},
selectedSpanID: "root",
@@ -133,12 +133,12 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
// ├─ childA (uncollapsed) → grandchildA ✓
// └─ childB (uncollapsed) → grandchildB ✓
name: "multiple_uncollapsed",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("childA", "svc", mkSpan("grandchildA", "svc")),
mkSpan("childB", "svc", mkSpan("grandchildB", "svc")),
)
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{"root", "childA", "childB"},
selectedSpanID: "root",
@@ -154,7 +154,7 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
// │ └─ grandchild2 ✓
// └─ childB ← selected (not expanded)
name: "manual_uncollapse",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("childA", "svc",
mkSpan("grandchild1", "svc", mkSpan("greatGrandchild", "svc")),
@@ -162,7 +162,7 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
),
mkSpan("childB", "svc"),
)
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{"childA"},
selectedSpanID: "childB",
@@ -171,12 +171,12 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
{
// A collapsed span hides all children.
name: "collapsed_span_hides_children",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("child1", "svc"),
mkSpan("child2", "svc"),
)
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{},
selectedSpanID: "root",
@@ -187,13 +187,13 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
//
// root → parent → selected
name: "path_to_selected_is_uncollapsed",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("parent", "svc",
mkSpan("selected", "svc"),
),
)
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{},
selectedSpanID: "selected",
@@ -206,14 +206,14 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
// ├─ unrelated → unrelated-child (✗)
// └─ parent → selected
name: "siblings_not_expanded",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("unrelated", "svc", mkSpan("unrelated-child", "svc")),
mkSpan("parent", "svc",
mkSpan("selected", "svc"),
),
)
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{},
selectedSpanID: "selected",
@@ -223,9 +223,9 @@ func TestGetSelectedSpans_SpanOrdering(t *testing.T) {
{
// An unknown selectedSpanID must not panic; returns a window from index 0.
name: "unknown_selected_span",
- buildRoots: func() ([]*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoots: func() ([]*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc", mkSpan("child", "svc"))
- return []*tracedetailtypes.WaterfallSpan{root}, buildSpanMap(root)
+ return []*spantypes.WaterfallSpan{root}, buildSpanMap(root)
},
uncollapsedSpans: []string{},
selectedSpanID: "nonexistent",
@@ -257,10 +257,10 @@ func TestGetSelectedSpans_MultipleRoots(t *testing.T) {
root2 := mkSpan("root2", "svc-b", mkSpan("child2", "svc-b"))
spanMap := buildSpanMap(root1, root2)
- trace := getWaterfallTrace([]*tracedetailtypes.WaterfallSpan{root1, root2}, spanMap)
+ trace := getWaterfallTrace([]*spantypes.WaterfallSpan{root1, root2}, spanMap)
spans, _ := trace.GetSelectedSpans([]string{"root1", "root2"}, "root1", 500, 5)
- traceRespnose := tracedetailtypes.NewGettableWaterfallTrace(trace, spans, nil, false, nil)
+ traceRespnose := spantypes.NewGettableWaterfallTrace(trace, spans, nil, false, nil)
assert.Equal(t, []string{"root1", "child1", "root2", "child2"}, spanIDs(spans), "root1 subtree must precede root2 subtree")
assert.Equal(t, "svc-a", traceRespnose.RootServiceName, "metadata comes from first root")
@@ -274,7 +274,7 @@ func TestGetSelectedSpans_MultipleRoots(t *testing.T) {
func TestGetSelectedSpans_UncollapsedTracking(t *testing.T) {
tests := []struct {
name string
- buildRoot func() (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan)
+ buildRoot func() (*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan)
uncollapsedSpans []string
selectedSpanID string
wantSpanIDs []string
@@ -283,7 +283,7 @@ func TestGetSelectedSpans_UncollapsedTracking(t *testing.T) {
{
// The path-to-selected spans are returned in updatedUncollapsedSpans.
name: "path_returned_in_uncollapsed",
- buildRoot: func() (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoot: func() (*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("parent", "svc",
mkSpan("selected", "svc"),
@@ -301,7 +301,7 @@ func TestGetSelectedSpans_UncollapsedTracking(t *testing.T) {
{
// Siblings of ancestors are not tracked as uncollapsed.
name: "siblings_not_in_uncollapsed",
- buildRoot: func() (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoot: func() (*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("unrelated", "svc", mkSpan("unrelated-child", "svc")),
mkSpan("parent", "svc",
@@ -330,7 +330,7 @@ func TestGetSelectedSpans_UncollapsedTracking(t *testing.T) {
// └─ grandchildB (internal ✓)
// └─ leafB (leaf ✗)
name: "auto_expanded_spans_returned",
- buildRoot: func() (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoot: func() (*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("childA", "svc",
mkSpan("grandchildA", "svc",
@@ -361,7 +361,7 @@ func TestGetSelectedSpans_UncollapsedTracking(t *testing.T) {
// If the selected span is already in uncollapsedSpans,
// it should appear exactly once in the result.
name: "duplicate_in_uncollapsed",
- buildRoot: func() (*tracedetailtypes.WaterfallSpan, map[string]*tracedetailtypes.WaterfallSpan) {
+ buildRoot: func() (*spantypes.WaterfallSpan, map[string]*spantypes.WaterfallSpan) {
root := mkSpan("root", "svc",
mkSpan("selected", "svc", mkSpan("child", "svc")),
)
@@ -384,7 +384,7 @@ func TestGetSelectedSpans_UncollapsedTracking(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
root, spanMap := tc.buildRoot()
- trace := getWaterfallTrace([]*tracedetailtypes.WaterfallSpan{root}, spanMap)
+ trace := getWaterfallTrace([]*spantypes.WaterfallSpan{root}, spanMap)
spans, uncollapsed := trace.GetSelectedSpans(tc.uncollapsedSpans, tc.selectedSpanID, 500, 5)
if tc.wantSpanIDs != nil {
assert.Equal(t, tc.wantSpanIDs, spanIDs(spans))
@@ -412,10 +412,10 @@ func TestGetSelectedSpans_SpanMetadata(t *testing.T) {
mkSpan("child2", "svc"),
)
spanMap := buildSpanMap(root)
- trace := getWaterfallTrace([]*tracedetailtypes.WaterfallSpan{root}, spanMap)
+ trace := getWaterfallTrace([]*spantypes.WaterfallSpan{root}, spanMap)
spans, _ := trace.GetSelectedSpans([]string{"root", "child1"}, "root", 500, 5)
- byID := map[string]*tracedetailtypes.WaterfallSpan{}
+ byID := map[string]*spantypes.WaterfallSpan{}
for _, s := range spans {
byID[s.SpanID] = s
}
@@ -478,7 +478,7 @@ func TestGetSelectedSpans_Window(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
root, spanMap, uncollapsed := makeChain(600)
- trace := getWaterfallTrace([]*tracedetailtypes.WaterfallSpan{root}, spanMap)
+ trace := getWaterfallTrace([]*spantypes.WaterfallSpan{root}, spanMap)
spans, _ := trace.GetSelectedSpans(uncollapsed, tc.selectedSpanID, 500, 5)
assert.Equal(t, tc.wantLen, len(spans), "window size")
@@ -536,7 +536,7 @@ func TestGetSelectedSpans_DepthCountedFromSelectedSpan(t *testing.T) {
root := mkSpan("root", "svc", mkSpan("A", "svc", selected))
spanMap := buildSpanMap(root)
- trace := getWaterfallTrace([]*tracedetailtypes.WaterfallSpan{root}, spanMap)
+ trace := getWaterfallTrace([]*spantypes.WaterfallSpan{root}, spanMap)
spans, _ := trace.GetSelectedSpans([]string{"selected"}, "selected", 500, 5)
ids := spanIDs(spans)
@@ -565,9 +565,9 @@ func TestGetAllSpans(t *testing.T) {
),
),
)
- trace := getWaterfallTrace([]*tracedetailtypes.WaterfallSpan{root}, nil)
+ trace := getWaterfallTrace([]*spantypes.WaterfallSpan{root}, nil)
spans := trace.GetAllSpans()
- traceResponse := tracedetailtypes.NewGettableWaterfallTrace(trace, spans, nil, true, nil)
+ traceResponse := spantypes.NewGettableWaterfallTrace(trace, spans, nil, true, nil)
assert.ElementsMatch(t, spanIDs(spans), []string{"root", "childA", "grandchildA", "leafA", "childB", "grandchildB", "leafB"})
assert.Equal(t, "svc", traceResponse.RootServiceName)
assert.Equal(t, "root-op", traceResponse.RootServiceEntryPoint)
diff --git a/pkg/modules/tracedetail/tracedetail.go b/pkg/modules/tracedetail/tracedetail.go
index 48768f2860..c2915d6cae 100644
--- a/pkg/modules/tracedetail/tracedetail.go
+++ b/pkg/modules/tracedetail/tracedetail.go
@@ -4,7 +4,7 @@ import (
"context"
"net/http"
- "github.com/SigNoz/signoz/pkg/types/tracedetailtypes"
+ "github.com/SigNoz/signoz/pkg/types/spantypes"
)
// Handler exposes HTTP handlers for trace detail APIs.
@@ -14,5 +14,5 @@ type Handler interface {
// Module defines the business logic for trace detail operations.
type Module interface {
- GetWaterfall(ctx context.Context, traceID string, req *tracedetailtypes.PostableWaterfall) (*tracedetailtypes.GettableWaterfallTrace, error)
+ GetWaterfall(ctx context.Context, traceID string, req *spantypes.PostableWaterfall) (*spantypes.GettableWaterfallTrace, error)
}
diff --git a/pkg/types/tracedetailtypes/aggregation.go b/pkg/types/spantypes/aggregation.go
similarity index 98%
rename from pkg/types/tracedetailtypes/aggregation.go
rename to pkg/types/spantypes/aggregation.go
index c06bb16982..5f980796eb 100644
--- a/pkg/types/tracedetailtypes/aggregation.go
+++ b/pkg/types/spantypes/aggregation.go
@@ -1,4 +1,4 @@
-package tracedetailtypes
+package spantypes
import (
"slices"
diff --git a/pkg/types/tracedetailtypes/aggregation_test.go b/pkg/types/spantypes/aggregation_test.go
similarity index 99%
rename from pkg/types/tracedetailtypes/aggregation_test.go
rename to pkg/types/spantypes/aggregation_test.go
index 4863cb328d..5f356192cb 100644
--- a/pkg/types/tracedetailtypes/aggregation_test.go
+++ b/pkg/types/spantypes/aggregation_test.go
@@ -1,4 +1,4 @@
-package tracedetailtypes
+package spantypes
import (
"testing"
diff --git a/pkg/types/spantypes/store.go b/pkg/types/spantypes/store.go
index 60c17f3c4c..520fd844ad 100644
--- a/pkg/types/spantypes/store.go
+++ b/pkg/types/spantypes/store.go
@@ -21,3 +21,9 @@ type SpanMapperStore interface {
UpdateMapper(ctx context.Context, mapper *SpanMapper) error
DeleteMapper(ctx context.Context, orgID, groupID, id valuer.UUID) error
}
+
+// TraceStore defines the data access interface for trace detail queries.
+type TraceStore interface {
+ GetTraceSummary(ctx context.Context, traceID string) (*TraceSummary, error)
+ GetTraceSpans(ctx context.Context, traceID string, summary *TraceSummary) ([]StorableSpan, error)
+}
diff --git a/pkg/types/tracedetailtypes/waterfall_span.go b/pkg/types/spantypes/waterfall_span.go
similarity index 99%
rename from pkg/types/tracedetailtypes/waterfall_span.go
rename to pkg/types/spantypes/waterfall_span.go
index 31c495d77f..37b0701f86 100644
--- a/pkg/types/tracedetailtypes/waterfall_span.go
+++ b/pkg/types/spantypes/waterfall_span.go
@@ -1,4 +1,4 @@
-package tracedetailtypes
+package spantypes
import (
"encoding/json"
diff --git a/pkg/types/tracedetailtypes/waterfall_trace.go b/pkg/types/spantypes/waterfall_trace.go
similarity index 99%
rename from pkg/types/tracedetailtypes/waterfall_trace.go
rename to pkg/types/spantypes/waterfall_trace.go
index b5ca39b3c2..088792c4e5 100644
--- a/pkg/types/tracedetailtypes/waterfall_trace.go
+++ b/pkg/types/spantypes/waterfall_trace.go
@@ -1,4 +1,4 @@
-package tracedetailtypes
+package spantypes
import (
"encoding/json"
diff --git a/pkg/types/tracedetailtypes/store.go b/pkg/types/tracedetailtypes/store.go
deleted file mode 100644
index 967bd11a69..0000000000
--- a/pkg/types/tracedetailtypes/store.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package tracedetailtypes
-
-import "context"
-
-// TraceStore defines the data access interface for trace detail queries.
-type TraceStore interface {
- GetTraceSummary(ctx context.Context, traceID string) (*TraceSummary, error)
- GetTraceSpans(ctx context.Context, traceID string, summary *TraceSummary) ([]StorableSpan, error)
-}