Tracing: prisma:engine
spans always get sampled when using probability based samplers
#15129
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
tech/typescript
Issue for tech TypeScript.
topic: tracing
Milestone
Bug description
When using any probability-based sampler (like
TraceIdRatioBasedSampler
) no matter what sampling ratio I use, theprisma:engine
spans are always sampled.For example, I’m tracing an endpoint that has a
prisma.model.findMany
query inside. I’m also using aTraceIdRatioBasedSampler
with a sampling ratio of 0.3. The samples are collected and visualized using Jaeger. The engine spans show up 100% of the time for every request I make to the endpoint, but the rest of the spans show up roughly 30% of the time.Here 6 traces were generated correspoding to 6 client requests, despite using a
TraceIdRatioBasedSampler
with a sampling ratio of 0.3. Four of these requests consist of onlyprisma:engine
spans. The remaining two traces consist of all the spans. (Note: The screenshot is from spans generated using prisma v4.2.0, but the issue persists in v4.3.0).How to reproduce
This repository provides a reproduction, along with instructions: https://github.com/TasinIshmam/tracing-probability-sampling-prisma
Expected behavior
All spans generated by Prisma should respect the sampling ratio of the underlying probability sampler.
Prisma information
Provided in the reproduction repository.
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: