-
Notifications
You must be signed in to change notification settings - Fork 293
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
[Exporter.Geneva] Allow to export only stack trace in logs #2421
Comments
Tagging component owner(s). |
This is not a bug, it is intentional to use ToString() here. OTel SDK upstream uses ToString() for representing exceptions, so if use OTLP Exporter, that is what you'd get. I don't recall full details, but I don't think StackTraces takes care of inner_exceptions. Also ToString() takes care of avoiding the async state machine stuff to get cleaner representation. But I can totally see some users preferring StackTrace. |
The same is the case when Msgpack encoding is used. |
Why do you think this is intentional? This is called Exception Stack and it is the ToString on Exception. There is a separate property for exception message here. IMHO, this should follow the spec and just be the stack trace and not a repeat of the message + stack trace. |
See the previous discussions on this topic in OTel SDK itself: open-telemetry/opentelemetry-dotnet#1569 OTel .NET SDK has chosen ex.ToString() as the representation in open-telemetry/opentelemetry-dotnet#5143 (To be precise, it was done in 1.0 itself, but this is where it was documented)
As shared above, this is already following the spec. Totally open to adding an option to let users decide the representation suitable for them. It should be done upstream in OTel SDK rather than GenevaExporter alone, otherwise users using OTLP Exporter will not be able to take advantage of this flexibility. |
Yes, let's please add an option for StackTrace to actually mean stacktrace... and not some other random string that differs from exception to exception. Thanks |
@prezaei I and @rajkumar-rangaraj can help with adding an opt-in feature to GenevaExporter to use Exception.StackTrace instead of Exception.ToString(). However, be aware that this will just work for GenevaExporter and will be inconsistent with other systems. I am aware of the below three other places that made the decision to use ToString().
|
Yes please. Let's add the config to the Geneva one please. |
Why? Exception conventions for Logs and Spans (Traces) are defined in the exact same way: https://github.com/open-telemetry/semantic-conventions/tree/main/docs/exceptions #2422 - I made a quick PR to add StackTrace support. I'll wait for code owners @CodeBlanch and @rajkumar-rangaraj to review. It does add a new public api, but seems very safe to me to ship it as stable. |
@CodeBlanch Could you mark this as non-bug, and feature request? |
Component
OpenTelemetry.Exporter.Geneva
Package Version
Runtime Version
net9.0
Description
I am looking at the Geneva Exporter and there seems to be bug:
Exception.ToString() is not the stack trace.... it has a ton more than that...
Can we please fix and limit to the stack trace?
Please consider using Exception.StackTrace here which is also cheaper to generate.
Steps to Reproduce
Log and exception and you see it is not the stack trace that gets exported.
Expected Result
Just the stack trace to be exported for this property.
Actual Result
Full Exception Message.
Additional Context
No response
The text was updated successfully, but these errors were encountered: