Add OpenTelemetry tracing instrumentation to API layer#13132
Open
sureshanaparti wants to merge 2 commits intoapache:4.22from
Open
Add OpenTelemetry tracing instrumentation to API layer#13132sureshanaparti wants to merge 2 commits intoapache:4.22from
sureshanaparti wants to merge 2 commits intoapache:4.22from
Conversation
Add OTel annotations and API dependencies to enable distributed tracing of CloudStack API requests. The @WithSpan annotation on handleRequest() tags each trace with the API command name (e.g. listVirtualMachines), making it possible to filter and analyze per-command latency. The OTel agent auto-instruments JDBC and HTTP calls, providing full request waterfalls with no additional code changes. All instrumentation is inert without the OTel Java agent attached: @WithSpan is ignored, Span.current() returns a no-op, and the opentelemetry-api calls return immediately with zero overhead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…gement Centralizes OTel version definitions to avoid version skew across modules and removes unused OTel dependency from api module. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13132 +/- ##
============================================
- Coverage 17.68% 17.67% -0.01%
+ Complexity 15794 15790 -4
============================================
Files 5922 5922
Lines 533095 533098 +3
Branches 65208 65209 +1
============================================
- Hits 94281 94237 -44
- Misses 428171 428223 +52
+ Partials 10643 10638 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17781 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR add OpenTelemetry tracing instrumentation to API layer.
When the OTel Java agent is attached (via
-javaagent), every API request is traced with:listVirtualMachines,deployVirtualMachine) viaSpan.current().updateName()and a filterableapi.commandattribute, making it possible to analyze latency per API command.All changes are no-ops without the OTel agent deployed. The
@WithSpanannotation is ignored,Span.current()returns a no-op, and theopentelemetry-apicalls return immediately with zero overhead. The two added dependencies (opentelemetry-instrumentation-annotationsandopentelemetry-api) are lightweight JARs (~50KB + ~200KB) with no transitive dependencies.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tracing output is visible in Grafana/Tempo when the OTel agent is attached.
How did you try to break this feature and the system with this change?