Skip to content

Commit 737c29c

Browse files
Removed V1 tags from AWS integrations
1 parent 3dd9e0b commit 737c29c

File tree

14 files changed

+157
-385
lines changed

14 files changed

+157
-385
lines changed

tracer/src/Datadog.Trace/Configuration/Schema/DatabaseSchema.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ public AerospikeTags CreateAerospikeTags()
9595
_ => new AerospikeV1Tags(),
9696
};
9797

98-
public AwsDynamoDbTags CreateAwsDynamoDbTags() => _version switch
99-
{
100-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsDynamoDbTags(),
101-
_ => new AwsDynamoDbV1Tags(),
102-
};
98+
public AwsDynamoDbTags CreateAwsDynamoDbTags() => new AwsDynamoDbTags();
10399
}
104100
}

tracer/src/Datadog.Trace/Configuration/Schema/MessagingSchema.cs

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -78,41 +78,17 @@ public MsmqTags CreateMsmqTags(string spanKind)
7878
_ => new MsmqV1Tags(spanKind),
7979
};
8080

81-
public AwsS3Tags CreateAwsS3Tags(string spanKind) => _version switch
82-
{
83-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsS3Tags(),
84-
_ => new AwsS3V1Tags(spanKind),
85-
};
81+
public AwsS3Tags CreateAwsS3Tags(string spanKind) => new AwsS3Tags();
8682

87-
public AwsSqsTags CreateAwsSqsTags(string spanKind) => _version switch
88-
{
89-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsSqsTags(),
90-
_ => new AwsSqsV1Tags(spanKind),
91-
};
83+
public AwsSqsTags CreateAwsSqsTags(string spanKind) => new AwsSqsTags();
9284

93-
public AwsSnsTags CreateAwsSnsTags(string spanKind) => _version switch
94-
{
95-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsSnsTags(),
96-
_ => new AwsSnsV1Tags(spanKind),
97-
};
85+
public AwsSnsTags CreateAwsSnsTags(string spanKind) => new AwsSnsTags();
9886

99-
public AwsEventBridgeTags CreateAwsEventBridgeTags(string spanKind) => _version switch
100-
{
101-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsEventBridgeTags(),
102-
_ => new AwsEventBridgeV1Tags(spanKind),
103-
};
87+
public AwsEventBridgeTags CreateAwsEventBridgeTags(string spanKind) => new AwsEventBridgeTags();
10488

105-
public AwsKinesisTags CreateAwsKinesisTags(string spanKind) => _version switch
106-
{
107-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsKinesisTags(spanKind),
108-
_ => new AwsKinesisV1Tags(spanKind),
109-
};
89+
public AwsKinesisTags CreateAwsKinesisTags(string spanKind) => new AwsKinesisTags(spanKind);
11090

111-
public AwsStepFunctionsTags CreateAwsStepFunctionsTags(string spanKind) => _version switch
112-
{
113-
SchemaVersion.V0 when !_peerServiceTagsEnabled => new AwsStepFunctionsTags(spanKind),
114-
_ => new AwsStepFunctionsV1Tags(spanKind)
115-
};
91+
public AwsStepFunctionsTags CreateAwsStepFunctionsTags(string spanKind) => new AwsStepFunctionsTags(spanKind);
11692

11793
public RabbitMQTags CreateRabbitMqTags(string spanKind)
11894
=> _version switch

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ 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 };
35+
// PeerServiceSourceBytes = MessagePack.Serialize("_dd.peer.service.source");
36+
private static ReadOnlySpan<byte> PeerServiceSourceBytes => new byte[] { 183, 95, 100, 100, 46, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101, 46, 115, 111, 117, 114, 99, 101 };
3337
// HttpMethodBytes = MessagePack.Serialize("http.method");
3438
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3539
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +53,8 @@ partial class AwsSdkTags
4953
"aws.requestId" => RequestId,
5054
"aws.service" => AwsService,
5155
"aws_service" => Service,
56+
"peer.service" => PeerService,
57+
"_dd.peer.service.source" => PeerServiceSource,
5258
"http.method" => HttpMethod,
5359
"http.url" => HttpUrl,
5460
"http.status_code" => HttpStatusCode,
@@ -72,6 +78,12 @@ public override void SetTag(string key, string value)
7278
case "aws_service":
7379
Service = value;
7480
break;
81+
case "peer.service":
82+
PeerService = value;
83+
break;
84+
case "_dd.peer.service.source":
85+
PeerServiceSource = value;
86+
break;
7587
case "http.method":
7688
HttpMethod = value;
7789
break;
@@ -135,6 +147,16 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135147
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136148
}
137149

