Rails <> OpenTelemetry Logs #1789
Replies: 4 comments
-
Hi @adenta! Thanks for sharing your example! I think this could be a good candidate for a Rails logger bridge distributed within the open-telemetry/opentelemetry-ruby-contrib repo. One option to distribute it would be to create a new gem, maybe Since this is so lightweight, it might be that adding something to the existing opentelemetry-instrumentation-rails gem may be more appropriate than creating an entirely new gem. It has a Railtie that defines an initializer and configures the SDK. Maybe the logger bridge would fit here too? We haven't released any logs bridges yet, so we're open to brainstorming together on the best way to distribute this code. |
Beta Was this translation helpful? Give feedback.
-
To keep consistent with Rails default |
Beta Was this translation helpful? Give feedback.
-
I like it! The only thing it needs is using |
Beta Was this translation helpful? Give feedback.
-
Hi @adenta thanks for sharing this code snippet. I am trying to integrate my Rails app with Otel_collector and the only missing piece is Logs. I don't find any documentation of how to do the integration (no README in the library). Checking your code, it is not clear to me how to use the defined I am using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@kaylareopelle check out the rails logs integration I put together:
This is nice because it only needs a single line of config in
production.rb
to get logs flowing to OTEL:config.logger = Loggers::OtelLogger.new(STDOUT)
Beta Was this translation helpful? Give feedback.
All reactions