Hey, has anyone looked into getting <https://www.e...
# orm-help
m
Hey, has anyone looked into getting https://www.elastic.co/apm to work with Prisma 2?
r
Hey @mape 👋 Could you explain a bit more about your use case as to what would be the way you would integrate Prisma 2 with Elasticsearch?
m
I'm looking into if it is possible to combine elastic APM and Prisma 2 so that I can instrument my application. See what data is fetched through prisma and how long it takes for each request. Specifically using https://github.com/elastic/apm-agent-nodejs
r
Currently there's no agent like this specifically for Prisma 2 so I wouldn't know how it would work with it currently. The best case right now could be to run it with the raw API that they provide and check if it works. Could you create a feature request here adding the above use-case so that we can look into it further?
m
Yes, I'll take a look at using their custom spans with the beforeRequest hook Prisma exposes. And if that doesn't work, or if it is messy to add an afterRequest hook to Prisma I'll post a feature request. Thanks for taking the time!
👍 1
r
Awesome 🙂 Do let me know how it goes. If you can create a GH repo then it would be great so I could look into that as well.
👍 1
m
💯 1
Not the most beautiful code but initial results are promising. https://gist.github.com/mape/56a689fcff9e73c50d377a89241cb623