Open kaylareopelle opened 1 year ago
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep
label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.
Hey @kaylareopelle, do you know where this project is at? Just curious when we might get to use a more generalized logging exporter. Thanks.
Hi @travisbell thanks for checking in! Apologies about the delay here.
There is an unreviewed OTLP logs exporter, along with other code to make Ruby spec-compliant for the Logs signal, available in this PR on my fork: https://github.com/kaylareopelle/opentelemetry-ruby/pull/6
The current process is to release small parts of this code to the main opentelemetry-ruby repository for review, and then revise the WIP branch as needed. I don't have a good sense of when all those code will be merged into main
.
If you'd like to test out the WIP logs implementation, you can follow the instructions in this gist: https://gist.github.com/kaylareopelle/76079747c1a7528449670b8bd1c78893
I also have a demo repository that integrates OpenTelemetry logs into a small Rails application: https://github.com/kaylareopelle/otel_ruby_logs_demo
I'm updating the branches about once a week to stay in sync with the latest changes upstream.
If you decide to give this experimental code a try, please let me know how it goes. You can comment here, open an issue on the demo repo, or add a comment to the gist.
WIP, unreviewed code for this issue, along with other parts of the logs SDK, can be found in https://github.com/kaylareopelle/opentelemetry-ruby/pull/6
@kaylareopelle What progress has been made and what else remains to be done? We would like to use this for logging from our ruby code.
Hi @cidemaxio! Thanks for reaching out. It's great to hear you'd like to use OTel Ruby logs.
Here's the project board for the Logs signal that tracks what remains to be done. I have a draft PR for the OTLP exporter on my fork with a todo list in the description for work to do before opening the PR in the main repo.
There is at least one other PR that needs to be opened for the SDK/API regarding configuration and instrument registries. After both that PR and https://github.com/open-telemetry/opentelemetry-ruby/pull/1696 are merged, we should be ready to release the logs SDK, API and OTLP exporter gems.
Hi, @cidemaxio! PR is now opened for the OTLP Log Record Exporter: #1727
Please take a look if you're interested! Additional feedback from the community may help speed up the process to merge/release the gem.
The other PR related to the SDK/API I mentioned in my last comment has been opened too: #1725
Thanks for the update @kaylareopelle! We will look at that PR.
@kaylareopelle both PRs seem to have conflicts. Could you bring them up to date with main if you have a chance?
Thank you, @wsmoak! The merge conflicts have been resolved 😄
Thanks @kaylareopelle .
I was able to merge the changes from both PRs to a branch locally and try it out in a simple Rails app based on the example above. I have the collector running in a Docker container according to the quickstart [1], and I can see the logs being sent to the collector.
[1] with the addition of port 4318 in the docker run command
This is fantastic news. Thanks for testing, @wsmoak!
Where did you find the docker run command? I'm wondering if there's a place we could update the documentation to include your port finding.
It's a bit off-topic for this issue, but if you're interested in trialing a Ruby Logger bridge to automatically emit your Rails logs as OpenTelemetry Logs, you can pull in the branch on this PR: https://github.com/open-telemetry/opentelemetry-ruby-contrib/pull/983
This is intended for the standard Ruby Logger class. If you're using semantic logger, there's a prototype here: https://github.com/reidmorrison/semantic_logger/pull/292
The docker run command I mentioned is the one in the otel collector quickstart: https://opentelemetry.io/docs/collector/quick-start/ -> step 3
I had that running, but when I started the Rails app, it complained that it couldn't export logs. Could this error have more details about where it was trying to send them?
E, [2024-10-17T18:47:03.126824 #86414] ERROR -- : OpenTelemetry error: Unable to export 3 log records
I eventually sorted out that the Ruby SDK was speaking HTTP and nothing was listening on 4318 in the collector.
(And I did see it wrapping the Rails logs already, I think I picked up the contrib gem from your otel_ruby_logs_demo Rails example.) Thanks!
That's great feedback! I'll see what I can do about the logs exporter message.
Thanks for pointing out the command. I opened https://github.com/open-telemetry/opentelemetry.io/pull/5441 to see if we can get that added.
So glad to hear you found the demo! 🎉
Hi @wsmoak, I updated the OTLP log exporter to log an OpenTelemetry error with more detail whenever it returns a FAILURE status code. Could you give it a try and let me know if that information would have helped debug the connection problem you encountered?
Here's the commit that introduced the logging: abfcd5466902b1eb21b4a3b4e8519fec10d5f0ab
Our current OTLP exporter is set up to exclusively send traces. This issue will either adapt current exporters or create a new, temporary exporter to send logs over OTLP. Support for HTTP will likely come first, followed by gRPC.