Kubernetes Custom Metrics #1992
-
Kubernetes offers a custom metric API by which any application can expose an endpoint of a particular shape and provide metrics of any type to the cluster. These metrics can then be used for horizontal pod autoscaling. Medium Article A useful metric to have would be requests/second, tracked per Any idea what might be the best way to implement this? I was thinking that the new metrics APIs could be used, perhaps alongside a custom Middleware, to track the load. Of course I'd also need to expose the endpoint for retrieving the metrics... The latter seems like the easier part, but I'm a little lost on where to start with the former. Has anyone implemented something like this for their YARP installation in Kubernetes? Or does anyone have any general thoughts/ideas? This could probably be baked in as part of YARP's Kubernetes Controller in some form, but I figured I'd see if I could get something working on my own before proposing it outright. (Aside: supposedly |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
This sounds similar to #124. This sort of information (e.g. RPS per cluster) may be interesting even outside of the k8s controller scenario. As for what API would be most appropriate, we're still working on that - dotnet/runtime#79371. Right now the majority of networking telemetry is implemented via |
Beta Was this translation helpful? Give feedback.
-
Having a meter in YARP for request count dimensioned by route would be a good thing to have - hint hint @MihaZupan - that would provide the basic information, and would be the right thing for all YARP customers. |
Beta Was this translation helpful? Give feedback.
Having a meter in YARP for request count dimensioned by route would be a good thing to have - hint hint @MihaZupan - that would provide the basic information, and would be the right thing for all YARP customers.
The data for that can be collected in-proc, or using dotnet-monitor which will expose it as a json & prometheus endpoint. I haven't fully parsed the medium post to determine what format k8s wants the data in?