Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.concurrent.*;
import java.util.regex.*;

import static com.predic8.membrane.annot.Constants.VERSION;
import static com.predic8.membrane.core.http.Response.*;
import static com.predic8.membrane.core.interceptor.Outcome.*;
import static com.predic8.membrane.core.interceptor.balancer.BalancerUtil.*;
Expand Down Expand Up @@ -126,6 +127,7 @@ private void collect() {
private void buildPrometheusStyleResponse(Context ctx) {
ctx.resetAll();
ctx.reset();
buildVersionLine(ctx);
for (Proxy r : router.getRuleManager().getRules()) {
if (!ctx.seenRules.add(prometheusCompatibleName(r.getName()))) {
// the prometheus format is not allowed to contain the same metric more than once
Expand Down Expand Up @@ -159,6 +161,10 @@ private void buildPrometheusStyleResponse(Context ctx) {

}

private void buildVersionLine(Context ctx) {
ctx.count.append("membrane_info{version=\"" + prometheusCompatibleName(VERSION) + "\"} 1\n");
}

private void buildLoadBalancerLines(Context ctx) {
ctx.lb_active_nodes.append("# TYPE membrane_lb_node_status gauge\n");
for (Cluster cl : collectClusters(router)) {
Expand Down
Loading