kopf icon indicating copy to clipboard operation
kopf copied to clipboard

Wanted to implement prometheus metrics for my operator

Open AnuragEkkati opened this issue 2 years ago • 2 comments

Keywords

prometheus metrics

Problem

I have successfully built an operator with kopf framework. For my operator to be production ready i need to expose /metrics endpoint for scrapping the application or operator metrics.

I see your discussion regarding this. I was trying to run per-operator daemon but it fails ( TypeError: Unspecific resource with no names.) . I am wondering if it works and wanted to know your inputs on how I can run standalone web service for prometheus to expose the metrics endpoint

As observability is becoming more and more relevant, It will be very useful if we have some documentation around how to setup prom metrics for the operator.

AnuragEkkati avatar Dec 29 '22 00:12 AnuragEkkati

Hi, i would suggest you to use the @kopf.on.startup decorator to spin up an webserver that will serve the /metrics endpoint.

schlitzered avatar Feb 02 '23 21:02 schlitzered

I will give it a try. Thanks for the response.

AnuragEkkati avatar Feb 08 '23 16:02 AnuragEkkati