001package io.prometheus.client.exemplars; 002 003/** 004 * Exemplar sampler for counter metrics. 005 */ 006public interface CounterExemplarSampler { 007 008 /** 009 * @param increment the value added to the counter on this event 010 * @param previous the previously sampled exemplar, or {@code null} if there is none. 011 * @return an Exemplar to be sampled, or {@code null} if the previous exemplar does not need to be updated. 012 * Returning {@code null} and returning {@code previous} is equivalent. 013 */ 014 Exemplar sample(double increment, Exemplar previous); 015}