-
Notifications
You must be signed in to change notification settings - Fork 876
[http] Add http.client.request.duration metric and .NET Framework support #4870
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
Changes from 1 commit
17d67e0
800a71d
4a9239e
d7b2472
46de1a9
4e445b5
f0ca432
bed7b2b
ba04ac0
48c354a
872ce63
6999167
42e9022
527106f
e31f687
01840c0
9ef2915
47fc955
d9ca497
308ca8f
480940e
27ad5ab
025c02d
dfaa8f7
ad10683
8bd64ef
6ca5c9d
61a01f7
b4dd250
bca1361
5200afb
4d15ca6
dd07ca0
fc47558
9ae0193
9c4c3b5
dcdde2c
a063be1
7ce3c51
bef3862
812ad91
2cfc3e2
051cb42
0f37992
86c8ab0
7704a82
7e03ca7
0ce3ced
5218b65
e70629b
616f299
1502d64
34e39f4
9f1f887
f2e864b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -417,29 +417,20 @@ private static void ProcessResult(IAsyncResult asyncResult, AsyncCallback asyncC | |
| durationMs = durationS * 1000; | ||
| } | ||
|
|
||
| TagList tags = default; | ||
| tags.Add(SemanticConventions.AttributeHttpFlavor, HttpTagHelper.GetFlavorTagValueFromProtocolVersion(request.ProtocolVersion)); | ||
| tags.Add(SemanticConventions.AttributeHttpMethod, request.Method); | ||
| tags.Add(SemanticConventions.AttributeHttpScheme, request.RequestUri.Scheme); | ||
| tags.Add(SemanticConventions.AttributeHttpUrl, HttpTagHelper.GetUriTagValueFromRequestUri(request.RequestUri)); | ||
| tags.Add(SemanticConventions.AttributeNetPeerName, request.RequestUri.Host); | ||
| tags.Add(SemanticConventions.AttributeNetPeerPort, request.RequestUri.Port); | ||
|
|
||
| if (httpStatusCode.HasValue) | ||
| { | ||
| HttpClientDuration.Record( | ||
| durationMs, | ||
| new(SemanticConventions.AttributeHttpFlavor, HttpTagHelper.GetFlavorTagValueFromProtocolVersion(request.ProtocolVersion)), | ||
| new(SemanticConventions.AttributeHttpMethod, request.Method), | ||
| new(SemanticConventions.AttributeHttpScheme, request.RequestUri.Scheme), | ||
| new(SemanticConventions.AttributeHttpStatusCode, httpStatusCode.Value), | ||
| new(SemanticConventions.AttributeHttpUrl, HttpTagHelper.GetUriTagValueFromRequestUri(request.RequestUri)), | ||
| new(SemanticConventions.AttributeNetPeerName, request.RequestUri.Host), | ||
| new(SemanticConventions.AttributeNetPeerPort, request.RequestUri.Port)); | ||
| } | ||
| else | ||
| { | ||
| HttpClientDuration.Record( | ||
| durationMs, | ||
| new(SemanticConventions.AttributeHttpFlavor, HttpTagHelper.GetFlavorTagValueFromProtocolVersion(request.ProtocolVersion)), | ||
| new(SemanticConventions.AttributeHttpMethod, request.Method), | ||
| new(SemanticConventions.AttributeHttpScheme, request.RequestUri.Scheme), | ||
| new(SemanticConventions.AttributeHttpUrl, HttpTagHelper.GetUriTagValueFromRequestUri(request.RequestUri)), | ||
| new(SemanticConventions.AttributeNetPeerName, request.RequestUri.Host), | ||
| new(SemanticConventions.AttributeNetPeerPort, request.RequestUri.Port)); | ||
| tags.Add(SemanticConventions.AttributeHttpStatusCode, httpStatusCode.Value); | ||
| } | ||
|
|
||
| HttpClientDuration.Record(durationMs, tags); | ||
|
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.