Counter

org.typelevel.otel4s.metrics.Counter
See theCounter companion object
trait Counter[F[_], A]

A Counter instrument that records values of type A.

The Counter is monotonic. This means the aggregated value is nominally increasing.

Type parameters

A

the type of the values to record. The type must have an instance of MeasurementValue. scala.Long and scala.Double are supported out of the box.

F

the higher-kinded type of a polymorphic effect

Attributes

See also

See UpDownCounter for non-monotonic alternative

Companion
object
Source
Counter.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Inherited methods

inline def add(inline value: A, inline 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 increment a counter with. Must be non-negative

Attributes

Inherited from:
CounterMacro (hidden)
Source
CounterMacro.scala
inline def add(inline value: A, inline attributes: 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 increment a counter with. Must be non-negative

Attributes

Inherited from:
CounterMacro (hidden)
Source
CounterMacro.scala
def backend: Backend[F, A]

Attributes

Inherited from:
CounterMacro (hidden)
Source
CounterMacro.scala
inline def inc(inline attributes: Iterable[Attribute[_]]): F[Unit]

Increments a counter by one.

Increments a counter by one.

Value parameters

attributes

the set of attributes to associate with the value

Attributes

Inherited from:
CounterMacro (hidden)
Source
CounterMacro.scala
inline def inc(inline attributes: Attribute[_]*): F[Unit]

Increments a counter by one.

Increments a counter by one.

Value parameters

attributes

the set of attributes to associate with the value

Attributes

Inherited from:
CounterMacro (hidden)
Source
CounterMacro.scala