• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elastic / cloudbeat / 17379720445 / 1
76%
main: 76%

Build:
DEFAULT BRANCH: main
Ran 01 Sep 2025 02:09PM UTC
Files 227
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Sep 2025 01:54PM UTC coverage: 76.062% (+0.05%) from 76.008%
17379720445.1

push

github

web-flow
feat(OTel): Use global providers (#3516)

This commit refactors the OpenTelemetry (OTel) instrumentation to use global tracer and meter providers instead of passing them through the context. This simplifies the observability setup and removes the need for custom wrappers around OTel functions.

This approach is idiomatic in OpenTelemetry-Go. OTel uses a delegation pattern where a default, no-op provider is initially present. When the application later configures and sets the actual provider, the default provider delegates all calls to the new, configured one. This design makes the initialization order flexible and robust, ensuring all components use the same fully-configured provider, regardless of when they were initialized.
See: https://seth-shi.medium.com/why-can-otel-gettracerprovider-5bfbc73db828

Key changes:
- The `internal/infra/observability/context.go` file has been removed, as providers are no longer stored in the context.
- `internal/infra/observability/otel.go` now initializes and manages global `TracerProvider` and `MeterProvider` instances using a `sync.Once` to ensure they are set up only once.
- The `observability.StartSpan` and `observability.MeterFromContext` helper functions have been removed. Callers now use the standard `otel.Tracer(name).Start()` and `otel.Meter(name)` to create spans and get meters directly.
- All call sites have been updated to use the new approach, obtaining tracers and meters from the global OTel instance.
- The `SetUpOtel` function no longer returns a context, as it now configures the global providers.

9456 of 12432 relevant lines covered (76.06%)

16.66 hits per line

Source Files on job 17379720445.1
  • Tree
  • List 227
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 17379720445
  • e9f1a82a on github
  • Prev Job for on main (#17370871921.1)
  • Next Job for on main (#17380320822.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc