Skip to content

Logs exporter: flattening EventId into Id and Name causes avoidable attribute name conflicts #4404

@nblumhardt

Description

@nblumhardt

Feature Request

EventId is part of .NET's stable log data model. Log events carry an event id, which may contain an Id for the log event (type), and an additional human-readable Name.

Currently, the OTLP exporter flattens these structure members into Id and Name attributes on resulting log records. These are extremely common attribute names to find in user log messages, for example:

logger.LogInformation(new EventId(42, "UserCreated"), "Created user {Name} with id {Id}", user.Name, user.Id);

generates two important attributes on the resulting log event, Name and Id, yet these will conflict with the EventId-derived Name and Id attached by the exporter.

Describe the solution you'd like:

Something akin to the way category names are handled could work? I.e.:

dotnet.ilogger.event_id.id
dotnet.ilogger.event_id.name

Describe alternatives you've considered.

--

Additional Context

See also #3491

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleIssues and pull requests which have been flagged for closing due to inactivityenhancementNew feature or requestlogsLogging signal relatedpkg:OpenTelemetry.Exporter.OpenTelemetryProtocolIssues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions