Try to understand the difference between event.name and logrecord.event.name and where the event.id is represented in otel #5804
-
Hi there. In the readme.md the following feature switch is documented:
When I create an event log in dotnet core 8.0 with OpenTelemetry.Exporter.OpenTelemetryProtocol (1.9.0) I get the following result: Environment.SetEnvironmentVariable(
"OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES", "true"
);
logger.LogInformation(new EventId(4711, "JustATest"), "JustATest log"); {
"resourceLogs": [
{
"resource": {
"attributes": [
..
]
},
"scopeLogs": [
{
"scope": { "name": "MyApplication" },
"logRecords": [
{
"timeUnixNano": "1724672694064471500",
"observedTimeUnixNano": "1724672694064471500",
"severityNumber": 9,
"severityText": "Information",
"body": { "stringValue": "JustATest log" },
"attributes": [
{
"key": "logrecord.event.id",
"value": { "intValue": "4711" }
},
{
"key": "logrecord.event.name",
"value": { "stringValue": "JustATest" }
}
],
"flags": 1,
"traceId": "1fc1034d6359bef1373fa7d6e741e1d5",
"spanId": "2834927eca22c371"
}
]
}
]
}
]
} My questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
OTel's Log data model does not have a place to put ILogger's EventId and Name, so they are now exported as attributes. Since there is no standardized attribute name spec-ed out today, the current ones("logrecord.*") were chosen, and marked experimental. The final name could be something else, or it could be a top-level field in OTel LogRecord or something else. No firm ETA on this, you can track progress here : #5462 |
Beta Was this translation helpful? Give feedback.
OTel's Log data model does not have a place to put ILogger's EventId and Name, so they are now exported as attributes. Since there is no standardized attribute name spec-ed out today, the current ones("logrecord.*") were chosen, and marked experimental. The final name could be something else, or it could be a top-level field in OTel LogRecord or something else.
No firm ETA on this, you can track progress here : #5462