mirror of
https://github.com/luxfi/monitoring.git
synced 2026-10-30 15:24:48 +00:00
148 lines
5.0 KiB
YAML
148 lines
5.0 KiB
YAML
groups:
|
|
# DEX Performance Recording Rules
|
|
- name: dex_performance
|
|
interval: 5s
|
|
rules:
|
|
# Order matching latency percentiles
|
|
- record: dex:matching_latency:p50
|
|
expr: histogram_quantile(0.50, rate(dex_matching_latency_bucket[1m]))
|
|
|
|
- record: dex:matching_latency:p95
|
|
expr: histogram_quantile(0.95, rate(dex_matching_latency_bucket[1m]))
|
|
|
|
- record: dex:matching_latency:p99
|
|
expr: histogram_quantile(0.99, rate(dex_matching_latency_bucket[1m]))
|
|
|
|
- record: dex:matching_latency:p999
|
|
expr: histogram_quantile(0.999, rate(dex_matching_latency_bucket[1m]))
|
|
|
|
# Throughput metrics
|
|
- record: dex:orders_per_second
|
|
expr: rate(dex_orders_processed_total[1m])
|
|
|
|
- record: dex:trades_per_second
|
|
expr: rate(dex_trades_executed_total[1m])
|
|
|
|
- record: dex:quotes_per_second
|
|
expr: rate(dex_quotes_processed_total[1m])
|
|
|
|
# Consensus metrics
|
|
- record: dex:consensus_round_time
|
|
expr: rate(dex_consensus_round_duration_seconds_sum[1m]) / rate(dex_consensus_round_duration_seconds_count[1m])
|
|
|
|
- record: dex:consensus_finality_time
|
|
expr: histogram_quantile(0.95, rate(dex_consensus_finality_bucket[1m]))
|
|
|
|
# DEX Alerting Rules
|
|
- name: dex_alerts
|
|
interval: 10s
|
|
rules:
|
|
# Critical: Latency exceeds 1ms (target is <1μs)
|
|
- alert: DEXHighLatency
|
|
expr: dex:matching_latency:p99 > 0.001
|
|
for: 1m
|
|
labels:
|
|
severity: critical
|
|
component: dex-engine
|
|
annotations:
|
|
summary: "DEX matching latency exceeds 1ms"
|
|
description: "DEX matching latency p99 is {{ $value }}s (target <1μs)"
|
|
|
|
# Warning: Latency exceeds 500μs
|
|
- alert: DEXElevatedLatency
|
|
expr: dex:matching_latency:p95 > 0.0005
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
component: dex-engine
|
|
annotations:
|
|
summary: "DEX matching latency elevated"
|
|
description: "DEX matching latency p95 is {{ $value }}s (target <500μs)"
|
|
|
|
# Critical: Throughput below 1M trades/sec
|
|
- alert: DEXLowThroughput
|
|
expr: dex:trades_per_second < 1000000
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
component: dex-engine
|
|
annotations:
|
|
summary: "DEX throughput below target"
|
|
description: "DEX processing {{ $value }} trades/sec (target >1M)"
|
|
|
|
# Critical: Consensus failure
|
|
- alert: DEXConsensusFailure
|
|
expr: up{job="dex-consensus"} == 0
|
|
for: 30s
|
|
labels:
|
|
severity: critical
|
|
component: dex-consensus
|
|
annotations:
|
|
summary: "DEX consensus node is down"
|
|
description: "DEX consensus node has been down for >30s"
|
|
|
|
# Warning: High memory usage
|
|
- alert: DEXHighMemoryUsage
|
|
expr: (node_memory_MemTotal_bytes{job="node",instance="dex-node"} - node_memory_MemAvailable_bytes{job="node",instance="dex-node"}) / node_memory_MemTotal_bytes{job="node",instance="dex-node"} > 0.9
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
component: dex-node
|
|
annotations:
|
|
summary: "DEX node high memory usage"
|
|
description: "DEX node memory usage is {{ $value | humanizePercentage }}"
|
|
|
|
# Critical: Database connection failure
|
|
- alert: DEXDatabaseDown
|
|
expr: up{job="dex-postgres"} == 0
|
|
for: 1m
|
|
labels:
|
|
severity: critical
|
|
component: dex-database
|
|
annotations:
|
|
summary: "DEX database is down"
|
|
description: "PostgreSQL/TimescaleDB connection failed"
|
|
|
|
# Warning: WebSocket connections dropping
|
|
- alert: DEXWebSocketDrops
|
|
expr: rate(dex_websocket_disconnects_total[5m]) > 10
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
component: dex-websocket
|
|
annotations:
|
|
summary: "High WebSocket disconnect rate"
|
|
description: "WebSocket disconnecting at {{ $value }}/sec"
|
|
|
|
# Critical: Order book desync
|
|
- alert: DEXOrderBookDesync
|
|
expr: dex_orderbook_sync_errors_total > 0
|
|
for: 30s
|
|
labels:
|
|
severity: critical
|
|
component: dex-orderbook
|
|
annotations:
|
|
summary: "Order book desynchronization detected"
|
|
description: "Order book sync errors: {{ $value }}"
|
|
|
|
# Warning: DPDK packet drops
|
|
- alert: DEXPacketDrops
|
|
expr: rate(dex_dpdk_packet_drops_total[1m]) > 100
|
|
for: 2m
|
|
labels:
|
|
severity: warning
|
|
component: dex-dpdk
|
|
annotations:
|
|
summary: "DPDK packet drops detected"
|
|
description: "Dropping {{ $value }} packets/sec"
|
|
|
|
# Critical: GPU acceleration failure
|
|
- alert: DEXGPUFailure
|
|
expr: dex_gpu_available == 0
|
|
for: 1m
|
|
labels:
|
|
severity: warning
|
|
component: dex-gpu
|
|
annotations:
|
|
summary: "GPU acceleration unavailable"
|
|
description: "GPU acceleration has failed or is unavailable" |