Commit c442de6
authored
Opt-out API Security endpoint discovery (#9623)
We were keeping this feature disabled for now because the backend does not support it yet. However, we’re actively working on adding support, and in the meantime, we need to measure the volume of data we’d need to handle once the feature is enabled.
As a result, this PR sets the default config flag to true:
ConfigDefaults.java#L120
Enabling the feature by default surfaced an issue during test execution:
an exception was thrown due to multiple beans of type RequestMappingHandlerMapping being present in the Spring context, which caused a NoUniqueBeanDefinitionException.
Error:
No qualifying bean of type 'RequestMappingHandlerMapping' available:
expected single matching bean but found 2: requestMappingHandlerMapping,controllerEndpointHandlerMapping
To resolve this, the instrumentations were updated to:
Use getBeansOfType(...) instead of getBean(...)
Iterate over all available RequestMappingHandlerMapping beans
Collect and merge their handler methods safely.
This avoids the error and ensures compatibility with Spring setups that register multiple handler mappings.1 parent 730565b commit c442de6
File tree
3 files changed
+19
-12
lines changed- dd-java-agent/instrumentation/spring/spring-webmvc
- spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb
- spring-webmvc-5.3/src/main/java/datadog/trace/instrumentation/springweb
- dd-trace-api/src/main/java/datadog/trace/api
3 files changed
+19
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
0 commit comments