docs: @SuppressWarnings("rawtypes")
    @Nullable
    private Metric collectGauge(MetricName dropwizardMetric, Gauge gauge) {
      // TODO cache dropwizard MetricName -> OC MetricDescriptor, Labels conversion
      String metricName = DropWizardUtils.generateFullMetricName(dropwizardMetric.getKey(), "gauge");
      String metricDescription =
          DropWizardUtils.generateFullMetricDescription(dropwizardMetric.getKey(), gauge);
      AbstractMap.SimpleImmutableEntry<List<LabelKey>, List<LabelValue>> labels =
          DropWizardUtils.generateLabels(dropwizardMetric);
      // Figure out which gauge instance and call the right method to get value
      Type type;
      Value value;
  
      Object obj = gauge.getValue();
      if (obj instanceof Number) {
        type = Type.GAUGE_DOUBLE;
        value = Value.doubleValue(((Number) obj).doubleValue());
      } else if (obj instanceof Boolean) {
        type = Type.GAUGE_INT64;
        value = Value.longValue(((Boolean) obj) ? 1 : 0);
      } else {
        // Ignoring Gauge (gauge.getKey()) with unhandled type.
        return null;
      }
  
      MetricDescriptor metricDescriptor =
          MetricDescriptor.create(metricName, metricDescription, DEFAULT_UNIT, type, labels.getKey());
      TimeSeries timeSeries =
          TimeSeries.createWithOnePoint(labels.getValue(), Point.create(value, clock.now()), null);
      return Metric.createWithOneTimeSeries(metricDescriptor, timeSeries);
    }