dotnet / extensions

This repository contains a suite of libraries that provide facilities commonly needed when creating production-ready applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deployment ring attribute name

NatMarchand opened this issue · comments

Description

Currently the attribute name used for application metadata deployment ring is not consistent with other values. Changing it to deployment.ring would make it consistent with deployment.environment.

Reproduction Steps

var builder = WebApplication.CreateBuilder(args);
builder.Services
    .AddApplicationMetadata(metadata =>
    {
        metadata.DeploymentRing = "test1";
    });
builder.Services
    .AddServiceLogEnricher(options =>
    {
        options.EnvironmentName = true;
        options.DeploymentRing = true;
    });

Expected behavior

2024-01-25 14:45:32 InstrumentationScope Program 
2024-01-25 14:45:32 LogRecord #0
2024-01-25 14:45:32 ObservedTimestamp: 2024-01-25 13:45:27.9344822 +0000 UTC
2024-01-25 14:45:32 Timestamp: 2024-01-25 13:45:27.9344822 +0000 UTC
2024-01-25 14:45:32 SeverityText: Information
2024-01-25 14:45:32 SeverityNumber: Info(9)
2024-01-25 14:45:32 Body: Str(Hi there !)
2024-01-25 14:45:32 Attributes:
2024-01-25 14:45:32      -> service.name: Str(myservice)
2024-01-25 14:45:32      -> deployment.environment: Str(preview)
2024-01-25 14:45:32      -> deployment.ring: Str(test1)

Actual behavior

2024-01-25 14:45:32 InstrumentationScope Program 
2024-01-25 14:45:32 LogRecord #0
2024-01-25 14:45:32 ObservedTimestamp: 2024-01-25 13:45:27.9344822 +0000 UTC
2024-01-25 14:45:32 Timestamp: 2024-01-25 13:45:27.9344822 +0000 UTC
2024-01-25 14:45:32 SeverityText: Information
2024-01-25 14:45:32 SeverityNumber: Info(9)
2024-01-25 14:45:32 Body: Str(Hi there !)
2024-01-25 14:45:32 Attributes:
2024-01-25 14:45:32      -> service.name: Str(myservice)
2024-01-25 14:45:32      -> deployment.environment: Str(preview)
2024-01-25 14:45:32      -> DeploymentRing: Str(test1)

Regression?

No response

Known Workarounds

No response

Configuration

dotnet 8

Other information

No response

Hmmm, looks like an oversight as we were migrating things over to this repo.

@xakep139 Can we fix this? Or are we stuck with it for compat reasons at this point?

@geeknoid that's not an oversight. You can see the comment @iliar-turdushev added in his PR: https://github.com/dotnet/extensions/pull/4545/files#r1356746467

TL;DR: we used PascalCase in all logging dimensions where we couldn't use OTel Semantic Conventions (that was the case for DeploymentRing dimension). That was discussed with .NET folks.

OK, closing as by-design.