Database Monitoring

Database Monitoring

Skill that teaches an AI agent to monitor database performance and health: connections, slow queries, table and index stats, with PostgreSQL and MySQL examples.

Skill files10 files

references/

scripts/

templates/

SKILL.md93 lines
1
---
2
name: database-monitoring
3
description: >
4
Monitor database performance and health. Use when setting up monitoring,
5
analyzing metrics, or troubleshooting database issues.
6
---
7
8
# Database Monitoring
9
10
## Table of Contents
11
12
- [Overview](#overview)
13
- [When to Use](#when-to-use)
14
- [Quick Start](#quick-start)
15
- [Reference Guides](#reference-guides)
16
- [Best Practices](#best-practices)
17
18
## Overview
19
20
Implement comprehensive database monitoring for performance analysis, health checks, and proactive alerting. Covers metrics collection, analysis, and troubleshooting strategies.
21
22
## When to Use
23
24
- Performance baseline establishment
25
- Real-time health monitoring
26
- Capacity planning
27
- Query performance analysis
28
- Resource utilization tracking
29
- Alerting rule configuration
30
- Incident response and troubleshooting
31
32
## Quick Start
33
34
Minimal working example:
35
36
```sql
37
-- View current connections
38
SELECT
39
pid,
40
usename,
41
application_name,
42
client_addr,
43
state,
44
query_start,
45
state_change
46
FROM pg_stat_activity
47
WHERE state != 'idle'
48
ORDER BY query_start DESC;
49
50
-- Count connections per database
51
SELECT
52
datname,
53
COUNT(*) as connection_count,
54
MAX(EXTRACT(EPOCH FROM (NOW() - query_start))) as max_query_duration_sec
55
FROM pg_stat_activity
56
GROUP BY datname;
57
58
-- Find idle transactions
59
SELECT
60
pid,
61
usename,
62
// ... (see reference guides for full implementation)
63
```
64
65
## Reference Guides
66
67
Detailed implementations in the `references/` directory:
68
69
| Guide | Contents |
70
|---|---|
71
| [Connection Monitoring](references/connection-monitoring.md) | Connection Monitoring |
72
| [Query Performance Monitoring](references/query-performance-monitoring.md) | Query Performance Monitoring |
73
| [Table & Index Monitoring](references/table-index-monitoring.md) | Table & Index Monitoring |
74
| [Performance Schema](references/performance-schema.md) | Performance Schema |
75
| [InnoDB Monitoring](references/innodb-monitoring.md) | InnoDB Monitoring |
76
| [PostgreSQL Monitoring Setup](references/postgresql-monitoring-setup.md) | PostgreSQL Monitoring Setup |
77
| [Automated Monitoring Dashboard](references/automated-monitoring-dashboard.md) | Automated Monitoring Dashboard |
78
79
## Best Practices
80
81
### ✅ DO
82
83
- Follow established patterns and conventions
84
- Write clean, maintainable code
85
- Add appropriate documentation
86
- Test thoroughly before deploying
87
88
### ❌ DON'T
89
90
- Skip testing or validation
91
- Ignore error handling
92
- Hard-code configuration values
93

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…