150+
if (PeerService is not null)
151+
{
152+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
153+
}
154+
155+
if (PeerServiceSource is not null)
156+
{
157+
processor.Process(new TagItem<string>("_dd.peer.service.source", PeerServiceSource, PeerServiceSourceBytes));
158+
}
159+
138160
if (HttpMethod is not null)
139161
{
140162
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +233,20 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211233
.Append(',');
212234
}
213235

236+
if (PeerService is not null)
237+
{
238+
sb.Append("peer.service (tag):")
239+
.Append(PeerService)
240+
.Append(',');
241+
}
242+
243+
if (PeerServiceSource is not null)
244+
{
245+
sb.Append("_dd.peer.service.source (tag):")
246+
.Append(PeerServiceSource)
247+
.Append(',');
248+
}
249+
214250
if (HttpMethod is not null)
215251
{
216252
sb.Append("http.method (tag):")

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ 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 };
35+
// PeerServiceSourceBytes = MessagePack.Serialize("_dd.peer.service.source");
36+
private static ReadOnlySpan<byte> PeerServiceSourceBytes => new byte[] { 183, 95, 100, 100, 46, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101, 46, 115, 111, 117, 114, 99, 101 };
3337
// HttpMethodBytes = MessagePack.Serialize("http.method");
3438
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3539
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +53,8 @@ partial class AwsSdkTags
4953
"aws.requestId" => RequestId,
5054
"aws.service" => AwsService,
5155
"aws_service" => Service,
56+
"peer.service" => PeerService,
57+
"_dd.peer.service.source" => PeerServiceSource,
5258
"http.method" => HttpMethod,
5359
"http.url" => HttpUrl,
5460
"http.status_code" => HttpStatusCode,
@@ -72,6 +78,12 @@ public override void SetTag(string key, string value)
7278
case "aws_service":
7379
Service = value;
7480
break;
81+
case "peer.service":
82+
PeerService = value;
83+
break;
84+
case "_dd.peer.service.source":
85+
PeerServiceSource = value;
86+
break;
7587
case "http.method":
7688
HttpMethod = value;
7789
break;
@@ -135,6 +147,16 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135147
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136148
}
137149

150+
if (PeerService is not null)
151+
{
152+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
153+
}
154+
155+
if (PeerServiceSource is not null)
156+
{
157+
processor.Process(new TagItem<string>("_dd.peer.service.source", PeerServiceSource, PeerServiceSourceBytes));
158+
}
159+
138160
if (HttpMethod is not null)
139161
{
140162
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +233,20 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211233
.Append(',');
212234
}
213235

236+
if (PeerService is not null)
237+
{
238+
sb.Append("peer.service (tag):")
239+
.Append(PeerService)
240+
.Append(',');
241+
}
242+
243+
if (PeerServiceSource is not null)
244+
{
245+
sb.Append("_dd.peer.service.source (tag):")
246+
.Append(PeerServiceSource)
247+
.Append(',');
248+
}
249+
214250
if (HttpMethod is not null)
215251
{
216252
sb.Append("http.method (tag):")

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ 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 };
35+
// PeerServiceSourceBytes = MessagePack.Serialize("_dd.peer.service.source");
36+
private static ReadOnlySpan<byte> PeerServiceSourceBytes => new byte[] { 183, 95, 100, 100, 46, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101, 46, 115, 111, 117, 114, 99, 101 };
3337
// HttpMethodBytes = MessagePack.Serialize("http.method");
3438
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3539
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +53,8 @@ partial class AwsSdkTags
4953
"aws.requestId" => RequestId,
5054
"aws.service" => AwsService,
5155
"aws_service" => Service,
56+
"peer.service" => PeerService,
57+
"_dd.peer.service.source" => PeerServiceSource,
5258
"http.method" => HttpMethod,
5359
"http.url" => HttpUrl,
5460
"http.status_code" => HttpStatusCode,
@@ -72,6 +78,12 @@ public override void SetTag(string key, string value)
7278
case "aws_service":
7379
Service = value;
7480
break;
81+
case "peer.service":
82+
PeerService = value;
83+
break;
84+
case "_dd.peer.service.source":
85+
PeerServiceSource = value;
86+
break;
7587
case "http.method":
7688
HttpMethod = value;
7789
break;
@@ -135,6 +147,16 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135147
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136148
}
137149

150+
if (PeerService is not null)
151+
{
152+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
153+
}
154+
155+
if (PeerServiceSource is not null)
156+
{
157+
processor.Process(new TagItem<string>("_dd.peer.service.source", PeerServiceSource, PeerServiceSourceBytes));
158+
}
159+
138160
if (HttpMethod is not null)
139161
{
140162
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +233,20 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211233
.Append(',');
212234
}
213235

236+
if (PeerService is not null)
237+
{
238+
sb.Append("peer.service (tag):")
239+
.Append(PeerService)
240+
.Append(',');
241+
}
242+
243+
if (PeerServiceSource is not null)
244+
{
245+
sb.Append("_dd.peer.service.source (tag):")
246+
.Append(PeerServiceSource)
247+
.Append(',');
248+
}
249+
214250
if (HttpMethod is not null)
215251
{
216252
sb.Append("http.method (tag):")

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ 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 };
35+
// PeerServiceSourceBytes = MessagePack.Serialize("_dd.peer.service.source");
36+
private static ReadOnlySpan<byte> PeerServiceSourceBytes => new byte[] { 183, 95, 100, 100, 46, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101, 46, 115, 111, 117, 114, 99, 101 };
3337
// HttpMethodBytes = MessagePack.Serialize("http.method");
3438
private static ReadOnlySpan<byte> HttpMethodBytes => new byte[] { 171, 104, 116, 116, 112, 46, 109, 101, 116, 104, 111, 100 };
3539
// HttpUrlBytes = MessagePack.Serialize("http.url");
@@ -49,6 +53,8 @@ partial class AwsSdkTags
4953
"aws.requestId" => RequestId,
5054
"aws.service" => AwsService,
5155
"aws_service" => Service,
56+
"peer.service" => PeerService,
57+
"_dd.peer.service.source" => PeerServiceSource,
5258
"http.method" => HttpMethod,
5359
"http.url" => HttpUrl,
5460
"http.status_code" => HttpStatusCode,
@@ -72,6 +78,12 @@ public override void SetTag(string key, string value)
7278
case "aws_service":
7379
Service = value;
7480
break;
81+
case "peer.service":
82+
PeerService = value;
83+
break;
84+
case "_dd.peer.service.source":
85+
PeerServiceSource = value;
86+
break;
7587
case "http.method":
7688
HttpMethod = value;
7789
break;
@@ -135,6 +147,16 @@ public override void EnumerateTags<TProcessor>(ref TProcessor processor)
135147
processor.Process(new TagItem<string>("aws_service", Service, ServiceBytes));
136148
}
137149

150+
if (PeerService is not null)
151+
{
152+
processor.Process(new TagItem<string>("peer.service", PeerService, PeerServiceBytes));
153+
}
154+
155+
if (PeerServiceSource is not null)
156+
{
157+
processor.Process(new TagItem<string>("_dd.peer.service.source", PeerServiceSource, PeerServiceSourceBytes));
158+
}
159+
138160
if (HttpMethod is not null)
139161
{
140162
processor.Process(new TagItem<string>("http.method", HttpMethod, HttpMethodBytes));
@@ -211,6 +233,20 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)
211233
.Append(',');
212234
}
213235

236+
if (PeerService is not null)
237+
{
238+
sb.Append("peer.service (tag):")
239+
.Append(PeerService)
240+
.Append(',');
241+
}
242+
243+
if (PeerServiceSource is not null)
244+
{
245+
sb.Append("_dd.peer.service.source (tag):")
246+
.Append(PeerServiceSource)
247+
.Append(',');
248+
}
249+
214250
if (HttpMethod is not null)
215251
{
216252
sb.Append("http.method (tag):")

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

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,4 @@ internal partial class AwsDynamoDbTags : AwsSdkTags
1717
[Tag(Trace.Tags.SpanKind)]
1818
public override string SpanKind => SpanKinds.Client;
1919
}
20-
21-
internal partial class AwsDynamoDbV1Tags : AwsDynamoDbTags
22-
{
23-
private string _peerServiceOverride = null;
24-
25-
// Use a private setter for setting the "peer.service" tag so we avoid
26-
// accidentally setting the value ourselves and instead calculate the
27-
// value from predefined precursor attributes.
28-
// However, this can still be set from ITags.SetTag so the user can
29-
// customize the value if they wish.
30-
[Tag(Trace.Tags.PeerService)]
31-
public string PeerService
32-
{
33-
get => _peerServiceOverride ?? TableName;
34-
private set => _peerServiceOverride = value;
35-
}
36-
37-
[Tag(Trace.Tags.PeerServiceSource)]
38-
public string PeerServiceSource
39-
{
40-
get
41-
{
42-
return _peerServiceOverride is not null
43-
? "peer.service"
44-
: Trace.Tags.TableName;
45-
}
46-
}
47-
}
4820
}

0 commit comments

Comments
 (0)