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

OTLP Exporter for Logs #1525

Open
kaylareopelle opened this issue Sep 20, 2023 · 15 comments · May be fixed by #1727
Open

OTLP Exporter for Logs #1525

kaylareopelle opened this issue Sep 20, 2023 · 15 comments · May be fixed by #1727
Assignees

Comments

@kaylareopelle
Copy link
Contributor

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.

Copy link
Contributor

github-actions bot commented Mar 2, 2024

👋 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.

@travisbell
Copy link

Hey @kaylareopelle, do you know where this project is at? Just curious when we might get to use a more generalized logging exporter. Thanks.

@kaylareopelle
Copy link
Contributor Author

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: kaylareopelle#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.

@kaylareopelle
Copy link
Contributor Author

WIP, unreviewed code for this issue, along with other parts of the logs SDK, can be found in kaylareopelle#6

@cidemaxio
Copy link

cidemaxio commented Sep 3, 2024

@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.

@kaylareopelle
Copy link
Contributor Author

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 #1696 are merged, we should be ready to release the logs SDK, API and OTLP exporter gems.

@kaylareopelle kaylareopelle linked a pull request Sep 12, 2024 that will close this issue
@kaylareopelle
Copy link
Contributor Author

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

@cidemaxio
Copy link

Thanks for the update @kaylareopelle! We will look at that PR.

@wsmoak
Copy link

wsmoak commented Oct 15, 2024

@kaylareopelle both PRs seem to have conflicts. Could you bring them up to date with main if you have a chance?

@kaylareopelle
Copy link
Contributor Author

Thank you, @wsmoak! The merge conflicts have been resolved 😄

@wsmoak
Copy link

wsmoak commented Oct 17, 2024

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

@kaylareopelle
Copy link
Contributor Author

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: open-telemetry/opentelemetry-ruby-contrib#983

This is intended for the standard Ruby Logger class. If you're using semantic logger, there's a prototype here: reidmorrison/semantic_logger#292

@wsmoak
Copy link

wsmoak commented Oct 17, 2024

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!

@kaylareopelle
Copy link
Contributor Author

That's great feedback! I'll see what I can do about the logs exporter message.

Thanks for pointing out the command. I opened open-telemetry/opentelemetry.io#5441 to see if we can get that added.

So glad to hear you found the demo! 🎉

@kaylareopelle
Copy link
Contributor Author

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: abfcd54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

4 participants