io.prometheus.client.hotspot.StandardExports Java Examples
The following examples show how to use
io.prometheus.client.hotspot.StandardExports.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrometheusMetricsSystem.java From besu with Apache License 2.0 | 6 votes |
public static ObservableMetricsSystem init(final MetricsConfiguration metricsConfiguration) { if (!metricsConfiguration.isEnabled() && !metricsConfiguration.isPushEnabled()) { return new NoOpMetricsSystem(); } final PrometheusMetricsSystem metricsSystem = new PrometheusMetricsSystem( metricsConfiguration.getMetricCategories(), metricsConfiguration.isTimersEnabled()); if (metricsSystem.isCategoryEnabled(StandardMetricCategory.PROCESS)) { metricsSystem.collectors.put( StandardMetricCategory.PROCESS, singleton(new StandardExports().register(metricsSystem.registry))); } if (metricsSystem.isCategoryEnabled(StandardMetricCategory.JVM)) { metricsSystem.collectors.put( StandardMetricCategory.JVM, asList( new MemoryPoolsExports().register(metricsSystem.registry), new BufferPoolsExports().register(metricsSystem.registry), new GarbageCollectorExports().register(metricsSystem.registry), new ThreadExports().register(metricsSystem.registry), new ClassLoadingExports().register(metricsSystem.registry))); } return metricsSystem; }
Example #2
Source File: JavaInstanceStarter.java From pulsar with Apache License 2.0 | 6 votes |
private void registerDefaultCollectors(CollectorRegistry registry) { // Add the JMX exporter for functionality similar to the kafka connect JMX metrics try { new JmxCollector("{}").register(registry); } catch (MalformedObjectNameException ex) { System.err.println(ex); } // Add the default exports from io.prometheus.client.hotspot.DefaultExports new StandardExports().register(registry); new MemoryPoolsExports().register(registry); new BufferPoolsExports().register(registry); new GarbageCollectorExports().register(registry); new ThreadExports().register(registry); new ClassLoadingExports().register(registry); new VersionInfoExports().register(registry); }