Provide observation context to exporters #18467
Labels
area/observability
Marks an issue as observability related
component/zeebe
Related to the Zeebe component/team
kind/feature
Categorizes an issue or PR as a feature, i.e. new behavior
Is your feature request related to a problem? Please describe.
I would like to add metrics from my own custom exporter and have them scraped along with the rest of the Zeebe metrics. However, using the default
CollectorRegistry.defaultRegistry
(or the Micrometer equivalent one) fails, as the exporter is loaded in a different class loader. This also implies that Zeebe will always rely on the default registry, which may not be true forever.Describe the solution you'd like
Much like the
Context
provided to the exporter on configuration has aLogger
member, I would like the same for metrics. I think usingMicrometer
(which is to metrics what SLF4J is to logging) would make more sense, but I'm OK with Prometheus :)Describe alternatives you've considered
You can work around this by loading the
CollectorRegistry
class directly from the system class loader, e.g.:As you can see, this is cumbersome, and ignores all the try-catch and possible errors. It also relies on the
defaultRegistry
global, which makes it harder if we ever more to Micrometer across the board.The text was updated successfully, but these errors were encountered: