code: function PrometheusMetrics() {
      // Only attempt to load these dependencies if metrics are enabled
      var client = this._client = require("prom-client");
  
      // prom-client 9.0.0 has to be asked explicitly; previous versions would
      //   do this by default
      if (client.collectDefaultMetrics) client.collectDefaultMetrics();
  
      this._collectors = []; // executed in order
      this._counters = {}; // counter metrics keyed by name
      this._timers = {}; // timer metrics (Histograms) keyed by name
  }
docs: Prometheus-style /metrics gathering and exporting.
  This class provides a central location to register gauge and counter metrics
  used to generate the <code>/metrics</code> page.
  
  This class depends on having <code>prom-client</code> installed. It
  will attempt to load this module when the constructor is invoked.
  
  @example <caption>A simple metric that counts the keys in an object:</caption>
  var metrics = new PrometheusMetrics();
  
  var orange = {};
  metrics.addGauge({
  name: "oranges",
  help: "current number of oranges",
  refresh: (gauge) => {
  gauge.set({}, Object.keys(oranges).length);
  },
  });
  
  @example <caption>Generating values for multiple gauges in a single collector
  function.</caption>
  var metrics = new PrometheusMetrics();
  
  var oranges_gauge = metrics.addGauge({
  name: "oranges",
  help: "current number of oranges",
  });
  var apples_gauge = metrics.addGauge({
  name: "apples",
  help: "current number of apples",
  });
  
  metrics.addCollector(() => {
  var counts = this._countFruit();
  oranges_gauge.set({}, counts.oranges);
  apples_gauge.set({}, counts.apples);
  });
  
  @example <caption>Using counters</caption>
  var metrics = new PrometheusMetrics();
  
  metrics.addCollector({
  name: "things_made",
  help: "count of things that we have made",
  });
  
  function makeThing() {
  metrics.incCounter("things_made");
  return new Thing();
  }
  
  @constructor