Commit 5920767
Remove unnecessary distributed tracing scopes from paging methods (#54006)
* Initial plan
* Add logic to skip distributed tracing for paging methods and add tests
Co-authored-by: JoshLove-msft <[email protected]>
* Regenerate BasicTypeSpec test project with updated distributed tracing visitor
Co-authored-by: JoshLove-msft <[email protected]>
* Refactor ShouldSkip to take ScmMethodProvider and check for paging methods
- Updated ShouldSkip method to accept ScmMethodProvider instead of TypeProvider
- Added ShouldSkipType method for constructor visitor to check TypeProvider
- Added IsFrameworkType check in IsPagingMethod to avoid exceptions on non-framework types
- This ensures paging methods are skipped for all method kinds, not just protocol methods
Co-authored-by: JoshLove-msft <[email protected]>
* Rename ShouldSkip to ShouldSkipMethod and remove redundant type check
- Renamed ShouldSkip method to ShouldSkipMethod for clarity
- Removed redundant typeProvider check from ShouldSkipMethod
- Updated VisitMethod to explicitly call both ShouldSkipType and ShouldSkipMethod
- ShouldSkipMethod now only contains the paging method check logic
Co-authored-by: JoshLove-msft <[email protected]>
* Add test coverage for convenience method paging instrumentation
- Extended TestSkipsInstrumentationForPagingMethods to test both Protocol and Convenience method kinds
- Added 2 new test cases for convenience methods (async and sync)
- Now testing 4 scenarios: Protocol async/sync and Convenience async/sync
- All tests verify that paging methods do not have DiagnosticScope instrumentation
Co-authored-by: JoshLove-msft <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JoshLove-msft <[email protected]>1 parent c685ebd commit 5920767
File tree
3 files changed
+91
-135
lines changed- eng/packages/http-client-csharp/generator
- Azure.Generator
- src/Visitors
- test/Visitors
- TestProjects/Local/Basic-TypeSpec/src/Generated
3 files changed
+91
-135
lines changedLines changed: 24 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | | - | |
| 270 | + | |
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
276 | 284 | | |
277 | 285 | | |
278 | 286 | | |
| |||
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
284 | 305 | | |
285 | 306 | | |
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
167 | 222 | | |
168 | 223 | | |
169 | 224 | | |
| |||
Lines changed: 12 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments