Skip to content

Utilities for configuring a Natchez EntryPoint for OpenTelemetry at Dwolla

License

Notifications You must be signed in to change notification settings

Dwolla/dwolla-otel-natchez

Repository files navigation

dwolla-otel-natchez

Provides OpenTelemetryAtDwolla, a utility object that configures a Natchez EntryPoint[F] for use with OpenTelemetry, using defaults appropriate for Dwolla tagless-final applications.

Example Usage

import cats.effect.{Trace => _, _}
import com.dwolla.tracing.DwollaEnvironment.Local
import com.dwolla.tracing._

object MyApp extends IOApp {
  override def run(args: List[String]): IO[ExitCode] = {
    OpenTelemetryAtDwolla[IO]("example-app", args.headOption.flatMap(DwollaEnvironment(_)).getOrElse(Local))
      .use { entryPoint =>

        entryPoint.root("root span").use { span =>
          span.put("demo-type" -> "Hello World").as(ExitCode.Success)
        }
      }
  }
}

About

Utilities for configuring a Natchez EntryPoint for OpenTelemetry at Dwolla

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages