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

feat(tagger): implement remote OriginInfo resolution #31836

Conversation

wdhif
Copy link
Member

@wdhif wdhif commented Dec 6, 2024

What does this PR do?

Implements External Data resolution for the Remote Tagger by introducing a new gRPC call, TaggerGenerateContainerIDFromOriginInfo. This call is used by the remote_tagger to generate a Container ID from External Data.

Once the Container ID is generated and retrieved, it can be used for standard tagging operations by other Agents using the Remote Tagger.

+-------------------+
|    Core Agent     |
|-------------------|
|   Local Tagger    |                    
|-------------------|                    
|   TaggerServer    |<--------------------+
+-------------------+                     |
                                          |
                                          | 
                                          v
+-------------------+          
|      Agent        |---------> gRPC: GenerateContainerIDFromOriginInfo
|-------------------|
|  Remote Tagger    |
+-------------------+

The only part of the Origin Info that is used to generate the container ID is the External Data but the gRPC call still accept the whole Origin Info for forward compatibility.

Motivation

This implementation is necessary to fully support the new Origin Detection specification, specifically the External Data resolution for APM and the Trace Agent.

Describe how you validated your changes

Deploy the Agent with a dummy deployment:

➜ kubectl get pods
NAME                                           READY   STATUS    RESTARTS   AGE
datadog-agent-fp2kf                            5/5     Running   0          11m
datadog-cluster-agent-57fbd68c78-k8cnh         1/1     Running   0          11m
datadog-cluster-checks-runner-9c46b54f-vpv2r   1/1     Running   0          11m
datadog-operator-546bdfb8fd-w6j7n              1/1     Running   0          2d5h
dd-trace-py-6cb4f96d6b-mccl7                   1/1     Running   0          2d2h

In another Agent using the Remote Tagger such as the Trace Agent, run the following command (with the correct data):

➜  kubectl exec daemonsets/datadog-agent -c trace-agent -- bash
root@datadog-agent-fp2kf:/# curl -H "authorization: Bearer `cat /etc/datadog-agent/auth_token`" -XPOST -k -H "Content-Type: application/json" --data '{"externalDataInit":false,"externalDataPodUID":"c4b45c6a-b296-4bd5-88df-7c2d6bcaabef","externalDataContainerName":"dd-trace-py"}' https://localhost:5001/v1/grpc/tagger/generate_container_id_from_origin_info
{"containerID":"c9fd60251b5237467462dad48999815eb0025f367c6e1abe91e0bd787d5915fc"}

Make sure that the Container ID the same one as your dummy deployment:

➜  kubectl describe dd-trace-py-6cb4f96d6b-p9rxl | grep "Container ID"
    Container ID:   docker://c9fd60251b5237467462dad48999815eb0025f367c6e1abe91e0bd787d5915fc

Possible Drawbacks / Trade-offs

For now, I have decided to duplicate the OriginInfo and ExternalData structs for origindetection while keeping them in taggertypes, as they are already used for DogStatsD Origin Detection. This approach avoids further complicating the PR.

We will need to transition the current DogStatsD Origin Detection from taggertypes to origindetection.

Additionally, caching in the remote tagger has not yet been implemented, as there is currently no client capable of using External Data resolution for APM. This will need to be addressed in a subsequent PR.

Additional Notes

@wdhif wdhif added the qa/done QA done before merge and regressions are covered by tests label Dec 6, 2024
@github-actions github-actions bot added the long review PR is complex, plan time to review it label Dec 6, 2024
@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch from 9ce206d to e505205 Compare December 6, 2024 14:03
Copy link

cit-pr-commenter bot commented Dec 6, 2024

Go Package Import Differences

Baseline: 5b903ef
Comparison: bfe71de

binaryosarchchange
agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
agentwindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
agentdarwinamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
agentdarwinarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
iot-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
iot-agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
heroku-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
cluster-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
cluster-agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
cluster-agent-cloudfoundrylinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
cluster-agent-cloudfoundrylinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
dogstatsdlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
dogstatsdlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
process-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
process-agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
process-agentwindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
process-agentdarwinamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
process-agentdarwinarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
heroku-process-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
security-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
security-agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
security-agentwindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
serverlesslinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
serverlesslinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
system-probelinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
system-probelinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
system-probewindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
trace-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
trace-agentlinuxarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
trace-agentwindowsamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
trace-agentdarwinamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
trace-agentdarwinarm64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection
heroku-trace-agentlinuxamd64
+1, -0
+github.com/DataDog/datadog-agent/comp/core/tagger/origindetection

@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch 10 times, most recently from d51a981 to cb520d6 Compare December 6, 2024 16:29
Copy link

cit-pr-commenter bot commented Dec 6, 2024

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: e1923a8b-c747-4278-9d7e-d6c817653258

Baseline: 5b903ef
Comparison: bfe71de
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.

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
otel_to_otel_logs ingress throughput +0.90 [+0.25, +1.55] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.75 [+0.68, +0.82] 1 Logs
quality_gate_logs % cpu utilization +0.56 [-2.45, +3.56] 1 Logs
file_to_blackhole_1000ms_latency egress throughput +0.21 [-0.57, +1.00] 1 Logs
file_to_blackhole_500ms_latency egress throughput +0.10 [-0.68, +0.87] 1 Logs
quality_gate_idle_all_features memory utilization +0.08 [-0.02, +0.18] 1 Logs bounds checks dashboard
file_to_blackhole_300ms_latency egress throughput +0.04 [-0.58, +0.66] 1 Logs
file_to_blackhole_0ms_latency_http1 egress throughput +0.04 [-0.79, +0.87] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] 1 Logs
file_to_blackhole_0ms_latency egress throughput -0.00 [-0.79, +0.79] 1 Logs
file_to_blackhole_100ms_latency egress throughput -0.00 [-0.80, +0.80] 1 Logs
uds_dogstatsd_to_api ingress throughput -0.01 [-0.12, +0.10] 1 Logs
file_to_blackhole_0ms_latency_http2 egress throughput -0.02 [-0.86, +0.82] 1 Logs
file_to_blackhole_1000ms_latency_linear_load egress throughput -0.60 [-1.07, -0.14] 1 Logs
quality_gate_idle memory utilization -0.97 [-1.01, -0.93] 1 Logs bounds checks dashboard
uds_dogstatsd_to_api_cpu % cpu utilization -1.73 [-2.46, -1.00] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_0ms_latency_http1 lost_bytes 10/10
file_to_blackhole_0ms_latency_http1 memory_usage 10/10
file_to_blackhole_0ms_latency_http2 lost_bytes 10/10
file_to_blackhole_0ms_latency_http2 memory_usage 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency_linear_load memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_300ms_latency lost_bytes 10/10
file_to_blackhole_300ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10
quality_gate_logs 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".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.

@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch 2 times, most recently from 0f9c6b9 to 877bc15 Compare December 8, 2024 17:57
@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch 12 times, most recently from 1134007 to 90e17d4 Compare December 8, 2024 22:14
@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch 5 times, most recently from bd84c2c to 6197b13 Compare December 15, 2024 20:19
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Dec 15, 2024

Uncompressed package size comparison

Comparison with ancestor 5b903ef9eef116f41bea415f3f58f0ad031eba8a

Diff per package
package diff status size ancestor threshold
datadog-agent-x86_64-rpm 0.17MB ⚠️ 1278.30MB 1278.13MB 140.00MB
datadog-agent-x86_64-suse 0.17MB ⚠️ 1278.30MB 1278.13MB 140.00MB
datadog-agent-amd64-deb 0.17MB ⚠️ 1269.06MB 1268.89MB 140.00MB
datadog-agent-aarch64-rpm 0.13MB ⚠️ 1013.31MB 1013.19MB 140.00MB
datadog-agent-arm64-deb 0.12MB ⚠️ 1004.10MB 1003.97MB 140.00MB
datadog-heroku-agent-amd64-deb 0.09MB ⚠️ 505.53MB 505.44MB 70.00MB
datadog-iot-agent-amd64-deb 0.05MB ⚠️ 113.34MB 113.29MB 10.00MB
datadog-iot-agent-x86_64-rpm 0.05MB ⚠️ 113.41MB 113.36MB 10.00MB
datadog-iot-agent-x86_64-suse 0.05MB ⚠️ 113.40MB 113.36MB 10.00MB
datadog-dogstatsd-x86_64-rpm 0.04MB ⚠️ 78.64MB 78.60MB 10.00MB
datadog-dogstatsd-x86_64-suse 0.04MB ⚠️ 78.64MB 78.60MB 10.00MB
datadog-dogstatsd-amd64-deb 0.04MB ⚠️ 78.57MB 78.52MB 10.00MB
datadog-iot-agent-arm64-deb 0.04MB ⚠️ 108.81MB 108.77MB 10.00MB
datadog-iot-agent-aarch64-rpm 0.04MB ⚠️ 108.88MB 108.84MB 10.00MB
datadog-dogstatsd-arm64-deb 0.03MB ⚠️ 55.77MB 55.74MB 10.00MB

Decision

⚠️ Warning

@wdhif wdhif requested a review from davidor December 16, 2024 08:50
@wdhif wdhif marked this pull request as ready for review December 16, 2024 08:56
@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch from 72a5031 to 496bb00 Compare December 16, 2024 14:38
@wdhif
Copy link
Member Author

wdhif commented Dec 16, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Dec 16, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-12-16 15:04:34 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2024-12-16 15:08:28 UTC ⚠️ MergeQueue: This merge request was unqueued

This merge request was unqueued

@wdhif
Copy link
Member Author

wdhif commented Dec 16, 2024

/remove

@dd-devflow
Copy link

dd-devflow bot commented Dec 16, 2024

Devflow running: /remove

View all feedbacks in Devflow UI.


2024-12-16 15:08:27 UTC ℹ️ Devflow: /remove

@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch 2 times, most recently from 084fce9 to 151796f Compare December 16, 2024 16:39
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch from 151796f to fced8e9 Compare December 16, 2024 16:46
Signed-off-by: Wassim DHIF <wassim.dhif@datadoghq.com>
@wdhif wdhif force-pushed the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch from fced8e9 to bfe71de Compare December 16, 2024 17:23
@wdhif
Copy link
Member Author

wdhif commented Dec 17, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Dec 17, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-12-17 10:45:40 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 31m.


2024-12-17 11:13:53 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit 9c7198c into main Dec 17, 2024
243 checks passed
@dd-mergequeue dd-mergequeue bot deleted the CONTP-15/wassim.dhif/implement-external-data-resolution-traces branch December 17, 2024 11:13
@github-actions github-actions bot added this to the 7.62.0 milestone Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog long review PR is complex, plan time to review it qa/done QA done before merge and regressions are covered by tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants