Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: expose debug endpoint for dumping tag store for Remote Agent workload provider #460

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

tobz
Copy link
Member

@tobz tobz commented Jan 29, 2025

Summary

This PR introduces support for dumping the current set of entities from the tag store used by the Remote Agent workload provider.

When the Remote Agent workload provider is enabled, a new API endpoint is exposed, /workload/remote_agent/tags/dump, which dumps out information on each entity in the tag store:

  • entity ID (container ID, pod UID, process PID, etc)
  • ancestors (so for entities like process ID, we would generally see the container ID here)
  • low, orchestrator, and high cardinality tags

This is in service of being able to debug issues with origin detection/enrichment, which often require trace-level logging as the baseline, in order to emit the logs immediately after starting up, when the tag store is "primed". Doing so is prohibitively noisy, however, so being able to instead dump the entire contents of the tag store on demand gives us more flexibility when doing this sort of debugging.

We've done a bunch of wiring and changes to support this:

  • changes to TagStore to allow concurrently iterating over active entities and entity mappings
  • creating the API handler specific to the Remote Agent workload provider
  • exposing the necessary information through TagStoreQuerier
  • wiring up and installing the API handler on the ADP side

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

Local testing only.

Ran ADP with the Datadog Agent, and launched a simple container to prime the tagger/workloadmeta side of things in the Agent. Using curl to call the new endpoint, I could see an entry both for the container entity and the container inode entity being scraped by the cgroups metadata collector.

This looked something like:

toby@consigliera:~/src/saluki$ curl -s -k https://localhost:5100/workload/remote_agent/tags/dump | jq '.'
[
  {
    "entity_id": "container_id://80ef5b83ee193ba3bf0b6935fb8ae3ed5af0a6b7f9d5288d53cce530cd05bef0",
    "ancestors": [],
    "low_cardinality_tags": "[image_name:ubuntu, short_image:ubuntu, image_tag:latest, image_id:sha256:59ab366372d56772eb54e426183435e6b0642152cb449ec7ab52473af8ca6e3f, docker_image:ubuntu:latest]",
    "orchestrator_cardinality_tags": "[image_name:ubuntu, short_image:ubuntu, image_tag:latest, image_id:sha256:59ab366372d56772eb54e426183435e6b0642152cb449ec7ab52473af8ca6e3f, docker_image:ubuntu:latest]",
    "high_cardinality_tags": "[image_name:ubuntu, short_image:ubuntu, image_tag:latest, image_id:sha256:59ab366372d56772eb54e426183435e6b0642152cb449ec7ab52473af8ca6e3f, docker_image:ubuntu:latest, container_name:funny_mccarthy, container_id:80ef5b83ee193ba3bf0b6935fb8ae3ed5af0a6b7f9d5288d53cce530cd05bef0]"
  },
  {
    "entity_id": "container_inode://129546",
    "ancestors": [
      "container_id://80ef5b83ee193ba3bf0b6935fb8ae3ed5af0a6b7f9d5288d53cce530cd05bef0"
    ],
    "low_cardinality_tags": "[image_name:ubuntu, short_image:ubuntu, image_tag:latest, image_id:sha256:59ab366372d56772eb54e426183435e6b0642152cb449ec7ab52473af8ca6e3f, docker_image:ubuntu:latest]",
    "orchestrator_cardinality_tags": "[image_name:ubuntu, short_image:ubuntu, image_tag:latest, image_id:sha256:59ab366372d56772eb54e426183435e6b0642152cb449ec7ab52473af8ca6e3f, docker_image:ubuntu:latest]",
    "high_cardinality_tags": "[image_name:ubuntu, short_image:ubuntu, image_tag:latest, image_id:sha256:59ab366372d56772eb54e426183435e6b0642152cb449ec7ab52473af8ca6e3f, docker_image:ubuntu:latest, container_name:funny_mccarthy, container_id:80ef5b83ee193ba3bf0b6935fb8ae3ed5af0a6b7f9d5288d53cce530cd05bef0]"
  }
]

References

N/A

@tobz tobz requested a review from a team as a code owner January 29, 2025 18:49
@github-actions github-actions bot added area/core Core functionality, event model, etc. area/config Configuration. labels Jan 29, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jan 29, 2025

Regression Detector (Saluki)

Regression Detector Results

Run ID: 290d3cec-5c75-4529-9baf-4bc12532278e

Baseline: 17184c5
Comparison: 250cfe7
Diff

❌ Experiments with missing or malformed data

This is a critical error. No usable optimization goal data was produced by the listed experiments. This may be a result of misconfiguration. Ping #single-machine-performance and we can help out.

  • dsd_uds_100mb_250k_contexts

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
dsd_uds_100mb_3k_contexts_distributions_only memory utilization +0.97 [+0.85, +1.09] 1
dsd_uds_10mb_3k_contexts ingress throughput +0.01 [-0.02, +0.04] 1
dsd_uds_50mb_10k_contexts_no_inlining_no_allocs ingress throughput +0.01 [-0.05, +0.07] 1
dsd_uds_1mb_3k_contexts_dualship ingress throughput +0.00 [-0.00, +0.01] 1
dsd_uds_512kb_3k_contexts ingress throughput +0.00 [-0.01, +0.01] 1
dsd_uds_1mb_3k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_50mb_10k_contexts_no_inlining ingress throughput -0.00 [-0.07, +0.07] 1
dsd_uds_100mb_3k_contexts ingress throughput -0.00 [-0.05, +0.04] 1
dsd_uds_40mb_12k_contexts_40_senders ingress throughput -0.01 [-0.04, +0.02] 1
quality_gates_idle_rss memory utilization -0.29 [-0.32, -0.27] 1
dsd_uds_500mb_3k_contexts ingress throughput -0.40 [-0.52, -0.27] 1
dsd_uds_1mb_50k_contexts_memlimit ingress throughput -1.25 [-1.77, -0.74] 1

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 10/10

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

@tobz tobz force-pushed the tobz/workload-provider-api-stores-debug branch from 4a44bc1 to 85a6165 Compare January 29, 2025 19:02
@pr-commenter
Copy link

pr-commenter bot commented Jan 29, 2025

Regression Detector (DogStatsD)

Regression Detector Results

Run ID: d5221dff-da26-4aa8-983f-b9d030dd747d

Baseline: 7.63.0-rc.2
Comparison: 7.63.0-rc.2

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gates_idle_rss memory utilization +2.20 [+2.10, +2.31] 1
dsd_uds_40mb_12k_contexts_40_senders ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_1mb_50k_contexts_memlimit ingress throughput +0.00 [-0.00, +0.00] 1
dsd_uds_100mb_250k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_512kb_3k_contexts ingress throughput -0.00 [-0.01, +0.01] 1
dsd_uds_1mb_3k_contexts_dualship ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_1mb_3k_contexts ingress throughput -0.00 [-0.00, +0.00] 1
dsd_uds_10mb_3k_contexts ingress throughput -0.00 [-0.02, +0.01] 1
dsd_uds_100mb_3k_contexts ingress throughput -0.01 [-0.05, +0.03] 1
dsd_uds_100mb_3k_contexts_distributions_only memory utilization -0.11 [-0.27, +0.05] 1
dsd_uds_500mb_3k_contexts ingress throughput -0.96 [-1.11, -0.82] 1

Bounds Checks: ❌ Failed

perf experiment bounds_check_name replicates_passed links
quality_gates_idle_rss memory_usage 0/10

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

@pr-commenter
Copy link

pr-commenter bot commented Jan 29, 2025

Regression Detector Links

Experiment Result Links

experiment link(s)
dsd_uds_100mb_250k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_100mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_100mb_3k_contexts_distributions_only [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_10mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_3k_contexts_dualship [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_50k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_1mb_50k_contexts_memlimit [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_40mb_12k_contexts_40_senders [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_500mb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_512kb_3k_contexts [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
quality_gates_idle_rss [Profiling (ADP)] [Profiling (DSD)] [SMP Dashboard]
dsd_uds_50mb_10k_contexts_no_inlining (ADP only) [Profiling (ADP)] [SMP Dashboard]
dsd_uds_50mb_10k_contexts_no_inlining_no_allocs (ADP only) [Profiling (ADP)] [SMP Dashboard]

@tobz tobz force-pushed the tobz/workload-provider-api-stores-debug branch from 85a6165 to 7331935 Compare January 30, 2025 02:52
@github-actions github-actions bot added the area/observability Internal observability of ADP and Saluki. label Jan 30, 2025
@tobz tobz merged commit f5ce719 into main Jan 30, 2025
21 checks passed
@tobz tobz deleted the tobz/workload-provider-api-stores-debug branch January 30, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Configuration. area/core Core functionality, event model, etc. area/observability Internal observability of ADP and Saluki.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant