Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,11 @@ partial class ")

sb.Append(
@"
#if NETCOREAPP
private static ReadOnlySpan<byte> ")
.Append(property.PropertyName)
.Append(@"Bytes => new byte[] { ")
.Append(@"Bytes => [")
.Append(tagByteArray)
.Append(@" };")
.Append(
@"
#else
private static readonly byte[] ")
.Append(property.PropertyName)
.Append(@"Bytes = new byte[] { ")
.Append(tagByteArray)
.Append(@" };")
.Append(
@"
#endif");
.AppendLine(@"];");
}
}

Expand All @@ -125,28 +113,15 @@ partial class ")

sb.Append(
@"
#if NETCOREAPP
private static ReadOnlySpan<byte> ")
.Append(property.PropertyName)
.Append(@"Bytes => new byte[] { ")
.Append(tagByteArray)
.Append(@" };")
.Append(
@"
#else
private static readonly byte[] ")
.Append(property.PropertyName)
.Append(@"Bytes = new byte[] { ")
.Append(@"Bytes => [")
.Append(tagByteArray)
.Append(@" };")
.Append(
@"
#endif");
.AppendLine(@"];");
}

sb.Append(
@"

public override string? GetTag(string key)
{
return key switch
Expand Down Expand Up @@ -283,11 +258,6 @@ protected override void WriteAdditionalTags(System.Text.StringBuilder sb)

if (tagList.MetricProperties.HasValues())
{
if (tagList.TagProperties.IsDefaultOrEmpty)
{
sb.AppendLine();
}

sb.Append(
@"
public override double? GetMetric(string key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,22 @@ namespace Datadog.Trace.Tagging
partial class AerospikeTags
{
// SpanKindBytes = MessagePack.Serialize("span.kind");
#if NETCOREAPP
private static ReadOnlySpan<byte> SpanKindBytes => new byte[] { 169, 115, 112, 97, 110, 46, 107, 105, 110, 100 };
#else
private static readonly byte[] SpanKindBytes = new byte[] { 169, 115, 112, 97, 110, 46, 107, 105, 110, 100 };
#endif
private static ReadOnlySpan<byte> SpanKindBytes => [169, 115, 112, 97, 110, 46, 107, 105, 110, 100];

// InstrumentationNameBytes = MessagePack.Serialize("component");
#if NETCOREAPP
private static ReadOnlySpan<byte> InstrumentationNameBytes => new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#else
private static readonly byte[] InstrumentationNameBytes = new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#endif
private static ReadOnlySpan<byte> InstrumentationNameBytes => [169, 99, 111, 109, 112, 111, 110, 101, 110, 116];

// KeyBytes = MessagePack.Serialize("aerospike.key");
#if NETCOREAPP
private static ReadOnlySpan<byte> KeyBytes => new byte[] { 173, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 107, 101, 121 };
#else
private static readonly byte[] KeyBytes = new byte[] { 173, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 107, 101, 121 };
#endif
private static ReadOnlySpan<byte> KeyBytes => [173, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 107, 101, 121];

// NamespaceBytes = MessagePack.Serialize("aerospike.namespace");
#if NETCOREAPP
private static ReadOnlySpan<byte> NamespaceBytes => new byte[] { 179, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 110, 97, 109, 101, 115, 112, 97, 99, 101 };
#else
private static readonly byte[] NamespaceBytes = new byte[] { 179, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 110, 97, 109, 101, 115, 112, 97, 99, 101 };
#endif
private static ReadOnlySpan<byte> NamespaceBytes => [179, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 110, 97, 109, 101, 115, 112, 97, 99, 101];

// SetNameBytes = MessagePack.Serialize("aerospike.setname");
#if NETCOREAPP
private static ReadOnlySpan<byte> SetNameBytes => new byte[] { 177, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 115, 101, 116, 110, 97, 109, 101 };
#else
private static readonly byte[] SetNameBytes = new byte[] { 177, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 115, 101, 116, 110, 97, 109, 101 };
#endif
private static ReadOnlySpan<byte> SetNameBytes => [177, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 115, 101, 116, 110, 97, 109, 101];

// UserKeyBytes = MessagePack.Serialize("aerospike.userkey");
#if NETCOREAPP
private static ReadOnlySpan<byte> UserKeyBytes => new byte[] { 177, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 117, 115, 101, 114, 107, 101, 121 };
#else
private static readonly byte[] UserKeyBytes = new byte[] { 177, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 117, 115, 101, 114, 107, 101, 121 };
#endif
private static ReadOnlySpan<byte> UserKeyBytes => [177, 97, 101, 114, 111, 115, 112, 105, 107, 101, 46, 117, 115, 101, 114, 107, 101, 121];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@ namespace Datadog.Trace.Tagging
partial class AerospikeV1Tags
{
// PeerServiceBytes = MessagePack.Serialize("peer.service");
#if NETCOREAPP
private static ReadOnlySpan<byte> PeerServiceBytes => new byte[] { 172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101 };
#else
private static readonly byte[] PeerServiceBytes = new byte[] { 172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101 };
#endif
private static ReadOnlySpan<byte> PeerServiceBytes => [172, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101];

// PeerServiceSourceBytes = MessagePack.Serialize("_dd.peer.service.source");
#if NETCOREAPP
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 };
#else
private static readonly 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 };
#endif
private static ReadOnlySpan<byte> PeerServiceSourceBytes => [183, 95, 100, 100, 46, 112, 101, 101, 114, 46, 115, 101, 114, 118, 105, 99, 101, 46, 115, 111, 117, 114, 99, 101];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ namespace Datadog.Trace.Tagging
partial class AspNetCoreEndpointTags
{
// AspNetCoreEndpointBytes = MessagePack.Serialize("aspnet_core.endpoint");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreEndpointBytes => new byte[] { 180, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 101, 110, 100, 112, 111, 105, 110, 116 };
#else
private static readonly byte[] AspNetCoreEndpointBytes = new byte[] { 180, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 101, 110, 100, 112, 111, 105, 110, 116 };
#endif
private static ReadOnlySpan<byte> AspNetCoreEndpointBytes => [180, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 101, 110, 100, 112, 111, 105, 110, 116];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,25 @@ namespace Datadog.Trace.Tagging
partial class AspNetCoreMvcTags
{
// SpanKindBytes = MessagePack.Serialize("span.kind");
#if NETCOREAPP
private static ReadOnlySpan<byte> SpanKindBytes => new byte[] { 169, 115, 112, 97, 110, 46, 107, 105, 110, 100 };
#else
private static readonly byte[] SpanKindBytes = new byte[] { 169, 115, 112, 97, 110, 46, 107, 105, 110, 100 };
#endif
private static ReadOnlySpan<byte> SpanKindBytes => [169, 115, 112, 97, 110, 46, 107, 105, 110, 100];

// InstrumentationNameBytes = MessagePack.Serialize("component");
#if NETCOREAPP
private static ReadOnlySpan<byte> InstrumentationNameBytes => new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#else
private static readonly byte[] InstrumentationNameBytes = new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#endif
private static ReadOnlySpan<byte> InstrumentationNameBytes => [169, 99, 111, 109, 112, 111, 110, 101, 110, 116];

// AspNetCoreControllerBytes = MessagePack.Serialize("aspnet_core.controller");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreControllerBytes => new byte[] { 182, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114 };
#else
private static readonly byte[] AspNetCoreControllerBytes = new byte[] { 182, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114 };
#endif
private static ReadOnlySpan<byte> AspNetCoreControllerBytes => [182, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114];

// AspNetCoreActionBytes = MessagePack.Serialize("aspnet_core.action");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreActionBytes => new byte[] { 178, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 97, 99, 116, 105, 111, 110 };
#else
private static readonly byte[] AspNetCoreActionBytes = new byte[] { 178, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 97, 99, 116, 105, 111, 110 };
#endif
private static ReadOnlySpan<byte> AspNetCoreActionBytes => [178, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 97, 99, 116, 105, 111, 110];

// AspNetCoreAreaBytes = MessagePack.Serialize("aspnet_core.area");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreAreaBytes => new byte[] { 176, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 97, 114, 101, 97 };
#else
private static readonly byte[] AspNetCoreAreaBytes = new byte[] { 176, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 97, 114, 101, 97 };
#endif
private static ReadOnlySpan<byte> AspNetCoreAreaBytes => [176, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 97, 114, 101, 97];

// AspNetCorePageBytes = MessagePack.Serialize("aspnet_core.page");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCorePageBytes => new byte[] { 176, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 112, 97, 103, 101 };
#else
private static readonly byte[] AspNetCorePageBytes = new byte[] { 176, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 112, 97, 103, 101 };
#endif
private static ReadOnlySpan<byte> AspNetCorePageBytes => [176, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 112, 97, 103, 101];

// AspNetCoreRouteBytes = MessagePack.Serialize("aspnet_core.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreRouteBytes => new byte[] { 177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] AspNetCoreRouteBytes = new byte[] { 177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> AspNetCoreRouteBytes => [177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,16 @@ namespace Datadog.Trace.Tagging
partial class AspNetCoreSingleSpanTags
{
// InstrumentationNameBytes = MessagePack.Serialize("component");
#if NETCOREAPP
private static ReadOnlySpan<byte> InstrumentationNameBytes => new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#else
private static readonly byte[] InstrumentationNameBytes = new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#endif
private static ReadOnlySpan<byte> InstrumentationNameBytes => [169, 99, 111, 109, 112, 111, 110, 101, 110, 116];

// AspNetCoreRouteBytes = MessagePack.Serialize("aspnet_core.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreRouteBytes => new byte[] { 177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] AspNetCoreRouteBytes = new byte[] { 177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> AspNetCoreRouteBytes => [177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101];

// AspNetCoreEndpointBytes = MessagePack.Serialize("aspnet_core.endpoint");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreEndpointBytes => new byte[] { 180, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 101, 110, 100, 112, 111, 105, 110, 116 };
#else
private static readonly byte[] AspNetCoreEndpointBytes = new byte[] { 180, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 101, 110, 100, 112, 111, 105, 110, 116 };
#endif
private static ReadOnlySpan<byte> AspNetCoreEndpointBytes => [180, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 101, 110, 100, 112, 111, 105, 110, 116];

// HttpRouteBytes = MessagePack.Serialize("http.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> HttpRouteBytes => new byte[] { 170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] HttpRouteBytes = new byte[] { 170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> HttpRouteBytes => [170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,13 @@ namespace Datadog.Trace.Tagging
partial class AspNetCoreTags
{
// InstrumentationNameBytes = MessagePack.Serialize("component");
#if NETCOREAPP
private static ReadOnlySpan<byte> InstrumentationNameBytes => new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#else
private static readonly byte[] InstrumentationNameBytes = new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#endif
private static ReadOnlySpan<byte> InstrumentationNameBytes => [169, 99, 111, 109, 112, 111, 110, 101, 110, 116];

// AspNetCoreRouteBytes = MessagePack.Serialize("aspnet_core.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetCoreRouteBytes => new byte[] { 177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] AspNetCoreRouteBytes = new byte[] { 177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> AspNetCoreRouteBytes => [177, 97, 115, 112, 110, 101, 116, 95, 99, 111, 114, 101, 46, 114, 111, 117, 116, 101];

// HttpRouteBytes = MessagePack.Serialize("http.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> HttpRouteBytes => new byte[] { 170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] HttpRouteBytes = new byte[] { 170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> HttpRouteBytes => [170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,22 @@ namespace Datadog.Trace.Tagging
partial class AspNetTags
{
// AspNetRouteBytes = MessagePack.Serialize("aspnet.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetRouteBytes => new byte[] { 172, 97, 115, 112, 110, 101, 116, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] AspNetRouteBytes = new byte[] { 172, 97, 115, 112, 110, 101, 116, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> AspNetRouteBytes => [172, 97, 115, 112, 110, 101, 116, 46, 114, 111, 117, 116, 101];

// AspNetControllerBytes = MessagePack.Serialize("aspnet.controller");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetControllerBytes => new byte[] { 177, 97, 115, 112, 110, 101, 116, 46, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114 };
#else
private static readonly byte[] AspNetControllerBytes = new byte[] { 177, 97, 115, 112, 110, 101, 116, 46, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114 };
#endif
private static ReadOnlySpan<byte> AspNetControllerBytes => [177, 97, 115, 112, 110, 101, 116, 46, 99, 111, 110, 116, 114, 111, 108, 108, 101, 114];

// AspNetActionBytes = MessagePack.Serialize("aspnet.action");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetActionBytes => new byte[] { 173, 97, 115, 112, 110, 101, 116, 46, 97, 99, 116, 105, 111, 110 };
#else
private static readonly byte[] AspNetActionBytes = new byte[] { 173, 97, 115, 112, 110, 101, 116, 46, 97, 99, 116, 105, 111, 110 };
#endif
private static ReadOnlySpan<byte> AspNetActionBytes => [173, 97, 115, 112, 110, 101, 116, 46, 97, 99, 116, 105, 111, 110];

// AspNetAreaBytes = MessagePack.Serialize("aspnet.area");
#if NETCOREAPP
private static ReadOnlySpan<byte> AspNetAreaBytes => new byte[] { 171, 97, 115, 112, 110, 101, 116, 46, 97, 114, 101, 97 };
#else
private static readonly byte[] AspNetAreaBytes = new byte[] { 171, 97, 115, 112, 110, 101, 116, 46, 97, 114, 101, 97 };
#endif
private static ReadOnlySpan<byte> AspNetAreaBytes => [171, 97, 115, 112, 110, 101, 116, 46, 97, 114, 101, 97];

// HttpRouteBytes = MessagePack.Serialize("http.route");
#if NETCOREAPP
private static ReadOnlySpan<byte> HttpRouteBytes => new byte[] { 170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101 };
#else
private static readonly byte[] HttpRouteBytes = new byte[] { 170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101 };
#endif
private static ReadOnlySpan<byte> HttpRouteBytes => [170, 104, 116, 116, 112, 46, 114, 111, 117, 116, 101];

// InstrumentationNameBytes = MessagePack.Serialize("component");
#if NETCOREAPP
private static ReadOnlySpan<byte> InstrumentationNameBytes => new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#else
private static readonly byte[] InstrumentationNameBytes = new byte[] { 169, 99, 111, 109, 112, 111, 110, 101, 110, 116 };
#endif
private static ReadOnlySpan<byte> InstrumentationNameBytes => [169, 99, 111, 109, 112, 111, 110, 101, 110, 116];

public override string? GetTag(string key)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,10 @@ namespace Datadog.Trace.Tagging
partial class AwsDynamoDbTags
{
// TableNameBytes = MessagePack.Serialize("tablename");
#if NETCOREAPP
private static ReadOnlySpan<byte> TableNameBytes => new byte[] { 169, 116, 97, 98, 108, 101, 110, 97, 109, 101 };
#else
private static readonly byte[] TableNameBytes = new byte[] { 169, 116, 97, 98, 108, 101, 110, 97, 109, 101 };
#endif
private static ReadOnlySpan<byte> TableNameBytes => [169, 116, 97, 98, 108, 101, 110, 97, 109, 101];

// SpanKindBytes = MessagePack.Serialize("span.kind");
#if NETCOREAPP
private static ReadOnlySpan<byte> SpanKindBytes => new byte[] { 169, 115, 112, 97, 110, 46, 107, 105, 110, 100 };
#else
private static readonly byte[] SpanKindBytes = new byte[] { 169, 115, 112, 97, 110, 46, 107, 105, 110, 100 };
#endif
private static ReadOnlySpan<byte> SpanKindBytes => [169, 115, 112, 97, 110, 46, 107, 105, 110, 100];

public override string? GetTag(string key)
{
Expand Down
Loading
Loading