@hackage / hs-opentelemetry-instrumentation-hspec

OpenTelemetry instrumentation for Hspec test suites

Latest1.0.0.0

About

Metadata

  • Last updated , by IanDuncan
  • License BSD-3-Clause
  • Categories Debugging, Testing
  • Maintained by: ian@iankduncan.com

  • Lottery factor: 7

Links

Installation

Readme

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.