Open
Description
Package
OpenTelemetry.Exporter.OpenTelemetryProtocol
Package Version
Package Name | Version |
---|---|
OpenTelemetry.Exporter.OpenTelemetryProtocal | 1.11.0-rc.1 |
Runtime Version
net9.0
Description
If I populate the Body
property of the LogRecordData
that I'm trying to emit with the formatted message and create a LogRecordAttributeList
with the {OriginalFormat} attribute and pass it to the EmitLog
method, the body of the exported log will be the value of {OriginalFormat} and the attribute itself as well as the Body
of the LogRecordData
won't be there.
Steps to Reproduce
using OpenTelemetry.Logs;
#pragma warning disable OTEL1001
using var provider = Sdk
.CreateLoggerProviderBuilder()
.AddOtlpExporter()
.Build();
var logger = provider.GetLogger();
var data = new LogRecordData
{
Body = "formatted message"
};
var attributes = new LogRecordAttributeList { { "{OriginalFormat}", "original format" } };
logger.EmitLog(data, attributes);
Thread.Sleep(10000);
Expected Result
The body of the exported log will be the Body
property of the LogRecordData
that I emitted and there will be the {OriginalFormat} attribute.
Actual Result
See description
Additional Context
No response
Activity