Commit 8c4a8c4
authored
## Summary of changes
- This is the big one
- Update services to dynamically update when mutable settings or
exporter settings change
- Stop rebuilding everything when there's manual/remote configuration
## Reason for change
This is the "endpoint" that we've been heading for - services only being
disposed/rebuilt at the end of the app, and otherwise only rebuilding
the _necessary_ parts. For example - we don't need to tear down all the
API factories when a customer changes a global tag via remote config;
they only need to change if the `ExporterSettings` change.
The hope is that overall this reduces the overhead of using
configuration in code and/or remote configuration, while also reducing
the number of issues due to managing disposal of services.
## Implementation details
Overall, this PR is kind of a pain. Moving from the "rebuild everything"
to "reconfigure each service" couldn't be done piecemeal, so this is the
one-shot PR. What's more, different services need different patterns
(though we can probably consolidate some of them, this has taken a _lot_
of work and I likely changed patterns unnecessarily in some places).
In general, there's a couple of patterns:
- CI Vis doesn't let you change settings at runtime, so it _never_ needs
to respond to changes. It always just uses the "initial" settings
- Debugger _today_ doesn't respond to changes at runtime (except its own
dynamic config), so for now we ignore Debugger too as it's not really a
regression. I hope we can fix this soon though.
- I've introduced the concept of `Managed*` versions of some services
- These services generally "wrap" the existing type, delegating access
to the underlying service, and handling settings changes
- Many services only care about a sub-set of mutable settings, so they
only update if they need to
- Somewhat annoyingly, setting updates occur on a background thread, so
we need to be careful about thread safety. Where necessary (most places)
I've made sure access to a now-mutable service is done using
`Volatile.Read()` (to ensure changes are visible) and are generally
cached to a local variable (as the underlying field may be updated in
the background).
## Test coverage
In the vast majority of places, this should be covered by existing tests
I plan to add some additional integration tests around reconfiguring and
a bunch of manual testing to make sure I'm confident.
## Other details
I strongly recommend reviewing commit-by-commit. They're generally
self-contained, and hopefully simple enough to understand one commit at
a time.
https://datadoghq.atlassian.net/browse/LANGPLAT-819
Part of a config stack
- #7522
- #7525
- #7530
- #7532
- #7543
- #7544
- #7721
- #7722
- #7695
- #7723
- #7724 👈
- #7796
This isn't the final PR in the stack, as there will be a bunch of
cleaning up to do, but it's the final "implementation" PR
1 parent 9ac42fd commit 8c4a8c4
File tree
137 files changed
+3963
-1507
lines changed- tracer
- src
- Datadog.Trace.Tools.Runner
- Datadog.Trace
- Agent
- DiscoveryService
- Ci
- Agent
- MessagePack
- Payloads
- Net
- ClrProfiler
- AutoInstrumentation/ManualInstrumentation
- Configuration/TracerSettings
- Tracer
- Configuration
- DataStreamsMonitoring
- Aggregation
- Transport
- Debugger
- ExceptionAutoInstrumentation
- Symbols
- Upload
- DogStatsd
- LibDatadog/DataPipeline
- Logging
- DirectSubmission
- Formatting
- TracerFlare
- OpenTelemetry
- Logs
- Metrics
- RemoteConfigurationManagement
- Protocol
- Transport
- RuntimeMetrics
- Sampling
- Telemetry
- Collectors
- Transports
- test
- Datadog.Trace.ClrProfiler.IntegrationTests
- CI/Agent
- Helpers
- Datadog.Trace.ClrProfiler.Managed.Tests/AutoInstrumentation/Logging/ILogger
- Datadog.Trace.IntegrationTests
- LibDatadog
- Logging/TracerFlare
- Tagging
- Datadog.Trace.Security.Unit.Tests
- Datadog.Trace.TestHelpers
- Stats
- TestTracer
- Datadog.Trace.Tests
- Agent
- MessagePack
- Configuration
- DataStreamsMonitoring
- Debugger
- DogStatsd
- Logging/DirectSubmission
- Formatting
- ManualInstrumentation
- RemoteConfigurationManagement
- RuntimeMetrics
- Tagging
- Telemetry
- Collectors
- Transports
- Util
- benchmarks/Benchmarks.Trace
- snapshots
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
137 files changed
+3963
-1507
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
| 436 | + | |
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | | - | |
74 | | - | |
| 84 | + | |
| 85 | + | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | | - | |
| 89 | + | |
79 | 90 | | |
80 | 91 | | |
81 | 92 | | |
| |||
92 | 103 | | |
93 | 104 | | |
94 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
95 | 110 | | |
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
99 | 114 | | |
100 | 115 | | |
101 | 116 | | |
102 | | - | |
103 | | - | |
104 | 117 | | |
105 | 118 | | |
106 | | - | |
| 119 | + | |
107 | 120 | | |
108 | 121 | | |
109 | 122 | | |
| |||
138 | 151 | | |
139 | 152 | | |
140 | 153 | | |
141 | | - | |
| 154 | + | |
142 | 155 | | |
143 | | - | |
144 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
145 | 162 | | |
146 | 163 | | |
147 | 164 | | |
| |||
244 | 261 | | |
245 | 262 | | |
246 | 263 | | |
247 | | - | |
| 264 | + | |
248 | 265 | | |
249 | 266 | | |
250 | 267 | | |
| |||
314 | 331 | | |
315 | 332 | | |
316 | 333 | | |
317 | | - | |
| 334 | + | |
318 | 335 | | |
319 | | - | |
320 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
321 | 342 | | |
322 | 343 | | |
323 | 344 | | |
| |||
336 | 357 | | |
337 | 358 | | |
338 | 359 | | |
339 | | - | |
| 360 | + | |
340 | 361 | | |
341 | 362 | | |
342 | 363 | | |
| |||
377 | 398 | | |
378 | 399 | | |
379 | 400 | | |
380 | | - | |
| 401 | + | |
381 | 402 | | |
382 | 403 | | |
383 | 404 | | |
| |||
512 | 533 | | |
513 | 534 | | |
514 | 535 | | |
515 | | - | |
| 536 | + | |
516 | 537 | | |
517 | | - | |
518 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
519 | 544 | | |
520 | 545 | | |
521 | 546 | | |
| |||
578 | 603 | | |
579 | 604 | | |
580 | 605 | | |
581 | | - | |
| 606 | + | |
582 | 607 | | |
583 | 608 | | |
584 | 609 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | | - | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
80 | 93 | | |
81 | 94 | | |
82 | 95 | | |
| |||
299 | 312 | | |
300 | 313 | | |
301 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
302 | 318 | | |
303 | 319 | | |
304 | 320 | | |
305 | | - | |
| 321 | + | |
306 | 322 | | |
307 | 323 | | |
308 | 324 | | |
| |||
311 | 327 | | |
312 | 328 | | |
313 | 329 | | |
314 | | - | |
| 330 | + | |
315 | 331 | | |
316 | 332 | | |
317 | 333 | | |
318 | | - | |
| 334 | + | |
319 | 335 | | |
320 | 336 | | |
321 | 337 | | |
322 | 338 | | |
323 | 339 | | |
324 | | - | |
| 340 | + | |
325 | 341 | | |
326 | 342 | | |
327 | 343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
| 16 | + | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
17 | 19 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
0 commit comments