[BUG] [Monitor] Logs sent through AzureMonitorLogExporter are not interpolated properly #46982
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Monitor
Monitor, Monitor Ingestion, Monitor Query
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Library name and version
Azure.Monitor.OpenTelemetry.AspNetCore 1.2.0
Describe the bug
Hello all. I have an ASP.NET 8 application which is currently using the old Application Insights SDK to ship logs and metrics to Application Insights. I am currently in the process of replacing the old SDK with the new OpenTelemetry package.
Our application uses Serilog for logging, which has a dedicated Application Insights sink. Since there is no official Serilog sink using the OTel package, I had to write my own to get feature parity. I implemented the sink according to the migration docs. However, when logging messages to the OTel-enabled
ILogger
, the messages arrive into Application Insights without being interpolated.Expected behavior
Log messages are properly interpolated so that they are easily readable. Instead of
Message with placeholder: {hole}
, the message should beMessage with placeholder: 42
, same as what the console logger does:Actual behavior
Logs show up in Application Insights without interpolation, with correct
customDimensions
:Reproduction Steps
I created a small repro using a console application:
Environment
VS Code 1.95.1 + C# + C# DevKit.
The text was updated successfully, but these errors were encountered: