Skip to content

Add Datadog-Entity-Id header - #6559

Merged
ygree merged 1 commit into
masterfrom
ygree/datadog-entity-id
Jan 29, 2024
Merged

Add Datadog-Entity-Id header#6559
ygree merged 1 commit into
masterfrom
ygree/datadog-entity-id

Conversation

@ygree

@ygree ygree commented Jan 26, 2024

Copy link
Copy Markdown
Contributor

What Does This Do

Adds Datadog-Entity-ID header.

Motivation

Send a new HTTP header Datadog-Entity-ID to the trace-agent. This will allow us to cover more container tagging scenarios.

The reference implementation is in Go: https://github.com/DataDog/dd-trace-go/blob/main/internal/container_linux.go

How to build the header value?

If the container ID (the value used for the Datadog-Container-ID header) is available and not empty, the value of Datadog-Entity-ID must be cid-<container ID>

Else if the tracer runs in the host cgroup namespace (see isHostCgroupNamespace), do not report Datadog-Entity-ID

Else the value of Datadog-Entity-ID must be in-<cgroup inode> (see getCgroupInode)

System-tests PR: DataDog/system-tests#2029

Additional Notes

Jira ticket: APMJAVA-1198

@pr-commenter

pr-commenter Bot commented Jan 26, 2024

Copy link
Copy Markdown

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/datadog-entity-id
git_commit_date 1706302847 1706307653
git_commit_sha e546801 d8f8712
release_version 1.29.0-SNAPSHOT~e546801121 1.29.0-SNAPSHOT~d8f87125a6
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1706310612 1706310612
ci_job_id 419988224 419988224
ci_pipeline_id 27281185 27281185
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 43 metrics, 11 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.29.0-SNAPSHOT~d8f87125a6, baseline=1.29.0-SNAPSHOT~e546801121

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.065 s) : 0, 1065237
Total [baseline] (9.398 s) : 0, 9397761
Agent [candidate] (1.06 s) : 0, 1059633
Total [candidate] (9.346 s) : 0, 9346455
section appsec
Agent [baseline] (1.164 s) : 0, 1163777
Total [baseline] (9.541 s) : 0, 9540787
Agent [candidate] (1.157 s) : 0, 1156719
Total [candidate] (9.419 s) : 0, 9419118
section iast
Agent [baseline] (1.187 s) : 0, 1187237
Total [baseline] (9.747 s) : 0, 9746881
Agent [candidate] (1.185 s) : 0, 1184742
Total [candidate] (9.754 s) : 0, 9754479
section profiling
Agent [baseline] (1.287 s) : 0, 1287220
Total [baseline] (9.628 s) : 0, 9628195
Agent [candidate] (1.299 s) : 0, 1299196
Total [candidate] (9.709 s) : 0, 9709030
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.065 s -
Agent appsec 1.164 s 98.539 ms (9.3%)
Agent iast 1.187 s 122.0 ms (11.5%)
Agent profiling 1.287 s 221.983 ms (20.8%)
Total tracing 9.398 s -
Total appsec 9.541 s 143.026 ms (1.5%)
Total iast 9.747 s 349.12 ms (3.7%)
Total profiling 9.628 s 230.434 ms (2.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.06 s -
Agent appsec 1.157 s 97.085 ms (9.2%)
Agent iast 1.185 s 125.108 ms (11.8%)
Agent profiling 1.299 s 239.562 ms (22.6%)
Total tracing 9.346 s -
Total appsec 9.419 s 72.664 ms (0.8%)
Total iast 9.754 s 408.024 ms (4.4%)
Total profiling 9.709 s 362.575 ms (3.9%)
gantt
    title petclinic - break down per module: candidate=1.29.0-SNAPSHOT~d8f87125a6, baseline=1.29.0-SNAPSHOT~e546801121

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (671.959 ms) : 0, 671959
BytebuddyAgent [candidate] (666.913 ms) : 0, 666913
GlobalTracer [baseline] (297.925 ms) : 0, 297925
GlobalTracer [candidate] (297.786 ms) : 0, 297786
AppSec [baseline] (52.429 ms) : 0, 52429
AppSec [candidate] (52.457 ms) : 0, 52457
Remote Config [baseline] (716.502 µs) : 0, 717
Remote Config [candidate] (684.257 µs) : 0, 684
Telemetry [baseline] (7.652 ms) : 0, 7652
Telemetry [candidate] (7.494 ms) : 0, 7494
section appsec
BytebuddyAgent [baseline] (672.68 ms) : 0, 672680
BytebuddyAgent [candidate] (667.315 ms) : 0, 667315
GlobalTracer [baseline] (298.292 ms) : 0, 298292
GlobalTracer [candidate] (297.709 ms) : 0, 297709
AppSec [baseline] (150.751 ms) : 0, 150751
AppSec [candidate] (150.084 ms) : 0, 150084
Remote Config [baseline] (658.025 µs) : 0, 658
Remote Config [candidate] (652.573 µs) : 0, 653
Telemetry [baseline] (6.809 ms) : 0, 6809
Telemetry [candidate] (6.742 ms) : 0, 6742
section iast
BytebuddyAgent [baseline] (780.29 ms) : 0, 780290
BytebuddyAgent [candidate] (778.248 ms) : 0, 778248
GlobalTracer [baseline] (289.432 ms) : 0, 289432
GlobalTracer [candidate] (289.355 ms) : 0, 289355
AppSec [baseline] (54.858 ms) : 0, 54858
AppSec [candidate] (54.621 ms) : 0, 54621
Remote Config [baseline] (627.811 µs) : 0, 628
Remote Config [candidate] (612.206 µs) : 0, 612
Telemetry [baseline] (6.615 ms) : 0, 6615
Telemetry [candidate] (7.375 ms) : 0, 7375
IAST [baseline] (21.108 ms) : 0, 21108
IAST [candidate] (20.184 ms) : 0, 20184
section profiling
ProfilingAgent [baseline] (125.96 ms) : 0, 125960
ProfilingAgent [candidate] (126.32 ms) : 0, 126320
BytebuddyAgent [baseline] (665.551 ms) : 0, 665551
BytebuddyAgent [candidate] (672.59 ms) : 0, 672590
GlobalTracer [baseline] (380.561 ms) : 0, 380561
GlobalTracer [candidate] (384.327 ms) : 0, 384327
AppSec [baseline] (52.392 ms) : 0, 52392
AppSec [candidate] (52.789 ms) : 0, 52789
Remote Config [baseline] (665.307 µs) : 0, 665
Remote Config [candidate] (665.766 µs) : 0, 666
Telemetry [baseline] (7.515 ms) : 0, 7515
Telemetry [candidate] (7.553 ms) : 0, 7553
Profiling [baseline] (125.984 ms) : 0, 125984
Profiling [candidate] (126.344 ms) : 0, 126344
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-01-26T22:46:13 2024-01-26T23:05:11
git_branch master ygree/datadog-entity-id
git_commit_date 1706302847 1706307653
git_commit_sha e546801 d8f8712
release_version 1.29.0-SNAPSHOT~e546801121 1.29.0-SNAPSHOT~d8f87125a6
start_time 2024-01-26T22:46:00 2024-01-26T23:04:58
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1706310612 1706310612
ci_job_id 419988224 419988224
ci_pipeline_id 27281185 27281185
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 15 unstable metrics.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.29.0-SNAPSHOT~d8f87125a6, baseline=1.29.0-SNAPSHOT~e546801121
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.354 ms) : 1334, 1373
.   : milestone, 1354,
appsec (1.768 ms) : 1742, 1794
.   : milestone, 1768,
iast (1.522 ms) : 1497, 1547
.   : milestone, 1522,
profiling (1.533 ms) : 1507, 1559
.   : milestone, 1533,
tracing (1.512 ms) : 1487, 1536
.   : milestone, 1512,
section candidate
no_agent (1.353 ms) : 1334, 1372
.   : milestone, 1353,
appsec (1.754 ms) : 1729, 1780
.   : milestone, 1754,
iast (1.516 ms) : 1490, 1541
.   : milestone, 1516,
profiling (1.514 ms) : 1489, 1539
.   : milestone, 1514,
tracing (1.491 ms) : 1466, 1516
.   : milestone, 1491,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.354 ms [1.334 ms, 1.373 ms] -
appsec 1.768 ms [1.742 ms, 1.794 ms] 414.593 µs (30.6%)
iast 1.522 ms [1.497 ms, 1.547 ms] 168.554 µs (12.5%)
profiling 1.533 ms [1.507 ms, 1.559 ms] 179.275 µs (13.2%)
tracing 1.512 ms [1.487 ms, 1.536 ms] 158.092 µs (11.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.353 ms [1.334 ms, 1.372 ms] -
appsec 1.754 ms [1.729 ms, 1.78 ms] 401.289 µs (29.7%)
iast 1.516 ms [1.49 ms, 1.541 ms] 162.42 µs (12.0%)
profiling 1.514 ms [1.489 ms, 1.539 ms] 161.293 µs (11.9%)
tracing 1.491 ms [1.466 ms, 1.516 ms] 137.756 µs (10.2%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.29.0-SNAPSHOT~d8f87125a6, baseline=1.29.0-SNAPSHOT~e546801121
    dateFormat X
    axisFormat %s
section baseline
no_agent (372.416 µs) : 352, 393
.   : milestone, 372,
iast (490.764 µs) : 470, 512
.   : milestone, 491,
iast_FULL (542.703 µs) : 522, 563
.   : milestone, 543,
iast_GLOBAL (509.756 µs) : 487, 532
.   : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (475.057 µs) : 455, 496
.   : milestone, 475,
iast_INACTIVE (447.906 µs) : 427, 469
.   : milestone, 448,
iast_TELEMETRY_OFF (473.653 µs) : 453, 494
.   : milestone, 474,
tracing (450.713 µs) : 430, 472
.   : milestone, 451,
section candidate
no_agent (375.469 µs) : 355, 395
.   : milestone, 375,
iast (472.763 µs) : 452, 493
.   : milestone, 473,
iast_FULL (539.023 µs) : 518, 560
.   : milestone, 539,
iast_GLOBAL (503.766 µs) : 483, 525
.   : milestone, 504,
iast_HARDCODED_SECRET_DISABLED (480.626 µs) : 460, 501
.   : milestone, 481,
iast_INACTIVE (446.44 µs) : 426, 467
.   : milestone, 446,
iast_TELEMETRY_OFF (478.002 µs) : 457, 500
.   : milestone, 478,
tracing (439.754 µs) : 419, 461
.   : milestone, 440,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 372.416 µs [352.225 µs, 392.606 µs] -
iast 490.764 µs [469.718 µs, 511.809 µs] 118.348 µs (31.8%)
iast_FULL 542.703 µs [522.084 µs, 563.321 µs] 170.287 µs (45.7%)
iast_GLOBAL 509.756 µs [487.457 µs, 532.055 µs] 137.34 µs (36.9%)
iast_HARDCODED_SECRET_DISABLED 475.057 µs [454.54 µs, 495.574 µs] 102.641 µs (27.6%)
iast_INACTIVE 447.906 µs [426.804 µs, 469.009 µs] 75.49 µs (20.3%)
iast_TELEMETRY_OFF 473.653 µs [452.904 µs, 494.403 µs] 101.237 µs (27.2%)
tracing 450.713 µs [429.893 µs, 471.533 µs] 78.297 µs (21.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 375.469 µs [355.462 µs, 395.476 µs] -
iast 472.763 µs [452.2 µs, 493.327 µs] 97.294 µs (25.9%)
iast_FULL 539.023 µs [518.241 µs, 559.805 µs] 163.554 µs (43.6%)
iast_GLOBAL 503.766 µs [482.829 µs, 524.703 µs] 128.297 µs (34.2%)
iast_HARDCODED_SECRET_DISABLED 480.626 µs [459.753 µs, 501.499 µs] 105.158 µs (28.0%)
iast_INACTIVE 446.44 µs [425.573 µs, 467.307 µs] 70.971 µs (18.9%)
iast_TELEMETRY_OFF 478.002 µs [456.502 µs, 499.502 µs] 102.533 µs (27.3%)
tracing 439.754 µs [418.745 µs, 460.763 µs] 64.286 µs (17.1%)

@ygree
ygree force-pushed the ygree/datadog-entity-id branch from 6d325e2 to 744b0b5 Compare January 26, 2024 07:40
@ygree ygree changed the title Implement Datadog-Entity-Id header Datadog-Entity-Id header Jan 26, 2024
@ygree
ygree force-pushed the ygree/datadog-entity-id branch 2 times, most recently from 4833837 to bc8b505 Compare January 26, 2024 17:50
@ygree ygree changed the title Datadog-Entity-Id header Add Datadog-Entity-Id header Jan 26, 2024
@ygree ygree self-assigned this Jan 26, 2024
@ygree ygree added the comp: telemetry Telemetry label Jan 26, 2024
@ygree
ygree requested a review from dougqh January 26, 2024 17:51
@ygree
ygree force-pushed the ygree/datadog-entity-id branch 3 times, most recently from 00f6440 to a63a779 Compare January 26, 2024 22:20
@ygree
ygree force-pushed the ygree/datadog-entity-id branch from a63a779 to d8f8712 Compare January 26, 2024 22:21
@ygree
ygree marked this pull request as ready for review January 26, 2024 22:52
@ygree
ygree requested review from a team as code owners January 26, 2024 22:53
@ygree
ygree requested review from jpbempel and mcculls and removed request for a team January 26, 2024 22:53
@ygree
ygree merged commit 0f8b948 into master Jan 29, 2024
@ygree
ygree deleted the ygree/datadog-entity-id branch January 29, 2024 16:37
@github-actions github-actions Bot added this to the 1.29.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants