Skip to content
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

[feature request] Support populating new LogRecord.EventName from log record EventId #6108

Open
lmolkova opened this issue Jan 27, 2025 · 1 comment
Labels
enhancement New feature or request needs-triage New issues which have not been classified or triaged by a community member pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Comments

@lmolkova
Copy link

Package

OpenTelemetry

Is your feature request related to a problem?

Since LogRecord now has top-level EventName proto field, OTel should support mapping EventId.EventName provided to ILogger.Log.

What is the expected behavior?

This example

var foodRecallNotice = new FoodRecallNotice
{
BrandName = "Contoso",
ProductDescription = "Salads",
ProductType = "Food & Beverages",
RecallReasonDescription = "due to a possible health risk from Listeria monocytogenes",
CompanyName = "Contoso Fresh Vegetables, Inc.",
};
logger.FoodRecallNotice(foodRecallNotice);
// Dispose logger factory before the application ends.
// This will flush the remaining logs and shutdown the logging pipeline.
loggerFactory.Dispose();
internal static partial class LoggerExtensions
{
[LoggerMessage(LogLevel.Critical)]
public static partial void FoodRecallNotice(
this ILogger logger,
[LogProperties(OmitReferenceName = true)] in FoodRecallNotice foodRecallNotice);
}

should produce a LogRecord (over OTLP) with EventName property set instead of event.name.

Which alternative solutions or features have you considered?

n/a

Additional context

No response

@lmolkova lmolkova added enhancement New feature or request needs-triage New issues which have not been classified or triaged by a community member labels Jan 27, 2025
@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Jan 27, 2025
@cijothomas
Copy link
Member

#5462 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs-triage New issues which have not been classified or triaged by a community member pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

No branches or pull requests

3 participants