Skip to content

[SVLS-9121] Identify Azure Container Apps OTel Payloads and emit Datadog exporter running metric#51116

Open
kathiehuang wants to merge 21 commits into
mainfrom
kathie.huang/identify-azure-container-apps-otel-payloads
Open

[SVLS-9121] Identify Azure Container Apps OTel Payloads and emit Datadog exporter running metric#51116
kathiehuang wants to merge 21 commits into
mainfrom
kathie.huang/identify-azure-container-apps-otel-payloads

Conversation

@kathiehuang

@kathiehuang kathiehuang commented May 20, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds AzureContainerAppsKind as a recognized OTel source type and emits otel.datadog_exporter.metrics.running.azurecontainerapps{replica_name, subscription_id, resource_group, name} when the Azure resource attributes azure.container_app.instance.id, azure.resource_group.name, cloud.account.id, service.instance.name are populated in a metric payload.

  • When cloud.platform is azure.container_apps (semconv >= v1.35.0), return AzureContainerAppsKind with the replica name as the identifier (service.instance.id)
    • azure_container_apps was added in v1.25.0 and then changed to azure.container_apps in v1.35.0. source.go currently uses semconv v1.6.1 so I added v1.40.0 for this use case
  • Ensure Azure Container Apps instrumented with the Azure Container App resourcedetectionprocessor don't fall through to Azure's hostname logic
  • Refactors Source.Identifier from string to a Source.SourceIdentifier{Primary, Dimensions} struct
    • Host and Fargate are still identified by a single string (e.g. host, task_arn), but Azure Container Apps are identified by replica name, subscription id, resource group, and service name, so the Dimensions field allows identification by multiple attributes
    • See Three Step Migration Needed section below for details on this
  • Adds a TagSetConsumer optional interface (ConsumeTagSet(metricSuffix string, tags []string)) to generalize workload-specific running-metric emission across all workloads. Deprecates the previous TagsConsumer that only allowed for one tag/workload on the running metric
    • Migrates Fargate onto TagSetConsumer (previously its own single-tag TagsConsumer/ConsumeTag mechanism) so both workload types (and future workloads) share one dedup/emission mechanism in consumer_collector.go
  • cloud.resource_id is parsed as a fallback source for subscription_id/resource_group/name when the primary semconv attributes aren't present

Motivation

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 metric otel.datadog_exporter.metrics.running.azurecontainerapps with the expected tags!
image
image

Three Step Migration Needed

opentelemetry-collector-contrib needs a PR to use source.Source.SourceIdentifier and metrics.TagSetConsumer once 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 Identifier struct change in this PR.

comp/otelcol/collector-contrib/impl/components.go:14:19: could not import github.com/open-telemetry/opentelemetry-collector-contrib/extension/datadogextension (/var/cache/dd/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/extension/datadogextension@v0.155.0/factory.go:23:2: could not import github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog/hostmetadata (/var/cache/dd/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog@v0.155.1-0.20260626121343-03d2fb4a4514/hostmetadata/hostmetadata.go:12:2: could not import github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog/hostmetadata (/var/cache/dd/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog@v0.155.0/hostmetadata/host.go:13:2: could not import github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog/hostmetadata/internal/azure (/var/cache/dd/go/pkg/mod/github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog@v0.155.0/hostmetadata/internal/azure/provider.go:14:2: could not import github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog/hostmetadata/provider (-: # github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog/hostmetadata/provider

As a result we are doing a 3-step migration from source.Source.Identifier to source.Source.SourceIdentifier:

  1. Add source.Source.SourceIdentifier as an additive field and use it where needed while still supporting source.Source.Identifier call sites. Mark source.Source.Identifier as deprecated. This will be in this PR.
  2. Once this PR is merged, make a new PR to migrate all source.Source.Identifier call sites to source.Source.SourceIdentifier
  3. Once all code paths use source.Source.SourceIdentifier, remove the deprecated source.Source.Identifier

Additional 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.name has been added to semantic conventions (released in v1.43.0) but go.opentelemetry.io/otel/semconv has not been updated to v1.43.0 yet. A PR to add azure.container_app.instance.id to semantic conventions is in progress

  • The resource detector emits azure.container_app.instance.id already but does not emit azure.resource_group.name - customers still have to set resource group and cloud.account.id=<subscription_id> manually via OTEL_RESOURCE_ATTRIBUTES because this information is not available in environment variables for Azure Container Apps

@dd-octo-sts dd-octo-sts Bot added the internal Identify a non-fork PR label May 20, 2026
@github-actions github-actions Bot added the medium review PR review might take time label May 20, 2026
@datadog-official

datadog-official Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 69.92%
Overall Coverage: 52.08% (+0.14%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dfa6738 | Docs | Datadog PR Page | Give us feedback!

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@dd-octo-sts dd-octo-sts Bot added the team/opentelemetry OpenTelemetry team label May 20, 2026
@dd-octo-sts

dd-octo-sts Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor 6332ce3d:

Results for datadog-agent_7.83.0~devel.git.379.dfa6738.pipeline.126651196-1_amd64.deb:

No change detected

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented May 20, 2026

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: 7471f6ac-a097-4166-83eb-8bcfcc3e7f8b

Baseline: 6332ce3
Comparison: dfa6738
Diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

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:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. 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.

  3. 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.

@dd-octo-sts

dd-octo-sts Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 6332ce3
📊 Static Quality Gates Dashboard
🔗 SQG Job

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64 +24.22 KiB (0.00% increase, -0.37% of buffer) 751.783 → 751.806 → 758.200
agent_deb_amd64_fips +16.16 KiB (0.00% increase, -0.40% of buffer) 706.563 → 706.579 → 710.520
agent_heroku_amd64 +20.22 KiB (0.01% increase, -0.27% of buffer) 308.029 → 308.048 → 315.230
agent_msi +17.0 KiB (0.00% increase, -0.10% of buffer) 639.988 → 640.005 → 656.640
agent_rpm_amd64 +24.22 KiB (0.00% increase, -0.37% of buffer) 751.767 → 751.790 → 758.170
agent_rpm_amd64_fips +16.16 KiB (0.00% increase, -0.40% of buffer) 706.547 → 706.563 → 710.520
agent_rpm_arm64 +12.16 KiB (0.00% increase, -0.93% of buffer) 728.390 → 728.401 → 729.660
agent_rpm_arm64_fips +12.19 KiB (0.00% increase, -0.46% of buffer) 686.313 → 686.325 → 688.910
agent_suse_amd64 +24.22 KiB (0.00% increase, -0.37% of buffer) 751.767 → 751.790 → 758.170
agent_suse_amd64_fips +16.16 KiB (0.00% increase, -0.40% of buffer) 706.547 → 706.563 → 710.520
agent_suse_arm64 +12.16 KiB (0.00% increase, -0.93% of buffer) 728.390 → 728.401 → 729.660
agent_suse_arm64_fips +12.19 KiB (0.00% increase, -0.46% of buffer) 686.313 → 686.325 → 688.910
docker_agent_amd64 +24.22 KiB (0.00% increase, -0.71% of buffer) 810.448 → 810.471 → 813.790
docker_agent_arm64 +12.16 KiB (0.00% increase, -0.41% of buffer) 812.118 → 812.130 → 815.030
docker_agent_jmx_amd64 +24.22 KiB (0.00% increase, -0.74% of buffer) 1001.345 → 1001.369 → 1004.550
docker_agent_jmx_arm64 +12.15 KiB (0.00% increase, -0.39% of buffer) 991.668 → 991.680 → 994.710
docker_host_profiler_amd64 +6.12 KiB (0.00% increase, -0.05% of buffer) 304.993 → 304.999 → 317.640
16 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
docker_cluster_agent_amd64 209.866 MiB
docker_cluster_agent_arm64 222.953 MiB
docker_cws_instrumentation_amd64 7.439 MiB
docker_cws_instrumentation_arm64 6.877 MiB
docker_dogstatsd_amd64 39.243 MiB
docker_dogstatsd_arm64 37.368 MiB
docker_host_profiler_arm64 316.319 MiB
dogstatsd_deb_amd64 29.984 MiB
dogstatsd_deb_arm64 28.024 MiB
dogstatsd_rpm_amd64 29.984 MiB
dogstatsd_suse_amd64 29.984 MiB
iot_agent_deb_amd64 46.153 MiB
iot_agent_deb_arm64 42.845 MiB
iot_agent_deb_armhf 43.613 MiB
iot_agent_rpm_amd64 46.154 MiB
iot_agent_suse_amd64 46.153 MiB

@dd-octo-sts

dd-octo-sts Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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!

@dd-octo-sts dd-octo-sts Bot added stale and removed stale labels Jun 4, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

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!

@dd-octo-sts dd-octo-sts Bot added the stale label Jun 22, 2026
@kathiehuang
kathiehuang force-pushed the kathie.huang/identify-azure-container-apps-otel-payloads branch from 50cd9d4 to 180d6c8 Compare June 29, 2026 19:30
@dd-octo-sts

dd-octo-sts Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Go Package Import Differences

Baseline: 6332ce3
Comparison: dfa6738

binaryosarchchange
cluster-agentlinuxamd64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
cluster-agentlinuxarm64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
cluster-agent-cloudfoundrylinuxamd64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
cluster-agent-cloudfoundrylinuxarm64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
trace-agentlinuxamd64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
trace-agentlinuxarm64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
trace-agentwindowsamd64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
trace-agentdarwinamd64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
trace-agentdarwinarm64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
trace-agentaixppc64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0
heroku-trace-agentlinuxamd64
+1, -0
+go.opentelemetry.io/otel/semconv/v1.40.0

@kathiehuang kathiehuang removed the stale label Jun 29, 2026
@github-actions github-actions Bot added long review PR is complex, plan time to review it and removed medium review PR review might take time labels Jul 8, 2026
@kathiehuang kathiehuang changed the title [SVLS-9121] Identify Azure Container Apps OTel Payloads [SVLS-9121] Identify Azure Container Apps OTel Payloads and emit Datadog exporter running metric Jul 10, 2026
@kathiehuang

Copy link
Copy Markdown
Contributor Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@kathiehuang
kathiehuang force-pushed the kathie.huang/identify-azure-container-apps-otel-payloads branch from a814af6 to f018c2e Compare July 10, 2026 18:17
@kathiehuang
kathiehuang requested a review from Copilot July 10, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 AzureContainerAppsKind source detection (including cloud.resource_id fallback parsing) and refactors Source.Identifier from string to a structured {Primary, Dimensions}.
  • Adds TagSetConsumer and 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.

Comment thread pkg/opentelemetry-mapping-go/otlp/metrics/consumer.go Outdated
Comment thread pkg/opentelemetry-mapping-go/otlp/attributes/attributes.go Outdated
@kathiehuang
kathiehuang requested a review from Copilot July 10, 2026 19:02
// 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 {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

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.

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 ?

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.

^ exactly, please avoid removing APIs at once, that breaks -contrib import. Instead do deprecate-replace-remove in 3 steps

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done! Thank you for the help 🙏 d14608b

I will create a follow-up PR to remove the deprecated old path after this is merged

@kathiehuang
kathiehuang force-pushed the kathie.huang/identify-azure-container-apps-otel-payloads branch from 54920c8 to 10b93fc Compare July 15, 2026 21:28
@kathiehuang
kathiehuang requested a review from Copilot July 16, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.CompositeTagsFromSlice may retain the provided slice without copying, but tags := append(buildTags, ...) can reuse buildTags’ backing array when it has spare capacity. That can cause previously emitted series to end up with the last language tag. Clone buildTags before 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)

Comment on lines 51 to 54
// Tag associated to a source.
func (s *Source) Tag() string {
func (s Source) Tag() string {
return fmt.Sprintf("%s:%s", s.Kind, s.Identifier)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added fallback logic in 09a6ead

Comment on lines +147 to 158
// 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)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added TagsConsumer back in 09a6ead, we can remove this in step 3 of the migration

if primary == "" {
primary = dims["name"]
}
return source.Source{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.name is bypassed, and
  • emit otel.datadog_exporter.metrics.running.azurecontainerapps with 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.

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.

Well discuss this in the sync, not sure there is value in submitting metric without identifying attributes.

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.

Following sync discussion, we should not submit metric if identifying attributes are missing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added an identity guard in e3ca03d, thank you for raising this!

@kathiehuang kathiehuang added the qa/done QA done before merge and regressions are covered by tests label Jul 23, 2026
@kathiehuang
kathiehuang force-pushed the kathie.huang/identify-azure-container-apps-otel-payloads branch from e3ca03d to dfa6738 Compare July 23, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog No changelog entry needed internal Identify a non-fork PR long review PR is complex, plan time to review it qa/done QA done before merge and regressions are covered by tests team/agent-build team/opentelemetry OpenTelemetry team team/serverless-azure-gcp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants