Skip to content

test(errortracking): add FakeIntake support for agent telemetry logs #52487

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
mainfrom
pducolin/coat-errortracking/stack-3-wiring
Jun 29, 2026
Merged

test(errortracking): add FakeIntake support for agent telemetry logs #52487
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
mainfrom
pducolin/coat-errortracking/stack-3-wiring

Conversation

@pducolin

@pducolin pducolin commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Stacked PR 3/4 — part of #50607. Builds on stack-2 #52486.

What does this PR do?

Adds /api/v2/apmtelemetry support to fakeintake so E2E tests can assert on error-tracking payloads forwarded by the agent, add CI boilerplate to run agent telemetry e2e tests.

  • New AgentTelemetryLogAggregator parses agent-logs request type from the shared /api/v2/apmtelemetry endpoint.
  • GetAgentTelemetryLogs() client method fetches and returns all received log records
  • Register /api/v2/apmtelemetry route in server/serverstore/parser.go so the /fakeintake/payloads query path works

Stack

  1. [stack-1 feat(errortracking): add core error-tracking package #52485] Core pkg/util/log/errortracking/ package
  2. [stack-2 feat(errortracking): extend agenttelemetry component with error log submission #52486] agenttelemetry component extensions + sender refactor
  3. This PR — e2e test boilerplate
  4. [stack-4] config, log-setup wiring, agent run command

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 70.97%
Overall Coverage: 51.08% (-3.25%)

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

@dd-octo-sts

dd-octo-sts Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Files inventory check summary

File checks results against ancestor 3af3972b:

Results for datadog-agent_7.82.0~devel.git.436.a16e455.pipeline.121554590-1_amd64.deb:

No change detected

@dd-octo-sts

dd-octo-sts Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Static quality checks

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

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64 +140.68 KiB (0.02% increase, -1.47% of buffer) 748.880 → 749.018 → 758.200
agent_deb_amd64_fips +140.62 KiB (0.02% increase, -2.74% of buffer) 704.826 → 704.963 → 709.840
agent_heroku_amd64 +60.25 KiB (0.02% increase, -0.89% of buffer) 308.649 → 308.708 → 315.230
agent_msi +157.0 KiB (0.02% increase, -1.12% of buffer) 616.906 → 617.059 → 630.600
agent_rpm_amd64 +140.68 KiB (0.02% increase, -1.48% of buffer) 748.864 → 749.001 → 758.170
agent_rpm_amd64_fips +140.62 KiB (0.02% increase, -2.73% of buffer) 704.810 → 704.947 → 709.840
agent_rpm_arm64 +123.46 KiB (0.02% increase, -2.30% of buffer) 724.417 → 724.537 → 729.660
agent_rpm_arm64_fips +135.4 KiB (0.02% increase, -2.70% of buffer) 683.970 → 684.102 → 688.860
agent_suse_amd64 +140.68 KiB (0.02% increase, -1.48% of buffer) 748.864 → 749.001 → 758.170
agent_suse_amd64_fips +140.62 KiB (0.02% increase, -2.73% of buffer) 704.810 → 704.947 → 709.840
agent_suse_arm64 +123.46 KiB (0.02% increase, -2.30% of buffer) 724.417 → 724.537 → 729.660
agent_suse_arm64_fips +135.4 KiB (0.02% increase, -2.70% of buffer) 683.970 → 684.102 → 688.860
docker_agent_amd64 +128.64 KiB (0.02% increase, -2.06% of buffer) 807.699 → 807.824 → 813.790
docker_agent_arm64 +123.4 KiB (0.01% increase, -1.78% of buffer) 808.268 → 808.388 → 815.030
docker_agent_jmx_amd64 +128.62 KiB (0.01% increase, -2.11% of buffer) 998.596 → 998.722 → 1004.550
docker_agent_jmx_arm64 +123.4 KiB (0.01% increase, -1.75% of buffer) 987.818 → 987.938 → 994.710
docker_cluster_agent_amd64 +28.12 KiB (0.01% increase, -1.14% of buffer) 208.060 → 208.087 → 210.470
docker_dogstatsd_amd64 +12.06 KiB (0.03% increase, -1.31% of buffer) 39.012 → 39.024 → 39.910
docker_host_profiler_amd64 +11.78 KiB (0.00% increase, -0.09% of buffer) 305.020 → 305.032 → 317.640
dogstatsd_deb_amd64 +16.06 KiB (0.05% increase, -1.12% of buffer) 29.743 → 29.759 → 31.150
dogstatsd_deb_arm64 +12.06 KiB (0.04% increase, -0.68% of buffer) 27.802 → 27.814 → 29.530
dogstatsd_rpm_amd64 +16.06 KiB (0.05% increase, -1.12% of buffer) 29.743 → 29.759 → 31.150
dogstatsd_suse_amd64 +16.06 KiB (0.05% increase, -1.12% of buffer) 29.743 → 29.759 → 31.150
iot_agent_deb_amd64 +32.16 KiB (0.07% increase, -4.43% of buffer) 45.672 → 45.703 → 46.380
iot_agent_deb_arm64 +32.16 KiB (0.07% increase, -2.35% of buffer) 42.386 → 42.418 → 43.720
iot_agent_deb_armhf +28.08 KiB (0.06% increase, -3.48% of buffer) 43.172 → 43.199 → 43.960
iot_agent_rpm_amd64 +32.16 KiB (0.07% increase, -4.44% of buffer) 45.672 → 45.704 → 46.380
iot_agent_suse_amd64 +32.16 KiB (0.07% increase, -4.43% of buffer) 45.671 → 45.703 → 46.380
5 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
docker_cluster_agent_arm64 221.314 MiB
docker_cws_instrumentation_amd64 7.447 MiB
docker_cws_instrumentation_arm64 6.877 MiB
docker_dogstatsd_arm64 37.179 MiB
docker_host_profiler_arm64 316.112 MiB

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jun 19, 2026

Copy link
Copy Markdown

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: eb348853-ca11-444f-bcff-f3781a8815f0

Baseline: ca75ed6
Comparison: e882170
Diff

❌ Experiments with retried target crashes

This is a critical error. One or more replicates failed with a non-zero exit code. These replicates may have been retried. See Replicate Execution Details for more information.

  • quality_gate_idle

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +0.54 [-0.56, +1.63] 1 Logs bounds checks dashboard
quality_gate_security_mean_fs_load memory utilization +0.20 [+0.16, +0.24] 1 Logs bounds checks dashboard
quality_gate_metrics_logs memory utilization +0.19 [-0.07, +0.44] 1 Logs bounds checks dashboard
quality_gate_security_no_fs_load memory utilization -0.00 [-0.10, +0.09] 1 Logs bounds checks dashboard
quality_gate_security_idle memory utilization -0.08 [-0.15, -0.02] 1 Logs bounds checks dashboard
quality_gate_idle_all_features memory utilization -0.13 [-0.17, -0.09] 1 Logs bounds checks dashboard
quality_gate_idle memory utilization -0.50 [-0.55, -0.45] 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 145.48MiB ≤ 154MiB bounds checks dashboard
quality_gate_idle total_bytes_received 10/10 577.18KiB ≤ 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 486.61MiB ≤ 495MiB bounds checks dashboard
quality_gate_idle_all_features total_bytes_received 10/10 0.89MiB ≤ 1.25MiB bounds checks dashboard
quality_gate_logs intake_connections 10/10 4 ≤ 6 bounds checks dashboard
quality_gate_logs memory_usage 10/10 180.29MiB ≤ 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.20MiB ≤ 292MiB bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 336.07 ≤ 2000 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 4 ≤ 6 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 403.54MiB ≤ 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.86GiB ≤ 1.04GiB bounds checks dashboard
quality_gate_security_idle cpu_usage 10/10 28.51 ≤ 40 bounds checks dashboard
quality_gate_security_idle memory_usage 10/10 296.51MiB ≤ 330MiB bounds checks dashboard
quality_gate_security_mean_fs_load cpu_usage 10/10 62.55 ≤ 80 bounds checks dashboard
quality_gate_security_mean_fs_load memory_usage 10/10 275.69MiB ≤ 310MiB bounds checks dashboard
quality_gate_security_no_fs_load cpu_usage 10/10 23.66 ≤ 40 bounds checks dashboard
quality_gate_security_no_fs_load memory_usage 10/10 287.70MiB ≤ 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 Normal Replicate Execution Failures (non-profiling)

Experiment Variant Replicates Failure Debug Dashboard
quality_gate_idle comparison 0 Oom killed Debug Dashboard

❌ 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 baseline 10 Oom killed Debug Dashboard
quality_gate_idle comparison 10 Oom killed 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_metrics_logs baseline 10 Oom killed Debug Dashboard
quality_gate_metrics_logs comparison 10 Oom killed Debug Dashboard
quality_gate_security_idle baseline 10 Oom killed Debug Dashboard
quality_gate_security_idle comparison 10 Oom killed Debug Dashboard
quality_gate_security_no_fs_load baseline 10 Oom killed Debug Dashboard
quality_gate_security_no_fs_load comparison 10 Oom killed Debug Dashboard

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_security_idle, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_idle, bounds check memory_usage: 10/10 replicas passed. Gate 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_metrics_logs, bounds check missed_bytes: 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 memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_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_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 missed_bytes: 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_security_mean_fs_load, bounds check cpu_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_security_mean_fs_load, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check total_bytes_received: 10/10 replicas passed. Gate passed.

@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-2-agenttelemetry branch from 7a2adb4 to be28f36 Compare June 22, 2026 08:20
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch 2 times, most recently from 20703ae to 6757598 Compare June 22, 2026 08:28
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-2-agenttelemetry branch from be28f36 to 53cf9d6 Compare June 22, 2026 08:28
@dd-octo-sts

dd-octo-sts Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Gitlab CI Configuration Changes

Added Jobs

.on_agenttelemetry_or_e2e_changes
.on_agenttelemetry_or_e2e_changes:
- if: $RUN_E2E_TESTS == "off"
  when: never
- if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
  when: never
- if: $RUN_E2E_TESTS == "on"
  when: on_success
- if: $CI_COMMIT_BRANCH == "main"
  when: on_success
- if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
  when: on_success
- if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$/
  when: on_success
- changes:
    compare_to: $COMPARE_TO_BRANCH
    paths:
    - .gitlab/test/e2e/e2e.yml
    - test/e2e-framework/**/*
    - test/new-e2e/go.mod
    - flakes.yaml
    - release.json
- changes:
    compare_to: $COMPARE_TO_BRANCH
    paths:
    - comp/core/agenttelemetry/**/*
    - pkg/util/log/errortracking/**/*
  when: on_success
new-e2e-agent-telemetry
new-e2e-agent-telemetry:
  after_script:
  - CODECOV_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $CODECOV token) || exit
    $?; export CODECOV_TOKEN
  - $CI_PROJECT_DIR/tools/ci/junit_upload.sh "junit-${CI_JOB_ID}.tgz" "$E2E_RESULT_JSON"
  - "if [ -d \"$E2E_COVERAGE_OUT_DIR\" ]; then\n  dda inv -- -e coverage.process-e2e-coverage-folders\
    \ $E2E_COVERAGE_OUT_DIR\n  dda inv -- -e dyntest.compute-and-upload-job-index\
    \ --bucket-uri $S3_PERMANENT_ARTIFACTS_URI --coverage-folder $E2E_COVERAGE_OUT_DIR\
    \ --commit-sha $CI_COMMIT_SHA --job-id $CI_JOB_ID\nfi\n"
  - "if [ -d \"$E2E_COVERAGE_OUT_DIR\" ]; then\n  DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh\
    \ $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY\n  for coverage in\
    \ \"$E2E_COVERAGE_OUT_DIR\"/*/coverage.txt; do\n    datadog-ci coverage upload\
    \ --format=go-coverprofile \"$coverage\" || true\n  done\nfi\n"
  artifacts:
    expire_in: 2 weeks
    paths:
    - $E2E_OUTPUT_DIR
    - $E2E_RESULT_JSON
    - junit-*.tgz
    - $E2E_COVERAGE_OUT_DIR
    reports:
      annotations:
      - $EXTERNAL_LINKS_PATH
    when: always
  before_script:
  - mkdir -p $GOPATH/pkg/mod/cache && zstd -dc modcache_e2e.tar.zst | tar xf - -C
    $GOPATH/pkg/mod/cache
  - rm -f modcache_e2e.tar.zst
  - mkdir -p ~/.pulumi && zstd -dc pulumi_plugins.tar.zst | tar xf - -C ~/.pulumi
  - rm -f pulumi_plugins.tar.zst
  - "go_bin=\"$(go env GOBIN)\"\nif [ -z \"$go_bin\" ]; then\n  go_bin=\"$(go env\
    \ GOPATH)/bin\"\nfi\nmkdir -p \"$go_bin\" \"$GOPATH/pkg/mod/cache\"\nzstd -dc\
    \ go_tools_bin.tar.zst | tar xf - -C \"$go_bin\"\nzstd -dc modcache_tools.tar.zst\
    \ | tar xf - -C \"$GOPATH/pkg/mod/cache\"\n"
  - rm -f go_tools_bin.tar.zst modcache_tools.tar.zst
  - export PATH=$PATH:$go_bin
  - mkdir -p ~/.aws
  - "if [ -n \"$E2E_USE_AWS_PROFILE\" ]; then\n  echo Using agent-qa-ci aws profile\n\
    \  $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E profile >> ~/.aws/config\
    \ || exit $?\n  # Now all `aws` commands target the agent-qa profile\n  export\
    \ AWS_PROFILE=agent-qa-ci\nelse\n  # Assume role to fetch only once credentials\
    \ and avoid rate limits\n  echo Assuming ddbuild-agent-ci role\n  roleoutput=\"\
    $(aws sts assume-role --role-arn arn:aws:iam::669783387624:role/ddbuild-agent-ci\
    \ --external-id ddbuild-agent-ci --role-session-name RoleSession)\"\n  export\
    \ AWS_ACCESS_KEY_ID=\"$(echo \"$roleoutput\" | jq -r '.Credentials.AccessKeyId')\"\
    \n  export AWS_SECRET_ACCESS_KEY=\"$(echo \"$roleoutput\" | jq -r '.Credentials.SecretAccessKey')\"\
    \n  export AWS_SESSION_TOKEN=\"$(echo \"$roleoutput\" | jq -r '.Credentials.SessionToken')\"\
    \nfi\n"
  - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_AWS_PUBLIC_KEY_PATH
    || exit $?
  - touch $E2E_AWS_PRIVATE_KEY_PATH && chmod 600 $E2E_AWS_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
    $AGENT_QA_E2E ssh_key_rsa > $E2E_AWS_PRIVATE_KEY_PATH || exit $?
  - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_AZURE_PUBLIC_KEY_PATH
    || exit $?
  - touch $E2E_AZURE_PRIVATE_KEY_PATH && chmod 600 $E2E_AZURE_PRIVATE_KEY_PATH &&
    $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_key_rsa > $E2E_AZURE_PRIVATE_KEY_PATH
    || exit $?
  - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_GCP_PUBLIC_KEY_PATH
    || exit $?
  - touch $E2E_GCP_PRIVATE_KEY_PATH && chmod 600 $E2E_GCP_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh
    $AGENT_QA_E2E ssh_key_rsa > $E2E_GCP_PRIVATE_KEY_PATH || exit $?
  - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
  - ARM_CLIENT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_AZURE client_id)
    || exit $?; export ARM_CLIENT_ID
  - ARM_CLIENT_SECRET=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_AZURE token)
    || exit $?; export ARM_CLIENT_SECRET
  - ARM_TENANT_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_AZURE tenant_id)
    || exit $?; export ARM_TENANT_ID
  - ARM_SUBSCRIPTION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_AZURE subscription_id)
    || exit $?; export ARM_SUBSCRIPTION_ID
  - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_GCP credentials_json > ~/gcp-credentials.json
    || exit $?
  - export GOOGLE_APPLICATION_CREDENTIALS=~/gcp-credentials.json
  - 'gcp_acr_key=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $E2E_GCP credentials_acr_readonly)
    || exit $?

    export E2E_GCP_IMAGE_PULL_PASSWORD="b64=$(printf ''%s'' "$gcp_acr_key" | base64
    -w 0)"

    '
  - dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
  - export DD_ENV=nativetest
  - export DD_CIVISIBILITY_ENABLED=true
  - export DD_CIVISIBILITY_AGENTLESS_ENABLED=true
  - export DD_CIVISIBILITY_FLAKY_RETRY_ENABLED=false
  - export DD_TAGS="gitlab.pipeline_source:${CI_PIPELINE_SOURCE}"
  - DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token)
    || exit $?; export DD_API_KEY
  - export WINDOWS_DDNPM_DRIVER=${WINDOWS_DDNPM_DRIVER:-$(dda inv release.get-release-json-value
    "dependencies::WINDOWS_DDNPM_DRIVER" --no-worktree)}
  - export WINDOWS_DDPROCMON_DRIVER=${WINDOWS_DDPROCMON_DRIVER:-$(dda inv release.get-release-json-value
    "dependencies::WINDOWS_DDPROCMON_DRIVER" --no-worktree)}
  image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
  needs:
  - go_e2e_deps
  - artifacts: false
    job: go_e2e_test_binaries
  - go_tools_deps
  - job: new-e2e-base-coverage
    optional: true
  - agent_deb-x64-a7
  - agent_deb-x64-a7-fips
  rules:
  - if: $CI_COMMIT_BRANCH =~ /^mq-working-branch-/
    when: never
  - allow_failure: true
    when: manual
  script:
  - export IS_DEV_BRANCH="$(dda inv -- -e pipeline.is-dev-branch)"
  - DYNAMIC_TESTS_BREAKGLASS=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $DYNAMIC_TESTS_BREAKGLASS
    value) || exit $?; export DYNAMIC_TESTS_BREAKGLASS
  - "if [ \"$DYNAMIC_TESTS_BREAKGLASS\" == \"true\" ] || [ \"$IS_DEV_BRANCH\" == \"\
    false\" ] || [ \"$RUN_E2E_TESTS\" == \"on\" ]; then\n  export DYNAMIC_TESTS_FLAG=\"\
    \"\nfi\n"
  - export E2E_IMAGE_PULL_PASSWORD=$(aws ecr get-login-password),$E2E_GCP_IMAGE_PULL_PASSWORD
  - dda inv -- -e new-e2e-tests.run $DYNAMIC_TESTS_FLAG $PRE_BUILT_BINARIES_FLAG $MAX_RETRIES_FLAG
    --local-package $CI_PROJECT_DIR/$OMNIBUS_BASE_DIR --result-json $E2E_RESULT_JSON
    --targets $TARGETS --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer
    --logs-folder=$E2E_OUTPUT_DIR/logs --logs-post-processing --logs-post-processing-test-depth=$E2E_LOGS_PROCESSING_TEST_DEPTH
  stage: e2e
  tags:
  - arch:amd64
  - specific:true
  variables:
    DYNAMIC_TESTS_FLAG: --impacted
    E2E_AWS_PRIVATE_KEY_PATH: /tmp/agent-qa-aws-ssh-key
    E2E_AWS_PUBLIC_KEY_PATH: /tmp/agent-qa-aws-ssh-key.pub
    E2E_AZURE_PRIVATE_KEY_PATH: /tmp/agent-qa-azure-ssh-key
    E2E_AZURE_PUBLIC_KEY_PATH: /tmp/agent-qa-azure-ssh-key.pub
    E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
    E2E_COVERAGE_OUT_DIR: $CI_PROJECT_DIR/coverage
    E2E_GCP_PRIVATE_KEY_PATH: /tmp/agent-qa-gcp-ssh-key
    E2E_GCP_PUBLIC_KEY_PATH: /tmp/agent-qa-gcp-ssh-key.pub
    E2E_IMAGE_PULL_REGISTRY: 669783387624.dkr.ecr.us-east-1.amazonaws.com,us-central1-docker.pkg.dev
    E2E_IMAGE_PULL_USERNAME: AWS,_json_key
    E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
    E2E_LOGS_PROCESSING_TEST_DEPTH: 1
    E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
    E2E_PIPELINE_ID: $CI_PIPELINE_ID
    E2E_PREBUILD_S3_URI: $S3_PERMANENT_ARTIFACTS_URI/e2e-pre-build/$CI_PIPELINE_ID
    E2E_RESULT_JSON: $CI_PROJECT_DIR/e2e_test_output.json
    E2E_SKIP_WINDOWS: $SKIP_WINDOWS
    E2E_USE_AWS_PROFILE: 'true'
    EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
    FLAKY_PATTERNS_CONFIG: $CI_PROJECT_DIR/flaky-patterns-runtime.yaml
    GIT_STRATEGY: clone
    KUBERNETES_CPU_REQUEST: 6
    KUBERNETES_MEMORY_LIMIT: 16Gi
    KUBERNETES_MEMORY_REQUEST: 12Gi
    MAX_RETRIES_FLAG: ''
    PRE_BUILT_BINARIES_FLAG: --use-prebuilt-binaries
    REMOTE_STACK_CLEANING: 'true'
    SHOULD_RUN_IN_FLAKES_FINDER: 'true'
    TARGETS: ./tests/agent-telemetry
    TEAM: agent-runtimes

Changes Summary

Removed Modified Added Renamed
0 0 2 0

ℹ️ Diff available in the job log.

@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch from 6757598 to cec2391 Compare June 22, 2026 08:34
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-2-agenttelemetry branch 2 times, most recently from 1b3c60a to f473840 Compare June 22, 2026 12:44
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch from cec2391 to ca2e86d Compare June 22, 2026 12:44
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-2-agenttelemetry branch from f473840 to 732215e Compare June 22, 2026 15:46
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch 2 times, most recently from 89a29be to cd037f9 Compare June 23, 2026 08:44
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-2-agenttelemetry branch 2 times, most recently from 70b773d to af32141 Compare June 23, 2026 11:37
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch from cd037f9 to 4ac540e Compare June 23, 2026 11:37
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-2-agenttelemetry branch from af32141 to 9b343ec Compare June 24, 2026 08:08
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch from 4ac540e to 76d9e93 Compare June 24, 2026 10:21
Base automatically changed from pducolin/coat-errortracking/stack-2-agenttelemetry to main June 25, 2026 07:59
… agent telemetry logs

Add apmTelemetryAggregator to parse agent-logs payloads from /api/v2/apmtelemetry
and expose GetAgentTelemetryLogs() on the fakeintake client.
@pducolin pducolin force-pushed the pducolin/coat-errortracking/stack-3-wiring branch from 76d9e93 to 024f180 Compare June 25, 2026 12:08
@dd-octo-sts dd-octo-sts Bot added internal Identify a non-fork PR team/agent-devx labels Jun 25, 2026
@github-actions github-actions Bot added the medium review PR review might take time label Jun 25, 2026
@pducolin pducolin changed the title feat(errortracking): wire error-tracking handler into agent startup feat(errortracking): add FakeIntake support for agent telemetry logs Jun 25, 2026
@pducolin pducolin changed the title feat(errortracking): add FakeIntake support for agent telemetry logs test(errortracking): add FakeIntake support for agent telemetry logs Jun 25, 2026
chatgpt-codex-connector[bot]

This comment was marked as outdated.

…filter

Add .on_agenttelemetry_or_e2e_changes rules and new-e2e-agent-telemetry job
targeting ./tests/agent-telemetry owned by agent-runtimes.
chatgpt-codex-connector[bot]

This comment was marked as outdated.

@pducolin pducolin added changelog/no-changelog No changelog entry needed qa/no-code-change No code change in Agent code requiring validation labels Jun 25, 2026
@pducolin pducolin marked this pull request as ready for review June 25, 2026 19:43
@pducolin pducolin requested review from a team as code owners June 25, 2026 19:43
Comment thread .gitlab-ci.yml
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit e882170 into main Jun 29, 2026
521 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the pducolin/coat-errortracking/stack-3-wiring branch June 29, 2026 12:30
@github-actions github-actions Bot added this to the 7.82.0 milestone Jun 29, 2026
github-actions Bot pushed a commit to nothingtosurprise/datadog-agent that referenced this pull request Jun 29, 2026
…ataDog#52487)

> **Stacked PR 3/4** — part of [DataDog#50607](DataDog#50607). Builds on [stack-2 DataDog#52486](DataDog#52486).

### What does this PR do?

Adds `/api/v2/apmtelemetry` support to fakeintake so E2E tests can assert on error-tracking payloads forwarded by the agent, add CI boilerplate to run agent telemetry e2e tests.

- New `AgentTelemetryLogAggregator` parses agent-logs request type from the shared `/api/v2/apmtelemetry` endpoint.
- `GetAgentTelemetryLogs()` client method fetches and returns all received log records
- Register `/api/v2/apmtelemetry` route in `server/serverstore/parser.go` so the /fakeintake/payloads query path works

### Stack
1. [stack-1 DataDog#52485] Core `pkg/util/log/errortracking/` package
2. [stack-2 DataDog#52486] agenttelemetry component extensions + sender refactor
3. **This PR** — e2e test boilerplate
4. [stack-4] config, log-setup wiring, agent run command

Co-authored-by: paola.ducolin <paola.ducolin@datadoghq.com> e882170
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 3, 2026
…52488)

> **Stacked PR 4/4** — part of [#50607](#50607). Builds on [stack-3 #52487](#52487).

### What does this PR do?

Wires the error-tracking handler into the agent and validates the full pipeline end-to-end:

- **Config defaults** — adds `buffer_size`, `flush_interval`, `bouncer_window` to `common_settings.go`
- **Log setup** — wires `errortracking.Handler` into `buildSlogLogger` as a synchronous sibling handler
- **Agent run command** — installs an `fx.Lifecycle` hook that starts/stops the handler
- **E2E test suite** (`test/new-e2e/tests/agent-telemetry/`) — provisions a real AWS EC2 VM via Pulumi, installs the agent with a Python check that logs errors and raises an exception. Asserts that error log payloads reach the internal telemetry intake. Tests both `errortracking.enabled: true` and the default disabled state.
- **CI** — extends `.on_agenttelemetry_or_e2e_changes` with `test/new-e2e/tests/agent-telemetry/**/*`

### Stack
1. [stack-1 #52485] Core `pkg/util/log/errortracking/` package
2. [stack-2 #52486] agenttelemetry component extensions + sender refactor
3. [stack-3 #52487] FakeIntake aggregator/client + CI scaffolding
4. **This PR** — agent wiring + E2E test

Co-authored-by: paola.ducolin <paola.ducolin@datadoghq.com>
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 medium review PR review might take time qa/no-code-change No code change in Agent code requiring validation team/agent-build team/agent-devx team/container-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants