io.opentelemetry.sdk.metrics.internal.exemplar.NoopExemplarReservoir Maven / Gradle / Ivy
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.sdk.metrics.internal.exemplar;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.context.Context;
import io.opentelemetry.sdk.metrics.data.DoubleExemplarData;
import io.opentelemetry.sdk.metrics.data.ExemplarData;
import io.opentelemetry.sdk.metrics.data.LongExemplarData;
import java.util.Collections;
import java.util.List;
/** A reservoir that keeps no exemplars. */
class NoopExemplarReservoir implements ExemplarReservoir {
static final NoopExemplarReservoir LONG_INSTANCE =
new NoopExemplarReservoir<>();
static final NoopExemplarReservoir DOUBLE_INSTANCE =
new NoopExemplarReservoir<>();
private NoopExemplarReservoir() {}
@Override
public void offerDoubleMeasurement(double value, Attributes attributes, Context context) {
// Do nothing
}
@Override
public void offerLongMeasurement(long value, Attributes attributes, Context context) {
// Do nothing
}
@Override
public List collectAndReset(Attributes pointAttributes) {
return Collections.emptyList();
}
}