Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Fix Tpyos (#520)
Browse files Browse the repository at this point in the history
Some tpyos made their way into the metrics service, fix those. Also
add more docs.
  • Loading branch information
shemnon authored Jan 7, 2019
1 parent 23388d7 commit dcedfea
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,27 @@ private void validateConfig(final MetricsConfiguration config) {
}

public CompletableFuture<?> start() {
LOG.info("Starting JsonRPC service on {}:{}", config.getHost(), config.getPort());
LOG.info("Starting Metrics service on {}:{}", config.getHost(), config.getPort());
// Create the HTTP server and a router object.
httpServer =
vertx.createHttpServer(
new HttpServerOptions().setHost(config.getHost()).setPort(config.getPort()));

// Handle json rpc requests
final Router router = Router.router(vertx);

// Verify Host header to avoid rebind attack.
// Verify Host header.
router.route().handler(checkWhitelistHostHeader());

// Endpoint for AWS health check.
router.route("/").method(HttpMethod.GET).handler(this::handleEmptyRequest);

// Endpoint for Prometheus metrics monitoring.
router
.route("/metrics")
.method(HttpMethod.GET)
.produces(TextFormat.CONTENT_TYPE_004)
.handler(this::metricsRequest);

final CompletableFuture<?> resultFuture = new CompletableFuture<>();
httpServer
.requestHandler(router::accept)
Expand All @@ -118,7 +121,6 @@ public CompletableFuture<?> start() {
}
resultFuture.completeExceptionally(cause);
});

return resultFuture;
}

Expand Down

0 comments on commit dcedfea

Please sign in to comment.