Commit f2e5da3
authored
refactor(app/inbound): router metrics middleware are
#4119 introduced a
`Permitted<T>` structure, to provide a more formal notion of a
`(HttpRoutePermit, T)` tuple.
during review of #4180, we
had a discussion about how the inbound proxy's http router had metrics
layers which were tightly coupled to the notion of a `Permitted<T>`:
> This isn't a hard blocker--but this is unfortunate that we're coupling
> this impl to the Permitted target type -- target types are usually an
> _internal implementation detail_ and not a public api that is depended
> on elsewhere.
>
> ...
>
> and then have our Permitted impl `Param<MetricsVariant> for Permitted<T>`.
>
> then this module remains decoupled from the concrete target types.
>
> That is, the metrics module is decoupled from _where it's called_--as
> long as the caller provides a target that can give us what we need to
> build our extractors, we're good to go.
this branch performs a series of changes to decouple our metric layers'
extractors from `Permitted<T>`.
importantly, this has the effect of leaving the inbound metrics layers'
extractors agnostic to their target: they now provide implementations
like `svc::ExtractParam<BodyDataMetrics, T>` rather than
`svc::ExtractParam<BodyDataMetrics, Permitted<T>>`.
see #4180.
---
* refactor(app/inbound): `Permitted<T>` is a struct
this restructures `Permitted<T>` so that it is no longer an enum. we
instead define a "dumb" enum that represents the grpc/http dichotomy,
and return to a model in which `Permitted<T>` is a `struct`.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app/inbound): `Permitted<T>` is not `T: Param<P>`
in order to carve out space to allow us to define other `Param<P>`
implementations for `Permitted<T>`, we remove this blanket deference to
the inner `T` target.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app/inbound): `Permitted<T>` exposes `Param<P>` impls
we cannot expose `T` or any of its own parameters, but we can expose the
permit, its variant, and its labels.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app/inbound): `family` lookups accept `PermitVariant`
these now accept specifically the variant, rather than the permitted
target.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app/inbound): `ExtractRecordBodyDataMetrics` is `T`-agnostic
this type now can extract metrics from arbitrary targets.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app/inbound): `ExtractRequestCount` is `T`-agnostic
this type now can extract metrics from arbitrary targets.
Signed-off-by: katelyn martin <[email protected]>
* refactor(app/inbound): `LogicalPerRequest::from` is `T`-agnostic
Signed-off-by: katelyn martin <[email protected]>
---------
Signed-off-by: katelyn martin <[email protected]>T-agnostic (#4181)1 parent 50ba196 commit f2e5da3
File tree
4 files changed
+107
-54
lines changed- linkerd/app/inbound/src
- http
- router
- policy
4 files changed
+107
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
259 | 262 | | |
260 | 263 | | |
261 | 264 | | |
262 | | - | |
| 265 | + | |
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
| 269 | + | |
266 | 270 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 271 | + | |
| 272 | + | |
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| |||
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
289 | | - | |
| 292 | + | |
290 | 293 | | |
291 | 294 | | |
292 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
109 | 112 | | |
110 | | - | |
111 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| |||
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
169 | | - | |
| 174 | + | |
170 | 175 | | |
171 | | - | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
175 | | - | |
176 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
177 | 182 | | |
178 | 183 | | |
179 | 184 | | |
| |||
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
216 | | - | |
217 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
218 | 226 | | |
219 | | - | |
220 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
170 | 177 | | |
171 | 178 | | |
172 | 179 | | |
173 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
177 | 188 | | |
178 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
179 | 194 | | |
180 | 195 | | |
181 | 196 | | |
| |||
394 | 409 | | |
395 | 410 | | |
396 | 411 | | |
397 | | - | |
398 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
399 | 422 | | |
400 | | - | |
| 423 | + | |
401 | 424 | | |
402 | | - | |
403 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
404 | 445 | | |
405 | 446 | | |
406 | 447 | | |
407 | 448 | | |
408 | 449 | | |
409 | 450 | | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
414 | 457 | | |
415 | 458 | | |
416 | 459 | | |
417 | 460 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 461 | + | |
422 | 462 | | |
423 | 463 | | |
424 | 464 | | |
425 | 465 | | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 466 | + | |
430 | 467 | | |
431 | 468 | | |
432 | 469 | | |
433 | 470 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
438 | 478 | | |
439 | 479 | | |
440 | 480 | | |
| |||
0 commit comments