Skip to content

Instantly share code, notes, and snippets.

@girisagar46
Created December 30, 2020 17:03
Show Gist options
  • Select an option

  • Save girisagar46/9ffa46b7f251301576a7df9bd4e59c00 to your computer and use it in GitHub Desktop.

Select an option

Save girisagar46/9ffa46b7f251301576a7df9bd4e59c00 to your computer and use it in GitHub Desktop.
// Just a service class which will provide the instance of PrometheusMeterRegistry
public class MetricService {
private static PrometheusMeterRegistry prometheusMeterRegistry = null;
public static PrometheusMeterRegistry getRegistry() {
if (prometheusMeterRegistry == null) {
prometheusMeterRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
}
return prometheusMeterRegistry;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment