feat(admin): 添加用户管理相关文件

添加用户管理视图、API和状态管理文件
This commit is contained in:
张翔
2026-03-28 14:37:29 +08:00
commit 08ea5fbe98
1643 changed files with 255646 additions and 0 deletions
@@ -0,0 +1,9 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://test-prometheus:9090
isDefault: true
editable: true
@@ -0,0 +1,93 @@
groups:
- name: test_environment_alerts
interval: 30s
rules:
- alert: TestAPIDown
expr: up{job="test-api-gateway"} == 0
for: 1m
labels:
severity: critical
service: api-gateway
annotations:
summary: "测试API网关服务宕机"
description: "测试API网关服务已宕机超过1分钟"
- alert: TestAdminBackendDown
expr: up{job="test-admin-backend"} == 0
for: 1m
labels:
severity: critical
service: admin-backend
annotations:
summary: "测试Admin后端服务宕机"
description: "测试Admin后端服务已宕机超过1分钟"
- alert: TestPostgresDown
expr: up{job="test-postgres"} == 0
for: 1m
labels:
severity: critical
service: postgres
annotations:
summary: "测试PostgreSQL数据库宕机"
description: "测试PostgreSQL数据库已宕机超过1分钟"
- alert: TestRedisDown
expr: up{job="test-redis"} == 0
for: 1m
labels:
severity: critical
service: redis
annotations:
summary: "测试Redis缓存宕机"
description: "测试Redis缓存已宕机超过1分钟"
- alert: TestAPIHighErrorRate
expr: rate(http_server_requests_seconds_count{job="test-api-gateway",status=~"5.."}[5m]) > 0.1
for: 5m
labels:
severity: warning
service: api-gateway
annotations:
summary: "测试API网关错误率过高"
description: "测试API网关5xx错误率超过10%"
- alert: TestAdminBackendHighErrorRate
expr: rate(http_server_requests_seconds_count{job="test-admin-backend",status=~"5.."}[5m]) > 0.1
for: 5m
labels:
severity: warning
service: admin-backend
annotations:
summary: "测试Admin后端错误率过高"
description: "测试Admin后端5xx错误率超过10%"
- alert: TestAPILatencyHigh
expr: histogram_quantile(0.95, rate(http_server_requests_seconds_bucket{job="test-api-gateway"}[5m])) > 2
for: 5m
labels:
severity: warning
service: api-gateway
annotations:
summary: "测试API网关延迟过高"
description: "测试API网关P95延迟超过2秒"
- alert: TestPostgresConnectionsHigh
expr: pg_stat_database{datname="everything_test"} > 80
for: 5m
labels:
severity: warning
service: postgres
annotations:
summary: "测试PostgreSQL连接数过高"
description: "测试PostgreSQL数据库连接数超过80"
- alert: TestRedisMemoryHigh
expr: redis_memory_used_bytes / redis_memory_max_bytes > 0.8
for: 5m
labels:
severity: warning
service: redis
annotations:
summary: "测试Redis内存使用率过高"
description: "测试Redis内存使用率超过80%"
+63
View File
@@ -0,0 +1,63 @@
global:
scrape_interval: 15s
evaluation_interval: 15s
external_labels:
monitor: 'test-environment'
scrape_configs:
- job_name: 'test-api-gateway'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['test-api-gateway:8080']
labels:
service: 'api-gateway'
application: 'everything-is-suitable-api'
environment: 'test'
scrape_interval: 15s
scrape_timeout: 10s
- job_name: 'test-admin-backend'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['test-admin-backend:8081']
labels:
service: 'admin-backend'
application: 'everything-is-suitable-admin'
environment: 'test'
scrape_interval: 15s
scrape_timeout: 10s
- job_name: 'test-postgres'
static_configs:
- targets: ['test-postgres:5432']
labels:
service: 'postgres'
environment: 'test'
scrape_interval: 30s
scrape_timeout: 10s
- job_name: 'test-redis'
static_configs:
- targets: ['test-redis:6379']
labels:
service: 'redis'
environment: 'test'
scrape_interval: 30s
scrape_timeout: 10s
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
labels:
service: 'prometheus'
environment: 'test'
scrape_interval: 30s
scrape_timeout: 10s
alerting:
alertmanagers:
- static_configs:
- targets: []
rule_files:
- 'alerting_rules.yml'