open-telemetry / open-telemetry/opentelemetry-ruby

Remove the legacy global provider compatibility shims

Open
#2,414 0 comments 0 reactions 1 assignee View on GitHub

@mwear is already working on this.

Since Sep 18, 2026.

Dominant language
Ruby
Stars
606
Forks
301
Avg merge
3d 19h
Merged PRs (30d)
42

Description

opentelemetry-metrics-api and opentelemetry-logs-api each carry a compatibility shim that exists only for SDK versions released before the global provider accessors moved out of the API gems. This issue tracks removing them. Background is in #2413.

The shims live in logs_api/lib/opentelemetry/logs/legacy_global_compat.rb and metrics_api/lib/opentelemetry/metrics/legacy_global_compat.rb. Each intercepts method_missing for two accessors and, if the matching SDK is loaded, requires the gem's global.rb and installs them. With no SDK loaded, an API-only user gets a NoMethodError.

They exist for opentelemetry-logs-sdk 0.6.1 and earlier, and opentelemetry-metrics-sdk 0.18.0 and earlier. Those versions assign and read the accessors during Configurator#configure and have no way to require global.rb themselves.

When to remove

Either of these is sufficient:

  • When the API gem reaches 1.0. The old SDKs pin their APIs at ~> 0.1 and ~> 0.2, which both mean < 1.0, so at that point bundler can no longer resolve the pairing and the shim is unreachable.
  • Potentially earlier, if we make a breaking API release and opentelemetry-logs-sdk 0.7.0 and opentelemetry-metrics-sdk 0.19.0 have been out for a couple of release cycles.
Knowing whether it is still needed

The shim warns once per process when it fires, naming the gem and the version to upgrade to. It fires only once because the require installs the real accessors. So anyone in the affected configuration is told what to do about it.

Removing them is a matter of deleting the file, its require, and its test in each gem. Nothing changes for anyone on a current SDK.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.