Skip to content

@effect-aws/powertools-tracer

AWS X-Ray Powertools SDK for Effect.

npm versionnpm downloads

This experimental library allows you to trace your Effect programs and send them to AWS X-Ray leveraging the Powertools SDK.

Installation

bash
npm install --save @effect-aws/powertools-tracer @aws-lambda-powertools/tracer

Note: @aws-lambda-powertools/tracer is a peer dependency.

Usage

typescript
import { Tracer } from "@effect-aws/powertools-tracer"

const program = Effect.gen(function* () {
  yield* Effect.log("Hello")
  yield* Effect.annotateCurrentSpan({ message: "Metadata" })
}).pipe(Effect.withSpan("MyTrace"))

program.pipe(Effect.provide(Tracer.layer()), Effect.runSync)

Check out the a more complete example in the examples.

Released under the MIT License.