Skip to content

Commit

Permalink
oteljava: add OtelJava.noop
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive committed Mar 11, 2024
1 parent d1bc42d commit b9ea4c4
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.typelevel.otel4s.oteljava

import cats.Applicative
import cats.effect.Async
import cats.effect.Resource
import cats.effect.Sync
Expand Down Expand Up @@ -88,6 +89,16 @@ object OtelJava {
)
}

/** Creates a no-op implementation of the [[OtelJava]].
*/
def noop[F[_]: Applicative: LocalContext]: OtelJava[F] =
new OtelJava(
JOpenTelemetry.noop(),
ContextPropagators.noop,
MeterProvider.noop,
TracerProvider.noop
)

/** Lifts the acquisition of a Java OpenTelemetrySdk instance to a Resource.
*
* @param acquire
Expand Down

0 comments on commit b9ea4c4

Please sign in to comment.