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

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

Build:
Build:
LAST BUILD BRANCH: gcp-sa-chain
DEFAULT BRANCH: main
Ran 11 Aug 2025 03:57PM UTC
Files 227
Run time 10s
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

11 Aug 2025 03:42PM UTC coverage: 76.158% (+0.007%) from 76.151%
16884958160.1

Pull #3516

github

orestisfl
feat(OTel): Use global providers

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.
Pull Request #3516: feat(OTel): Use global providers

9458 of 12419 relevant lines covered (76.16%)

16.6 hits per line

Source Files on job 16884958160.1
  • Tree
  • List 227
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 16884958160
  • 70903af0 on github
  • Prev Job for on otel-no-ctx (#16880378546.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