Giter Site home page Giter Site logo

markflorkowski / prisma-axiom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from axiomhq/prisma-axiom

0.0 0.0 0.0 242 KB

Axiom observability middleware for Prisma

Home Page: https://npmjs.com/prisma-axiom

License: MIT License

TypeScript 97.11% Nix 2.89%

prisma-axiom's Introduction

prisma-axiom CI

Axiom observability middleware for Prisma.

Quickstart

  1. Install prisma-axiom
npm install --save prisma-axiom
  1. 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.

  1. Enable the prisma tracing preview feature in schema.prisma like this:
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["tracing"]
}

Kitchen Sink Full Configuration

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
});

License

© Axiom, Inc., 2022

Distributed under MIT License (The MIT License).

See LICENSE for more information.

prisma-axiom's People

Contributors

bahlo avatar schehata avatar seiflotfy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.