Open shawkins opened 3 years ago
Hi @shawkins , it's an interesting idea, the cache is quite an internal thing, currently we are actually changing the implementation regarding to it. So it will be more extensible and replacable with custom implementation. However not sure if that is the best place to imeplement metrics. I agree that observability could be better in general. I think the best would be to implement metrics with micromete, seer: https://github.com/java-operator-sdk/java-operator-sdk/issues/64
What metrics you are interested in, could you provide some examples? Thx
I think the best would be to implement metrics with micromete, seer: #64
Yes, that is the approach we are taking with the quarkus + micrometer integration.
What metrics you are interested in, could you provide some examples? Thx
Access to the cache was for things like:
Related to #64 and #323 in general we added Timed and Counted at the primary controller methods - see #393 (which I should have logged against the extension). Those as well could be handled by the operator framework itself.
We are looking to implement metrics over the custom resource managed by the operator and would like to avoid k8s api calls if possible. It seems that the cache could be utilized either directly or indirectly for this purpose. Directly would look like having access in the Controller, possibly via the init method - then we could use that to drive simple metrics count, and checks based upon the resource Status. Indirect access would be related to https://github.com/java-operator-sdk/java-operator-sdk/issues/323 - such that count and other readily definable metrics are automatically exposed.