Skip to content

Commit 080c266

Browse files
fixed overrides
1 parent 4a30b65 commit 080c266

File tree

13 files changed

+88
-15
lines changed

13 files changed

+88
-15
lines changed

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/SQS/AwsSqsCommon.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ internal static class AwsSqsCommon
5050

5151
tags.Service = SqsServiceName;
5252
tags.Operation = operation;
53+
tags.PeerService = "sqs." + tags.AwsRegion + "amazonaws.com";
5354
tags.SetAnalyticsSampleRate(IntegrationId, perTraceSettings.Settings, enabledWithGlobalSetting: false);
5455
tracer.TracerManager.Telemetry.IntegrationGeneratedSpan(IntegrationId);
5556
}

tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TagListGenerator/AwsSdkTags.g.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ partial class AwsSdkTags
3030
private static ReadOnlySpan<byte> AwsServiceBytes => new byte[] { 171, 97, 119, 115, 46, 115, 101, 114, 118, 105, 99, 101 };
3131
// ServiceBytes = MessagePack.Serialize("aws_service");
3232
private static ReadOnlySpan<byte> ServiceBytes => new byte[] { 171, 97, 119, 115, 95, 115, 101, 114, 118, 105, 99, 101 };
33+
// PeerServiceBytes = MessagePack.Serialize("peer.service");
34+
private static ReadOnlySpan<byte> PeerServiceBytes => new byte[] { 172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101 };
3335
// HttpMethodBytes = MessagePack.Serialize("http.method");
3436
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3537
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +51,7 @@ partial class AwsSdkTags
4951
"aws.requestId" => RequestId,
5052
"aws.service" => AwsService,
5153
"aws_service" => Service,
54+
"peer.service" => PeerService,
5255
"http.method" => HttpMethod,
5356
"http.url" => HttpUrl,
5457
"http.status_code" => HttpStatusCode,
@@ -72,6 +75,9 @@ public override void SetTag(string key, string value)
7275
case "aws_service":
7376
Service = value;
7477
break;
78+
case "peer.service":
79+
PeerService = value;
80+
break;
7581
case "http.method":
7682
HttpMethod = value;
7783
break;
@@ -135,6 +141,11 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135141
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136142
}
137143

144+
if (PeerService is not null)
145+
{
146+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
147+
}
148+
138149
if (HttpMethod is not null)
139150
{
140151
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +222,13 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211222
.Append(',');
212223
}
213224

225+
if (PeerService is not null)
226+
{
227+
sb.Append("peer.service (tag):")
228+
.Append(PeerService)
229+
.Append(',');
230+
}
231+
214232
if (HttpMethod is not null)
215233
{
216234
sb.Append("http.method (tag):")

tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TagListGenerator/AwsSdkTags.g.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ partial class AwsSdkTags
3030
private static ReadOnlySpan<byte> AwsServiceBytes => new byte[] { 171, 97, 119, 115, 46, 115, 101, 114, 118, 105, 99, 101 };
3131
// ServiceBytes = MessagePack.Serialize("aws_service");
3232
private static ReadOnlySpan<byte> ServiceBytes => new byte[] { 171, 97, 119, 115, 95, 115, 101, 114, 118, 105, 99, 101 };
33+
// PeerServiceBytes = MessagePack.Serialize("peer.service");
34+
private static ReadOnlySpan<byte> PeerServiceBytes => new byte[] { 172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101 };
3335
// HttpMethodBytes = MessagePack.Serialize("http.method");
3436
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3537
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +51,7 @@ partial class AwsSdkTags
4951
"aws.requestId" => RequestId,
5052
"aws.service" => AwsService,
5153
"aws_service" => Service,
54+
"peer.service" => PeerService,
5255
"http.method" => HttpMethod,
5356
"http.url" => HttpUrl,
5457
"http.status_code" => HttpStatusCode,
@@ -72,6 +75,9 @@ public override void SetTag(string key, string value)
7275
case "aws_service":
7376
Service = value;
7477
break;
78+
case "peer.service":
79+
PeerService = value;
80+
break;
7581
case "http.method":
7682
HttpMethod = value;
7783
break;
@@ -135,6 +141,11 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135141
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136142
}
137143

