You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature]: Prometheus/OpenTelemetry metrics for queue #1037
thanks for reaching out - this seems to be long time gone 😄 hadn't had an idea it was existing.
from my perspective open telemetry metrics should be the way to go and therefore needs to have an HTTP pull endpoint as mentioned in the docs on top of collecting the data - maybe you have more experience with that and can elaborate a little on this?
generally I think there is still some design issue in the operator-sdk, unfortunately, as the queue is not in front of the reconciler itself but the watcher and the queue call the reconciler side-by-side. this leads to a potentially race condition #977 and limits the parallelisation of the reconciler (which could be more efficient when reconciling same kinds in parallel - but not same uid's) - see discussion #656
that said collecting metrics inside the queue would currently be just a partial overview.
I think integrating otel metrics in the queue is a good first way to get started - keeping in mind that it doesn't give the total picture. I guess this should be implemented in the operator, so it doesn't needs to be implemented as a custom behaviour over and over again - maybe configurable by the operator settings.
Thanks for providing the additional context @kimpenhaus. I wasn't aware of this.
therefore needs to have an HTTP pull endpoint as mentioned in the docs on top of collecting the data - maybe you have more experience with that and can elaborate a little on this?
@gustavclausen thanks for the fast feedback - I tried to implement your recommendations (metrics and attributes should be proper prefixed now) and tweaked the usage a little - as it felt a little redundant in the usage. I've also added and example.
Activity
kimpenhaus commentedon Feb 4, 2026
Hey @gustavclausen
thanks for reaching out - this seems to be long time gone 😄 hadn't had an idea it was existing.
from my perspective open telemetry metrics should be the way to go and therefore needs to have an HTTP pull endpoint as mentioned in the docs on top of collecting the data - maybe you have more experience with that and can elaborate a little on this?
generally I think there is still some design issue in the operator-sdk, unfortunately, as the queue is not in front of the reconciler itself but the watcher and the queue call the reconciler side-by-side. this leads to a potentially race condition #977 and limits the parallelisation of the reconciler (which could be more efficient when reconciling same kinds in parallel - but not same uid's) - see discussion #656
that said collecting metrics inside the queue would currently be just a partial overview.
I think integrating otel metrics in the queue is a good first way to get started - keeping in mind that it doesn't give the total picture. I guess this should be implemented in the operator, so it doesn't needs to be implemented as a custom behaviour over and over again - maybe configurable by the operator settings.
@buehler, @gustavclausen - what's your opinion on this?
gustavclausen commentedon Feb 4, 2026
Thanks for providing the additional context @kimpenhaus. I wasn't aware of this.
Yes, a HTTP endpoint for scraping the metrics would be the way to go. There are some examples in the official OTEL docs for reference (example of custom counter and example in ASP.NET Core).
I would be happy to build the OTEL foundation and support queue metrics for starters.
refactor(operator)!: decouple ResourceWatcher from Reconciler via que…
kimpenhaus commentedon Jun 14, 2026
@gustavclausen I have tried to add basic otel support. It's currently on a pull request only available. (see #1152)
da you have a chance to test that version prior to releasing it? that would help a lot.
gustavclausen commentedon Jun 14, 2026
That's awesome @kimpenhaus! Will test it out in the next couple of days and get back to you
gustavclausen commentedon Jun 15, 2026
@kimpenhaus I just tested it out in one of the example projects (following the new docs), and it looks to be working fine.
One thing that I would recommend is to prefix the metrics with "kubeops" (or whatever you prefer), according to the naming conventions (see General naming considerations, Recommendations for application developers and System-specific naming sections).
I think this serves as a really good starting point, and we can get some value out of it already. Good job on this, highly appreciated.
kimpenhaus commentedon Jun 15, 2026
@gustavclausen thanks for the fast feedback - I tried to implement your recommendations (metrics and attributes should be proper prefixed now) and tweaked the usage a little - as it felt a little redundant in the usage. I've also added and example.
If you like to - you could get it another shot?
gustavclausen commentedon Jun 17, 2026
@kimpenhaus Looks great! Both the OTLP and Prometheus exporter works as expected
kimpenhaus commentedon Jun 18, 2026
@gustavclausen that is great news - thanks for testing out. I am going to merge the feature then. official release will be on Tuesday. thanks again
feat(metrics): added otel metrics support (dotnet#1152)