-
Notifications
You must be signed in to change notification settings - Fork 482
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
Simplified stdout exporter for logs and traces #2040
Simplified stdout exporter for logs and traces #2040
Conversation
I'll leave this open for a day or two, to make sure others have a chance to share feedback. |
Thanks for the effort on simplifying the output. I agree the existing json format (even with serde pretty-print) is not easy read. |
I was initially thinking of keeping existing and providing an option to do the current output format... Then I felt that it'd possibly convey wrong intent that we intend to keep such flexibility! Removing all such flexibility, makes our intent pretty clear - this is only for learning/testing purpose and nothing more. |
I see your point in potential confusion coming with the flexibility provided. We can also have a balance by documenting that the existing flexibility doesn’t make the current exporter suitable for any production use-case. No strong opinion though, i eventually go with what all agree :) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2040 +/- ##
=======================================
+ Coverage 77.3% 77.9% +0.5%
=======================================
Files 124 121 -3
Lines 21282 21136 -146
=======================================
Hits 16472 16472
+ Misses 4810 4664 -146 ☔ View full report in Codecov by Sentry. |
Given there is general acceptance to move towards this PR, I'll continue polishing this (and add metrics too). Marking draft while I work through them and address review feedbacks. |
Co-authored-by: Cijo Thomas <[email protected]>
Co-authored-by: Cijo Thomas <[email protected]>
Merging now, given there is general agreement for this direction. Happy to address more feedback in follow ups. |
Hello there! Is there any suggested crate for people like me who were relying on the older behavior against all warnings? I was using Update: I ended up using Jaeger's ability to save a trace as a JSON file, which is good enough for my use case. |
Based on open-telemetry/opentelemetry-specification#4183 we can add a new exporter that'll output OTLP as json, and this time without any "don't use for prod" warning! |
The current implementation of stdout exporter is not very easy to read by default or even with optional json formatting. Modified the stdout exporter implementation to print logs,traces in an easier to read format. (Of course, this is subjective!). I tried to mimic OTel Collector Debug exporters detailed output format. closely.
If everyone feels this is better, I'll continue and extend this for Metrics too, and fix up any gaps. (i.e ensure every field is exported etc.) This can also eliminate the transformation code we maintain for stdout exporter.Update after initial PR review: All signals are covered now.Note that the output format is not fixed and users are already advised not to rely on any particular format. Stdout exporter is ONLY designed/meant for learning purposes and not any other scenarios.
Example Logs output
Before:
With this PR
Example Span output
Before:
With this PR
Metrics output with this PR