All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opentelemetry.contrib.metrics.micrometer.internal.instruments.AbstractHistogram Maven / Gradle / Ivy

There is a newer version: 1.43.0-alpha
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.contrib.metrics.micrometer.internal.instruments;

import io.micrometer.core.instrument.DistributionSummary;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.contrib.metrics.micrometer.internal.state.InstrumentState;

abstract class AbstractHistogram extends AbstractInstrument {
  protected AbstractHistogram(InstrumentState instrumentState) {
    super(instrumentState);
  }

  public DistributionSummary distribution(Attributes attributes) {
    return DistributionSummary.builder(name())
        .tags(attributesToTags(attributes))
        .description(description())
        .baseUnit(unit())
        .register(meterRegistry());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy