Skip to content
Open
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
3 changes: 1 addition & 2 deletions Datadog.Trace.OSX.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
"tracer\\test\\test-applications\\integrations\\Samples.AzureServiceBus\\Samples.AzureServiceBus.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.CIVisibilityIpc\\Samples.CIVisibilityIpc.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.Console\\Samples.Console.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.CosmosDb\\Samples.CosmosDb.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.CosmosDb.Vnext\\Samples.CosmosDb.Vnext.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.CosmosDb\\Samples.CosmosDb.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.Couchbase3\\Samples.Couchbase3.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.Couchbase\\Samples.Couchbase.csproj",
"tracer\\test\\test-applications\\integrations\\Samples.Dapper\\Samples.Dapper.csproj",
Expand Down Expand Up @@ -181,7 +181,6 @@
"tracer\\test\\test-applications\\regression\\Sandbox.ManualTracing\\Sandbox.ManualTracing.csproj",
"tracer\\test\\test-applications\\regression\\ServiceBus.Minimal.MassTransit\\ServiceBus.Minimal.MassTransit.csproj",
"tracer\\test\\test-applications\\regression\\ServiceBus.Minimal.Rebus\\ServiceBus.Minimal.Rebus.csproj",
"tracer\\test\\test-applications\\regression\\StackExchange.Redis.AssemblyConflict.LegacyProject\\StackExchange.Redis.AssemblyConflict.LegacyProject.csproj",
"tracer\\test\\test-applications\\regression\\StackExchange.Redis.AssemblyConflict.SdkProject\\StackExchange.Redis.AssemblyConflict.SdkProject.csproj",
"tracer\\test\\test-applications\\regression\\StackExchange.Redis.StackOverflowException\\StackExchange.Redis.StackOverflowException.csproj",
"tracer\\test\\test-applications\\Samples.Shared\\Samples.Shared.shproj",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// <copyright file="OtlpFieldNames.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

#nullable enable

namespace Datadog.Trace.ClrProfiler.IntegrationTests.Helpers
{
/// <summary>
/// The test agent renders an OTLP http/json payload with camelCase field names and an
/// http/protobuf payload with snake_case field names. This maps a protocol to the casing
Comment on lines +11 to +12

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to fix this at source instead? 🤔 It would touch a lot of places, and I don't know which is preferable honestly 😅

EDIT: Oh wait, just realised this isn't our test server, this is https://github.com/DataDog/dd-apm-test-agent. Never mind then!

/// used when walking the rendered JSON.
/// </summary>
internal readonly struct OtlpFieldNames
{
private OtlpFieldNames(bool isJson)
{
IsJson = isJson;
}

public bool IsJson { get; }

public string ResourceSpans => IsJson ? "resourceSpans" : "resource_spans";

public string ScopeSpans => IsJson ? "scopeSpans" : "scope_spans";

public string StringValue => IsJson ? "stringValue" : "string_value";

public string IntValue => IsJson ? "intValue" : "int_value";

public string TraceId => IsJson ? "traceId" : "trace_id";

public string SpanId => IsJson ? "spanId" : "span_id";

public string ParentSpanId => IsJson ? "parentSpanId" : "parent_span_id";

public string StartTimeUnixNano => IsJson ? "startTimeUnixNano" : "start_time_unix_nano";

public string EndTimeUnixNano => IsJson ? "endTimeUnixNano" : "end_time_unix_nano";

public string TimeUnixNano => IsJson ? "timeUnixNano" : "time_unix_nano";

public static OtlpFieldNames For(bool isJson) => new(isJson);
}
}
Loading
Loading