Hi,

On Wed, May 27, 2020 at 11:47 PM Allen Liu <al...@adobe.com.invalid> wrote:
> ...I created a function in my monitoring service to register gauge as a 
> service...

You should rather add a @Component(service=GaugeMonitor.class)
annotation to your GaugeImpl, so that's it's registered as an OSGi
service if your build setup handles that. Or call
BundleContext.registerService in that bundle's Activator to register
an instance of GaugeImpl.

And export the java package of GaugeMonitor from your bundle so it's
accessible from the outside.

You can then acquire that GaugeMonitor service from other bundles to
call setValue, and the Gauge should be available from the
MetricsRegistry.

-Bertrand

Reply via email to