-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Kafka Exporter incorrectly sends data from filelog receiver to topic (Container operator does not parse the CRI-O logs.) #35686
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
cc @ChrsMark |
Hey @xzizka! I'm not really sure what can be the issue here but let's try to narrow the scope down:
filelog:
exclude:
- /var/log/pods/default_daemonset-collector*_*/opentelemetry-collector/*.log
include:
- /var/log/pods/*/*/*.log
include_file_name: false
include_file_path: true
operators: ... From the logs that you shared it looks like indeed the Collector is collecting and parsing its own output:
I don't know if something can be wrong with kafka exporter but let's isolate this for now. |
Hello @ChrsMark, Thank you for your reaction.
ad 2)
I also see, that in the output above, there is
Did I configured the Thank you for any advice.... |
So everything looks to work, right? The logs seem to be parsed and the content ends up in the
What you have set just add the |
Hello @ChrsMark, Thank you for the analysis. Thank you |
I did some more tests... I changed the configuration to this one:
Then I saw in the log records like this one (formated for better reading):
But in the Kafka topic I still see only content of the I created a new Kafka topic and sent there tem full message manually. I was able to see there the full message. Then I forwarded the parsed log to this topic and I see the same again like mentioned before. So it looks Kafkaexporter sends just the content of the /label exporter/kafka |
Pinging code owners for exporter/kafka: @pavolloffay @MovieStoreGuy. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I was checking the Kafka exporter code. I am not a Go programmer, but I see in the code that the RAW marshaller takes only the body of the log (I expect, that the
This would provide an answer to my question, why do I see just the content of the Body parameter in the Kafka topic and not the whole message produced by filelog. See the output from the filelog from the debug mode I provided above.
@pavolloffay @MovieStoreGuy Could you please confirm that? |
Ah yes... It is also written in the documentation...
Maybe a feature request to send the whole record and not just a body. I need to think about the use case. Thanks to all participants in this discussion. |
Thank's for investigating this @xzizka ! |
Component(s)
receiver/filelog
Describe the issue you're reporting
I want to configure Kubernetes log collection and forward them to Kafka.
My testing setup is:
Log are located in
/var/log/pods/
. This location is mounted inside of the deamonset pods using the manifest below:The daemonset uses SA with the following clusterrole (it is also used for metrics collection):
The confiuration for OTEL collector is following:
A part of detailed logs from one of the pods looks like this.
If I switxch back to basic logging I see the following:
If I check what is in the Kafka topic, I see just a message from the log and nothing else.
I was following this blogpost:
https://opentelemetry.io/blog/2024/otel-collector-container-log-parser/
I tried to use
format: auto
andformat: crio
, but without any positive effect.Also
add_metadata_from_filepath: true
had no effect.Cloud you please advice me where can be the issue? Why the logs are not processed to the JSON format and forwarded to the Kafka topic?
Is it possible it is an issue with Kafka exproter and not with the container parser?
Thank you
@djaglowski @TylerHelmuth
The text was updated successfully, but these errors were encountered: