opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

[resource] Remove an attribute

Open CodeBlanch opened this issue 1 year ago • 5 comments
trafficstars

What are you trying to achieve?

I just got an interesting request from a user. They are using some .NET resource detectors like this:

otelOptions.SetResourceBuilder(
   ResourceBuilder.CreateDefault()
      .AddService(serviceName: "VoiceCompanionApp", serviceVersion: "1.0.0")
      .AddHostDetector()
      .AddProcessDetector()
      .AddProcessRuntimeDetector()
      .AddOperatingSystemDetector());

User wants to remove "hostname" & "username" attributes from the final resource.

There is a Merge operation defined in the spec but I don't see a way to remove specific keys via that mechanism.

Q: Should we extend Merge to support removal or add something dedicated?

/cc @flaviocdc

CodeBlanch avatar Sep 19 '24 19:09 CodeBlanch