use of io.micrometer.core.instrument.binder.system.ProcessorMetrics in project dolphin-platform by canoo.
the class MetricsModule method initialize.
@Override
public void initialize(final ServerCoreComponents coreComponents) {
final PlatformConfiguration configuration = coreComponents.getConfiguration();
final ServletContext servletContext = coreComponents.getInstance(ServletContext.class);
if (!configuration.getBooleanProperty(METRICS_NOOP_PROPERTY, true)) {
final PrometheusMeterRegistry prometheusRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
final List<Tag> tagList = TagUtil.convertTags(ContextManagerImpl.getInstance().getGlobalContexts());
new ClassLoaderMetrics(tagList).bindTo(prometheusRegistry);
new JvmMemoryMetrics(tagList).bindTo(prometheusRegistry);
new JvmGcMetrics(tagList).bindTo(prometheusRegistry);
new ProcessorMetrics(tagList).bindTo(prometheusRegistry);
new JvmThreadMetrics(tagList).bindTo(prometheusRegistry);
servletContext.addFilter(METRICS_SERVLET_FILTER_NAME, new RequestMetricsFilter()).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, ALL_URL_MAPPING);
servletContext.addListener(new MetricsHttpSessionListener());
servletContext.addServlet(METRICS_SERVLET_NAME, new MetricsServlet(prometheusRegistry)).addMapping(configuration.getProperty(METRICS_ENDPOINT_PROPERTY));
MetricsImpl.getInstance().init(prometheusRegistry);
}
}
use of io.micrometer.core.instrument.binder.system.ProcessorMetrics in project zeppelin by apache.
the class ZeppelinServer method initMetrics.
private static void initMetrics(ZeppelinConfiguration conf) {
if (conf.isPrometheusMetricEnabled()) {
promMetricRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
Metrics.addRegistry(promMetricRegistry);
}
if (conf.isJMXEnabled()) {
Metrics.addRegistry(new JmxMeterRegistry(JmxConfig.DEFAULT, Clock.SYSTEM));
}
new ClassLoaderMetrics().bindTo(Metrics.globalRegistry);
new JvmMemoryMetrics().bindTo(Metrics.globalRegistry);
new JvmThreadMetrics().bindTo(Metrics.globalRegistry);
new FileDescriptorMetrics().bindTo(Metrics.globalRegistry);
new ProcessorMetrics().bindTo(Metrics.globalRegistry);
new UptimeMetrics().bindTo(Metrics.globalRegistry);
new JVMInfoBinder().bindTo(Metrics.globalRegistry);
}
use of io.micrometer.core.instrument.binder.system.ProcessorMetrics in project vertx-micrometer-metrics by vert-x3.
the class MetricsExamples method instrumentJVM.
public void instrumentJVM() {
MeterRegistry registry = BackendRegistries.getDefaultNow();
new ClassLoaderMetrics().bindTo(registry);
new JvmMemoryMetrics().bindTo(registry);
new JvmGcMetrics().bindTo(registry);
new ProcessorMetrics().bindTo(registry);
new JvmThreadMetrics().bindTo(registry);
}
use of io.micrometer.core.instrument.binder.system.ProcessorMetrics in project zipkin by openzipkin.
the class ZipkinPrometheusMetricsConfiguration method prometheusMeterRegistry.
@Bean
@ConditionalOnMissingBean
public PrometheusMeterRegistry prometheusMeterRegistry(PrometheusConfig config, CollectorRegistry registry, Clock clock) {
PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(config, registry, clock);
new JvmMemoryMetrics().bindTo(meterRegistry);
new JvmGcMetrics().bindTo(meterRegistry);
new JvmThreadMetrics().bindTo(meterRegistry);
new ClassLoaderMetrics().bindTo(meterRegistry);
new ProcessorMetrics().bindTo(meterRegistry);
return meterRegistry;
}
use of io.micrometer.core.instrument.binder.system.ProcessorMetrics in project snow-owl by b2ihealthcare.
the class SnowOwlPlugin method createRegistry.
private PrometheusMeterRegistry createRegistry(final MonitoringConfiguration monitoringConfig) {
final PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
Map<String, String> tags = newHashMapWithExpectedSize(1 + monitoringConfig.getTags().size());
// always set the application tag to snow_owl
tags.put("application", "snow_owl");
// override with tags coming from the config file
tags.putAll(monitoringConfig.getTags());
// configure the tags
final List<Tag> commonTags = tags.entrySet().stream().map(entry -> Tag.of(entry.getKey(), entry.getValue())).collect(Collectors.toList());
registry.config().commonTags(commonTags);
// configure default JVM and node metrics
new ClassLoaderMetrics().bindTo(registry);
new JvmGcMetrics().bindTo(registry);
new JvmMemoryMetrics().bindTo(registry);
new JvmThreadMetrics().bindTo(registry);
new UptimeMetrics().bindTo(registry);
new ProcessorMetrics().bindTo(registry);
new LogbackMetrics().bindTo(registry);
new FileDescriptorMetrics().bindTo(registry);
return registry;
}
Aggregations