-
Notifications
You must be signed in to change notification settings - Fork 765
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
[Instrumentation.Http] Support for enrich and filter delegates for http client metric #4075
[Instrumentation.Http] Support for enrich and filter delegates for http client metric #4075
Conversation
|
23b526a
to
43cf01f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aunikitin Thanks for your PR. Could you please update the PR to only include changes related to enrich and filter options on metrics?. This will keep it small and easier to review. Any refactoring, renaming can be done separately.
@vishweshbankwar hello, you want me to rollback changes in tests (for example moving test |
4dbf5b9
to
dcb5abf
Compare
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/open-telemetry/opentelemetry-dotnet/pull/4075/files#r1073154671
Not yet ready to make new additions to instrumentation library as we do not have a metrics enrichment concept yet.
2b54dd5
to
75b8411
Compare
@aunikitin Thanks for the PR. I have triggered CI checks and will review. |
src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationMeterOptions.cs
Outdated
Show resolved
Hide resolved
@cijothomas okay, I'm waiting of your decision. |
Signed-off-by: aunikitin <sanya_nikiti@mail.ru>
Signed-off-by: aunikitin <sanya_nikiti@mail.ru>
Signed-off-by: aunikitin <sanya_nikiti@mail.ru>
d5bdb44
to
4b587cf
Compare
Signed-off-by: aunikitin <sanya_nikiti@mail.ru>
src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
{ | ||
tags.Add(new KeyValuePair<string, object>(SemanticConventions.AttributeNetPeerPort, request.RequestUri.Port)); | ||
} | ||
this.EnrichWithHttpRequestMessage(ref tags, request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above...this looks like response message and not request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In meter, both request and response are used. Should I do the same? I agree that it's more convinient to have response, but it'll conflict with #4098
src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationMeterOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.Http/MeterProviderBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
/// <param name="name">The name of the metric being enriched.</param> | ||
/// <param name="requestMessage"><see cref="HttpRequestMessage"/>: the HttpRequestMessage object.</param> | ||
/// <param name="tags"><see cref="TagList"/>: List of current tags. You can add additional tags to this list. </param> | ||
public delegate void HttpRequestMessageEnrichmentFunc(string name, HttpRequestMessage requestMessage, ref TagList tags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to pass in both request and response.
#4098
@cijothomas - FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave HttpResponse, if your changes appear earlier, I'll fix mine, and vice versa
…etry#4092) * Remove the dependency on Microsoft.Extensions.Configuration.EnvironmentVariables from SDK. * Added notes. * CHANGELOG patch.
Signed-off-by: Alex <sanya_nikiti@mail.ru>
ff8550b
to
ebb41ce
Compare
# Conflicts: # src/OpenTelemetry/CHANGELOG.md # src/OpenTelemetry/OpenTelemetry.csproj
Signed-off-by: Alex <sanya_nikiti@mail.ru>
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Hello, I'd like to have an opportunity to enrich metrics with custom logic (for example uri templates of requested paths). Also I add opportunity to filter some requests because of TODO in
MeterProviderBuilderExtensions
I tried to use existing
HttpClientInstrumentationOptions
but firstly, they have too mutch for metrics and secondly, because in theHttpHandlerMetricsDiagnosticListener
we are not allowed to take tags from activity (because of uncontrolled source of filling), that's why delegates in settings don't fit .Also I wrote some tests and did small refactoring in them (move trace tests in one file; split configuration tests from common, because they don't need running
HttpListener
).If my changes are admissible, I will add description to
CHANGELOG.md
.Probably it resolves issue
Changes
Please provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes