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