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
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ public async Task IntegrationDisabled(string packageVersion)

#if NET6_0_OR_GREATER
[SkippableTheory]
[Flaky("New test agent seems to not always be ready", maxRetries: 3)]
[Trait("Category", "EndToEnd")]
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
Expand Down Expand Up @@ -259,7 +258,7 @@ public async Task SubmitsOtlpMetrics(string packageVersion, string datadogMetric
metricsResponse.EnsureSuccessStatusCode();

var metricsJson = await metricsResponse.Content.ReadAsStringAsync();
var metricsData = JToken.Parse(metricsJson);
var metricsData = JToken.Parse(metricsJson).Last;

metricsData.Should().NotBeNullOrEmpty();

Expand Down Expand Up @@ -302,7 +301,6 @@ await Verifier.Verify(formattedJson, settings)

#if NETCOREAPP3_1_OR_GREATER
[SkippableTheory]
[Flaky("New test agent seems to not always be ready", maxRetries: 3)]
[Trait("Category", "EndToEnd")]
[Trait("RequiresDockerDependency", "true")]
[Trait("DockerGroup", "1")]
Expand Down Expand Up @@ -335,7 +333,7 @@ public async Task SubmitsOtlpLogs(string packageVersion, string datadogLogsEnabl
SetEnvironmentVariable("OTEL_LOGS_EXPORTER_ENABLED", otelLogsEnabled);
SetEnvironmentVariable("OTEL_EXPORTER_OTLP_PROTOCOL", protocol);
SetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT", $"http://{testAgentHost}:{otlpPort}");
SetEnvironmentVariable("OTEL_LOG_EXPORT_INTERVAL", "1000");
SetEnvironmentVariable("OTEL_BLRP_SCHEDULE_DELAY", "1000");
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the default value, so I'm not sure this will change anything 🤔

SetEnvironmentVariable("DD_LOGS_DIRECT_SUBMISSION_MINIMUM_LEVEL", "Verbose");

var startTimeNanoseconds = DateTimeOffset.UtcNow.ToUnixTimeNanoseconds();
Expand All @@ -350,7 +348,7 @@ public async Task SubmitsOtlpLogs(string packageVersion, string datadogLogsEnabl
logsResponse.EnsureSuccessStatusCode();

var logsJson = await logsResponse.Content.ReadAsStringAsync();
var logsData = JToken.Parse(logsJson);
var logsData = JToken.Parse(logsJson).Last;

logsData.Should().NotBeNullOrEmpty();
logsData.SelectTokens("$..log_records[*]").Should().AllSatisfy(logRecord =>
Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

For reviewers: the only change in all these snapshots is the removal of the enclosing []:

image

Original file line number Diff line number Diff line change
@@ -1,148 +1,146 @@
[
{
"resource_logs": [
{
"resource": {
"attributes": [
{
"resource_logs": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"string_value": "OtlpLogsService"
}
},
{
"key": "deployment.environment",
"value": {
"string_value": "testing"
}
},
{
"key": "telemetry.sdk.name",
"value": {
"string_value": "sdk-name"
}
},
{
"key": "telemetry.sdk.language",
"value": {
"string_value": "dotnet"
}
},
{
"key": "telemetry.sdk.version",
"value": {
"string_value": "sdk-version"
}
}
]
},
"scope_logs": [
{
"scope": {
"name": "LogServiceName"
},
"log_records": [
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_INFO",
"severity_text": "Information",
"body": {
"string_value": "Hello from OpenTelemetry logger within span context"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"key": "service.name",
"value": {
"string_value": "OtlpLogsService"
}
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_TRACE",
"severity_text": "Trace",
"body": {
"string_value": "This is a trace message within span context"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"key": "deployment.environment",
"value": {
"string_value": "testing"
}
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_WARN",
"severity_text": "Warning",
"body": {
"string_value": "This is a warning message"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"key": "telemetry.sdk.name",
"value": {
"string_value": "sdk-name"
}
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_ERROR",
"severity_text": "Error",
"body": {
"string_value": "This is an error message"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"key": "telemetry.sdk.language",
"value": {
"string_value": "dotnet"
}
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_INFO",
"severity_text": "Information",
"body": {
"string_value": "Hello from OpenTelemetry logger outside span context"
},
"observed_time_unix_nano": "0"
},
{
"key": "telemetry.sdk.version",
"value": {
"string_value": "sdk-version"
}
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_FATAL",
"severity_text": "Critical",
"body": {
"string_value": "This is a critical message"
},
"observed_time_unix_nano": "0"
}
]
},
"scope_logs": [
{
"scope": {
"name": "LogServiceName"
},
"log_records": [
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_INFO",
"severity_text": "Information",
"body": {
"string_value": "Hello from OpenTelemetry logger within span context"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_TRACE",
"severity_text": "Trace",
"body": {
"string_value": "This is a trace message within span context"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_WARN",
"severity_text": "Warning",
"body": {
"string_value": "This is a warning message"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_ERROR",
"severity_text": "Error",
"body": {
"string_value": "This is an error message"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_INFO",
"severity_text": "Information",
"body": {
"string_value": "Hello from OpenTelemetry logger outside span context"
},
"observed_time_unix_nano": "0"
},
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_FATAL",
"severity_text": "Critical",
"body": {
"string_value": "This is a critical message"
},
"observed_time_unix_nano": "0"
}
]
{
"scope": {
"name": "OtherLibrary"
},
{
"scope": {
"name": "OtherLibrary"
"log_records": [
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_INFO",
"severity_text": "Information",
"body": {
"string_value": "Response from other library"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
},
"log_records": [
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_INFO",
"severity_text": "Information",
"body": {
"string_value": "Response from other library"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_DEBUG",
"severity_text": "Debug",
"body": {
"string_value": "Debug information from other library"
},
{
"time_unix_nano": "0",
"severity_number": "SEVERITY_NUMBER_DEBUG",
"severity_text": "Debug",
"body": {
"string_value": "Debug information from other library"
},
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
}
]
}
]
}
]
}
]
"flags": 1,
"trace_id": "normalized-trace-id",
"span_id": "normalized-span-id",
"observed_time_unix_nano": "0"
}
]
}
]
}
]
}
Loading
Loading