001package io.prometheus.metrics.instrumentation.dropwizard5;
002
003import io.prometheus.metrics.annotations.StableApi;
004
005@FunctionalInterface
006@StableApi
007public interface InvalidMetricHandler {
008  InvalidMetricHandler ALWAYS_THROW = (metricName, exc) -> false;
009
010  /**
011   * @param metricName the name of the metric that was collected.
012   * @param exc The exception that was thrown when producing the metric snapshot.
013   * @return true if the exception should be suppressed.
014   */
015  boolean suppressException(String metricName, Exception exc);
016}