Axiom observability middleware for Prisma.
- Install prisma-axiom
npm install --save prisma-axiom
- Add the following where you initialize your Prisma client:
import withAxiom from 'prisma-axiom';
const prisma = withAxiom(new PrismaClient());
Note: This will configure Axiom from the
AXIOM_TOKEN
and other environment variables. Check out the Kitchen Sink Full Configuration for more advanced configuration.
- Enable the prisma tracing preview feature in
schema.prisma
like this:
generator client {
provider = "prisma-client-js"
previewFeatures = ["tracing"]
}
You can configure prisma-axiom
by passing an options object as the second
parameter.
This snippet shows all available options:
const prisma = withAxiom(new PrismaClient(), {
axiomToken: "xaat-xxxxx",
axiomUrl: "https://my-axiom.example.org",
additionalInstrumentations: [new HttpInstrumentation()] // add more instrumentations to the tracing setup
});
© Axiom, Inc., 2022
Distributed under MIT License (The MIT License
).
See LICENSE for more information.