-
Notifications
You must be signed in to change notification settings - Fork 304
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
Support for http.request.header.<key>
and http.response.header.<key>
attributes
#1696
Comments
Implementation proposalChangelogOptions class statusonly collection found is public API files across main/contrib repositories Extending public API changesOption 1 - same naming - for server and clientSame API names, regardless if it is used on the server or client side Changes for +OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureRequestsHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureRequestsHeaders.set -> void
+OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureResponseHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureResponseHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureRequestsHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureRequestsHeaders.set -> void
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureResponseHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureResponseHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureRequestsHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureRequestsHeaders.set -> void
+OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureResponseHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureResponseHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureRequestsHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureRequestsHeaders.set -> void
+OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureResponseHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureResponseHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureRequestsHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureRequestsHeaders.set -> void
+OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureResponseHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureResponseHeaders.set -> void Option 2 - distinguish server and client optionsChanges for +OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureRequestsServerHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureRequestsServerHeaders.set -> void
+OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureResponseServerHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNet.AspNetTraceInstrumentationOptions.CaptureResponseServerHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureRequestsServerHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureRequestsServerHeaders.set -> void
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureResponseServerHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.AspNetCore.AspNetCoreTraceInstrumentationOptions.CaptureResponseServerHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureRequestsClientHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureRequestsClientHeaders.set -> void
+OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureResponseClientHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.GrpcNetClient.GrpcClientTraceInstrumentationOptions.CaptureResponseClientHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureRequestsClientHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureRequestsClientHeaders.set -> void
+OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureResponseClientHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Http.HttpClientTraceInstrumentationOptions.CaptureResponseClientHeaders.set -> void Changes for +OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureRequestsServerHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureRequestsServerHeaders.set -> void
+OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureResponseServerHeaders.get -> System.Collections.Generic.IReadOnlyCollection<string!>?
+OpenTelemetry.Instrumentation.Owin.OwinInstrumentationOptions.CaptureResponseServerHeaders.set -> void Configuration by environmental variablesAs the feature is needed for Automatic Instrumentation there is a need to configure options by environmental variables. There is no env. variables defined for this on the semantic convention level. All packages except There are 3 options to handled this
If decided to implement it here we should decide of the names Follow Java naming conventionUse following set of variables
Create .NET conventionJava convention does not follow the rules. It does on include Variables for
Variables for
Variables for
Variables for
Variables for
Alternative approachImplement all this stuff on the Automatic Instrumentation side. It is fully feasible as |
@open-telemetry/dotnet-contrib-approvers, as it touches mostly core instrumentation package please let me know about your opinion. I would like to implement both code-options and env. variable support in these packages. |
@Kielek - For
|
No, these variables are not part of spec nor semantic convention. It is just implemented on the Java side. |
In addition to Vishwesh's input, here are my thoughts. While I understand that this customization would make auto-instrumentation easier, I believe we should avoid introducing such customizations directly into the instrumentation library. Creating new APIs or environment variables for this purpose may not be the best option due to the potential complexity and maintenance overhead it would introduce. Instead, I recommend exploring alternative approaches that leverage existing mechanisms within the OpenTelemetry framework. One such approach could be to use the enrich API in the instrumentation options to handle the specific headers you need. This way, the core library remains lean and focused, while still allowing for the flexibility required by specific use cases. For auto-instrumentation, we could explore a design to incorporate it as a part of it by customizing instrumentation options. |
@rajkumar-rangaraj, I can agree that the env. vars. are only importand for auotmatic instrumentation and there is not need to put it directly in the instrumentation library itself, but using |
If the Enrich* functions are not developer-friendly and are causing difficulties, our priority should be to address and improve their usability within the instrumentation libraries rather than seeking alternative solutions. |
Piggybacking on what @vishweshbankwar said above... IMO let's stick with using Enrich for now. We kind of need to wait and see what happens with .NET9 and the planned tracing updates. I would hate to add a bunch of features now that we then tell users in ~Nov won't work on .NET9 or they have to go and change their code to get the same results. Once we see those new APIs we'll have to figure out what to do with our instrumentation libraries. Ideally we'll be able to bridge the existing Enrich APIs onto whatever runtime provides so that users upgrading to .NET9 won't have to change anything. Could be difficult, who knows 🤣 |
Sure, we will go then with implementation in auto-instrumentation side. Hopefully, we will be able to contribute it here in November. If you have any beta-version of implementation I will be happy to verify if it covers all supported cases by AutoInstumentation. |
Functionality implemented on Automatic Instrumentation side. |
@Kielek , does this opt in variables work for php instrumentation too |
@HeenaBansal20, I think that the best way is to ask in https://github.com/open-telemetry/opentelemetry-php-contrib (creating issue). I do not know basically anything about PHP instrumentation. |
Issue that does not fit into other categories
What are you trying to achieve?
Possibility to opt-in following parameters
http.response.header.<key>
,http.request.header.<key>
.Needed at last in
Potentially affects also Instrumentation.Owin in this repository.
It will be great to have a possibility to enable it by options and environmental variables.
Additional context.
Java already implements it. It can be configured by 4 independent env. variables:
OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS
OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_RESPONSE_HEADERS
OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_REQUEST_HEADERS
OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_RESPONSE_HEADERS
Needed by (Splunk) .NET Auto Instrumentation technology. Would like to contribute it here.
The text was updated successfully, but these errors were encountered: