Skip to content

feat: add opentelemetry middleware to web server#79

Open
DCchoudhury15 wants to merge 6 commits intoopenkruise:masterfrom
DCchoudhury15:feature/otel-integration
Open

feat: add opentelemetry middleware to web server#79
DCchoudhury15 wants to merge 6 commits intoopenkruise:masterfrom
DCchoudhury15:feature/otel-integration

Conversation

@DCchoudhury15
Copy link
Contributor

What this PR does / why we need it:
This PR integrates OpenTelemetry (OTEL) middleware into the Gin web server to enable tracing and observability, as requested in #23.

Which issue(s) this PR fixes:
Fixes #23

Special notes for your reviewer:

  • New Middleware: Added otelgin middleware to the Gin router in pkg/servers/web/server.go.
  • Refactoring: Refactored NewServer to accept a Service interface instead of the concrete e2b implementation. This was necessary to resolve a circular dependency between the web and e2b packages.
  • Dependencies: Updated go.mod to include go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin.

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.07%. Comparing base (deda1a7) to head (a3d3c60).
⚠️ Report is 63 commits behind head on master.

Files with missing lines Patch % Lines
pkg/servers/web/server.go 76.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
+ Coverage   50.95%   51.07%   +0.12%     
==========================================
  Files          87       88       +1     
  Lines        4814     4826      +12     
==========================================
+ Hits         2453     2465      +12     
- Misses       2149     2151       +2     
+ Partials      212      210       -2     
Flag Coverage Δ
unittests 51.07% <78.94%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DCchoudhury15
Copy link
Contributor Author

cc @furykerry pr up for review

@DCchoudhury15
Copy link
Contributor Author

@AiRanthem up for review

@furykerry
Copy link
Member

@DCchoudhury15 the patch seems incomplete, no one will call NewServer

@DCchoudhury15
Copy link
Contributor Author

@furykerry implemented the fix up for review

@kruise-bot
Copy link

@DCchoudhury15: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] enable tracing of major sandbox api

3 participants