[SVLS-9121] Identify Azure Container Apps OTel Payloads and emit Datadog exporter running metric#51116
[SVLS-9121] Identify Azure Container Apps OTel Payloads and emit Datadog exporter running metric#51116kathiehuang wants to merge 21 commits into
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: dfa6738 | Docs | Datadog PR Page | Give us feedback! |
Files inventory check summaryFile checks results against ancestor 6332ce3d: Results for datadog-agent_7.83.0~devel.git.379.dfa6738.pipeline.126651196-1_amd64.deb:No change detected |
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: 6332ce3 Optimization Goals: ✅ No significant changes detected
|
| perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
|---|---|---|---|---|---|---|
| ➖ | quality_gate_metrics_logs | memory utilization | +1.06 | [+0.81, +1.31] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_logs | % cpu utilization | +0.28 | [-0.71, +1.28] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_idle | memory utilization | +0.25 | [+0.20, +0.30] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_security_mean_fs_load | memory utilization | +0.21 | [+0.18, +0.25] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_idle_all_features | memory utilization | +0.21 | [+0.17, +0.25] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_security_no_fs_load | memory utilization | -0.05 | [-0.15, +0.04] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_security_idle | memory utilization | -0.12 | [-0.17, -0.06] | 1 | Logs bounds checks dashboard |
| ➖ | quality_gate_private_action_runner | memory utilization | -0.43 | [-0.55, -0.30] | 1 | Logs bounds checks dashboard |
Bounds Checks: ✅ Passed
| perf | experiment | bounds_check_name | replicates_passed | observed_value | links |
|---|---|---|---|---|---|
| ✅ | quality_gate_idle | intake_connections | 10/10 | 3 ≤ 4 | bounds checks dashboard |
| ✅ | quality_gate_idle | memory_usage | 10/10 | 149.40MiB ≤ 154MiB | bounds checks dashboard |
| ✅ | quality_gate_idle | total_bytes_received | 10/10 | 736.35KiB ≤ 819.20KiB | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | intake_connections | 10/10 | 3 ≤ 4 | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | memory_usage | 10/10 | 500.12MiB ≤ 512MiB | bounds checks dashboard |
| ✅ | quality_gate_idle_all_features | total_bytes_received | 10/10 | 1.13MiB ≤ 1.25MiB | bounds checks dashboard |
| ✅ | quality_gate_logs | intake_connections | 10/10 | 4 ≤ 6 | bounds checks dashboard |
| ✅ | quality_gate_logs | memory_usage | 10/10 | 187.26MiB ≤ 195MiB | bounds checks dashboard |
| ✅ | quality_gate_logs | missed_bytes | 10/10 | 0B = 0B | bounds checks dashboard |
| ✅ | quality_gate_logs | total_bytes_received | 10/10 | 264.15MiB ≤ 292MiB | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | cpu_usage | 10/10 | 360.29 ≤ 2000 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | intake_connections | 10/10 | 3 ≤ 6 | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | memory_usage | 10/10 | 392.49MiB ≤ 430MiB | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | missed_bytes | 10/10 | 0B = 0B | bounds checks dashboard |
| ✅ | quality_gate_metrics_logs | total_bytes_received | 10/10 | 0.93GiB ≤ 1.04GiB | bounds checks dashboard |
| ✅ | quality_gate_private_action_runner | memory_usage | 10/10 | 71.12MiB ≤ 75MiB | bounds checks dashboard |
| ✅ | quality_gate_security_idle | cpu_usage | 10/10 | 30.88 ≤ 100 | bounds checks dashboard |
| ✅ | quality_gate_security_idle | memory_usage | 10/10 | 301.13MiB ≤ 330MiB | bounds checks dashboard |
| ✅ | quality_gate_security_mean_fs_load | cpu_usage | 10/10 | 65.93 ≤ 200 | bounds checks dashboard |
| ✅ | quality_gate_security_mean_fs_load | memory_usage | 10/10 | 278.88MiB ≤ 310MiB | bounds checks dashboard |
| ✅ | quality_gate_security_no_fs_load | cpu_usage | 10/10 | 21.93 ≤ 100 | bounds checks dashboard |
| ✅ | quality_gate_security_no_fs_load | memory_usage | 10/10 | 284.11MiB ≤ 320MiB | bounds checks dashboard |
Explanation
Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%
Performance changes are noted in the perf column of each table:
- ✅ = significantly better comparison variant performance
- ❌ = significantly worse comparison variant performance
- ➖ = no significant change in performance
A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".
For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.
-
Its configuration does not mark it "erratic".
Replicate Execution Details
We run multiple replicates for each experiment/variant. However, we allow replicates to be automatically retried if there are any failures, up to 8 times, at which point the replicate is marked dead and we are unable to run analysis for the entire experiment. We call each of these attempts at running replicates a replicate execution. This section lists all replicate executions that failed due to the target crashing or being oom killed.
Note: In the below tables we bucket failures by experiment, variant, and failure type. For each of these buckets we list out the replicate indexes that failed with an annotation signifying how many times said replicate failed with the given failure mode. In the below example the baseline variant of the experiment named experiment_with_failures had two replicates that failed by oom kills. Replicate 0, which failed 8 executions, and replicate 1 which failed 6 executions, all with the same failure mode.
| Experiment | Variant | Replicates | Failure | Logs | Debug Dashboard |
|---|---|---|---|---|---|
| experiment_with_failures | baseline | 0 (x8) 1 (x6) | Oom killed | Debug Dashboard |
The debug dashboard links will take you to a debugging dashboard specifically designed to investigate replicate execution failures.
❌ Retried Profiling Replicate Execution Failures (ddprof)
Note: Profiling replicas may still be executing. See the debug dashboard for up to date status.
| Experiment | Variant | Replicates | Failure | Debug Dashboard |
|---|---|---|---|---|
| quality_gate_idle_all_features | baseline | 10 | Oom killed | Debug Dashboard |
| quality_gate_idle_all_features | comparison | 10 | Oom killed | Debug Dashboard |
| quality_gate_logs | baseline | 10 | Oom killed | Debug Dashboard |
| quality_gate_logs | comparison | 10 | Oom killed | Debug Dashboard |
| quality_gate_metrics_logs | baseline | 10 | Oom killed | Debug Dashboard |
| quality_gate_metrics_logs | comparison | 10 | Oom killed | Debug Dashboard |
| quality_gate_security_idle | baseline | 10 | Crashed (exit code: 134) | Debug Dashboard |
| quality_gate_security_idle | comparison | 10 | Oom killed | Debug Dashboard |
| quality_gate_security_mean_fs_load | baseline | 10 | Crashed (exit code: 134) | Debug Dashboard |
| quality_gate_security_no_fs_load | baseline | 10 | Oom killed | Debug Dashboard |
| quality_gate_security_no_fs_load | comparison | 10 | Crashed (exit code: 134) | Debug Dashboard |
CI Pass/Fail Decision
✅ Passed. All Quality Gates passed.
- quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_security_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_security_idle, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_security_no_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_security_no_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
- quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check missed_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_security_mean_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_security_mean_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
- quality_gate_private_action_runner, bounds check memory_usage: 10/10 replicas passed. Gate passed.
Static quality checks✅ Please find below the results from static quality gates Successful checksInfo
16 successful checks with minimal change (< 2 KiB)
|
|
This pull request has been automatically marked as stale because it has not had activity in the past 15 days. It will be closed in 30 days if no further activity occurs. If this pull request is still relevant, adding a comment or pushing new commits will keep it open. Also, you can always reopen the pull request if you missed the window. Thank you for your contributions! |
|
This pull request has been automatically marked as stale because it has not had activity in the past 15 days. It will be closed in 30 days if no further activity occurs. If this pull request is still relevant, adding a comment or pushing new commits will keep it open. Also, you can always reopen the pull request if you missed the window. Thank you for your contributions! |
50cd9d4 to
180d6c8
Compare
Go Package Import DifferencesBaseline: 6332ce3
|
|
@codex review |
a814af6 to
f018c2e
Compare
There was a problem hiding this comment.
Pull request overview
Adds first-class detection for Azure Container Apps as an OTLP “source” and uses that source identity to emit a workload-specific exporter running metric (otel.datadog_exporter.metrics.running.azurecontainerapps{...}), while refactoring source identity handling to support multi-dimension identifiers.
Changes:
- Introduces
AzureContainerAppsKindsource detection (includingcloud.resource_idfallback parsing) and refactorsSource.Identifierfromstringto a structured{Primary, Dimensions}. - Adds
TagSetConsumerand expands running-metric emission to support multi-tag workload identities (Fargate + Azure Container Apps). - Updates trace/log/metrics pipelines and unit tests to use
Identifier.Primary, plus Bazel deps for additional semconv versions.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/trace/transform/transform.go | Adjust hostname extraction to use Identifier.Primary. |
| pkg/trace/api/otlp.go | Updates OTLP trace receiver hostname/source handling for new identifier type. |
| pkg/trace/api/otlp_test.go | Fixes assertions to validate Identifier.Primary. |
| pkg/opentelemetry-mapping-go/otlp/metrics/minimal_translator.go | Adds TagSetConsumer support and ACA tag building for running metric attribution. |
| pkg/opentelemetry-mapping-go/otlp/metrics/metrics_translator.go | Updates host handling and expands running-metric attribution for Fargate/ACA via TagSetConsumer. |
| pkg/opentelemetry-mapping-go/otlp/metrics/metrics_translator_test.go | Updates test provider to return structured identifiers. |
| pkg/opentelemetry-mapping-go/otlp/metrics/consumer.go | Introduces TagSetConsumer interface and documents running-metric attribution. |
| pkg/opentelemetry-mapping-go/otlp/logs/translator.go | Updates log hostname extraction to use Identifier.Primary. |
| pkg/opentelemetry-mapping-go/otlp/logs/transform.go | Updates host extraction helpers to use Identifier.Primary. |
| pkg/opentelemetry-mapping-go/otlp/attributes/source/source_provider.go | Adds AzureContainerAppsKind, introduces Identifier struct, updates Tag() behavior. |
| pkg/opentelemetry-mapping-go/otlp/attributes/source.go | Implements ACA detection + dimension extraction and prevents falling back to Azure hostname logic. |
| pkg/opentelemetry-mapping-go/otlp/attributes/source_test.go | Adds ACA unit tests and updates existing source tests for structured identifiers. |
| pkg/opentelemetry-mapping-go/otlp/attributes/BUILD.bazel | Adds Bazel dependency for semconv/v1.40.0. |
| pkg/opentelemetry-mapping-go/otlp/attributes/azure/azure.go | Clarifies resource-group attribute key differences for Azure semconv variants. |
| pkg/opentelemetry-mapping-go/otlp/attributes/attributes.go | Adds ACA tag mappings + Azure ARM resource ID parsing helper + updates GetHost logic. |
| pkg/opentelemetry-mapping-go/inframetadata/reporter.go | Updates infra metadata hostname extraction to use Identifier.Primary. |
| comp/otelcol/otlp/components/exporter/serializerexporter/serializer.go | Updates serializer hostname provider to use Identifier.Primary. |
| comp/otelcol/otlp/components/exporter/serializerexporter/factory.go | Switches OSS consumer dedup tracking from single tags to tag sets. |
| comp/otelcol/otlp/components/exporter/serializerexporter/exporter.go | Updates source provider to return structured identifier. |
| comp/otelcol/otlp/components/exporter/serializerexporter/exporter_test.go | Updates tests for new tag-set dedup tracking and identifier handling. |
| comp/otelcol/otlp/components/exporter/serializerexporter/consumer_collector.go | Implements tag-set dedup + workload-specific running metrics (including ACA). |
| comp/otelcol/otlp/components/exporter/serializerexporter/consumer_collector_test.go | Adds/updates tests for workload running metrics + ACA tag-set dedup. |
| comp/otelcol/otlp/components/exporter/datadogexporter/traces_exporter.go | Updates trace exporter source keying to use Identifier.Primary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Identifier holds the identity of a telemetry source. | ||
| // For sources that can be identified by a single value, only Primary is set. | ||
| // For sources that need to be identified by multiple values (e.g. Azure Container Apps), Dimensions is set. | ||
| type Identifier struct { |
There was a problem hiding this comment.
This PR changes source.Source.Identifier from a string to a struct because Azure Container Apps is the first workload to need multiple tags on the otel.datadog_exporter.metrics.running.* metric. datadog-agent's components.go pulls in collector-contrib's datadogextension, and datadogextension's factory.go pulls in datadog-agent's pkg/datadog/hostmetadata which calls internal/datadog's hostmetadata.GetSourceProvider, and internal/datadog/hostmetadata's provider.go uses the Identifier type, which I believe is causing these failures
How should we resolve this circular dependency? I had turned Identifier into a struct since Azure Container Apps and other serverless workloads (e.g. Azure Functions, Azure App Service, GCP which will follow my container app work) will also need multi-dimensional data
There was a problem hiding this comment.
Might be good to do this in multiple steps:
- Step 1: Add a new Identifier struct, something like SourceIdentifier, and then duplicate functions where needed to accept the new SourceIdentifier struct, all while still supporting the old path. Mark all structs/ funcs from old path as deprecated.
- Step 2: make your changes to move to new path in datadog-agent and contrib
- Step 3: once all code paths use new path, remove deprecated old path
@songy23 I believe you have dealt with these types of issues recently, the above is how we used to address this, is still approach still what we do today or is there a better way ?
There was a problem hiding this comment.
^ exactly, please avoid removing APIs at once, that breaks -contrib import. Instead do deprecate-replace-remove in 3 steps
There was a problem hiding this comment.
Done! Thank you for the help 🙏 d14608b
I will create a follow-up PR to remove the deprecated old path after this is merged
54920c8 to
10b93fc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
comp/otelcol/otlp/components/exporter/serializerexporter/consumer_collector.go:64
tagset.CompositeTagsFromSlicemay retain the provided slice without copying, buttags := append(buildTags, ...)can reusebuildTags’ backing array when it has spare capacity. That can cause previously emitted series to end up with the last language tag. ClonebuildTagsbefore appending to keep tag slices independent.
for _, lang := range languageTags {
tags := append(buildTags, "language:"+lang) //nolint:gocritic
runningMetric := exporterDefaultMetrics("runtime_metrics", "", timestamp, tags)
series = append(series, runningMetric)
| // Tag associated to a source. | ||
| func (s *Source) Tag() string { | ||
| func (s Source) Tag() string { | ||
| return fmt.Sprintf("%s:%s", s.Kind, s.Identifier) | ||
| } |
| // TagSetConsumer is a multi-tag source consumer. | ||
| // It is an optional interface that can be implemented by a Consumer. | ||
| // Consumed tags are used for running metrics, and should represent | ||
| // some resource running a Collector (e.g. Fargate task). | ||
| type TagsConsumer interface { | ||
| // ConsumeTag consumes a tag | ||
| ConsumeTag(tag string) | ||
| // Use it for any source that needs one or more tags on its own dedicated | ||
| // running metric (e.g. Fargate, Azure Container Apps). | ||
| type TagSetConsumer interface { | ||
| // ConsumeTagSet consumes a multi-tag source for running metric emission. | ||
| // metricSuffix names the workload-specific metric: the resulting metric | ||
| // is "otel.datadog_exporter.metrics.running.<metricSuffix>" (e.g. "fargate", | ||
| // "azurecontainerapps"). | ||
| // tags is the full slice of "key:value" strings to attach to the metric. | ||
| ConsumeTagSet(metricSuffix string, tags []string) | ||
| } |
There was a problem hiding this comment.
Added TagsConsumer back in 09a6ead, we can remove this in step 3 of the migration
| if primary == "" { | ||
| primary = dims["name"] | ||
| } | ||
| return source.Source{ |
There was a problem hiding this comment.
ACA branch commits unconditionally — no identity guard like Fargate has
Unlike the Fargate branch above (which only returns once a task ARN is present, and
otherwise falls through to hostnameFromAttributes), this branch returns
AzureContainerAppsKind as soon as cloud.platform matches — even when no identifying
attribute was resolved and Dimensions/Primary stay empty.
Since this runs before hostnameFromAttributes, a payload that reports
cloud.platform=azure_container_apps but has no ACA identity (or carries an explicit
datadog.host.name) will:
- get an empty hostname on traces/logs — the explicit
datadog.host.nameis bypassed, and - emit
otel.datadog_exporter.metrics.running.azurecontainerappswith only
version/command tags and no identifying dimensions.
In practice the ACA detector always sets azure.container_app.instance.id, so this is an
edge case, and not falling through to Azure hostname logic is intended. Still, consider
mirroring Fargate's inner guard — only return ACA when at least one dimension was found,
otherwise fall through — or add a comment noting that ACA intentionally overrides host
attributes even when unidentified.
There was a problem hiding this comment.
Well discuss this in the sync, not sure there is value in submitting metric without identifying attributes.
There was a problem hiding this comment.
Following sync discussion, we should not submit metric if identifying attributes are missing.
There was a problem hiding this comment.
Added an identity guard in e3ca03d, thank you for raising this!
…r apps from trace path
…from resource attributes
…ce into its own function
…er to string, and fix call sites
e3ca03d to
dfa6738
Compare
What does this PR do?
Adds
AzureContainerAppsKindas a recognized OTel source type and emitsotel.datadog_exporter.metrics.running.azurecontainerapps{replica_name, subscription_id, resource_group, name}when the Azure resource attributesazure.container_app.instance.id,azure.resource_group.name,cloud.account.id,service.instance.nameare populated in a metric payload.cloud.platformisazure.container_apps(semconv >= v1.35.0), return AzureContainerAppsKind with the replica name as the identifier (service.instance.id)azure_container_appswas added in v1.25.0 and then changed toazure.container_appsin v1.35.0.source.gocurrently usessemconv v1.6.1so I addedv1.40.0for this use caseresourcedetectionprocessordon't fall through to Azure's hostname logicSource.Identifierfrom string to aSource.SourceIdentifier{Primary, Dimensions}structhost,task_arn), but Azure Container Apps are identified by replica name, subscription id, resource group, and service name, so theDimensionsfield allows identification by multiple attributesTagSetConsumeroptional interface (ConsumeTagSet(metricSuffix string, tags []string)) to generalize workload-specific running-metric emission across all workloads. Deprecates the previousTagsConsumerthat only allowed for one tag/workload on the running metricTagSetConsumer(previously its own single-tagTagsConsumer/ConsumeTagmechanism) so both workload types (and future workloads) share one dedup/emission mechanism inconsumer_collector.gocloud.resource_idis parsed as a fallback source forsubscription_id/resource_group/namewhen the primary semconv attributes aren't presentMotivation
https://datadoghq.atlassian.net/browse/SVLS-9121
Describe how you validated your changes
Unit tests
Built Go binary in corresponding collector-contrib PR and deployed an Azure Container App emitting a metric using an OTel collector with the Datadog exporter and a bicep file with


OTEL_RESOURCE_ATTRIBUTES='cloud.account.id=${subscription().subscriptionId},azure.resource_group.name=${resourceGroup().name}'using serverless-azure-gcp-otel-sample-apps repo with the Azure Container Apps resource detector from the Go SDK. Saw the metricotel.datadog_exporter.metrics.running.azurecontainerappswith the expected tags!Three Step Migration Needed
opentelemetry-collector-contrib needs a PR to use
source.Source.SourceIdentifierandmetrics.TagSetConsumeronce this is merged and to add Azure Container Apps to its legacy consumer path.Draft PR: open-telemetry/opentelemetry-collector-contrib#49615
It seems like there's a circular pin dependency as collector-contrib depends on the
Identifierstruct change in this PR.As a result we are doing a 3-step migration from
source.Source.Identifiertosource.Source.SourceIdentifier:source.Source.SourceIdentifieras an additive field and use it where needed while still supportingsource.Source.Identifiercall sites. Marksource.Source.Identifieras deprecated. This will be in this PR.source.Source.Identifiercall sites tosource.Source.SourceIdentifiersource.Source.SourceIdentifier, remove the deprecatedsource.Source.IdentifierAdditional Notes
Note: A PR is in progress in the resourcedetectionprocessor to add a resource detector for Azure Container Apps. https://datadoghq.atlassian.net/browse/SVLS-8996
Note:
azure.resource_group.namehas been added to semantic conventions (released in v1.43.0) butgo.opentelemetry.io/otel/semconvhas not been updated tov1.43.0yet. A PR to addazure.container_app.instance.idto semantic conventions is in progressazure.container_app.instance.idalready but does not emitazure.resource_group.name- customers still have to set resource group andcloud.account.id=<subscription_id>manually viaOTEL_RESOURCE_ATTRIBUTESbecause this information is not available in environment variables for Azure Container Apps