Skip to content

Commit

Permalink
removing url
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpendu Kumar Garai authored and Arpendu Kumar Garai committed Jun 26, 2021
1 parent e81f9f2 commit de0a5ee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions node-application-monitoring-app/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const url = require('url');
const client = require('prom-client');
const express = require('express');
const app = express();
Expand Down Expand Up @@ -60,7 +59,7 @@ const createDelayHandler = async (req, res) => {
app.get('/metrics', async (req, res) => {
// Start the timer
const end = httpRequestDurationMicroseconds.startTimer();
const route = url.parse(req.url).pathname;
const route = req.route.path;

res.setHeader('Content-Type', register.contentType);
res.send(await register.metrics());
Expand All @@ -72,7 +71,7 @@ app.get('/metrics', async (req, res) => {
app.get('/slow', async (req, res) => {
// Start the timer
const end = httpRequestDurationMicroseconds.startTimer();
const route = url.parse(req.url).pathname;
const route = req.route.path;

await createDelayHandler(req, res);

Expand Down

0 comments on commit de0a5ee

Please sign in to comment.