Skip to content

Commit

Permalink
Add implicit Otel4s#localContext
Browse files Browse the repository at this point in the history
Add `implicit def localContext: Local[F, Ctx]` to `Otel4s`, where
previously it was only defined on subtypes.
  • Loading branch information
NthPortal committed Jan 31, 2025
1 parent 8af8ebb commit 5c7f708
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/all/src/main/scala/org/typelevel/otel4s/Otel4s.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@

package org.typelevel.otel4s

import cats.mtl.Local
import org.typelevel.otel4s.context.propagation.ContextPropagators
import org.typelevel.otel4s.metrics.MeterProvider
import org.typelevel.otel4s.trace.TracerProvider

trait Otel4s[F[_]] {

/** The type of context used by telemetry components. */
type Ctx

/** The [[cats.mtl.Local `Local`]] context. */
implicit def localContext: Local[F, Ctx]

/** The registered propagators. */
def propagators: ContextPropagators[Ctx]

/** A registry for creating named meters.
*/
/** A registry for creating named meters. */
def meterProvider: MeterProvider[F]

/** An entry point of the tracing API.
*/
/** An entry point of the tracing API. */
def tracerProvider: TracerProvider[F]
}

0 comments on commit 5c7f708

Please sign in to comment.