Skip to content

Commit d9e1e77

Browse files
committed
nullaway
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 99fd8f3 commit d9e1e77

File tree

5 files changed

+10
-21
lines changed

5 files changed

+10
-21
lines changed

prometheus-metrics-exporter-pushgateway/src/main/java/io/prometheus/metrics/exporter/pushgateway/PushGateway.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.prometheus.metrics.exporter.pushgateway;
22

33
import static io.prometheus.metrics.exporter.pushgateway.Scheme.HTTP;
4-
import static io.prometheus.metrics.model.snapshots.PrometheusNaming.escapeName;
54
import static java.util.Objects.requireNonNull;
65

76
import io.prometheus.metrics.config.ExporterPushgatewayProperties;
@@ -461,11 +460,11 @@ private URL makeUrl(@Nullable ExporterPushgatewayProperties properties)
461460
}
462461
for (Map.Entry<String, String> entry : groupingKey.entrySet()) {
463462
if (entry.getValue().isEmpty()) {
464-
url += "/" + entry.getKey() + "@base64/=";
463+
url += "/" + entry.getKey() + "@base64/=";
465464
} else if (entry.getValue().contains("/")) {
466-
url += "/" + entry.getKey() + "@base64/" + base64url(entry.getValue());
465+
url += "/" + entry.getKey() + "@base64/" + base64url(entry.getValue());
467466
} else {
468-
url += "/" + entry.getKey() + "/" + URLEncoder.encode(entry.getValue(), "UTF-8");
467+
url += "/" + entry.getKey() + "/" + URLEncoder.encode(entry.getValue(), "UTF-8");
469468
}
470469
}
471470
return URI.create(url).normalize().toURL();

prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/OpenMetricsTextFormatWriter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,7 @@ private void writeCreated(Writer writer, MetricMetadata metadata, DataPointSnaps
347347
}
348348

349349
private void writeNameAndLabels(
350-
Writer writer,
351-
String name,
352-
@Nullable String suffix,
353-
Labels labels)
354-
throws IOException {
350+
Writer writer, String name, @Nullable String suffix, Labels labels) throws IOException {
355351
writeNameAndLabels(writer, name, suffix, labels, null, 0.0);
356352
}
357353

prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/PrometheusTextFormatWriter.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,7 @@ private void writeUnknown(Writer writer, UnknownSnapshot snapshot) throws IOExce
346346
}
347347

348348
private void writeNameAndLabels(
349-
Writer writer,
350-
String name,
351-
@Nullable String suffix,
352-
Labels labels)
353-
throws IOException {
349+
Writer writer, String name, @Nullable String suffix, Labels labels) throws IOException {
354350
writeNameAndLabels(writer, name, suffix, labels, null, 0.0);
355351
}
356352

@@ -373,8 +369,8 @@ private void writeNameAndLabels(
373369
}
374370

375371
private void writeMetadata(
376-
Writer writer,
377-
@Nullable String suffix, String typeString, MetricMetadata metadata) throws IOException {
372+
Writer writer, @Nullable String suffix, String typeString, MetricMetadata metadata)
373+
throws IOException {
378374
if (metadata.getHelp() != null && !metadata.getHelp().isEmpty()) {
379375
writer.write("# HELP ");
380376
writer.write(metadata.getPrometheusName());

prometheus-metrics-exposition-textformats/src/main/java/io/prometheus/metrics/expositionformats/TextFormatUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ static void writeEscapedLabelValue(Writer writer, String s) throws IOException {
102102
static void writeLabels(
103103
Writer writer,
104104
Labels labels,
105-
@Nullable String additionalLabelName, double additionalLabelValue)
105+
@Nullable String additionalLabelName,
106+
double additionalLabelValue)
106107
throws IOException {
107108
writer.write('{');
108109
for (int i = 0; i < labels.size(); i++) {

prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import io.dropwizard.metrics5.Meter;
77
import io.dropwizard.metrics5.Metric;
88
import io.dropwizard.metrics5.MetricFilter;
9-
import io.dropwizard.metrics5.MetricName;
109
import io.dropwizard.metrics5.MetricRegistry;
1110
import io.dropwizard.metrics5.Snapshot;
1211
import io.dropwizard.metrics5.Timer;
@@ -69,9 +68,7 @@ public DropwizardExports(MetricRegistry registry, MetricFilter metricFilter) {
6968
* @param labelMapper a labelMapper to use to map labels.
7069
*/
7170
public DropwizardExports(
72-
MetricRegistry registry,
73-
MetricFilter metricFilter,
74-
@Nullable CustomLabelMapper labelMapper) {
71+
MetricRegistry registry, MetricFilter metricFilter, @Nullable CustomLabelMapper labelMapper) {
7572
this.registry = registry;
7673
this.metricFilter = metricFilter;
7774
this.labelMapper = labelMapper;

0 commit comments

Comments
 (0)