/** * Span Categorization Service * * Categorizes spans based on OTel GenAI semantic conventions. * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/ */ import { Span, SpanCategory, CategorizedSpan, OTelComplianceResult } from '../../types/index.js'; /** * Category metadata (color, icon, label) */ interface CategoryMeta { color: string; bgColor: string; icon: string; label: string; } /** * Get category metadata for a given category */ export declare function getCategoryMeta(category: SpanCategory): CategoryMeta; /** * Determine span category based on OTel gen_ai.operation.name attribute, * with fallback to name-based pattern matching for legacy agents (e.g., Langgraph). */ export declare function getSpanCategory(span: Span): SpanCategory; /** * Build display name for a span using OTel attributes */ export declare function buildDisplayName(span: Span, category: SpanCategory): string; /** * Categorize a single span with full metadata */ export declare function categorizeSpan(span: Span): CategorizedSpan; /** * Categorize an array of spans */ export declare function categorizeSpans(spans: Span[]): CategorizedSpan[]; /** * Categorize a span tree (preserving hierarchy) */ export declare function categorizeSpanTree(spans: Span[]): CategorizedSpan[]; /** * Filter spans by categories */ export declare function filterSpansByCategory(spans: CategorizedSpan[], categories: SpanCategory[]): CategorizedSpan[]; /** * Filter span tree by categories (preserves hierarchy, hides non-matching) */ export declare function filterSpanTreeByCategory(spans: CategorizedSpan[], categories: SpanCategory[]): CategorizedSpan[]; /** * Count spans by category */ export declare function countByCategory(spans: CategorizedSpan[]): Record; /** * Check if a span follows OTEL GenAI semantic conventions */ export declare function checkOTelCompliance(span: CategorizedSpan): OTelComplianceResult; /** * Check if any span in array has OTEL compliance warnings */ export declare function hasAnyWarnings(spans: CategorizedSpan[]): boolean; export {}; //# sourceMappingURL=spanCategorization.d.ts.map