144+
if (PeerService is not null)
145+
{
146+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
147+
}
148+
138149
if (HttpMethod is not null)
139150
{
140151
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +222,13 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211222
.Append(',');
212223
}
213224

225+
if (PeerService is not null)
226+
{
227+
sb.Append("peer.service (tag):")
228+
.Append(PeerService)
229+
.Append(',');
230+
}
231+
214232
if (HttpMethod is not null)
215233
{
216234
sb.Append("http.method (tag):")

tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TagListGenerator/AwsSdkTags.g.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ partial class AwsSdkTags
3030
private static ReadOnlySpan<byte> AwsServiceBytes => new byte[] { 171, 97, 119, 115, 46, 115, 101, 114, 118, 105, 99, 101 };
3131
// ServiceBytes = MessagePack.Serialize("aws_service");
3232
private static ReadOnlySpan<byte> ServiceBytes => new byte[] { 171, 97, 119, 115, 95, 115, 101, 114, 118, 105, 99, 101 };
33+
// PeerServiceBytes = MessagePack.Serialize("peer.service");
34+
private static ReadOnlySpan<byte> PeerServiceBytes => new byte[] { 172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101 };
3335
// HttpMethodBytes = MessagePack.Serialize("http.method");
3436
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3537
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +51,7 @@ partial class AwsSdkTags
4951
"aws.requestId" => RequestId,
5052
"aws.service" => AwsService,
5153
"aws_service" => Service,
54+
"peer.service" => PeerService,
5255
"http.method" => HttpMethod,
5356
"http.url" => HttpUrl,
5457
"http.status_code" => HttpStatusCode,
@@ -72,6 +75,9 @@ public override void SetTag(string key, string value)
7275
case "aws_service":
7376
Service = value;
7477
break;
78+
case "peer.service":
79+
PeerService = value;
80+
break;
7581
case "http.method":
7682
HttpMethod = value;
7783
break;
@@ -135,6 +141,11 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135141
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136142
}
137143

144+
if (PeerService is not null)
145+
{
146+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
147+
}
148+
138149
if (HttpMethod is not null)
139150
{
140151
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +222,13 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211222
.Append(',');
212223
}
213224

225+
if (PeerService is not null)
226+
{
227+
sb.Append("peer.service (tag):")
228+
.Append(PeerService)
229+
.Append(',');
230+
}
231+
214232
if (HttpMethod is not null)
215233
{
216234
sb.Append("http.method (tag):")

tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TagListGenerator/AwsSdkTags.g.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ partial class AwsSdkTags
3030
private static ReadOnlySpan<byte> AwsServiceBytes => new byte[] { 171, 97, 119, 115, 46, 115, 101, 114, 118, 105, 99, 101 };
3131
// ServiceBytes = MessagePack.Serialize("aws_service");
3232
private static ReadOnlySpan<byte> ServiceBytes => new byte[] { 171, 97, 119, 115, 95, 115, 101, 114, 118, 105, 99, 101 };
33+
// PeerServiceBytes = MessagePack.Serialize("peer.service");
34+
private static ReadOnlySpan<byte> PeerServiceBytes => new byte[] { 172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101 };
3335
// HttpMethodBytes = MessagePack.Serialize("http.method");
3436
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3537
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +51,7 @@ partial class AwsSdkTags
4951
"aws.requestId" => RequestId,
5052
"aws.service" => AwsService,
5153
"aws_service" => Service,
54+
"peer.service" => PeerService,
5255
"http.method" => HttpMethod,
5356
"http.url" => HttpUrl,
5457
"http.status_code" => HttpStatusCode,
@@ -72,6 +75,9 @@ public override void SetTag(string key, string value)
7275
case "aws_service":
7376
Service = value;
7477
break;
78+
case "peer.service":
79+
PeerService = value;
80+
break;
7581
case "http.method":
7682
HttpMethod = value;
7783
break;
@@ -135,6 +141,11 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135141
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136142
}
137143

