@erickluis00/otelviewer
Version:
Shared OpenTelemetry tracing utilities, types, and batch processor for Realtime OpenTelemetry Viewer [WIP]
348 lines • 10.6 kB
TypeScript
import { z } from 'zod';
export declare const spanStatusSchema: z.ZodObject<{
code: z.ZodEnum<["OK", "ERROR", "UNSET"]>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}>;
export declare const spanAttributesSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
export declare const spanSchema: z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<["SPAN", "LOG"]>;
traceId: z.ZodString;
parentId: z.ZodNullable<z.ZodString>;
name: z.ZodString;
startTime: z.ZodNumber;
endTime: z.ZodNumber;
status: z.ZodObject<{
code: z.ZodEnum<["OK", "ERROR", "UNSET"]>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}>;
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
projectId: z.ZodOptional<z.ZodString>;
isPartial: z.ZodDefault<z.ZodBoolean>;
isRealTime: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes: Record<string, any>;
isPartial: boolean;
isRealTime: boolean;
projectId?: string | undefined;
}, {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes?: Record<string, any> | undefined;
projectId?: string | undefined;
isPartial?: boolean | undefined;
isRealTime?: boolean | undefined;
}>;
export declare const spansArraySchema: z.ZodObject<{
spans: z.ZodArray<z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<["SPAN", "LOG"]>;
traceId: z.ZodString;
parentId: z.ZodNullable<z.ZodString>;
name: z.ZodString;
startTime: z.ZodNumber;
endTime: z.ZodNumber;
status: z.ZodObject<{
code: z.ZodEnum<["OK", "ERROR", "UNSET"]>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}>;
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
projectId: z.ZodOptional<z.ZodString>;
isPartial: z.ZodDefault<z.ZodBoolean>;
isRealTime: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes: Record<string, any>;
isPartial: boolean;
isRealTime: boolean;
projectId?: string | undefined;
}, {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes?: Record<string, any> | undefined;
projectId?: string | undefined;
isPartial?: boolean | undefined;
isRealTime?: boolean | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
spans: {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes: Record<string, any>;
isPartial: boolean;
isRealTime: boolean;
projectId?: string | undefined;
}[];
}, {
spans: {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes?: Record<string, any> | undefined;
projectId?: string | undefined;
isPartial?: boolean | undefined;
isRealTime?: boolean | undefined;
}[];
}>;
export declare const traceSchema: z.ZodObject<{
traceId: z.ZodString;
spans: z.ZodArray<z.ZodObject<{
id: z.ZodString;
kind: z.ZodEnum<["SPAN", "LOG"]>;
traceId: z.ZodString;
parentId: z.ZodNullable<z.ZodString>;
name: z.ZodString;
startTime: z.ZodNumber;
endTime: z.ZodNumber;
status: z.ZodObject<{
code: z.ZodEnum<["OK", "ERROR", "UNSET"]>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}, {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
}>;
attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
projectId: z.ZodOptional<z.ZodString>;
isPartial: z.ZodDefault<z.ZodBoolean>;
isRealTime: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes: Record<string, any>;
isPartial: boolean;
isRealTime: boolean;
projectId?: string | undefined;
}, {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes?: Record<string, any> | undefined;
projectId?: string | undefined;
isPartial?: boolean | undefined;
isRealTime?: boolean | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
traceId: string;
spans: {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes: Record<string, any>;
isPartial: boolean;
isRealTime: boolean;
projectId?: string | undefined;
}[];
}, {
traceId: string;
spans: {
status: {
code: "OK" | "ERROR" | "UNSET";
message?: string | undefined;
};
id: string;
kind: "SPAN" | "LOG";
traceId: string;
parentId: string | null;
name: string;
startTime: number;
endTime: number;
attributes?: Record<string, any> | undefined;
projectId?: string | undefined;
isPartial?: boolean | undefined;
isRealTime?: boolean | undefined;
}[];
}>;
export declare const searchFiltersSchema: z.ZodObject<{
search: z.ZodOptional<z.ZodString>;
startDate: z.ZodOptional<z.ZodNumber>;
endDate: z.ZodOptional<z.ZodNumber>;
status: z.ZodOptional<z.ZodEnum<["success", "error", "warning", "exception", "running"]>>;
page: z.ZodDefault<z.ZodNumber>;
limit: z.ZodDefault<z.ZodNumber>;
projectId: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
page: number;
limit: number;
status?: "success" | "error" | "warning" | "exception" | "running" | undefined;
projectId?: string | undefined;
search?: string | undefined;
startDate?: number | undefined;
endDate?: number | undefined;
}, {
status?: "success" | "error" | "warning" | "exception" | "running" | undefined;
projectId?: string | undefined;
search?: string | undefined;
startDate?: number | undefined;
endDate?: number | undefined;
page?: number | undefined;
limit?: number | undefined;
}>;
export declare const paginatedResultSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
data: z.ZodArray<T, "many">;
pagination: z.ZodObject<{
page: z.ZodNumber;
limit: z.ZodNumber;
total: z.ZodNumber;
totalPages: z.ZodNumber;
hasNext: z.ZodBoolean;
hasPrev: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
}, {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
}>;
}, "strip", z.ZodTypeAny, {
data: T["_output"][];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
};
}, {
data: T["_input"][];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
};
}>;
export type SpanStatus = z.infer<typeof spanStatusSchema>;
export type OtelSpan = z.infer<typeof spanSchema>;
export type SpansArray = z.infer<typeof spansArraySchema>;
export type Trace = z.infer<typeof traceSchema>;
export type SearchFilters = z.infer<typeof searchFiltersSchema>;
export type PaginatedResult<T> = {
data: T[];
pagination: {
page: number;
limit: number;
total: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
};
};
export interface SpanAttributeValue {
dataType?: string;
data?: any;
[key: string]: any;
}
//# sourceMappingURL=schemas.d.ts.map