Saved LogQL Queries
This document contains commonly used LogQL queries for ReptiDex services. These queries are also available as saved queries in Grafana.Error Analysis
All Errors from a Service
Errors with Grouping by Type
Top 10 Error Types
Error Rate Over Time
Errors by Endpoint
New Error Types (Last 24h)
Performance Analysis
Slow Requests (>1 second)
Top 10 Slowest Endpoints
Request Duration Percentiles
Slow Database Queries
Database Connection Pool Exhaustion
Cache Miss Patterns
Memory Warnings
Security & Authentication
Failed Authentication Attempts
Authentication Failure Rate
Unauthorized Access Attempts (401/403)
Top IPs with Auth Failures
Suspicious Activity (Multiple Failed Attempts)
API Rate Limits Hit
Rate Limit Hits by Endpoint
User Activity
User Activity Timeline
User Actions by Service
Active Users in Last Hour
User Session Analysis
Database Operations
Database Errors
Database Connection Errors
SQL Injection Attempts
Transaction Rollbacks
API Monitoring
5xx Server Errors
4xx Client Errors
Error Rate by Status Code
Top Error Endpoints
Request Volume by Service
Service Health
Service Startup/Shutdown Events
Unhealthy Service Checks
Background Job Failures
Resource Warnings
Debugging Queries
Context View (Logs Around a Specific Time)
Live Tail (Real-time Logs)
Full Request/Response Debug
Unique Error Messages
Correlation Queries
Errors with Slow Requests
Failed Requests with User Context
Variables for Dashboards
When using these queries in Grafana dashboards, use these variables:Query Tips
- Start broad, filter narrow: Begin with
{service="repti-core"}then add filters - Use json parsing early:
| jsonextracts fields for filtering - Format output for readability:
| line_format "{{.field1}}: {{.field2}}" - Limit results: Add
| limit 100to large result sets - Use aggregation functions:
count_over_time(),rate(),sum(),avg() - Regex tips:
=~for regex match!~for regex not match(?i)for case-insensitive
- Time ranges: Always specify time range with
[5m],[1h], etc.
Next Steps
- Error Investigation Workflow - How to investigate errors
- Debugging Playbook - Common debugging scenarios
- Log Correlation - Correlating logs with metrics

