Skip to content

Commit

Permalink
Merge pull request #731 from iRevive/sdk-trace/reuse-meta
Browse files Browse the repository at this point in the history
sdk-trace: define `meta: InstrumentMeta[F]` as `val`
  • Loading branch information
iRevive authored Aug 26, 2024
2 parents 2604ca7 + 0163413 commit cc4c8d9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private object SdkCounter {
name: String,
storage: MetricStorage.Synchronous.Writeable[F, Primitive]
) extends Counter.Backend[F, A] {
def meta: InstrumentMeta[F] = InstrumentMeta.enabled
val meta: InstrumentMeta[F] = InstrumentMeta.enabled

def add(value: A, attributes: immutable.Iterable[Attribute[_]]): F[Unit] =
record(cast(value), attributes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private object SdkGauge {
cast: A => Primitive,
storage: MetricStorage.Synchronous.Writeable[F, Primitive]
) extends Gauge.Backend[F, A] {
def meta: InstrumentMeta[F] = InstrumentMeta.enabled
val meta: InstrumentMeta[F] = InstrumentMeta.enabled

def record(
value: A,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private object SdkHistogram {
name: String,
storage: MetricStorage.Synchronous.Writeable[F, Primitive]
) extends Histogram.Backend[F, A] {
def meta: Histogram.Meta[F] = Histogram.Meta.enabled
val meta: Histogram.Meta[F] = Histogram.Meta.enabled

def record(
value: A,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private object SdkUpDownCounter {
cast: A => Primitive,
storage: MetricStorage.Synchronous.Writeable[F, Primitive]
) extends UpDownCounter.Backend[F, A] {
def meta: InstrumentMeta[F] = InstrumentMeta.enabled
val meta: InstrumentMeta[F] = InstrumentMeta.enabled

def add(value: A, attributes: immutable.Iterable[Attribute[_]]): F[Unit] =
record(cast(value), attributes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private final class SdkSpanBackend[F[_]: Monad: Clock: Console] private (
) extends Span.Backend[F]
with SpanRef[F] {

def meta: InstrumentMeta[F] =
val meta: InstrumentMeta[F] =
InstrumentMeta.enabled

def context: SpanContext =
Expand Down

0 comments on commit cc4c8d9

Please sign in to comment.