Skip to content

D bluemoon query - #447

Open
D-Bluemoon wants to merge 5 commits into
Betta-Pay:mainfrom
D-Bluemoon:D-Bluemoon-query
Open

D bluemoon query#447
D-Bluemoon wants to merge 5 commits into
Betta-Pay:mainfrom
D-Bluemoon:D-Bluemoon-query

Conversation

@D-Bluemoon

Copy link
Copy Markdown
Contributor

Description

Adds Prisma slow-query telemetry: queries exceeding SLOW_QUERY_THRESHOLD_MS (default 500ms) are logged with redacted, truncated arguments and counted in prisma_slow_queries_total by model and action.

Fixes / Closes: #365


Type of Change

  • Bug Fix (non-breaking change which fixes an issue)
  • [✔️] New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring / Performance (clean-up or performance optimization without behavioral changes)
  • Documentation / CI (changes to docs, workflows, config files)

Verification & Test Plan

Automated Tests

TS_NODE_TRANSPILE_ONLY=true node --loader ts-node/esm prisma.test.ts

Manual Verification

  1. Confirmed middleware warns only above the configured threshold.
  2. Confirmed warning arguments redact PII and truncate to 200 characters.

Sub-System Checklist

1. Smart Contracts (BettaPay-Contract)

  • Code compiles without warnings (cargo build --release --target wasm32-unknown-unknown)
  • Cargo test suite passes locally (cargo test)
  • Emits events for state changes
  • Implemented proper authorization controls (auth.require_auth())

2. Backend Services (BettaPay-Backend)

  • Prisma models updated and migrated (if database schema changes)
  • Zod validation checks added/updated
  • API routes and services build successfully (pnpm build)
  • Local env variables updated in .env.example

3. Frontend Dashboard (BettaPay-Frontend)

  • Local build completes successfully (pnpm build)
  • Focus states, labels, and aria attributes tested for accessibility
  • No regression on styling or components
  • Env parameters documented in .env.local

Checklist

  • My code follows the style guidelines of this project (run formatters/linters)
  • [✔️] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Prisma query telemetry for slow queries

1 participant