Skip to content

Conversation

@reakaleek
Copy link
Member

No description provided.

@reakaleek reakaleek force-pushed the feature/cleanup-otel branch from dd76e31 to ea4a4c5 Compare November 3, 2025 22:29
@reakaleek reakaleek requested a review from Copilot November 3, 2025 22:29
@reakaleek reakaleek self-assigned this Nov 3, 2025
@reakaleek reakaleek marked this pull request as ready for review November 3, 2025 22:29
@reakaleek reakaleek added the chore label Nov 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the OpenTelemetry instrumentation for the AskAI streaming API to align with GenAI semantic conventions, consolidates telemetry configuration, and renames event types for clarity. The changes simplify telemetry collection while improving observability standards compliance.

  • Renamed Chunk and ChunkComplete events to MessageChunk and MessageComplete for consistency with semantic conventions
  • Refactored OpenTelemetry configuration into a centralized OpenTelemetryExtensions class with proper AOT compatibility
  • Simplified streaming telemetry by removing granular per-token activities and focusing on conversation-level metrics

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/tooling/docs-builder/docs-builder.csproj Added OpenTelemetry package references for the docs-builder CLI tool
src/tooling/docs-builder/Http/DocumentationWebHost.cs Minor formatting change adding empty line
src/api/Elastic.Documentation.Api.Lambda/Program.cs Replaced inline EDOT configuration with centralized extension method call
src/api/Elastic.Documentation.Api.Infrastructure/OpenTelemetryExtensions.cs New extension method consolidating OpenTelemetry configuration with AOT support
src/api/Elastic.Documentation.Api.Infrastructure/Elastic.Documentation.Api.Infrastructure.csproj Added OpenTelemetry package dependencies
src/api/Elastic.Documentation.Api.Infrastructure/Adapters/AskAi/StreamTransformerBase.cs Refactored telemetry to align with GenAI semantic conventions and simplified activity tracking
src/api/Elastic.Documentation.Api.Infrastructure/Adapters/AskAi/LlmGatewayStreamTransformer.cs Updated event names and added error event parsing for LLM Gateway
src/api/Elastic.Documentation.Api.Infrastructure/Adapters/AskAi/AgentBuilderStreamTransformer.cs Updated event names, made helper methods static, and removed duplicate error logging
src/api/Elastic.Documentation.Api.Core/SerializationContext.cs Added telemetry types for OpenTelemetry message serialization
src/api/Elastic.Documentation.Api.Core/AskAi/AskAiUsecase.cs Simplified telemetry setup using GenAI semantic conventions
src/api/Elastic.Documentation.Api.Core/AskAi/AskAiEvent.cs Renamed Chunk to MessageChunk and ChunkComplete to MessageComplete
src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/StreamingAiMessage.tsx Updated TypeScript to reference renamed event types
src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/ChatMessage.tsx Updated TypeScript to reference renamed event types
src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/AskAi/AskAiEvent.ts Updated TypeScript event type constants and schemas
Directory.Packages.props Updated OpenTelemetry package versions to 1.13.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants