Skip to content

Commit

Permalink
For the OpenTelemetry integration, update the tag generated for the s…
Browse files Browse the repository at this point in the history
…pan_created telemetry metric from `integration_name:opentelemetry` to `integration_name:otel` to align with other tracing libraries
  • Loading branch information
zacharycmontoya committed Dec 20, 2024
1 parent 61bdaf9 commit cb0a799
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down Expand Up @@ -498,7 +498,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down Expand Up @@ -498,7 +498,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down Expand Up @@ -498,7 +498,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down Expand Up @@ -498,7 +498,7 @@ private static AggregatedMetric[] GetCountBuffer()
new(new[] { "integration_name:process" }),
new(new[] { "integration_name:hashalgorithm" }),
new(new[] { "integration_name:symmetricalgorithm" }),
new(new[] { "integration_name:opentelemetry" }),
new(new[] { "integration_name:otel" }),
new(new[] { "integration_name:pathtraversal" }),
new(new[] { "integration_name:ssrf" }),
new(new[] { "integration_name:ldap" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private static AggregatedMetric[] GetCountSharedBuffer()
new(new[] { "integration_name:symmetricalgorithm", "error_type:duck_typing" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:invoker" }),
new(new[] { "integration_name:symmetricalgorithm", "error_type:execution" }),
new(new[] { "integration_name:opentelemetry", "error_type:duck_typing" }),
new(new[] { "integration_name:opentelemetry", "error_type:invoker" }),
new(new[] { "integration_name:opentelemetry", "error_type:execution" }),
new(new[] { "integration_name:otel", "error_type:duck_typing" }),
new(new[] { "integration_name:otel", "error_type:invoker" }),
new(new[] { "integration_name:otel", "error_type:execution" }),
new(new[] { "integration_name:pathtraversal", "error_type:duck_typing" }),
new(new[] { "integration_name:pathtraversal", "error_type:invoker" }),
new(new[] { "integration_name:pathtraversal", "error_type:execution" }),
Expand Down
2 changes: 1 addition & 1 deletion tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ internal enum IntegrationName
[Description("integration_name:process")]Process,
[Description("integration_name:hashalgorithm")]HashAlgorithm,
[Description("integration_name:symmetricalgorithm")]SymmetricAlgorithm,
[Description("integration_name:opentelemetry")]OpenTelemetry,
[Description("integration_name:otel")]OpenTelemetry, // Note: The naming of this tag value breaks the convention of using the integration name to use a standardized value
[Description("integration_name:pathtraversal")]PathTraversal,
[Description("integration_name:ssrf")]Ssrf,
[Description("integration_name:ldap")]Ldap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,25 @@ _ when data.TryGetPayload<GenerateMetricsPayload>(TelemetryRequestTypes.Generate
}
}

var integrationName = integrationId.ToString();
var integrationNameTagValue = integrationName switch
{
"OpenTelemetry" => "otel",
_ => integrationName.ToLowerInvariant(),
};

if (enabled)
{
spansCreatedByIntegration.Should().NotBeEmpty();

var spansCreated = spansCreatedByIntegration.Should().ContainKey($"integration_name:{integrationId.ToString().ToLower()}").WhoseValue;
var spansCreated = spansCreatedByIntegration.Should().ContainKey($"integration_name:{integrationNameTagValue}").WhoseValue;
spansCreated.Points.Should().NotBeEmpty();
spansCreated.Points.Sum(p => p.Value).Should().BeGreaterThanOrEqualTo(1);
}

latestIntegrations.Should().NotBeEmpty();

var integration = latestIntegrations.Should().ContainKey(integrationId.ToString()).WhoseValue;
var integration = latestIntegrations.Should().ContainKey(integrationName).WhoseValue;

integration.Enabled.Should().Be(enabled, $"{integration.Name} should only be enabled if we generate a span");
if (autoEnabled.HasValue)
Expand Down

0 comments on commit cb0a799

Please sign in to comment.