-
Notifications
You must be signed in to change notification settings - Fork 790
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
[bug] Body and the {OriginalFormat} attribute of LogRecord data don't work together when using logging bridge API. #6109
Comments
Question...
Why are you doing this? Let's say we want to bridge some logging library into OTel. It supports a formatted message and a message template. This would be more correct usage of the log bridge: var data = new LogRecordData
{
Body = "This is a log bridge from some logging library for requestId = 1"
};
var attributes = new LogRecordAttributeList
{
{ "dotnet.logging_library_name.template", "This is a log bridge from some logging library for requestId = {RequestId}" }
}; OTLP exporter would send both without issue. |
I know |
Make your own name 😄 We own the Strictly speaking, @alanwest What are your thoughts here? |
I agree that this is a bug and it should be a valid use case, however it is unlikely something we can resolve in the near term. I also agree with @CodeBlanch and recommend steering clear of using I'm personally not keen on using |
Package
OpenTelemetry.Exporter.OpenTelemetryProtocol
Package Version
Runtime Version
net9.0
Description
If I populate the
Body
property of theLogRecordData
that I'm trying to emit with the formatted message and create aLogRecordAttributeList
with the {OriginalFormat} attribute and pass it to theEmitLog
method, the body of the exported log will be the value of {OriginalFormat} and the attribute itself as well as theBody
of theLogRecordData
won't be there.Steps to Reproduce
Expected Result
The body of the exported log will be the
Body
property of theLogRecordData
that I emitted and there will be the {OriginalFormat} attribute.Actual Result
See description
Additional Context
No response
The text was updated successfully, but these errors were encountered: