dotnet / dotnet/extensions

Specifying custom tag names does not work

Open
#5,196 5 comments 0 reactions 2 assignees Claimed by @dariusclay View on GitHub
area-telemetry bug
Dominant language
C#
Stars
3.2k
Forks
894
Avg merge
1d 12h
Merged PRs (30d)
23

Description

I am trying to use custom names for my properties however that attribute is not working. For reference my log generator is as follows:
```c#
[LoggerMessage(
EventId = 0,
Message = "Have recorded metric")]
public static partial void RecordMetric(
#pragma warning disable EXTEXP0003 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
this ILogger logger, LogLevel logLevel, [LogProperties(SkipNullProperties = true)] [TagName("test")] MetricDef metric, [LogProperties(SkipNullProperties = true)] MetricDescriptorDef descriptor, [LogProperties(SkipNullProperties = true)] EventDef @event);
#pragma warning restore EXTEXP0003 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

```

The code compiles but the property doesn't change name. to reflect.

Let me know if this needs to become a feature request.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.