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

elastic / cloudbeat / 16884958160
76%
main: 76%

Build:
Build:
LAST BUILD BRANCH: nested-entity-inside-user-host
DEFAULT BRANCH: main
Ran 11 Aug 2025 03:57PM UTC
Jobs 1
Files 227
Run time 1min
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

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

37 of 44 new or added lines in 5 files covered. (84.09%)

3 existing lines in 1 file now uncovered.

9458 of 12419 relevant lines covered (76.16%)

16.6 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
0.0
0.0% internal/flavors/posture.go
6
75.78
1.4% internal/infra/observability/otel.go

Uncovered Existing Lines

Lines Coverage ∆ File
3
83.06
-0.98% internal/resources/providers/gcplib/inventory/provider.go
Jobs
ID Job ID Ran Files Coverage
1 16884958160.1 11 Aug 2025 03:57PM UTC 227
76.16
GitHub Action Run
Source Files on build 16884958160
  • Tree
  • List 227
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #3516
  • PR Base - main (#16880378546)
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

© 2025 Coveralls, Inc