text: 'use strict';
  
  var client = require('prom-client');
  var Boom = require('@hapi/boom');
  
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  
  var client__default = /*#__PURE__*/_interopDefaultLegacy(client);
  var Boom__default = /*#__PURE__*/_interopDefaultLegacy(Boom);
  
  client__default['default'].register.clear();
  const gauge = new client__default['default'].Gauge({
    name: 'number_of_peers',
    help: 'the_number_of_currently_connected_peers'
  });
  var debugRoutes = [{
      method: 'POST',
      path: '/debug/metrics/prometheus',
      async handler(request, h) {
        if (!process.env.IPFS_MONITORING) {
          throw Boom__default['default'].notImplemented('Monitoring is disabled. Enable it by setting environment variable IPFS_MONITORING');
        }
        const {ipfs} = request.server.app;
        const peers = await ipfs.swarm.peers();
        gauge.set(peers.length);
        return h.response(client__default['default'].register.metrics()).type(client__default['default'].register.contentType);
      }
    }];
  
  module.exports = debugRoutes;
  