Skip to content

Commit

Permalink
move /metrics-json endpoint to /metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartisk committed Sep 8, 2020
1 parent ef5f53b commit ff7837b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class JsonConfig implements MicrometerConfig.CapabilityEnabled {
* The path for the JSON metrics endpoint.
* The default value is {@code /metrics-json}.
*/
@ConfigItem(defaultValue = "/metrics-json")
@ConfigItem(defaultValue = "/metrics")
public String path;

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

import java.util.function.Function;

import javax.ws.rs.core.MediaType;

import io.quarkus.micrometer.runtime.export.handlers.JsonHandler;
import io.quarkus.runtime.annotations.Recorder;
import io.vertx.ext.web.Route;
Expand All @@ -25,7 +23,7 @@ public Function<Router, Route> route(String path) {
return new Function<Router, Route>() {
@Override
public Route apply(Router router) {
return router.route(path).produces(MediaType.APPLICATION_JSON);
return router.route(path).order(2).produces("application/json");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.function.Function;

import io.prometheus.client.exporter.common.TextFormat;
import io.quarkus.micrometer.runtime.export.handlers.PrometheusHandler;
import io.quarkus.runtime.annotations.Recorder;
import io.vertx.ext.web.Route;
Expand All @@ -24,7 +23,7 @@ public Function<Router, Route> route(String path) {
return new Function<Router, Route>() {
@Override
public Route apply(Router router) {
return router.route(path).produces(TextFormat.CONTENT_TYPE_004);
return router.route(path).order(1).produces("text/plain");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void validateMetricsOutput_2() {
@Order(7)
void validateJsonOutput() {
given()
.when().get("/metrics-json")
.header("Accept", "application/json")
.when().get("/metrics")
.then()
.log().body()
.statusCode(200)
Expand Down

0 comments on commit ff7837b

Please sign in to comment.