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

elastic / cloudbeat / 17379720445
76%

Build:
DEFAULT BRANCH: main
Ran 01 Sep 2025 02:09PM 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

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

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.

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

9456 of 12432 relevant lines covered (76.06%)

16.66 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
Jobs
ID Job ID Ran Files Coverage
1 17379720445.1 01 Sep 2025 02:09PM UTC 227
76.06
GitHub Action Run
Source Files on build 17379720445
  • Tree
  • List 227
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e9f1a82a on github
  • Prev Build on main (#17370871921)
  • Next Build on main (#17380320822)
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