Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion 8 pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@
-Xep:MissingSummary:OFF
-Xep:LongDoubleConversion:OFF
-Xep:StringSplitter:OFF
-XepExcludedPaths:.*/generated/.*
-XepExcludedPaths:(.*/generated/.*|.*/src/test/java/.*|.*/examples/.*|.*/integration-tests/.*)
-XepOpt:NullAway:AnnotatedPackages=io.prometheus.metrics
</arg>
</compilerArgs>
<annotationProcessorPaths>
Expand All @@ -276,6 +277,11 @@
<artifactId>error_prone_core</artifactId>
<version>2.41.0</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>0.12.8</version>
</path>
<!-- Other annotation processors go here.

If 'annotationProcessorPaths' is set, processors will no longer be
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.prometheus.metrics.config;

import java.util.Map;
import javax.annotation.Nullable;

/** Properties starting with io.prometheus.exemplars */
public class ExemplarsProperties {
Expand All @@ -10,14 +11,14 @@ public class ExemplarsProperties {
private static final String MAX_RETENTION_PERIOD_SECONDS = "maxRetentionPeriodSeconds";
private static final String SAMPLE_INTERVAL_MILLISECONDS = "sampleIntervalMilliseconds";

private final Integer minRetentionPeriodSeconds;
private final Integer maxRetentionPeriodSeconds;
private final Integer sampleIntervalMilliseconds;
@Nullable private final Integer minRetentionPeriodSeconds;
@Nullable private final Integer maxRetentionPeriodSeconds;
@Nullable private final Integer sampleIntervalMilliseconds;

private ExemplarsProperties(
Integer minRetentionPeriodSeconds,
Integer maxRetentionPeriodSeconds,
Integer sampleIntervalMilliseconds) {
@Nullable Integer minRetentionPeriodSeconds,
@Nullable Integer maxRetentionPeriodSeconds,
@Nullable Integer sampleIntervalMilliseconds) {
this.minRetentionPeriodSeconds = minRetentionPeriodSeconds;
this.maxRetentionPeriodSeconds = maxRetentionPeriodSeconds;
this.sampleIntervalMilliseconds = sampleIntervalMilliseconds;
Expand All @@ -28,6 +29,7 @@ private ExemplarsProperties(
*
* <p>Default see {@code ExemplarSamplerConfig.DEFAULT_MIN_RETENTION_PERIOD_SECONDS}
*/
@Nullable
public Integer getMinRetentionPeriodSeconds() {
return minRetentionPeriodSeconds;
}
Expand All @@ -37,6 +39,7 @@ public Integer getMinRetentionPeriodSeconds() {
*
* <p>Default see {@code ExemplarSamplerConfig.DEFAULT_MAX_RETENTION_PERIOD_SECONDS}
*/
@Nullable
public Integer getMaxRetentionPeriodSeconds() {
return maxRetentionPeriodSeconds;
}
Expand All @@ -48,6 +51,7 @@ public Integer getMaxRetentionPeriodSeconds() {
*
* <p>Default see {@code ExemplarSamplerConfig.DEFAULT_SAMPLE_INTERVAL_MILLISECONDS}
*/
@Nullable
public Integer getSampleIntervalMilliseconds() {
return sampleIntervalMilliseconds;
}
Expand Down Expand Up @@ -108,9 +112,9 @@ public static Builder builder() {

public static class Builder {

private Integer minRetentionPeriodSeconds;
private Integer maxRetentionPeriodSeconds;
private Integer sampleIntervalMilliseconds;
@Nullable private Integer minRetentionPeriodSeconds;
@Nullable private Integer maxRetentionPeriodSeconds;
@Nullable private Integer sampleIntervalMilliseconds;

private Builder() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;

/** Properties starting with io.prometheus.exporter.filter */
public class ExporterFilterProperties {
Expand All @@ -15,16 +16,16 @@ public class ExporterFilterProperties {
public static final String METRIC_NAME_MUST_NOT_START_WITH = "metricNameMustNotStartWith";
private static final String PREFIX = "io.prometheus.exporter.filter";

private final List<String> allowedNames;
private final List<String> excludedNames;
private final List<String> allowedPrefixes;
private final List<String> excludedPrefixes;
@Nullable private final List<String> allowedNames;
@Nullable private final List<String> excludedNames;
@Nullable private final List<String> allowedPrefixes;
@Nullable private final List<String> excludedPrefixes;

private ExporterFilterProperties(
List<String> allowedNames,
List<String> excludedNames,
List<String> allowedPrefixes,
List<String> excludedPrefixes) {
@Nullable List<String> allowedNames,
@Nullable List<String> excludedNames,
@Nullable List<String> allowedPrefixes,
@Nullable List<String> excludedPrefixes) {
this.allowedNames =
allowedNames == null ? null : Collections.unmodifiableList(new ArrayList<>(allowedNames));
this.excludedNames =
Expand All @@ -39,18 +40,22 @@ private ExporterFilterProperties(
: Collections.unmodifiableList(new ArrayList<>(excludedPrefixes));
}

@Nullable
public List<String> getAllowedMetricNames() {
return allowedNames;
}

@Nullable
public List<String> getExcludedMetricNames() {
return excludedNames;
}

@Nullable
public List<String> getAllowedMetricNamePrefixes() {
return allowedPrefixes;
}

@Nullable
public List<String> getExcludedMetricNamePrefixes() {
return excludedPrefixes;
}
Expand Down Expand Up @@ -79,10 +84,10 @@ public static Builder builder() {

public static class Builder {

private List<String> allowedNames;
private List<String> excludedNames;
private List<String> allowedPrefixes;
private List<String> excludedPrefixes;
@Nullable private List<String> allowedNames;
@Nullable private List<String> excludedNames;
@Nullable private List<String> allowedPrefixes;
@Nullable private List<String> excludedPrefixes;

private Builder() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package io.prometheus.metrics.config;

import java.util.Map;
import javax.annotation.Nullable;

/** Properties starting with io.prometheus.exporter.httpServer */
public class ExporterHttpServerProperties {

private static final String PORT = "port";
private static final String PREFIX = "io.prometheus.exporter.httpServer";
private final Integer port;
@Nullable private final Integer port;

private ExporterHttpServerProperties(Integer port) {
private ExporterHttpServerProperties(@Nullable Integer port) {
this.port = port;
}

@Nullable
public Integer getPort() {
return port;
}
Expand All @@ -34,7 +36,7 @@ public static Builder builder() {

public static class Builder {

private Integer port;
@Nullable private Integer port;

private Builder() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nullable;

// TODO: JavaDoc is currently only in OpenTelemetryExporter.Builder. Look there for reference.
public class ExporterOpenTelemetryProperties {
Expand All @@ -21,27 +22,27 @@ public class ExporterOpenTelemetryProperties {
"resourceAttributes"; // otel.resource.attributes
private static final String PREFIX = "io.prometheus.exporter.opentelemetry";

private final String protocol;
private final String endpoint;
@Nullable private final String endpoint;
@Nullable private final String protocol;
private final Map<String, String> headers;
private final String interval;
private final String timeout;
private final String serviceName;
private final String serviceNamespace;
private final String serviceInstanceId;
private final String serviceVersion;
@Nullable private final String interval;
@Nullable private final String timeout;
@Nullable private final String serviceName;
@Nullable private final String serviceNamespace;
@Nullable private final String serviceInstanceId;
@Nullable private final String serviceVersion;
private final Map<String, String> resourceAttributes;

private ExporterOpenTelemetryProperties(
String protocol,
String endpoint,
@Nullable String protocol,
@Nullable String endpoint,
Map<String, String> headers,
String interval,
String timeout,
String serviceName,
String serviceNamespace,
String serviceInstanceId,
String serviceVersion,
@Nullable String interval,
@Nullable String timeout,
@Nullable String serviceName,
@Nullable String serviceNamespace,
@Nullable String serviceInstanceId,
@Nullable String serviceVersion,
Map<String, String> resourceAttributes) {
this.protocol = protocol;
this.endpoint = endpoint;
Expand All @@ -55,10 +56,12 @@ private ExporterOpenTelemetryProperties(
this.resourceAttributes = resourceAttributes;
}

@Nullable
public String getProtocol() {
return protocol;
}

@Nullable
public String getEndpoint() {
return endpoint;
}
Expand All @@ -67,26 +70,32 @@ public Map<String, String> getHeaders() {
return headers;
}

@Nullable
public String getInterval() {
return interval;
}

@Nullable
public String getTimeout() {
return timeout;
}

@Nullable
public String getServiceName() {
return serviceName;
}

@Nullable
public String getServiceNamespace() {
return serviceNamespace;
}

@Nullable
public String getServiceInstanceId() {
return serviceInstanceId;
}

@Nullable
public String getServiceVersion() {
return serviceVersion;
}
Expand Down Expand Up @@ -131,15 +140,15 @@ public static Builder builder() {

public static class Builder {

private String protocol;
private String endpoint;
@Nullable private String protocol;
@Nullable private String endpoint;
private final Map<String, String> headers = new HashMap<>();
private String interval;
private String timeout;
private String serviceName;
private String serviceNamespace;
private String serviceInstanceId;
private String serviceVersion;
@Nullable private String interval;
@Nullable private String timeout;
@Nullable private String serviceName;
@Nullable private String serviceNamespace;
@Nullable private String serviceInstanceId;
@Nullable private String serviceVersion;
private final Map<String, String> resourceAttributes = new HashMap<>();

private Builder() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.prometheus.metrics.config;

import java.util.Map;
import javax.annotation.Nullable;

/** Properties starting with io.prometheus.exporter */
public class ExporterProperties {
Expand All @@ -11,14 +12,14 @@ public class ExporterProperties {
private static final String EXEMPLARS_ON_ALL_METRIC_TYPES = "exemplarsOnAllMetricTypes";
private static final String PREFIX = "io.prometheus.exporter";

private final Boolean includeCreatedTimestamps;
private final Boolean prometheusTimestampsInMs;
private final Boolean exemplarsOnAllMetricTypes;
@Nullable private final Boolean includeCreatedTimestamps;
@Nullable private final Boolean prometheusTimestampsInMs;
@Nullable private final Boolean exemplarsOnAllMetricTypes;

private ExporterProperties(
Boolean includeCreatedTimestamps,
Boolean prometheusTimestampsInMs,
Boolean exemplarsOnAllMetricTypes) {
@Nullable Boolean includeCreatedTimestamps,
@Nullable Boolean prometheusTimestampsInMs,
@Nullable Boolean exemplarsOnAllMetricTypes) {
this.includeCreatedTimestamps = includeCreatedTimestamps;
this.prometheusTimestampsInMs = prometheusTimestampsInMs;
this.exemplarsOnAllMetricTypes = exemplarsOnAllMetricTypes;
Expand Down Expand Up @@ -64,8 +65,8 @@ public static Builder builder() {

public static class Builder {

private Boolean includeCreatedTimestamps;
private Boolean exemplarsOnAllMetricTypes;
@Nullable private Boolean includeCreatedTimestamps;
@Nullable private Boolean exemplarsOnAllMetricTypes;
boolean prometheusTimestampsInMs;

private Builder() {}
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.