Commit 5c66a15
ConfigProvider iterates over all sources and reports all non-null values to telemetry (#9404)
* apply all changes from PR #9327, accomodated to master
* nits: add configId in ConfigProvider methods where it was missing; fix configId test to accommodate new ConfigCollector data structure
* Fix 'test config id exists in ConfigCollector when using StableConfigSource'
* introduce reportDefault
* Call collect in BaseApplication.getLogInjectionEnabled; make getAppliedConfigSetting static function that takes in a map
* Fix call to getAppliedConfigSetting in ConfigCollector test
* Introduce ConfigValueResolver and ConfigMergeResolver
* getString methods only report non-null values to telemetry
* remove dependency on collectConfig for reReportToCollector and reReportFinalResult
* updating config collector to not override existing configs
* Adding putDefault and adding unit tests
* relaxing reReportToCollector restraint and adding unit test
* cleanup
* updating failing unit test
* abstracing ConfigCollector
* adding support for proper seqId with Remote Config
* abstracting away getString
* Update internal-api/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java
* Update internal-api/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java
* Update internal-api/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java
* nit: fix javadoc comments
* Modify getEnum, getList, getIntegerRange and getSet to report defaults before calling getString. And modify putDefault to treat null entries as a valid value
* remove remoteConfig methods from ConfigCollector + highestSeqId
* remove serializenulls comment in TelemetryRequestBody
* remove 'no usages' comment above unused ConfigCollector put method
* Simplify javadoc for putAll
* remove javadoc for ABSENT_SEQ_ID
* revert getStringInternal changes
* Introduce new getStringInternal, for getting string from non-default sources
* Deprecate ConfigCollector constructor without sequence ID
* putRemote: ConfigCollector method for 'putting' from Remote Config origin; migrate AppSecConfigServiceImpl to use this API
* ConfigSetting.NON_DEFAULT_SEQ_ID: introduce new constant, migrate all calls to 'DEFAULT_SEQ_ID + 1' to use new constant; move constants to top of ConfigSetting class
* ConfigCollector.put: Delete unused function
* Update internal-api/src/test/groovy/datadog/trace/api/ConfigCollectorTest.groovy
Co-authored-by: Stuart McCulloch <[email protected]>
* replace 'def origin' assignment in ConfigCollectorTest with in-line use
* ConfigCollector.put: Remove deprecated function with zero uses
* NEW_SUB_MAP: Define reusable lambda function as static field in ConfigCollector, used by putDefault and put
* updateAll: rename putAll to updateAll, and scope to Remote origin, only
* Fix updateAll
* Align naming of methods that report remote config to the ConfigCollector
* Avoid need to peek into ConfigCollector internals
* Restore atomic reporting of updates from remote-config
* Update utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java
Co-authored-by: Stuart McCulloch <[email protected]>
* Update utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java
Co-authored-by: Stuart McCulloch <[email protected]>
* Update utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java
Co-authored-by: Stuart McCulloch <[email protected]>
* Fix bug in reReportFinalResult that incorrectly reported CALCULATED for all non-default values
---------
Co-authored-by: Matthew Li <[email protected]>
Co-authored-by: Stuart McCulloch <[email protected]>1 parent 27641db commit 5c66a15
File tree
16 files changed
+1023
-201
lines changed- dd-java-agent/appsec/src/main/java/com/datadog/appsec/config
- dd-smoke-tests/log-injection/src/main/java/datadog/smoketest/loginjection
- internal-api/src
- main/java/datadog/trace/api
- test/groovy/datadog/trace
- api
- bootstrap/config/provider
- telemetry/src
- main/java/datadog/telemetry
- test/groovy/datadog/telemetry
- utils/config-utils/src/main/java/datadog/trace
- api
- bootstrap/config/provider
16 files changed
+1023
-201
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
589 | 588 | | |
590 | 589 | | |
591 | 590 | | |
592 | | - | |
| 591 | + | |
593 | 592 | | |
594 | 593 | | |
595 | 594 | | |
| |||
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 3 | | |
| 4 | + | |
8 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | | - | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
5300 | 5301 | | |
5301 | 5302 | | |
5302 | 5303 | | |
5303 | | - | |
| 5304 | + | |
| 5305 | + | |
5304 | 5306 | | |
5305 | 5307 | | |
5306 | 5308 | | |
| |||
5323 | 5325 | | |
5324 | 5326 | | |
5325 | 5327 | | |
5326 | | - | |
| 5328 | + | |
| 5329 | + | |
5327 | 5330 | | |
5328 | 5331 | | |
5329 | 5332 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
Lines changed: 96 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
71 | 88 | | |
72 | 89 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 90 | + | |
| 91 | + | |
77 | 92 | | |
78 | 93 | | |
79 | | - | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
| |||
89 | 104 | | |
90 | 105 | | |
91 | 106 | | |
92 | | - | |
| 107 | + | |
| 108 | + | |
93 | 109 | | |
94 | 110 | | |
95 | 111 | | |
| |||
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
108 | | - | |
| 124 | + | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
111 | 128 | | |
| |||
126 | 143 | | |
127 | 144 | | |
128 | 145 | | |
129 | | - | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
| |||
146 | 164 | | |
147 | 165 | | |
148 | 166 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
153 | 171 | | |
154 | 172 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
160 | 178 | | |
161 | 179 | | |
162 | 180 | | |
| |||
165 | 183 | | |
166 | 184 | | |
167 | 185 | | |
168 | | - | |
| 186 | + | |
169 | 187 | | |
170 | 188 | | |
171 | | - | |
| 189 | + | |
| 190 | + | |
172 | 191 | | |
173 | 192 | | |
174 | 193 | | |
175 | 194 | | |
176 | | - | |
| 195 | + | |
177 | 196 | | |
178 | 197 | | |
179 | | - | |
| 198 | + | |
180 | 199 | | |
181 | 200 | | |
182 | 201 | | |
| |||
207 | 226 | | |
208 | 227 | | |
209 | 228 | | |
210 | | - | |
| 229 | + | |
211 | 230 | | |
212 | 231 | | |
213 | | - | |
| 232 | + | |
214 | 233 | | |
215 | 234 | | |
216 | 235 | | |
| |||
230 | 249 | | |
231 | 250 | | |
232 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
233 | 277 | | |
234 | 278 | | |
235 | 279 | | |
| |||
243 | 287 | | |
244 | 288 | | |
245 | 289 | | |
246 | | - | |
| 290 | + | |
247 | 291 | | |
248 | 292 | | |
249 | 293 | | |
250 | 294 | | |
251 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
252 | 318 | | |
0 commit comments