Backend

org.typelevel.otel4s.metrics.Histogram.Backend
trait Backend[F[_], A]

Attributes

Source
Histogram.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class DoubleBackend[F]

Members list

Value members

Abstract methods

def meta: Meta[F]

Attributes

Source
Histogram.scala
def record(value: A, attributes: Iterable[Attribute[_]]): F[Unit]

Records a value with a set of attributes.

Records a value with a set of attributes.

Value parameters

attributes

the set of attributes to associate with the value

value

the value to record

Attributes

Source
Histogram.scala
def recordDuration(timeUnit: TimeUnit, attributes: Iterable[Attribute[_]]): Resource[F, Unit]

Records duration of the given effect.

Records duration of the given effect.

Value parameters

attributes

the set of attributes to associate with the value

timeUnit

the time unit of the duration measurement

Attributes

Example

val histogram: Histogram[F] = ???
val attributeKey = AttributeKey.string("query_name")
def findUser(name: String) =
 histogram.recordDuration(TimeUnit.MILLISECONDS, Attribute(attributeKey, "find_user")).use { _ =>
   db.findUser(name)
 }
Source
Histogram.scala