Skip to content

Conversation

@cratelyn
Copy link
Member

@cratelyn cratelyn commented Nov 20, 2025

in #4298, we introduced a new metrics telemetry
layer that can measure and report status codes, in a protocol-agnostic
fashion. this commit integrates this status code telemtry into the
inbound proxy, so that HTTP and gRPC traffic can be observed.

a new family of metrics is introduced to the InboundMetrics structure,
and the inbound http* router's metrics layer is accordingly updated to
thread this metrics family into an extractor, which is in turn provided
to the NewRecordStatusCode layer.

* as a note for reviewers, the inbound proxy does not model the http and
grpc protocols as distinct concepts in the network stack's type system,
unlike the outbound proxy. this means that while target types in the
outbound proxy like Http<()> are specific to HTTP, the inbound proxy's
distinction of HTTP/gRPC is determined by obtaining and inspecting the
PermitVariant.

🔗 related

some previous pull requests related to this change:

@cratelyn cratelyn force-pushed the kate/app-inbound.add-status-code-metrics branch from 1dc3306 to 0d51e4e Compare December 1, 2025 16:07
@cratelyn cratelyn changed the title feat(app/inbound): add response status metrics feat(app/inbound): http and grpc status code metrics Dec 1, 2025
@cratelyn cratelyn self-assigned this Dec 1, 2025
@cratelyn cratelyn force-pushed the kate/app-inbound.add-status-code-metrics branch from 0d51e4e to 9a3b864 Compare December 1, 2025 16:13
@cratelyn
Copy link
Member Author

cratelyn commented Dec 1, 2025

ci is not currently passing. #4330 shows that this is happening on main, and is not related to these changes.

@cratelyn cratelyn marked this pull request as ready for review December 1, 2025 17:11
@cratelyn cratelyn requested a review from a team as a code owner December 1, 2025 17:11
@cratelyn
Copy link
Member Author

cratelyn commented Dec 4, 2025

#4333 is addressing fixes required in linkerd-install.

in #4298, we introduced a new metrics telemetry
layer that can measure and report status codes, in a protocol-agnostic
fashion. this commit integrates this status code telemtry into the
inbound proxy, so that HTTP and gRPC traffic can be observed.

a new family of metrics is introduced to the `InboundMetrics` structure,
and the inbound http\* router's metrics layer is accordingly updated to
thread this metrics family into an extractor, which is in turn provided
to the `NewRecordStatusCode` layer.

\* as a note for reviewers, the inbound proxy does not model the http and
grpc protocols as distinct concepts in the network stack's type system,
unlike the outbound proxy. this means that while target types in the
outbound proxy like `Http<()>` are specific to HTTP, the inbound proxy's
distinction of HTTP/gRPC is determined by obtaining and inspecting the
`PermitVariant`.

 #### 🔗 related

some previous pull requests related to this change:

* #4298
* #4180
* #4203
* #4127
* #4119

Signed-off-by: katelyn martin <kate@buoyant.io>
@cratelyn cratelyn force-pushed the kate/app-inbound.add-status-code-metrics branch from 9a3b864 to a731516 Compare January 13, 2026 23:40
Copy link
Contributor

@sfleen sfleen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, the PR is clean and easy to follow.

One more general comment that's definitely outside the scope of this PR, it feels like we should have some sort of tests that these values are populated correctly in the actual metrics output. We already test the extracted values like in #4298, but something that checks the real metric output seems like it might be valuable. Maybe even at the linkerd2 repo level?

Copy link
Member

@unleashed unleashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cratelyn
Copy link
Member Author

i did some reading yesterday to see if i could find a way to do integration tests on these metrics, but didn't see anything that could be easily reached for today. i do strongly agree that we should have better facilities for writing integration tests that can inspect metrics, both (a) to test metrics, and (b) as a mechanism for testing and observing other components.

for now, i'm going to merge this and consider that concern out-of-scope. thank you both for your time reviewing this :)

@cratelyn cratelyn merged commit 1c0ca40 into main Jan 15, 2026
15 of 17 checks passed
@cratelyn cratelyn deleted the kate/app-inbound.add-status-code-metrics branch January 15, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants