Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest release of active_record instrumentation fails to install on a rails 7 app #38

Closed
supaspoida opened this issue Apr 14, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@supaspoida
Copy link

Description of the bug

After installing the latest release of opentelemetry-ruby (v0.2.2) via opentelemetry-instrumentation-all and configuring it using use_all, I see the following message in the logs when starting up my app:

WARN -- : Instrumentation: OpenTelemetry::Instrumentation::ActiveRecord failed to install

After doing some digging I found this PR which appears to fix the issue: open-telemetry/opentelemetry-ruby#1043

However, when I inspect the source that was installed the changes from that PR are not present. It looks like maybe a release with those changes failed, or I'm just misunderstanding the release cadence for this lib.

I am able to work around this with the following monkey-patch placed before my instrumentation setup:

module OpenTelemetry
  module Instrumentation
    module ActiveRecord
      class Instrumentation < OpenTelemetry::Instrumentation::Base
        compatible do
          true
        end
      end
    end
  end
end

That silences the warning, but I'm a bit concerned about running on this version w/out the additional changes included in that PR.

Share details about your runtime

Operating system details: Linux, Ubuntu 20.04 LTS
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.1.0"
RUBY_DESCRIPTION: "ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]"

Share a simplified reproduction if possible

# In Gemfile
  
gem 'opentelemetry-sdk'
gem 'opentelemetry-exporter-oltp'
gem 'opentelemetry-instrumentation-all'


# config/initializers/opentelemetry.rb
OpenTelemetry::SDK.configure do |c|
  c.use_all()
end
@arielvalentin
Copy link
Collaborator

I could be wrong but looks like the fix has not yet been released.

Also may I confirm that you are using v1.0.2 of the SDK?

@supaspoida
Copy link
Author

Yea, it looks to me like the release that was meant to include it was here: open-telemetry/opentelemetry-ruby#1082 (comment)

Confirmed using v1.0.2 of SDK as well.

@arielvalentin
Copy link
Collaborator

@supaspoida unfortunately that comment indicates that the ActiveRecord instrumentation had change but would not be included in the release since it was a targeted release of the Trilogy instrumentation.

I will put in a request to release AR Instrumentation now.

@supaspoida
Copy link
Author

@arielvalentin just did a scan of recent releases and it seems active_record hasn't had one cut with this fix yet. Anything we can do to help that along?

Thank you!

@arielvalentin
Copy link
Collaborator

@plantfansam plantfansam transferred this issue from open-telemetry/opentelemetry-ruby Jun 14, 2022
@arielvalentin
Copy link
Collaborator

@supaspoida following up. I am going to assume that this is working for newer versions of the gem. Please reopen if you still need help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants