Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build the Docker image
run: |
mkdir target
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run tests in docker container
run: |
mkdir target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public class MeshMonitorCommand implements Callable<Integer> {

@CommandLine.Option(
names = {"-m", "--metrics-bind"},
description = "Bind address of a metrics server port in format ipv4[:port]",
defaultValue = "127.0.0.1:12223",
description = "Bind address for metrics server in format [host][:port]. Default is 12223 for all interfaces",
defaultValue = "12223",
converter = InetSocketAddressConverter.class)
private InetSocketAddress metricsBindAddress;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Volt Active Data Inc.
* Copyright (C) 2024-2025 Volt Active Data Inc.
*
* Use of this source code is governed by an MIT
* license that can be found in the LICENSE file or at
Expand Down Expand Up @@ -53,8 +53,12 @@ private void handleGetRequest(HttpExchange httpExchange) throws IOException {
try (OutputStream outputStream = httpExchange.getResponseBody()) {
StringBuilder output = new StringBuilder();
serverManager.getMonitors().forEach(monitor -> monitorStatsPrinter.print(output, monitor));

String prometheusResponse = output.toString();

// Set Content-Type header (required by Prometheus)
// see: https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-details
httpExchange.getResponseHeaders().set("Content-Type", "text/plain; version=0.0.4; charset=utf-8");

httpExchange.sendResponseHeaders(200, prometheusResponse.length());

outputStream.write(prometheusResponse.getBytes());
Expand Down