144+
if (PeerService is not null)
145+
{
146+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
147+
}
148+
138149
if (HttpMethod is not null)
139150
{
140151
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +222,13 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211222
.Append(',');
212223
}
213224

225+
if (PeerService is not null)
226+
{
227+
sb.Append("peer.service (tag):")
228+
.Append(PeerService)
229+
.Append(',');
230+
}
231+
214232
if (HttpMethod is not null)
215233
{
216234
sb.Append("http.method (tag):")

tracer/src/Datadog.Trace/Tagging/AwsDynamoDbTags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ internal partial class AwsDynamoDbV1Tags : AwsDynamoDbTags
2828
// However, this can still be set from ITags.SetTag so the user can
2929
// customize the value if they wish.
3030
[Tag(Trace.Tags.PeerService)]
31-
public string PeerService
31+
public override string PeerService
3232
{
3333
get => _peerServiceOverride ?? TableName;
34-
private set => _peerServiceOverride = value;
34+
set => _peerServiceOverride = value;
3535
}
3636

3737
[Tag(Trace.Tags.PeerServiceSource)]

tracer/src/Datadog.Trace/Tagging/AwsEventBridgeTags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public AwsEventBridgeV1Tags(string spanKind)
5555
// However, this can still be set from ITags.SetTag so the user can
5656
// customize the value if they wish.
5757
[Tag(Trace.Tags.PeerService)]
58-
public string? PeerService
58+
public override string? PeerService
5959
{
6060
get
6161
{
@@ -66,7 +66,7 @@ public string? PeerService
6666

6767
return _peerServiceOverride ?? RuleName;
6868
}
69-
private set => _peerServiceOverride = value;
69+
set => _peerServiceOverride = value;
7070
}
7171

7272
[Tag(Trace.Tags.PeerServiceSource)]

tracer/src/Datadog.Trace/Tagging/AwsKinesisTags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public AwsKinesisV1Tags(string spanKind)
5353
// However, this can still be set from ITags.SetTag so the user can
5454
// customize the value if they wish.
5555
[Tag(Trace.Tags.PeerService)]
56-
public string PeerService
56+
public override string PeerService
5757
{
5858
get
5959
{
@@ -64,7 +64,7 @@ public string PeerService
6464

6565
return _peerServiceOverride ?? StreamName;
6666
}
67-
private set => _peerServiceOverride = value;
67+
set => _peerServiceOverride = value;
6868
}
6969

7070
[Tag(Trace.Tags.PeerServiceSource)]

tracer/src/Datadog.Trace/Tagging/AwsS3Tags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public AwsS3V1Tags(string spanKind)
5757
// However, this can still be set from ITags.SetTag so the user can
5858
// customize the value if they wish.
5959
[Tag(Trace.Tags.PeerService)]
60-
public string? PeerService
60+
public override string? PeerService
6161
{
6262
get
6363
{
@@ -68,7 +68,7 @@ public string? PeerService
6868

6969
return _peerServiceOverride ?? BucketName;
7070
}
71-
private set => _peerServiceOverride = value;
71+
set => _peerServiceOverride = value;
7272
}
7373

7474
[Tag(Trace.Tags.PeerServiceSource)]

tracer/src/Datadog.Trace/Tagging/AwsSdkTags.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal abstract partial class AwsSdkTags : InstrumentationTags, IHasStatusCode
3838
public string Service { get; set; }
3939

4040
[Tag(Trace.Tags.PeerService)]
41-
public string PeerService { get; set; }
41+
public virtual string PeerService { get; set; }
4242

4343
[Tag(Trace.Tags.HttpMethod)]
4444
public string HttpMethod { get; set; }

0 commit comments

Comments
 (0)