Optimize is not showing queries

I've been trying to get optimize to work since it first launched in beta, but queries just don't show up in the dashboard. i'm not sure how to get more logging...
21 Replies
Nurul
Nurul2mo ago
Do you get any errors while trying to use Optimize?
samuelcole
samuelcole2mo ago
none at all the app works, the prompt+notification to go to the optimize dashboard pops up just nothing shows up in the dashboard random clues: i already love open telemetry, and we have our own instrumentation registered (but i believe i tried removing it, and there were no changes) we are a monoropo running on turbo, prisma is imported from a shared project, and is using singleton pattern
DennisK
DennisK2mo ago
I have the same
brookmg
brookmg2mo ago
I have been facing the same issue since the beta. Not sure why it's not working either Is there a flag to pass to make it log its issues?
Papa Smerf
Papa Smerf2mo ago
Soo for me recording catch only create/delete queries all select queries are omitted.
brookmg
brookmg2mo ago
Is that how it works normally? I'm using main / replica setup using @prisma/extension-read-replicas extension as well. Not sure if that's affecting it somehow. @Nurul (Prisma)
Papa Smerf
Papa Smerf2mo ago
Nope that was my fault. There is a section about data that should be captured by recording
No description
Papa Smerf
Papa Smerf2mo ago
Also good to know if some of the queries are not shown you should try to change the order of extends e.g first you use optimize then accelerate
brookmg
brookmg2mo ago
I don't use the other services. I did attempt changing the order of extends but no luck What flag can we use to make optimize log verbose?
Papa Smerf
Papa Smerf2mo ago
Maybe this will help you https://www.prisma.io/docs/optimize/known-limitations. At the bottom is Driver adapter compatibility and that can cause problems
brookmg
brookmg2mo ago
Well I'm using the client as is, there is no driver adapter involved.
Nurul
Nurul2mo ago
@samuelcole @DennisK @brookmg Are your projects in which you are trying to use optimize open source? Would it be possible to share a minimal reproduction so that we can figure out what's going on?
DennisK
DennisK2mo ago
Nope sorry, it is not OS.
Nurul
Nurul2mo ago
We have released a new optimize extension version 1.0.1 which fixes a bunch of issues. Can you try using the new version and check if your issue gets resolved? https://www.npmjs.com/package/@prisma/extension-optimize
npm
@prisma/extension-optimize
This is the package for the Prisma Client extension, which enables the use of Prisma Optimize.. Latest version: 1.0.1, last published: 36 minutes ago. Start using @prisma/extension-optimize in your project by running `np...
brookmg
brookmg2mo ago
Sadly can't share the codebase but the lastest update isn't working either. 1.0.1.
export const MClient = new PrismaClient({
log: [
{ emit: "stdout", level: "info" },
{ emit: "stdout", level: "warn" },
{ emit: "stdout", level: "error" },
{ emit: "event", level: "query" },
],
}).$extends(
withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }),
).$extends(readReplicas({
url: process.env.DATABASE_URL_REPLICA,
}));
export const MClient = new PrismaClient({
log: [
{ emit: "stdout", level: "info" },
{ emit: "stdout", level: "warn" },
{ emit: "stdout", level: "error" },
{ emit: "event", level: "query" },
],
}).$extends(
withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }),
).$extends(readReplicas({
url: process.env.DATABASE_URL_REPLICA,
}));
This is how I currently configured it but nothing shows up on the dashboard
Nurul
Nurul2mo ago
Thanks for letting me know. Can you try without readReplicas extension and check if something shows up in the dashboard?
samuelcole
samuelcole2mo ago
1.0.1 isn’t working for me either, and I don’t use readReplicas Do we all use next.js by any chance? This is a next app
Nurul
Nurul2mo ago
Oh Okay! Is your app open source by any chance samuel?
samuelcole
samuelcole2mo ago
it is not 😕 also i would like to reiterate that i would love an additional logging level, so that i can see under the hood a bit, to see if there's any clues there
trevor_h.
trevor_h.5w ago
Same issue here. Everything runs but no queries show in optimize console. Was able to get it working.. Found that we weren't using the read replica extension, but we were instantiating a separate PrismaClient with the datasources option set: { datasources: { db: { url: config.PRISMA_READ_URL } } } This caused the issue..
Eric
Eric3w ago
I have the same issue (also a private repo so can not share). I've followed the instructions and set everything up, I see See your Optimize dashboard at: https://optimize.prisma.io in the console, hit record, and nothing showing up as I play around in my app. Any updates @Nurul (Prisma) ?
Want results from more Discord servers?
Add your server