Skip to content

Conversation

@BrianHawley
Copy link
Contributor

This makes it so the logs and metrics will work when you require like

require 'opentelemetry/sdk/logs'
require 'opentelemetry/sdk/metrics'

Without requiring 'opentelemetry-logs-api' or 'opentelemetry-logs-metrics' earlier.

The opentelemetry-exporter-otlp-logs gem works around this, but I'm leaving that workaround there for now, so it will work with old versions of the opentelemetry-logs-sdk gem that are still locked.

[Fixes #1955]

@BrianHawley BrianHawley changed the title Move the logs-sdk and metrics-sdk requires fix: Move the logs-sdk and metrics-sdk requires Nov 8, 2025
@BrianHawley
Copy link
Contributor Author

Looks like truffleruby is failing for unrelated reasons. I may look into that later.

@BrianHawley
Copy link
Contributor Author

BrianHawley commented Nov 15, 2025

The test failures are unrelated, an incompatibility between Truffleruby and the latest json gem. So, until that gets fixed, the test suite isn't going to pass. What do we do next?

The test failures were fixed by #1959 so the tests pass now.

@BrianHawley BrianHawley force-pushed the fixes_1955 branch 2 times, most recently from 2de51fa to 49d6a29 Compare November 24, 2025 20:01
This makes it so the logs and metrics will work when you require like
```ruby
require 'opentelemetry/sdk/logs'
require 'opentelemetry/sdk/metrics'
```
Without getting 'opentelemetry-logs-api' or 'opentelemetry-logs-metrics'
earlier.

The opentelemetry-exporter-otlp-logs gem works around this, but I'm
leaving that workaround there for now, so it will work with old versions
of the opentelemetry-logs-sdk gem that are still locked.

[Fixes open-telemetry#1955]
@kaylareopelle
Copy link
Contributor

kaylareopelle commented Dec 12, 2025

Hi @BrianHawley, thanks for your patience on this PR. I'm able to reproduce the bug you describe in #1955, but when I run the reproduction you have with this branch, the error still appears.

These are the contents of the Ruby file I'm using:

require 'bundler/inline'

gemfile(true) do
  source 'https://rubygems.org'

  gem 'opentelemetry-exporter-otlp-metrics', github: 'BrianHawley/opentelemetry-ruby', branch: 'fixes_1955', glob: 'exporter/otlp-metrics/*.gemspec'
end

require 'opentelemetry-exporter-otlp-metrics'

OpenTelemetry::SDK.configure do |c|
  c.use_all
end

This is the output:

Fetching https://github.com/BrianHawley/opentelemetry-ruby.git
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.../opentelemetry-api-1.7.0/lib/opentelemetry.rb:7: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
W, [2025-12-11T16:05:24.499438 #52700]  WARN -- : The otlp exporter cannot be configured - please add opentelemetry-exporter-otlp to your Gemfile, spans will not be exported
E, [2025-12-11T16:05:24.499588 #52700] ERROR -- : OpenTelemetry error: unexpected configuration error due to undefined method 'meter_provider=' for module OpenTelemetry - OpenTelemetry::SDK::ConfigurationError - .../opentelemetry-sdk-1.10.0/lib/opentelemetry/sdk.rb:74:in 'OpenTelemetry::SDK#configure'

Can you take a look? Am I misunderstanding what this PR addresses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requires in the wrong place in opentelemetry-logs-sdk and opentelemetry-metrics-sdk

2 participants