-
Notifications
You must be signed in to change notification settings - Fork 32
Clean up OTel instrumentation for AskAi #2144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dd76e31 to
ea4a4c5
Compare
There was a problem hiding this 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
ChunkandChunkCompleteevents toMessageChunkandMessageCompletefor consistency with semantic conventions - Refactored OpenTelemetry configuration into a centralized
OpenTelemetryExtensionsclass 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 |
No description provided.