@hackage hs-opentelemetry-instrumentation-hspec1.0.0.0

OpenTelemetry instrumentation for Hspec test suites

hs-opentelemetry-instrumentation-hspec

hs-opentelemetry-instrumentation-hspec

OpenTelemetry instrumentation for the Hspec test framework; it creates one span per test case inside the instrumented Spec tree.

Usage

do
  provider <- getGlobalTracerProvider
  let tracer = OpenTelemetry.Trace.makeTracer provider "my-test-suite" OpenTelemetry.Trace.tracerOptions
  context <- OpenTelemetry.Context.ThreadLocal.getContext

  hspec $ instrumentSpec tracer context $ do
    describe "Spec" do
      it "is instrumented with OpenTelemetry" do
        True `shouldBe` True

See examples/hspec for an instrumented test suite.