-
Notifications
You must be signed in to change notification settings - Fork 165
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
Contrib image: journaldreceiver receiver is missing journalctl #462
Comments
This may be a better default. I'm not sure what kinds of compatibility guarantees systemd gives for the journal format, but I've seen issues surface from shipping journalctl with the Sumo otel distro container image. In general, it's safer to mount the necessary files from the host, and this is something the operator should consider doing eventually. |
I'm running into the same issue as well, is there a different image which has journalctl? or any other workarounds to export journal logs to a otlp exporter? |
There aren't plans right now to include |
@TylerHelmuth I think that is not a great solution, particularly while depending on a binary. The collector should be self-sufficient for the most part, for all receivers/exporters that it includes. At least an image that includes it, or instructions on how to set it up would be appreciated. eg. Mounting the file from host, or just |
I agree. I'd vote to remove journaldreceiver from the image, as providing all its dependencies is not feasible, IMO. |
I don't agree with that, since |
The correct solution to this problem is a pure Go implementation of a journald file format reader. As we don't have that yet, If you want to do it on your own, here' is an example of how to do it in a relatively thorough fashion. |
Mounting would but great, but since it’s dynamically linked it’s not just mounting a binary or path. You have to build a full image. Out of curiosity I wonder how fluentd, fluentbit, datadog, etc do it. I’ll go check, but if they ship the binary, I would say that is a safe bet. |
I'm pretty sure you can mount all the dependencies. The Dockerfile I linked copies them from a Debian container. |
I believe the code owners for this component should make the decision (cc @sumo-drosiek, @djaglowski). That said, I would appreciate hearing about the concrete use-case of having journaldreceiver on a Collector on a container: are you trying to read journald files from the host? Or do you have a whole journald process on the container itself? |
The aim is to read journald files from the host (eg. in Kubernetes environment), but for now there is no pure go implementation which is doing that. The libraries I know require CGO, which AFAIR we are avoiding for Open Telemetry Collector, so we rely on the binary itself. Like @swiatekm-sumo compatibility between version is not guaranteed and because of that I'm sceptical to put the binary into the container as it won't work everywhere. On the other hand it will solve most of the usages by default. I will try to find some time this week to verify how complex is writing the reader in pure go, and then I will have stricter opinion |
While it is likely technically possible, it's not practical in my opinion to mount ~30 paths to get this working. If this was a self-contained binary, I would agree it would be a suitable solution.
Is there confirmation of this? Because I believe it was an assumption. The spec seems to be fairly well defined: https://systemd.io/JOURNAL_FILE_FORMAT/ I checked both Datadog and Fluentbit
|
I am under impression we had one issue related to the incompatibility of systemd. @swiatekm-sumo do you remind such case? |
After more research and making some PoC for golang based journald reader I have the following opinion. It doesn't seem to be hard to write journald reader, but it may need some effort in order to test it properly and solve edge cases. I have some initial implementation which I'm going to share after I add some features, todo comments and small refactor.
Yes, at the end seems that there is full backward compatibility for journal format Due to above, I think we may add binary to the image and replace it as soon as it will be possible. Firstly using golang based reader as experimental optional reader and then after fixing remaining bugs and adding more feature use it as only way cc: @djaglowski for another opinion 😄 |
That's great news. This would be a huge improvement.
My understanding is that this is a messy undertaking. I'd rather avoid it especially if it's only temporary. If we have a potential solution in the works then I'd just as soon wait for it at this point. |
I cannot give any ETA for now, other on that I agree 🙈 |
Related issue in OpenTelemetry repository: open-telemetry/opentelemetry-collector-contrib#32711 I pushed my poc code to the following repo: https://github.com/sumo-drosiek/gournal |
Why not doing it with journald-remote to be agnostic instead of adding a complex binary dependency on the otel image ? Design proposed here: open-telemetry/opentelemetry-collector-contrib#2332 (comment)
This solution is natively supported by systemd, on the host without tricks. |
+1 for having this feature, I'm currently trying to scrape the kubelet logs, which are only available in the journal files |
The contrib docker image does not have
journalctl
The text was updated successfully, but these errors were encountered: