org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer Java Examples

The following examples show how to use org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer. 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: ZipkinServerConfiguration.java    From pivotal-bank-demo with Apache License 2.0 6 votes vote down vote up
@Bean
public MeterRegistryCustomizer meterRegistryCustomizer() {
  return registry ->
      registry
          .config()
          .meterFilter(
              MeterFilter.deny(
                  id -> {
                    String uri = id.getTag("uri");
                    return uri != null
                        && (uri.startsWith("/actuator")
                            || uri.startsWith("/metrics")
                            || uri.startsWith("/health")
                            || uri.startsWith("/favicon.ico")
                            || uri.startsWith("/prometheus"));
                  }));
}
 
Example #2
Source File: LocMetricsAutoConfigure.java    From loc-framework with MIT License 6 votes vote down vote up
@Bean
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
  return registry -> {
    registry.config().commonTags(APP_TAG_KEY, appName);
    registry.config().commonTags(HOST_TAG_KEY, HostUtil.getHost(HostUtil.getMXBeanName()));
    registry.config()
        .commonTags(IP_TAG_KEY, registry.config().namingConvention().tagKey(HostUtil.HOST_IP));
    registry.config().commonTags(PROFILE_KEY, profile);
  };
}
 
Example #3
Source File: MonitoringConfiguration.java    From waggle-dance with Apache License 2.0 5 votes vote down vote up
@Bean
MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(PrometheusConfiguration prometheusConfiguration) {
  return registry -> {
    if (registry instanceof PrometheusMeterRegistry) {
      registry.config().commonTags("application", prometheusConfiguration.getPrefix());
    }
  };
}
 
Example #4
Source File: MetricsConfiguration.java    From enmasse with Apache License 2.0 5 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
@Profile(PROFILE_DEVICE_REGISTRY)
public MeterRegistryCustomizer<MeterRegistry> commonTagsRegistry() {
    return r -> r
            .config()
            .commonTags(forService(Constants.SERVICE_NAME_DEVICE_REGISTRY));
}
 
Example #5
Source File: MetricsConfiguration.java    From enmasse with Apache License 2.0 5 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
@Profile(PROFILE_DEVICE_CONNECTION)
public MeterRegistryCustomizer<MeterRegistry> commonTagsConnection() {
    return r -> r
            .config()
            .commonTags(forService(Constants.SERVICE_NAME_DEVICE_CONNECTION));
}
 
Example #6
Source File: MetricsConfiguration.java    From enmasse with Apache License 2.0 5 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
@Profile({PROFILE_DEVICE_CONNECTION})
public MeterRegistryCustomizer<MeterRegistry> commonTagsConnection() {
    return r -> r
            .config()
            .commonTags(forService(Constants.SERVICE_NAME_DEVICE_CONNECTION));
}
 
Example #7
Source File: MetricsConfiguration.java    From enmasse with Apache License 2.0 5 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
@Profile({PROFILE_REGISTRY_ADAPTER, PROFILE_REGISTRY_MANAGEMENT})
public MeterRegistryCustomizer<MeterRegistry> commonTagsRegistry() {
    return r -> r
            .config()
            .commonTags(forService(Constants.SERVICE_NAME_DEVICE_REGISTRY));
}
 
Example #8
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_KURA));
}
 
Example #9
Source File: LightminServer.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Bean
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(@Value("${spring.application.name}") final String name) {
    return registry ->
            registry.config()
                    .commonTags("APPLICATION_NAME", name);
}
 
Example #10
Source File: ApplicationConfig.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Bean
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(@Value("${spring.application.name}") final String name) {
    return registry ->
            registry.config()
                    .commonTags("APPLICATION_NAME", name);
}
 
Example #11
Source File: LightminServerCoreConfiguration.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(value = MeterRegistryCustomizer.class)
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
    return registry -> registry.config();
}
 
Example #12
Source File: LightminClientConfiguration.java    From spring-batch-lightmin with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(value = MeterRegistryCustomizer.class)
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
    return registry -> registry.config();
}
 
Example #13
Source File: MeterRegistryConfig.java    From entrada with GNU General Public License v3.0 4 votes vote down vote up
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags(
    @Value("${management.metrics.export.graphite.prefix:entrada}") String prefix) {
  return r -> r.config().commonTags("prefix", StringUtils.trim(prefix));
}
 
Example #14
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_MQTT));
}
 
Example #15
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_AMQP));
}
 
Example #16
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_HTTP));
}
 
Example #17
Source File: AlibabaRSocketBrokerServer.java    From alibaba-rsocket-broker with Apache License 2.0 4 votes vote down vote up
@Bean
MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
    return registry -> registry.config().commonTags("application", "alibaba-rsocket-broker");
}
 
Example #18
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_LORA));
}
 
Example #19
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_COAP));
}
 
Example #20
Source File: Config.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {
    return r -> r.config().commonTags(
            MetricsTags.forProtocolAdapter(Constants.PROTOCOL_ADAPTER_TYPE_SIGFOX));
}
 
Example #21
Source File: ApplicationConfig.java    From hono with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {

    return r -> r.config().commonTags(MetricsTags.forService(Constants.SERVICE_NAME_AUTH));
}
 
Example #22
Source File: MonitoringConfiguration.java    From eventeum with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnProperty(name="management.endpoint.metrics.enabled", havingValue = "true")
public MeterRegistryCustomizer<MeterRegistry> metricsCommonTags(Environment environment) {
    return registry -> registry.config().commonTags("application", "Eventeum", "environment", getProfileName(environment));
}
 
Example #23
Source File: ContainersApplication.java    From k8s-for-the-busy with Apache License 2.0 4 votes vote down vote up
@Bean
MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
	return registry -> registry.config().commonTags("application", "myapp-micrometer-tag");
}
 
Example #24
Source File: ApplicationConfig.java    From hono with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {

    return r -> r.config().commonTags(MetricsTags.forService(Constants.SERVICE_NAME_DEVICE_REGISTRY));

}
 
Example #25
Source File: MetricsConfiguration.java    From enmasse with Apache License 2.0 3 votes vote down vote up
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {

    return r -> r.config().commonTags(
            MetricsTags.forService("tenant-service"));

}
 
Example #26
Source File: ApplicationConfig.java    From hono with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {

    return r -> r.config().commonTags(MetricsTags.forService(Constants.SERVICE_NAME_DEVICE_CONNECTION));

}
 
Example #27
Source File: ApplicationConfig.java    From hono with Eclipse Public License 2.0 3 votes vote down vote up
/**
 * Customizer for meter registry.
 *
 * @return The new meter registry customizer.
 */
@Bean
public MeterRegistryCustomizer<MeterRegistry> commonTags() {

    return r -> r.config().commonTags(MetricsTags.forService(Constants.SERVICE_NAME_DEVICE_REGISTRY));

}