Skip to main content

QueryShield production monitoring middleware for FastAPI and Django

Project description

queryshield-monitoring

Production database query monitoring middleware for QueryShield.

Monitor real-world database query performance in FastAPI and Django applications with minimal overhead.

Features

  • Low-overhead query sampling (configurable rate)
  • Batch upload to SaaS backend
  • Performance regression detection
  • Slow query alerting
  • Integration with FastAPI middleware
  • Integration with Django middleware
  • Slack notifications

Installation

pip install queryshield-monitoring

Usage

FastAPI

from fastapi import FastAPI
from queryshield_monitoring import QueryShieldMiddleware

app = FastAPI()

app.add_middleware(
    QueryShieldMiddleware,
    api_key="sk_...",
    sample_rate=0.01,
    slow_query_threshold_ms=500
)

Django

# settings.py
MIDDLEWARE = [
    'queryshield_monitoring.middleware.QueryShieldMiddleware',
]

QUERYSHIELD = {
    'API_KEY': 'sk_...',
    'SAMPLE_RATE': 0.01,
    'SLOW_QUERY_THRESHOLD_MS': 500,
}

Documentation

See the main QueryShield documentation for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

queryshield_monitoring-0.2.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file queryshield_monitoring-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for queryshield_monitoring-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f229fbd7744908cc8e00e64b5019256bd9d52228203a70c72bc4e196e8a966
MD5 350be570b3cd0f7ceb2990d9b5f9c058
BLAKE2b-256 104ac54a0f47e5c8cdb9f6a3d8dfe8c9b5a649f8133ea0b2f2dc043d2a2d9def

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page