Kuadrant / gateway-api-state-metrics

Kube State Metrics `CustomResourceState` configurations for Gateway API resources
Apache License 2.0
13 stars 2 forks source link

metrics: Policy Attachment metrics (investigate/proof of concept) #4

Closed david-martin closed 8 months ago

david-martin commented 10 months ago

How can/Does it make sense to support state metrics for Policies that have been attached via https://gateway-api.sigs.k8s.io/references/policy-attachment/?

What's the impact on:

Would an example or 'how-to' make more sense if it's not reasonable to solve this in a generic way?

david-martin commented 10 months ago

@guicassolato @alexsnaps Would you have an example AuthPolicy and RateLimitPolicy for reference here (v2 I guess)? Even better if you had one with the status block showing some useful information.

Thanks, I'd really appreciate it.

guicassolato commented 9 months ago

@guicassolato @alexsnaps Would you have an example AuthPolicy and RateLimitPolicy for reference here (v2 I guess)? Even better if you had one with the status block showing some useful information.

These are the most up-to-date examples of AuthPolicy and RateLimitPolicy v2 I can think of now, @david-martin:

TBH, I'm not sure how helpful the status stanza of these CRs can be as of today. But we do have some work in the roadmap to get them enhanced soon – certainly along the lines of what's proposed in https://github.com/Kuadrant/architecture/pull/9, but also open to suggestions.


Meanwhile, and at least for Authorino only, maybe there's sth here that we could use:

While the AuthConfigs and the AuthPolicies relate 1:1 one another, the status of the AuthConfig CRs, as well as their so-called associated "deep metrics", will certainly influence the status and the metrics of the AuthPolicies. Perhaps not so much regarding the Policy Attachment aspect of the AuthPolicies directly, but other observable aspects for sure. And, by transition, even the Policy Attachment part may end up affected, I reckon.

E.g.: "HTTPRouteRule X is generating too much latency due to an associated config in the auth policy that make requests to this route to fetch metadata from an external source, without setting proper caching." (If that makes any sense.)

guicassolato commented 8 months ago

I don't see metrics related to Kuadrant's AuthPolicy introduced in #36. Do we want to reopen this issue or capture what we missed in a new one?

david-martin commented 8 months ago

Good catch @guicassolato I'll reopen this. It closed automatically. @Ygnas We can model the AuthPolicy metrics and dashboard on the RLP & TLSPolicy ones.