Skip to content

Commit 7239d17

Browse files
authored
fix prometheus builder (#279)
1 parent ad21de0 commit 7239d17

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/arpnetworking/metrics/common/sources/PrometheusHttpSource.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.arpnetworking.metrics.common.sources;
1717

1818
import com.arpnetworking.metrics.mad.parsers.PrometheusToRecordParser;
19+
import net.sf.oval.constraint.NotNull;
1920

2021
/**
2122
* Processes Prometheus messages, extracts data and emits metrics.
@@ -42,7 +43,6 @@ public static final class Builder extends HttpSource.Builder<Builder, Prometheus
4243
public Builder() {
4344
super(PrometheusHttpSource::new);
4445
setActorName(ACTOR_NAME);
45-
setParser(new PrometheusToRecordParser(_interpretUnits, _outputDebugFiles));
4646
}
4747

4848
/**
@@ -72,8 +72,17 @@ protected Builder self() {
7272
return this;
7373
}
7474

75+
@NotNull
7576
private Boolean _interpretUnits = false;
77+
78+
@NotNull
7679
private Boolean _outputDebugFiles = false;
80+
81+
@Override
82+
public PrometheusHttpSource build() {
83+
setParser(new PrometheusToRecordParser(_interpretUnits, _outputDebugFiles));
84+
return super.build();
85+
}
7786
}
7887

7988
}

0 commit comments

Comments
 (0)