Skip to content

Commit

Permalink
Merge branch 'main' into logrecorddata
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Jun 18, 2022
2 parents 65c1f27 + 3c38200 commit 0e48f44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Metrics instrumentation to correctly populate 'http.flavor' tag.
(1.1 instead of HTTP/1.1 etc.)
([3379](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3379))

* Tracing instrumentation to populate 'http.flavor' tag.
([3372](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3372))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override void OnStopActivity(Activity activity, object payload)
{
tags = new TagList
{
{ SemanticConventions.AttributeHttpFlavor, context.Request.Protocol },
{ SemanticConventions.AttributeHttpFlavor, HttpTagHelper.GetFlavorTagValueFromProtocol(context.Request.Protocol) },
{ SemanticConventions.AttributeHttpScheme, context.Request.Scheme },
{ SemanticConventions.AttributeHttpMethod, context.Request.Method },
{ SemanticConventions.AttributeHttpHost, host },
Expand All @@ -90,7 +90,7 @@ public override void OnStopActivity(Activity activity, object payload)
{
tags = new TagList
{
{ SemanticConventions.AttributeHttpFlavor, context.Request.Protocol },
{ SemanticConventions.AttributeHttpFlavor, HttpTagHelper.GetFlavorTagValueFromProtocol(context.Request.Protocol) },
{ SemanticConventions.AttributeHttpScheme, context.Request.Scheme },
{ SemanticConventions.AttributeHttpMethod, context.Request.Method },
{ SemanticConventions.AttributeHttpHost, host },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public async Task RequestMetricIsCaptured()
var method = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpMethod, "GET");
var scheme = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpScheme, "http");
var statusCode = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpStatusCode, "200");
var flavor = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpFlavor, "HTTP/1.1");
var flavor = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpFlavor, "1.1");
var host = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpHost, "localhost");
var target = new KeyValuePair<string, object>(SemanticConventions.AttributeHttpTarget, "api/Values");
Assert.Contains(method, attributes);
Expand Down

0 comments on commit 0e48f44

Please sign in to comment.