New to Kestra?
Use blueprints to kickstart your first workflows.
Monitor MongoDB WiredTiger storage engine cache pressure and dirty pages with Kestra. Query serverStatus, log GitHub issues, and alert Slack.
Diagram unavailable
We could not build the topology for this blueprint. The flow itself is valid, use the YAML on the left to run it.
MongoDB's default storage engine, WiredTiger, allocates half of available RAM minus 1 GB for its in-memory working cache. Under heavy write workloads or unindexed update operations, data pages in memory become dirty before being flushed to disk. When dirty bytes exceed 20% of the total cache, WiredTiger forces user application threads to stall and perform disk writes, causing catastrophic p99 query latency spikes and connection pileups. This blueprint probes MongoDB serverStatus on a 10-minute schedule, calculates dirty cache saturation, opens an automated GitHub DBA incident ticket, and alerts on-call database engineers on Slack.
periodic_wiredtiger_health_check (io.kestra.plugin.core.trigger.Schedule) initiates the audit every 10 minutes (shipped disabled for safe verification).probe_wiredtiger_cache_status (io.kestra.plugin.scripts.python.Script) executes the serverStatus administrative command and extracts wiredTiger.cache metrics.branch_on_cache_pressure (io.kestra.plugin.core.flow.If) evaluates whether dirty cache percentage breached the operator threshold (is_pressure_critical == true):then: Automatically files a GitHub tracking issue via create_dba_incident_issue (io.kestra.plugin.github.issues.Create) and alerts the Slack channel via alert_dba_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook).else: Emits an informational log entry (log_cache_healthy) confirming normal operational cache levels.log_audit_complete (io.kestra.plugin.core.log.Log) records the final audit outcome.errors block alerts Slack if database authentication times out or network connectivity fails.Kestra coordinates administrative database probing, memory metric calculations, conditional escalation, and chat alerting inside a single declarative workflow. It manages database credentials securely, provides complete execution history, and eliminates the need for separate standalone monitoring daemons.
serverStatus or clusterMonitor permissions.GITHUB_TOKEN: GitHub token used to open incident issues.SLACK_WEBHOOK: Incoming Webhook URL for DBA alerts.connection_uri (STRING, default mongodb://mongo-cluster.internal.company.com:27017): MongoDB connection string.dirty_cache_percent_threshold (FLOAT, default 20.0): Percentage of dirty cache above which alerts fire.target_repository (STRING, default my-org/database-operations): Target GitHub repository for logging incident issues.outputs.probe_wiredtiger_cache_status.vars.bytes_in_cache: Current bytes in memory cache.outputs.probe_wiredtiger_cache_status.vars.dirty_pct: Percentage of dirty bytes in cache.outputs.probe_wiredtiger_cache_status.vars.is_pressure_critical: Boolean indicating whether threshold was breached.GITHUB_TOKEN and SLACK_WEBHOOK in your Kestra namespace.connection_uri to match your database endpoint.periodic_wiredtiger_health_check trigger for continuous cache health monitoring.db.currentOp().setParameter administrative commands after approval.