-
Notifications
You must be signed in to change notification settings - Fork 594
Open
Labels
SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releaseP2: Important but not vital; high-value items that are not crucial for the immediate releasechoreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance choresmanual-testingManual testing / test planning issuesManual testing / test planning issuesreadyValidated, ready-to-work-on itemsValidated, ready-to-work-on itemstestingTesting (unit, e2e, manual, automated, etc)Testing (unit, e2e, manual, automated, etc)
Milestone
Description
📈 [TESTING][FUNCTIONALITY]: Metrics System Manual Test Plan
Goal
Produce a comprehensive manual test plan for metrics system including buffering, rollup, cleanup, and queries.
Why Now?
Metrics enable operational insight:
- Collection: Gather system metrics
- Aggregation: Rollup for efficiency
- Cleanup: Manage storage
- Queries: Enable dashboards
📖 User Stories
US-1: SRE - Metrics Access
As an SRE
I want access to system metrics
So that I can monitor performance
Acceptance Criteria:
Feature: Metrics System
Scenario: Query metrics
Given metrics are being collected
When I query for metrics
Then I should see time-series data🏗 Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ METRICS ARCHITECTURE │
└─────────────────────────────────────────────────────────────────────────────┘
APPLICATION BUFFER STORAGE
─────────── ────── ───────
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Metric │ │ Metrics │ │ Database │
│ Events │──────▶│ Buffer │──────▶│ Storage │
└──────────────┘ └──────────────┘ └──────────────┘
│
│ Rollup
▼
┌──────────────┐
│ Aggregated │
│ Metrics │
└──────────────┘
📋 Test Environment Setup
export GATEWAY_URL="http://localhost:8000"
export TOKEN=$(python -m mcpgateway.utils.create_jwt_token \
--username admin@example.com --secret "$JWT_SECRET")🧪 Manual Test Cases
Section 1: Metrics Collection
| Case | Scenario | Metric | Expected | Validation |
|---|---|---|---|---|
| MC-01 | Request counter | http_requests | Incremented | Count increases |
| MC-02 | Latency histogram | request_latency | Buckets | Distribution |
| MC-03 | Gauge | active_connections | Current | Value |
MC-01: Request Counter
Steps:
# Get initial count
BEFORE=$(curl -s "$GATEWAY_URL/metrics" | grep "http_requests_total" | grep -v "#" | awk '{print $2}')
# Make requests
for i in {1..10}; do
curl -s "$GATEWAY_URL/health" > /dev/null
done
# Get new count
AFTER=$(curl -s "$GATEWAY_URL/metrics" | grep "http_requests_total" | grep -v "#" | awk '{print $2}')
echo "Before: $BEFORE, After: $AFTER"Expected Result:
- Counter increased by ~10
Section 2: Rollup & Cleanup
| Case | Scenario | Action | Expected | Validation |
|---|---|---|---|---|
| RU-01 | Rollup execution | Scheduled | Aggregated | Reduced rows |
| CL-01 | Cleanup old | Retention | Deleted | Old data gone |
📊 Test Matrix
| Test Case | Collection | Rollup | Cleanup | Queries |
|---|---|---|---|---|
| MC-01 | ✓ | |||
| MC-02 | ✓ | |||
| MC-03 | ✓ | |||
| RU-01 | ✓ | |||
| CL-01 | ✓ |
✅ Success Criteria
- All 5 test cases pass
- Metrics collected correctly
- Rollup aggregates data
- Cleanup removes old data
🔗 Related Files
mcpgateway/services/metrics_service.py
🔗 Related Issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releaseP2: Important but not vital; high-value items that are not crucial for the immediate releasechoreLinting, formatting, dependency hygiene, or project maintenance choresLinting, formatting, dependency hygiene, or project maintenance choresmanual-testingManual testing / test planning issuesManual testing / test planning issuesreadyValidated, ready-to-work-on itemsValidated, ready-to-work-on itemstestingTesting (unit, e2e, manual, automated, etc)Testing (unit, e2e, manual, automated, etc)