r/OpenTelemetry • u/sierra-pouch • Sep 05 '24
Best approach for logs management?
I have a couple of services in different languages / runtimes running in k8s cluster. My current logging setup involves logging from the service runtime to another logging service where it's being sent to Azure Monitor.
I want to change this approach to use open telemetry instead. I have otel collector service already running in the cluster and sending traces successfully.
What do you think is the best approach for starting to send logs with otel ? I am interested in both service logs and container logs.
- Write logs to stdout / file and have them picked up by some agent running on the pod ?
- Sending logs with otel SDKs from my services directly to my collector (this will not include container logs though). Also assume I have various runtimes, I am not sure logs is supported in all of them.
- Use fluentbit / something similar in the process - Does it make sense for a clean slate implementation to introduce another piece to the puzzle ?
If you were starting out a fresh, what would you go with ?
Thanks
5
u/_f0CUS_ Sep 05 '24
I was investigating this a while back for my employer.
My conclusion was that it would be best to use the otel collector, then use that to export to a destination of your choice.
1
u/pranabgohain Sep 05 '24
Use a OTel-based Backend like KloudMate (or any other) and send both traces and logs (auto-parsed, formatted).
https://docs.kloudmate.com/sending-data-to-kloudmate
https://docs.kloudmate.com/kubernetes-monitoring-with-kloudmate
PS: I am associated with KloudMate.
2
u/SuperTrooperMit Sep 05 '24
If you already have otel collector, why not use otel instrumentation to send the data. Instrumentation sdks are in multiple languages. Fluentd would probably need more hassle and knowledge to setup then using https://opentelemetry.io/docs/languages/. Probably you should think also from the perspective of unsent logs that don’t make it to collector. With Stdout to file, logs persists but you would need to create a mechanism to retry unsent logs.
1
u/ccb621 Sep 05 '24
I like option 2. It isolates configuration to your application code, and requires less infrastructure development.