See gh-15134
pull/15153/head
Johnny Lim 6 years ago committed by Stephane Nicoll
parent 2c3b455b8b
commit fd5aa3ebf1

@ -21,7 +21,7 @@ import java.time.Duration;
import io.micrometer.core.instrument.Meter;
/**
* A service level agreement boundary for use when configuring micrometer. Can be
* A service level agreement boundary for use when configuring Micrometer. Can be
* specified as either a {@link Long} (applicable to timers and distribution summaries) or
* a {@link Duration} (applicable to only timers).
*
@ -57,7 +57,7 @@ public final class ServiceLevelAgreementBoundary {
}
/**
* Return a new {@link ServiceLevelAgreementBoundary} instance for the given long
* Return a new {@link ServiceLevelAgreementBoundary} instance for the given String
* value.
* @param value the source value
* @return a {@link ServiceLevelAgreementBoundary} instance

@ -131,8 +131,7 @@ public class PrometheusMetricsExportAutoConfiguration {
String job = properties.getJob();
job = (job != null) ? job
: environment.getProperty("spring.application.name");
job = (job != null) ? job : FALLBACK_JOB;
return job;
return (job != null) ? job : FALLBACK_JOB;
}
}

@ -43,7 +43,7 @@ public class PrometheusProperties {
* Configuration options for using Prometheus Pushgateway, allowing metrics to be
* pushed when they cannot be scraped.
*/
private Pushgateway pushgateway = new Pushgateway();
private final Pushgateway pushgateway = new Pushgateway();
/**
* Step size (i.e. reporting frequency) to use.
@ -70,10 +70,6 @@ public class PrometheusProperties {
return this.pushgateway;
}
public void setPushgateway(Pushgateway pushgateway) {
this.pushgateway = pushgateway;
}
/**
* Configuration options for push-based interaction with Prometheus.
*/

@ -34,7 +34,7 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Class that can be used to managed the pushing of metrics to a {@link PushGateway
* Class that can be used to manage the pushing of metrics to a {@link PushGateway
* Prometheus PushGateway}. Handles the scheduling of push operations, error handling and
* shutdown operations.
*
@ -115,9 +115,9 @@ public class PrometheusPushGatewayManager {
}
catch (UnknownHostException ex) {
String host = ex.getMessage();
String message = "Unable to locate prometheus push gateway host";
message += StringUtils.hasLength(host) ? " '" + host + "'" : "";
message += ". No longer attempting metrics publication to this host";
String message = "Unable to locate prometheus push gateway host"
+ (StringUtils.hasLength(host) ? " '" + host + "'" : "")
+ ". No longer attempting metrics publication to this host";
logger.error(message, ex);
shutdown(ShutdownOperation.NONE);
}

@ -213,13 +213,12 @@ class OnClassCondition extends FilteringSpringBootCondition {
private ConditionOutcome getOutcome(String candidates) {
try {
if (!candidates.contains(",")) {
return getOutcome(candidates, ClassNameFilter.MISSING,
this.beanClassLoader);
return getOutcome(candidates, this.beanClassLoader);
}
for (String candidate : StringUtils
.commaDelimitedListToStringArray(candidates)) {
ConditionOutcome outcome = getOutcome(candidate,
ClassNameFilter.MISSING, this.beanClassLoader);
this.beanClassLoader);
if (outcome != null) {
return outcome;
}
@ -231,9 +230,8 @@ class OnClassCondition extends FilteringSpringBootCondition {
return null;
}
private ConditionOutcome getOutcome(String className,
ClassNameFilter classNameFilter, ClassLoader classLoader) {
if (classNameFilter.matches(className, classLoader)) {
private ConditionOutcome getOutcome(String className, ClassLoader classLoader) {
if (ClassNameFilter.MISSING.matches(className, classLoader)) {
return ConditionOutcome.noMatch(ConditionMessage
.forCondition(ConditionalOnClass.class)
.didNotFind("required class").items(Style.QUOTE, className));

@ -1011,11 +1011,6 @@
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>${netty-tcnative.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
<version>${prometheus-pushgateway.version}</version>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
@ -1023,6 +1018,11 @@
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
<version>${prometheus-pushgateway.version}</version>
</dependency>
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>

@ -2013,7 +2013,7 @@ include::{code-examples}/jpa/HibernateSecondLevelCacheExample.java[tag=configura
----
This customizer will configure Hibernate to use the same `CacheManager` as the one that
the application uses. It is also possible to use separate `CacheManager` instances, refer
the application uses. It is also possible to use separate `CacheManager` instances. For details, refer
to {hibernate-documentation}#caching-provider-jcache[the Hibernate user guide].

@ -1436,7 +1436,7 @@ annotation markers.
[[production-ready-metrics-export-appoptics]]
==== AppOptics
By default, the AppOptics registry pushes metrics to https://www.appoptics.com/
By default, the AppOptics registry pushes metrics to https://api.appoptics.com/v1/measurements
periodically. To export metrics to SaaS
{micrometer-registry-documentation}/appoptics[AppOptics], your API token must be provided:

@ -62,6 +62,7 @@ public class FilteredClassLoader extends URLClassLoader {
* Create a {@link FilteredClassLoader} that hides resources from the given
* {@link ClassPathResource classpath resources}.
* @param hiddenResources the resources to hide
* @since 2.1.0
*/
public FilteredClassLoader(ClassPathResource... hiddenResources) {
this(Collections.emptyList(),
@ -164,6 +165,8 @@ public class FilteredClassLoader extends URLClassLoader {
/**
* Filter to restrict the resources that can be loaded.
*
* @since 2.1.0
*/
public static final class ClassPathResourceFilter implements Predicate<String> {

@ -243,7 +243,7 @@ public class AutoConfigureAnnotationProcessor extends AbstractProcessor {
NamedValuesExtractor(String... names) {
this.names = new HashSet<>(Arrays.asList(names));
};
}
@Override
public List<Object> getValues(AnnotationMirror annotation) {

Loading…
Cancel
Save