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

Make DisableUrlQueryRedaction option in OpenTelemetry.Instrumentation.Http public #1954

Open
ImoutoChan opened this issue Jul 13, 2024 · 5 comments
Labels
bug Something isn't working comp:instrumentation.http Things related to OpenTelemetry.Instrumentation.Http

Comments

@ImoutoChan
Copy link

ImoutoChan commented Jul 13, 2024

Component

OpenTelemetry.Instrumentation.Http

Package Version

Package Name Version
OpenTelemetry.Api 1.9.0
OpenTelemetry 1.9.0

Runtime Version

net8.0

Description

After update URLs in traces became redacted. There is a property to disable it, but it's internal.

internal bool DisableUrlQueryRedaction { get; set; }

Why is this property internal? If I can disable it through environment variable, I should be able to disable it through code.
Please make it public and set the default value however you like. You're forcing developers to use reflection, this is bad design decision.

You also hide the fact itself that it can be disabled, no one expect hidden internal property on options configuration object.

Steps to Reproduce

No response

Expected Result

No response

Actual Result

No response

Additional Context

The ugly but acceptable workaround is to disable access checks. Add it to your project file:

<ItemGroup>
    <PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.7.0" PrivateAssets="All" />
    <InternalsAssemblyName Include="OpenTelemetry.Instrumentation.Http" />
    <InternalsAssemblyName Include="OpenTelemetry.Instrumentation.AspNetCore" />
</ItemGroup>

After that you'll be able to change these properties. Also the same problem is with AspNetCoreInstrumentation, don't forget to disable it there too.

It uses https://github.com/aelij/IgnoresAccessChecksToGenerator, give the author some love.

@ImoutoChan ImoutoChan added the bug Something isn't working label Jul 13, 2024
@github-actions github-actions bot added the comp:instrumentation.http Things related to OpenTelemetry.Instrumentation.Http label Jul 13, 2024
@TimothyMothra
Copy link
Contributor

Hi @ImoutoChan
The current feature is still Experimental which is why it's behind the OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION environment variable.

We're waiting for the OpenTelemetry Community to define how to handle this feature. That conversation is still ongoing: open-telemetry/semantic-conventions#961

@ImoutoChan
Copy link
Author

That conversation is still ongoing

I understand that some features are still experimetal, but then you should provide them as opt-in, not as opt-out. Right now this experimental feature affects all users who updated their packages to the latest non-preview version.

@bmajik
Copy link

bmajik commented Jul 29, 2024

As @ImoutoChan says, this could have been made trivial to opt-in OR opt-out, but that wasn't done.

This is a breaking change, with no semVer bump. Also exposing the option for people who use Builder and options function semantics would have been the right thing to do, especially since so many tutorials/docs use that convention for configuration.

@Wraith2
Copy link
Contributor

Wraith2 commented Sep 18, 2024

I have no problem with redaction existing in the current form and being enabled by default, but I do want to be able to deal with it in a natural way for the language/framework that I'm using. For .Net that means IConfiguration and options classes not only environment variables.

The fact that the feature is experimental is immaterial. It has changed the observable behaviour of the library. If it was intended to be hidden and only used by people choosing to use experimental features then it needed to be opt-in not opt-out.

If you wanted to you could use the new experimental attribute https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-12.0/experimental-attribute and ifdef obsolete's for down level tfm's forcing people to see and disable the warnings.

How long do we have to wait for the semantic convention changes to be approved or rejected? the issue has gone stale several times already.

@strue36
Copy link

strue36 commented Feb 18, 2025

Hi @ImoutoChan The current feature is still Experimental which is why it's behind the OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTION environment variable.

We're waiting for the OpenTelemetry Community to define how to handle this feature. That conversation is still ongoing: open-telemetry/semantic-conventions#961

The linked PR was closed and replaced by one that is more selective. What further decisions by the OpenTelemetry Community are being waited on in order to determine how this redaction should be configured?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comp:instrumentation.http Things related to OpenTelemetry.Instrumentation.Http
Projects
None yet
Development

No branches or pull requests

5 participants