Search in sources :

Example 6 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)

Example 7 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics 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;
}
Also used : PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) Index(com.b2international.index.Index) IndexSettings(com.b2international.snowowl.core.config.IndexSettings) ProcessorMetrics(io.micrometer.core.instrument.binder.system.ProcessorMetrics) ResourceTypeConverter(com.b2international.snowowl.core.ResourceTypeConverter) UptimeMetrics(io.micrometer.core.instrument.binder.system.UptimeMetrics) Plugin(com.b2international.snowowl.core.setup.Plugin) CompositeMeterRegistry(io.micrometer.core.instrument.composite.CompositeMeterRegistry) ResourceURIPathResolver(com.b2international.snowowl.core.uri.ResourceURIPathResolver) Mappings(com.b2international.index.mapping.Mappings) Indexes(com.b2international.index.Indexes) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) Environment(com.b2international.snowowl.core.setup.Environment) Map(java.util.Map) RevisionIndex(com.b2international.index.revision.RevisionIndex) RepositoryConfiguration(com.b2international.snowowl.core.config.RepositoryConfiguration) SnowOwlConfiguration(com.b2international.snowowl.core.config.SnowOwlConfiguration) PathTerminologyResourceResolver(com.b2international.snowowl.core.repository.PathTerminologyResourceResolver) ClassPathScanner(com.b2international.snowowl.core.plugin.ClassPathScanner) FileDescriptorMetrics(io.micrometer.core.instrument.binder.system.FileDescriptorMetrics) Tag(io.micrometer.core.instrument.Tag) DefaultRevisionIndex(com.b2international.index.revision.DefaultRevisionIndex) ClassLoaderMetrics(io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) TimestampProvider(com.b2international.index.revision.TimestampProvider) DefaultResourceURIPathResolver(com.b2international.snowowl.core.uri.DefaultResourceURIPathResolver) ConfigurationRegistry(com.b2international.snowowl.core.setup.ConfigurationRegistry) Collectors(java.util.stream.Collectors) MonitoringConfiguration(com.b2international.snowowl.core.monitoring.MonitoringConfiguration) TerminologyRegistry(com.b2international.snowowl.core.terminology.TerminologyRegistry) LogbackMetrics(io.micrometer.core.instrument.binder.logging.LogbackMetrics) List(java.util.List) VersionDocument(com.b2international.snowowl.core.version.VersionDocument) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) Maps.newHashMapWithExpectedSize(com.google.common.collect.Maps.newHashMapWithExpectedSize) Component(com.b2international.snowowl.core.plugin.Component) PrometheusConfig(io.micrometer.prometheus.PrometheusConfig) 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) ClassLoaderMetrics(io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics) JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) Tag(io.micrometer.core.instrument.Tag) UptimeMetrics(io.micrometer.core.instrument.binder.system.UptimeMetrics) LogbackMetrics(io.micrometer.core.instrument.binder.logging.LogbackMetrics)

Example 8 with JvmGcMetrics

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

the class PrometheusJvmExporter method start.

public void start() {
    log.info("enableClassLoaderMetrics = {}, enableJvmMemoryMetrics = {}, enableJvmGcMetrics = {}, enableLogbackMetrics = {}", enableClassLoaderMetrics, enableJvmMemoryMetrics, enableJvmGcMetrics, enableLogbackMetrics);
    if (enableClassLoaderMetrics)
        new ClassLoaderMetrics().bindTo(Metrics.globalRegistry);
    if (enableJvmMemoryMetrics)
        new JvmMemoryMetrics().bindTo(Metrics.globalRegistry);
    if (enableJvmGcMetrics) {
        jvmGcMetrics = new JvmGcMetrics();
        jvmGcMetrics.bindTo(Metrics.globalRegistry);
    }
    if (enableLogbackMetrics) {
        logbackMetrics = new LogbackMetrics();
        logbackMetrics.bindTo(Metrics.globalRegistry);
    }
    if (enableJvmThreadMetrics)
        new JvmThreadMetrics().bindTo(Metrics.globalRegistry);
}
Also used : ClassLoaderMetrics(io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics) JvmThreadMetrics(io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics) JvmMemoryMetrics(io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics) LogbackMetrics(io.micrometer.core.instrument.binder.logging.LogbackMetrics)

Example 9 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics 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;
}
Also used : PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) 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) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 10 with JvmGcMetrics

use of io.micrometer.core.instrument.binder.jvm.JvmGcMetrics in project vertx-micrometer-metrics by vert-x3.

the class VertxMetricsFactoryImpl method metrics.

@Override
public VertxMetrics metrics(VertxOptions vertxOptions) {
    MetricsOptions metricsOptions = vertxOptions.getMetricsOptions();
    MicrometerMetricsOptions options;
    if (metricsOptions instanceof MicrometerMetricsOptions) {
        options = (MicrometerMetricsOptions) metricsOptions;
    } else {
        options = new MicrometerMetricsOptions(metricsOptions.toJson());
    }
    BackendRegistry backendRegistry = BackendRegistries.setupBackend(options);
    VertxMetricsImpl metrics = new VertxMetricsImpl(options, backendRegistry);
    metrics.init();
    if (options.isJvmMetricsEnabled()) {
        new ClassLoaderMetrics().bindTo(backendRegistry.getMeterRegistry());
        new JvmMemoryMetrics().bindTo(backendRegistry.getMeterRegistry());
        new JvmGcMetrics().bindTo(backendRegistry.getMeterRegistry());
        new ProcessorMetrics().bindTo(backendRegistry.getMeterRegistry());
        new JvmThreadMetrics().bindTo(backendRegistry.getMeterRegistry());
    }
    return metrics;
}
Also used : BackendRegistry(io.vertx.micrometer.backends.BackendRegistry) MicrometerMetricsOptions(io.vertx.micrometer.MicrometerMetricsOptions) MetricsOptions(io.vertx.core.metrics.MetricsOptions) 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) MicrometerMetricsOptions(io.vertx.micrometer.MicrometerMetricsOptions) JvmGcMetrics(io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)

Aggregations

JvmGcMetrics (io.micrometer.core.instrument.binder.jvm.JvmGcMetrics)10 JvmMemoryMetrics (io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics)10 JvmThreadMetrics (io.micrometer.core.instrument.binder.jvm.JvmThreadMetrics)10 ProcessorMetrics (io.micrometer.core.instrument.binder.system.ProcessorMetrics)9 ClassLoaderMetrics (io.micrometer.core.instrument.binder.jvm.ClassLoaderMetrics)8 PrometheusMeterRegistry (io.micrometer.prometheus.PrometheusMeterRegistry)5 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)3 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 CompositeMeterRegistry (io.micrometer.core.instrument.composite.CompositeMeterRegistry)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