Search in sources :

Example 1 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics in project iaf by ibissource.

the class IbisContext method initMetrics.

private void initMetrics() {
    if (meterRegistry != null) {
        meterRegistry.config().commonTags("instance", APP_CONSTANTS.getString("instance.name", ""), "ff_version", APP_CONSTANTS.getProperty("application.version"), "hostname", Misc.getHostname(), "dtap.stage", APP_CONSTANTS.getProperty("dtap.stage"));
        // These classes are for exposing JVM specific metrics
        new ClassLoaderMetrics().bindTo(meterRegistry);
        new JvmMemoryMetrics().bindTo(meterRegistry);
        new JvmGcMetrics().bindTo(meterRegistry);
        new ProcessorMetrics().bindTo(meterRegistry);
        new JvmThreadMetrics().bindTo(meterRegistry);
    }
}
Also used : ClassLoaderMetrics(io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics) JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)

Example 2 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics 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);
    }
}
Also used : PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) PlatformConfiguration(com.canoo.platform.core.PlatformConfiguration) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) RequestMetricsFilter(com.canoo.dp.impl.platform.server.metrics.servlet.RequestMetricsFilter) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics) ClassLoaderMetrics(io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics) JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) MetricsHttpSessionListener(com.canoo.dp.impl.platform.server.metrics.servlet.MetricsHttpSessionListener) MetricsServlet(com.canoo.dp.impl.platform.server.metrics.servlet.MetricsServlet) ServletContext(javax.servlet.ServletContext) Tag(io.micrometer.core.instrument.Tag) DispatcherType(javax.servlet.DispatcherType)

Example 3 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics in project hono by eclipse.

the class AbstractServiceApplication method enableJvmMetrics.

/**
 * Enables collection of JVM related metrics.
 * <p>
 * Enables collection of Memory, Thread, GC and Processor metrics.
 */
protected void enableJvmMetrics() {
    new ProcessorMetrics().bindTo(meterRegistry);
    new JvmMemoryMetrics().bindTo(meterRegistry);
    new JvmThreadMetrics().bindTo(meterRegistry);
    new FileDescriptorMetrics().bindTo(meterRegistry);
    this.jvmGcMetrics = new JvmGcMetrics();
    jvmGcMetrics.bindTo(meterRegistry);
}
Also used : JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) FileDescriptorMetrics(io.micrometer.core.instrument.binder.system.FileDescriptorMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)

Example 4 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics 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);
}
Also used : ClassLoaderMetrics(io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics) JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)

Example 5 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics in project pravega by pravega.

the class StatsProviderImpl method init.

@Synchronized
private void init() {
    new JvmMemoryMetrics().bindTo(metrics);
    new JvmGcMetrics().bindTo(metrics);
    new ProcessorMetrics().bindTo(metrics);
    new JvmThreadMetrics().bindTo(metrics);
}
Also used : JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics) Synchronized(lombok.Synchronized)

Aggregations

JvmGcMetrics (io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)8 JvmMemoryMetrics (io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics)8 JvmThreadMetrics (io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics)8 ProcessorMetrics (io.micrometer.core.instrument.binder.system.ProcessorMetrics)7 ClassLoaderMetrics (io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics)6 PrometheusMeterRegistry (io.micrometer.prometheus.PrometheusMeterRegistry)4 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)2 Tag (io.micrometer.core.instrument.Tag)2 LogbackMetrics (io.micrometer.core.instrument.binder.logging.LogbackMetrics)2 FileDescriptorMetrics (io.micrometer.core.instrument.binder.system.FileDescriptorMetrics)2 Index (com.b2international.index.Index)1 Indexes (com.b2international.index.Indexes)1 Mappings (com.b2international.index.mapping.Mappings)1 DefaultRevisionIndex (com.b2international.index.revision.DefaultRevisionIndex)1 RevisionIndex (com.b2international.index.revision.RevisionIndex)1 TimestampProvider (com.b2international.index.revision.TimestampProvider)1 ResourceTypeConverter (com.b2international.snowowl.core.ResourceTypeConverter)1 IndexSettings (com.b2international.snowowl.core.config.IndexSettings)1 RepositoryConfiguration (com.b2international.snowowl.core.config.RepositoryConfiguration)1 SnowOwlConfiguration (com.b2international.snowowl.core.config.SnowOwlConfiguration)1