Skip to content
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

Transform exception.message for custom exception types #5786

Open
lvde0 opened this issue Aug 14, 2024 · 3 comments
Open

Transform exception.message for custom exception types #5786

lvde0 opened this issue Aug 14, 2024 · 3 comments
Labels
question Further information is requested

Comments

@lvde0
Copy link

lvde0 commented Aug 14, 2024

What is the question?

Is there any reasonable way of transforming the exception.message of an exception record? I have this ProblemDetails (RFC 7807) exception that carries its information inside the Detail property and not the Message. Would be nice if I could send that to the OTLP endpoint.

Additional context

No response

@lvde0 lvde0 added the question Further information is requested label Aug 14, 2024
@cijothomas
Copy link
Member

Is that for Activity or LogRecord?

@lvde0
Copy link
Author

lvde0 commented Aug 16, 2024

@cijothomas For LogRecord

@cijothomas
Copy link
Member

The raw Exception object is stored in LogRecord, so you can write a LogRecordProcessor that can read the Exception, get the additional details from it, and store it as attributes on LogRecord.
(Its not super straightforward, https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry/Logs/LogRecord.cs maybe used as a starting example to make extra attributes)

This is a doc gap as well. If you are not able to get it working, let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants