-
Notifications
You must be signed in to change notification settings - Fork 150
Read container tags hash from agent #7893
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
base: master
Are you sure you want to change the base?
Conversation
| // Add container ID header if available | ||
| var containerId = ContainerMetadata.GetContainerId(); | ||
| if (containerId != null) | ||
| { | ||
| api.AddHeader(AgentHttpHeaderNames.ContainerId, containerId); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are fixed for the lifetime of the app, right? In that case, we should likely include it as a default header instead, as part of the CreateApiRequestFactory call
| var containerTagsHash = response.GetHeader(AgentHttpHeaderNames.ContainerTagsHash); | ||
| if (containerTagsHash != null) | ||
| { | ||
| ContainerMetadata.ContainerTagsHash = containerTagsHash; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear you're trolling me with all this static stuff 😅 Having static readonly state is one thing, but having static mutable state is a whole new ball game 😛 I think the ContainerMetadata object likely needs refactoring to be an instance type and passed in to where it's used, so that we don't destroy our tests completely. I'd suggest doing that in a separate PR first, then rebasing this on top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fair 😅
| /// <summary> | ||
| /// Gets or sets the container tags hash received from the agent, used by DBM/DSM | ||
| /// </summary> | ||
| public static string ContainerTagsHash { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT, this isn't actually used anywhere? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yet 😏
I could use it in the same PR, but I wanted to do baby steps. It's gonna be used in DSM and DBM injection
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7893) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (75ms) : 70, 80
master - mean (75ms) : 69, 81
section Bailout
This PR (7893) - mean (80ms) : 75, 85
master - mean (79ms) : 74, 83
section CallTarget+Inlining+NGEN
This PR (7893) - mean (1,070ms) : 1013, 1128
master - mean (1,066ms) : 997, 1135
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (117ms) : 111, 123
master - mean (117ms) : 109, 124
section Bailout
This PR (7893) - mean (119ms) : 112, 126
master - mean (118ms) : 110, 126
section CallTarget+Inlining+NGEN
This PR (7893) - mean (766ms) : 731, 801
master - mean (759ms) : 717, 801
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (106ms) : 100, 113
master - mean (104ms) : 99, 110
section Bailout
This PR (7893) - mean (107ms) : 101, 113
master - mean (106ms) : 100, 113
section CallTarget+Inlining+NGEN
This PR (7893) - mean (709ms) : 680, 739
master - mean (709ms) : 680, 738
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (105ms) : 99, 111
master - mean (103ms) : 97, 109
section Bailout
This PR (7893) - mean (105ms) : 100, 111
master - mean (104ms) : 98, 110
section CallTarget+Inlining+NGEN
This PR (7893) - mean (686ms) : 652, 720
master - mean (685ms) : 652, 717
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (193ms) : 189, 198
master - mean (193ms) : 189, 197
section Bailout
This PR (7893) - mean (197ms) : 194, 199
master - mean (197ms) : 194, 200
section CallTarget+Inlining+NGEN
This PR (7893) - mean (1,126ms) : 1054, 1197
master - mean (1,121ms) : 1051, 1191
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (278ms) : 273, 283
master - mean (279ms) : 274, 283
section Bailout
This PR (7893) - mean (278ms) : 274, 282
master - mean (279ms) : 274, 283
section CallTarget+Inlining+NGEN
This PR (7893) - mean (919ms) : 884, 955
master - mean (913ms) : 867, 958
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (272ms) : 266, 278
master - mean (271ms) : 267, 276
section Bailout
This PR (7893) - mean (271ms) : 268, 275
master - mean (271ms) : 267, 274
section CallTarget+Inlining+NGEN
This PR (7893) - mean (889ms) : 841, 937
master - mean (892ms) : 855, 929
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7893) - mean (271ms) : 265, 277
master - mean (270ms) : 265, 275
section Bailout
This PR (7893) - mean (270ms) : 267, 273
master - mean (270ms) : 266, 273
section CallTarget+Inlining+NGEN
This PR (7893) - mean (826ms) : 801, 852
master - mean (828ms) : 807, 848
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
same as DataDog/dd-trace-java#9156
This hash is meant to be matched in the backend with the actual container tags, with the advantage that :
related RFC: https://docs.google.com/document/d/15GtNOKGBCt6Dc-HsDNnMmCdZwhewFQx8yUlI9in5n3M
Implementation details
storing the value in a
public staticis probably not the best, but I'm following what my predecessors did on the container metadata 😬Test coverage
Other details