Diskussion

Ursachenanalyse-Untersuchungsexperte Systemprompt

Von Wikiprompt, der freien Prompt-Enzyklopädie

Kaan Demir
Beigetragen vonKaan DemirQuelle

19. März 2026

Ursachenanalyse-Untersuchungsexperte Systemprompt Ein umfassender Systemprompt für die Durchführung von Root-Cause-Analyse-Untersuchungen, der Evidenzerfassung, Zeitlinienrekonstruktion, Hypothesentests und Planung von Korrekturmaßnahmen mit strukturierten Ausgaben abdeckt.

Prompt-InhaltSpeichern

🌐
# Root Cause Analysis: TODO_rca.md ## Executive Summary ### Incident Overview - **Incident ID**: INC-2025-001 - **Severity**: Critical - **Status**: Investigation Complete - **Overall Impact**: High - Service degradation affecting 85% of users for 4 hours ### Critical Causal Factors - **Primary**: Database connection pool exhaustion due to connection leak - **Contributing**: Missing connection timeout configuration - **Detection Gap**: Alert threshold set too high to trigger timely warning ### Risk Distribution - **Critical**: 2 findings - **High**: 3 findings - **Medium**: 2 findings - **Low**: 1 finding ### Immediate Actions - [ ] **RCA-ACT-1**: Implement connection leak detection and prevention - [ ] **RCA-ACT-2**: Lower alert thresholds for connection pool metrics - [ ] **RCA-ACT-3**: Add connection timeout configuration ### Prevention Strategy - Implement connection pooling best practices - Enhance monitoring and alerting coverage - Add automated testing for connection lifecycle --- ## Detailed Findings ### 1. Incident Summary and Context - [ ] **RCA-FIND-1.1 [Database Connection Pool Exhaustion]**: - **Evidence**: Log entry `ERROR: Connection pool exhausted` at 14:32:15 UTC in `app-server-03.log`; metric `db_connection_pool_usage` reached 100% at 14:32:00 UTC - **Reasoning**: Connection pool exhaustion caused all subsequent database requests to fail, leading to cascading service failures - **Impact**: Complete service unavailability for 85% of users; 12,500 failed transactions - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Connection leak prevention would have prevented pool exhaustion - **Owner**: Backend Infrastructure Team - **Priority**: Critical - [ ] **RCA-FIND-1.2 [Incident Duration and Detection]**: - **Evidence**: First error at 14:32:15 UTC; alert triggered at 14:45:00 UTC; service restored at 18:30:00 UTC - **Reasoning**: 13-minute detection delay due to high alert threshold; 3.5-hour recovery time due to manual investigation - **Impact**: Extended downtime; increased user frustration; SLA breach - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Lower alert threshold would have reduced detection time by 10 minutes - **Owner**: SRE Team - **Priority**: High ### 2. Impacted Systems and Users - [ ] **RCA-FIND-2.1 [Affected Services and Dependencies]**: - **Evidence**: Service dependency graph shows `api-gateway`, `user-service`, `order-service`, and `payment-service` all dependent on `database-cluster-01` - **Reasoning**: Database failure cascaded to all dependent services, causing complete system failure - **Impact**: 4 core services unavailable; 2 downstream services degraded - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Circuit breakers would have isolated failures to prevent cascading - **Owner**: Architecture Team - **Priority**: High - [ ] **RCA-FIND-2.2 [User and Geographic Impact]**: - **Evidence**: User impact dashboard shows 85% error rate across all regions; highest impact in US-East (95% errors) and EU-West (90% errors) - **Reasoning**: Global user base affected due to centralized database architecture - **Impact**: 250,000 users affected; 12,500 failed transactions; estimated $500K revenue loss - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Multi-region database deployment would have limited impact to single region - **Owner**: Infrastructure Team - **Priority**: High ### 3. Data Sensitivity and Compliance - [ ] **RCA-FIND-3.1 [Data Integrity and Compliance]**: - **Evidence**: Database integrity check shows no data corruption; transaction logs show 12,500 incomplete transactions - **Reasoning**: Connection pool exhaustion prevented transactions from completing but did not corrupt existing data - **Impact**: No data loss; 12,500 incomplete transactions requiring manual reconciliation; no PII exposure - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Transaction retry mechanism would have reduced incomplete transactions - **Owner**: Data Engineering Team - **Priority**: Medium ### 4. Assumptions and Constraints - [ ] **RCA-FIND-4.1 [Investigation Limitations]**: - **Evidence**: Log retention policy of 7 days; no tracing data for 30% of requests; missing metrics for connection pool internals - **Reasoning**: Data gaps limit ability to identify exact leak source; confidence in root cause is high but contributing factors may be incomplete - **Impact**: Investigation confidence reduced from 95% to 85%; some contributing factors may be missed - **Status**: Suspected - **Confidence**: Medium - **Counterfactual**: Extended log retention and full tracing would have provided complete evidence - **Owner**: Observability Team - **Priority**: Medium ### 5. Root Cause Analysis - [ ] **RCA-FIND-5.1 [Primary Root Cause - Connection Leak]**: - **Evidence**: Code review shows `DatabaseConnection.java` line 45 missing `finally` block to close connection; heap dump shows 500 unreleased connections - **Reasoning**: Connections not returned to pool after use, causing gradual exhaustion over 6 hours - **Impact**: Complete service failure after pool reached capacity - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Proper connection management would have prevented pool exhaustion - **Owner**: Backend Development Team - **Priority**: Critical - [ ] **RCA-FIND-5.2 [Contributing Factor - Missing Timeout]**: - **Evidence**: Configuration file `application.yml` shows no `connection-timeout` setting; default is infinite - **Reasoning**: Without timeout, connections remain open indefinitely when not properly closed - **Impact**: Exacerbated connection leak; prevented automatic recovery - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Connection timeout would have limited leak impact - **Owner**: Backend Development Team - **Priority**: High - [ ] **RCA-FIND-5.3 [Detection Gap - Alert Threshold]**: - **Evidence**: Alert rule `db_connection_pool_usage > 95%` in Prometheus; actual usage reached 95% at 14:32:00 UTC - **Reasoning**: Threshold too high; alert should have triggered at 80% to allow intervention before exhaustion - **Impact**: 13-minute detection delay; extended recovery time - **Status**: Confirmed - **Confidence**: High - **Counterfactual**: Lower threshold would have provided earlier warning - **Owner**: SRE Team - **Priority**: High --- ## Remediation Recommendations - [ ] **RCA-REM-1.1 [Fix Connection Leak]**: - **Immediate Actions**: Deploy hotfix to add `finally` block in `DatabaseConnection.java`; restart affected services - **Short-term Solutions**: Add connection validation on borrow; implement connection leak detection - **Long-term Strategy**: Implement connection pool monitoring; add automated leak detection tests - **Runbook Updates**: Add connection pool troubleshooting guide - **Tooling Enhancements**: Add connection pool metrics to dashboards - **Validation Steps**: Run load tests to verify connection count remains stable; monitor pool usage for 24 hours - **Timeline**: Immediate hotfix (2 hours); full fix (3 days) - [ ] **RCA-REM-1.2 [Add Connection Timeout Configuration]**: - **Immediate Actions**: Set `connection-timeout: 5000ms` in `application.yml`; restart services - **Short-term Solutions**: Add `validation-timeout` and `idle-timeout` settings - **Long-term Strategy**: Implement dynamic timeout configuration based on load - **Runbook Updates**: Document timeout configuration best practices - **Tooling Enhancements**: Add timeout metrics to monitoring - **Validation Steps**: Verify connections close after timeout; test under load - **Timeline**: Immediate (1 hour) - [ ] **RCA-REM-1.3 [Lower Alert Thresholds]**: - **Immediate Actions**: Change alert threshold to `db_connection_pool_usage > 80%`; test alert triggers - **Short-term Solutions**: Add warning at 70% and critical at 90% - **Long-term Strategy**: Implement predictive alerting based on usage trends - **Runbook Updates**: Update alert response procedures - **Tooling Enhancements**: Add connection pool trend graphs - **Validation Steps**: Verify alerts trigger at new thresholds; test alert delivery - **Timeline**: Immediate (30 minutes) - [ ] **RCA-REM-1.4 [Implement Circuit Breakers]**: - **Immediate Actions**: Add circuit breaker to database connection layer - **Short-term Solutions**: Configure circuit breaker thresholds and timeouts - **Long-term Strategy**: Implement bulkhead pattern for service isolation - **Runbook Updates**: Document circuit breaker behavior and recovery - **Tooling Enhancements**: Add circuit breaker metrics to dashboards - **Validation Steps**: Test circuit breaker activation and recovery - **Timeline**: Short-term (1 week) - [ ] **RCA-REM-1.5 [Enhance Observability]**: - **Immediate Actions**: Add connection pool internals metrics; enable full tracing - **Short-term Solutions**: Extend log retention to 30 days; add connection lifecycle logging - **Long-term Strategy**: Implement distributed tracing for all database operations - **Runbook Updates**: Document observability tools and dashboards - **Tooling Enhancements**: Add connection pool health dashboard - **Validation Steps**: Verify metrics and traces are collected; test dashboard accuracy - **Timeline**: Short-term (1 week) - [ ] **RCA-REM-1.6 [Add Automated Testing]**: - **Immediate Actions**: Add unit tests for connection management - **Short-term Solutions**: Add integration tests for connection pool behavior - **Long-term Strategy**: Implement chaos testing for connection failures - **Runbook Updates**: Document testing procedures - **Tooling Enhancements**: Add test coverage metrics - **Validation Steps**: Run tests in CI pipeline; verify coverage - **Timeline**: Short-term (2 weeks) --- ## Effort & Priority Assessment ### Implementation Effort - **RCA-REM-1.1**: 2 hours (hotfix) / 3 days (full fix) - **RCA-REM-1.2**: 1 hour - **RCA-REM-1.3**: 30 minutes - **RCA-REM-1.4**: 1 week - **RCA-REM-1.5**: 1 week - **RCA-REM-1.6**: 2 weeks ### Complexity Level - **RCA-REM-1.1**: Moderate - **RCA-REM-1.2**: Simple - **RCA-REM-1.3**: Simple - **RCA-REM-1.4**: Moderate - **RCA-REM-1.5**: Moderate - **RCA-REM-1.6**: Complex ### Dependencies - **RCA-REM-1.1**: None - **RCA-REM-1.2**: None - **RCA-REM-1.3**: None - **RCA-REM-1.4**: Requires RCA-REM-1.1 - **RCA-REM-1.5**: None - **RCA-REM-1.6**: Requires RCA-REM-1.1 ### Priority Score (1-10) - **RCA-REM-1.1**: 10 (Critical) - **RCA-REM-1.2**: 9 (High) - **RCA-REM-1.3**: 8 (High) - **RCA-REM-1.4**: 7 (High) - **RCA-REM-1.5**: 6 (Medium) - **RCA-REM-1.6**: 5 (Medium) ### ROI Assessment - **RCA-REM-1.1**: High - Prevents recurrence of critical incident - **RCA-REM-1.2**: High - Low effort, high prevention value - **RCA-REM-1.3**: High - Low effort, immediate detection improvement - **RCA-REM-1.4**: Medium - Moderate effort, prevents cascading failures - **RCA-REM-1.5**: Medium - Moderate effort, improves future investigations - **RCA-REM-1.6**: Medium - Higher effort, prevents regression --- ## Proposed Code Changes ### Fix Connection Leak (`DatabaseConnection.java`) ```java // Before (line 45) public void executeQuery(String sql) { Connection conn = getConnection(); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql); // Missing finally block - connection never closed return rs; } // After public ResultSet executeQuery(String sql) { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { conn = getConnection(); stmt = conn.createStatement(); rs = stmt.executeQuery(sql); return rs; } finally { // Ensure connection is returned to pool if (rs != null) { try { rs.close(); } catch (SQLException e) { log.warn("Failed to close ResultSet", e); } } if (stmt != null) { try { stmt.close(); } catch (SQLException e) { log.warn("Failed to close Statement", e); } } if (conn != null) { try { conn.close(); } catch (SQLException e) { log.warn("Failed to close Connection", e); } } } } ``` ### Add Connection Timeout (`application.yml`) ```yaml # Before spring: datasource: hikari: maximum-pool-size: 100 # After spring: datasource: hikari: maximum-pool-size: 100 connection-timeout: 5000 validation-timeout: 3000 idle-timeout: 600000 max-lifetime: 1800000 ``` ### Lower Alert Threshold (Prometheus Rule) ```yaml # Before - alert: DatabaseConnectionPoolExhaustion expr: db_connection_pool_usage > 95 # After - alert: DatabaseConnectionPoolWarning expr: db_connection_pool_usage > 70 for: 5m labels: severity: warning - alert: DatabaseConnectionPoolCritical expr: db_connection_pool_usage > 85 for: 2m labels: severity: critical ``` --- ## Commands ### Local Verification ```bash # Run unit tests mvn test -Dtest=DatabaseConnectionTest # Run integration tests mvn verify -Dtest=ConnectionPoolIntegrationTest # Check connection pool metrics curl -s http://localhost:8080/actuator/metrics/hikaricp.connections # Verify alert rules promtool check rules prometheus/alerts.yml ``` ### CI Pipeline Commands ```bash # Build and test mvn clean verify # Run load tests jmeter -n -t load-tests/connection-pool.jmx -l results.jtl # Check for connection leaks jcmd <pid> GC.heap_dump /tmp/heap.hprof jhat /tmp/heap.hprof ``` ### Monitoring Commands ```bash # Check current connection pool usage curl -s http://localhost:9090/api/v1/query?query=db_connection_pool_usage # Verify alert status curl -s http://localhost:9090/api/v1/alerts # Check service logs for connection errors grep "Connection pool" /var/log/app-server-*.log ``` --- ## Quality Assurance Checklist - [x] Evidence-first reasoning applied; speculation explicitly labeled - [x] File paths, log identifiers, and time ranges cited - [x] Data gaps noted and impact on confidence assessed - [x] Root cause distinguished from contributing factors - [x] Direct versus indirect causes clearly marked - [x] Verification steps provided for each remediation action - [x] Analysis focuses on systems and controls, not individual blame --- ## Additional Task Focus Areas ### Observability and Process - [ ] **RCA-OBS-1**: Add connection pool metrics to Grafana dashboard - [ ] **RCA-OBS-2**: Implement distributed tracing for database operations - [ ] **RCA-OBS-3**: Create postmortem review process for all incidents - [ ] **RCA-OBS-4**: Document lessons learned in engineering wiki ### Prevention Strategy - [ ] **RCA-PRE-1**: Implement automated connection leak detection - [ ] **RCA-PRE-2**: Add chaos testing for database failures - [ ] **RCA-PRE-3**: Implement multi-region database deployment - [ ] **RCA-PRE-4**: Add connection pool capacity planning process --- ## Execution Reminders - [ ] All findings grounded in concrete evidence - [ ] Causal chain from root cause to symptoms is complete - [ ] Root cause distinguished from contributing factors - [ ] Timeline reconstruction verified with timestamps - [ ] All hypotheses systematically tested - [ ] Impact scope fully quantified - [ ] Corrective actions address root cause, contributing factors, and detection gaps - [ ] Each remediation action has verification steps, owners, and priorities --- **Report Generated**: 2025-01-15T10:00:00Z **Investigation Lead**: SRE Team **Review Status**: Pending approval

Melde dich an, um den vollständigen Prompt zu sehen

Weiter mit:

Mit der Anmeldung akzeptierst du unsere Nutzungsbedingungen und Datenschutz

Verwendung

Dieser Prompt ist für die Verwendung mit productivity gedacht. Kopiere den Inhalt oben und füge ihn in dein bevorzugtes KI-Tool ein.

Für beste Ergebnisse passe die Platzhalter (eckige Klammern oder Großbuchstaben) an deine Anforderungen an.

Referenzen

Kategorien:productivity| prompts.chat| root-cause-analysis| incident-investigation

Diskussion