Skip to content

outbound: Report per-route-backend request count metrics#2372

Merged
olix0r merged 1 commit intomainfrom
ver/route-reqs-mtx
Apr 4, 2023
Merged

outbound: Report per-route-backend request count metrics#2372
olix0r merged 1 commit intomainfrom
ver/route-reqs-mtx

Conversation

@olix0r
Copy link
Member

@olix0r olix0r commented Apr 1, 2023

When performing policy-based routing, proxies may dispatch requests through per-route backend configurations. In order to illustrate how routing rules apply and how backend distributions are being honored, this change adds two new metrics:

  • outbound_http_route_backend_requests_total; and
  • outbound_grpc_route_backend_requests_total

Each of these metrics includes labels that identify a routes parent (i.e. a Service), the route resource being used, and the backend resource being used.

This implementation does NOT implement any form of metrics eviction for these new metrics. This is tolerable for the short term as the cardinality of services and routes is generally much less than the cardinality of individual endpoints (where we do require timeout/eviction for metrics).

@olix0r olix0r requested a review from a team as a code owner April 1, 2023 19:36
@olix0r olix0r force-pushed the ver/route-reqs-mtx branch from 52e55bb to f51a651 Compare April 1, 2023 19:37
@olix0r olix0r marked this pull request as draft April 1, 2023 19:49
When performing policy-based routing, proxies may dispatch requests
through per-route backend configurations. In order to illustrate how
routing rules apply and how backend distributions are being honored,
this change adds two new metrics:

* `outbound_http_route_backend_requests_total`; and
* `outbound_grpc_route_backend_requests_total`

Each of these metrics includes labels that identify a routes parent
(i.e. a Service), the route resource being used, and the backend
resource being used.

This implementation does NOT implement any form of metrics eviction for
these new metrics. This is tolerable for the short term as the
cardinality of services and routes is generally much less than the
cardinality of individual endpoints (where we do require
timeout/eviction for metrics).
@olix0r olix0r force-pushed the ver/route-reqs-mtx branch from f51a651 to df78f29 Compare April 1, 2023 19:58
@olix0r olix0r marked this pull request as ready for review April 2, 2023 00:30
@olix0r olix0r marked this pull request as draft April 2, 2023 22:50
Comment on lines +80 to +83
write!(f, "{scope}_group=\"{}\"", meta.group())?;
write!(f, ",{scope}_kind=\"{}\"", meta.kind())?;
write!(f, ",{scope}_namespace=\"{}\"", meta.namespace())?;
write!(f, ",{scope}_name=\"{}\"", meta.name())?;
Copy link
Member Author

Choose a reason for hiding this comment

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

I don’t think these labels are sufficient.

Without port information, we can’t differentiate between ports on a service.

Should port information be reflected through meta.section()? Or do we need a separate field to reflect ports?

How are ports handled in the Gateway API?

Copy link
Member Author

Choose a reason for hiding this comment

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

Gateway API parent references may include either/both sectionName and port (number) fields.

@olix0r olix0r merged commit 9e8c1fc into main Apr 4, 2023
@olix0r olix0r deleted the ver/route-reqs-mtx branch April 4, 2023 21:37
hawkw added a commit to linkerd/linkerd2 that referenced this pull request Apr 4, 2023
This proxy release adds new `outbound_http_route_backend_requests_total`
and `outbound_grpc_route_backend_requests_total` metrics, which can be
used to track how routing rules and backend distributions apply to
requests. These metrics contain labels describing the route's parent
(i.e. a Service), the route resource being used, and the backend
resource being used by each request. In addition, this proxy release
adds new `INFO`-level logs for failure accrual, and updates logging
contexts with Kubernetes resource metadata.

---

* outbound: Emit INFO-level logs on failure accrual changes (linkerd/linkerd2-proxy#2373)
* app: Rename Metrics types as InboundMetrics and OutboundMetrics (linkerd/linkerd2-proxy#2376)
* outbound: Configure balancers with service metadata (linkerd/linkerd2-proxy#2374)
* outbound: Report per-route-backend request count metrics (linkerd/linkerd2-proxy#2372)
* outbound: Report per-route-backend request count metrics (linkerd/linkerd2-proxy#2377)
hawkw added a commit to linkerd/linkerd2 that referenced this pull request Apr 5, 2023
This proxy release adds new `outbound_http_route_backend_requests_total`
and `outbound_grpc_route_backend_requests_total` metrics, which can be
used to track how routing rules and backend distributions apply to
requests. These metrics contain labels describing the route's parent
(i.e. a Service), the route resource being used, and the backend
resource being used by each request. In addition, this proxy release
adds new `INFO`-level logs for failure accrual, and updates logging
contexts with Kubernetes resource metadata.

---

* outbound: Emit INFO-level logs on failure accrual changes (linkerd/linkerd2-proxy#2373)
* app: Rename Metrics types as InboundMetrics and OutboundMetrics (linkerd/linkerd2-proxy#2376)
* outbound: Configure balancers with service metadata (linkerd/linkerd2-proxy#2374)
* outbound: Report per-route-backend request count metrics (linkerd/linkerd2-proxy#2372)
* outbound: Report per-route-backend request count metrics (linkerd/linkerd2-proxy#2377)
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.

1 participant