mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-23 13:12:16 +00:00
- Add api-server Deployment with 3 replicas, 8000 HTTP and 9090 metrics ports, database/Redis/InfluxDB environment configuration, 256Mi-512Mi memory, 250m-500m CPU, health probes - Add charging-engine Deployment with 2 replicas, 3001 port, Redis integration, 128Mi-256Mi memory, 100m-200m CPU - Add packet-gateway Deployment with 2 replicas, 9000 metrics port, privileged security context with NET_ADMIN/SYS_ADMIN capabilities
326 lines
8.5 KiB
YAML
326 lines
8.5 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: alertmanager-config
|
|
namespace: telecom-monitoring
|
|
data:
|
|
alertmanager.yml: |
|
|
global:
|
|
smtp_smarthost: 'localhost:587'
|
|
smtp_from: '[email protected]'
|
|
|
|
route:
|
|
group_by: ['alertname']
|
|
group_wait: 10s
|
|
group_interval: 10s
|
|
repeat_interval: 1h
|
|
receiver: 'web.hook'
|
|
routes:
|
|
- match:
|
|
severity: critical
|
|
receiver: 'critical-alerts'
|
|
- match:
|
|
severity: warning
|
|
receiver: 'warning-alerts'
|
|
|
|
receivers:
|
|
- name: 'web.hook'
|
|
webhook_configs:
|
|
- url: 'http://api-server-service:8000/webhooks/alertmanager'
|
|
send_resolved: true
|
|
- name: 'critical-alerts'
|
|
webhook_configs:
|
|
- url: 'http://api-server-service:8000/webhooks/critical-alerts'
|
|
send_resolved: true
|
|
email_configs:
|
|
- to: '[email protected]'
|
|
subject: '[CRITICAL] Telecom Platform Alert'
|
|
body: |
|
|
{{ range .Alerts }}
|
|
Alert: {{ .Annotations.summary }}
|
|
Description: {{ .Annotations.description }}
|
|
Labels: {{ range .Labels.SortedPairs }}{{ .Name }}={{ .Value }} {{ end }}
|
|
{{ end }}
|
|
- name: 'warning-alerts'
|
|
webhook_configs:
|
|
- url: 'http://api-server-service:8000/webhooks/warning-alerts'
|
|
send_resolved: true
|
|
|
|
inhibit_rules:
|
|
- source_match:
|
|
severity: 'critical'
|
|
target_match:
|
|
severity: 'warning'
|
|
equal: ['alertname', 'instance']
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: grafana-provisioning
|
|
namespace: telecom-monitoring
|
|
data:
|
|
datasources.yml: |
|
|
apiVersion: 1
|
|
|
|
datasources:
|
|
- name: Prometheus
|
|
type: prometheus
|
|
access: proxy
|
|
url: http://prometheus:9090
|
|
isDefault: true
|
|
editable: true
|
|
|
|
- name: InfluxDB
|
|
type: influxdb
|
|
access: proxy
|
|
url: http://influxdb-service:8086
|
|
database: telecom
|
|
user: admin
|
|
jsonData:
|
|
version: Flux
|
|
organization: telecom
|
|
defaultBucket: telecom
|
|
tlsSkipVerify: true
|
|
secureJsonData:
|
|
token: telecom-super-secret-auth-token
|
|
editable: true
|
|
|
|
dashboards.yml: |
|
|
apiVersion: 1
|
|
|
|
providers:
|
|
- name: 'telecom-dashboards'
|
|
orgId: 1
|
|
folder: ''
|
|
type: file
|
|
disableDeletion: false
|
|
updateIntervalSeconds: 10
|
|
allowUiUpdates: true
|
|
options:
|
|
path: /var/lib/grafana/dashboards
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: grafana-dashboards
|
|
namespace: telecom-monitoring
|
|
data:
|
|
telecom-overview.json: |
|
|
{
|
|
"annotations": {
|
|
"list": [
|
|
{
|
|
"builtIn": 1,
|
|
"datasource": {
|
|
"type": "grafana",
|
|
"uid": "-- Grafana --"
|
|
},
|
|
"enable": true,
|
|
"hide": true,
|
|
"iconColor": "rgba(0, 211, 255, 1)",
|
|
"name": "Annotations & Alerts",
|
|
"type": "dashboard"
|
|
}
|
|
]
|
|
},
|
|
"description": "Telecom Platform Overview Dashboard",
|
|
"editable": true,
|
|
"fiscalYearStartMonth": 0,
|
|
"graphTooltip": "shared_crosshair",
|
|
"id": null,
|
|
"links": [],
|
|
"liveNow": false,
|
|
"panels": [
|
|
{
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${DS_PROMETHEUS}"
|
|
},
|
|
"description": "Total number of subscribers",
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"color": {
|
|
"mode": "palette-classic"
|
|
},
|
|
"custom": {
|
|
"axisLabel": "",
|
|
"axisPlacement": "auto",
|
|
"barAlignment": 0,
|
|
"drawStyle": "line",
|
|
"fillOpacity": 10,
|
|
"gradientMode": "none",
|
|
"hideFrom": {
|
|
"legend": false,
|
|
"tooltip": false,
|
|
"vis": false
|
|
},
|
|
"lineInterpolation": "linear",
|
|
"lineWidth": 1,
|
|
"pointSize": 5,
|
|
"scaleDistribution": {
|
|
"type": "linear"
|
|
},
|
|
"showPoints": "never",
|
|
"spanNulls": false,
|
|
"stacking": {
|
|
"group": "A",
|
|
"mode": "none"
|
|
},
|
|
"thresholdsStyle": {
|
|
"mode": "off"
|
|
}
|
|
},
|
|
"mappings": [],
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 80
|
|
}
|
|
]
|
|
},
|
|
"unit": "short"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"gridPos": {
|
|
"h": 8,
|
|
"w": 12,
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"id": 1,
|
|
"options": {
|
|
"legend": {
|
|
"calcs": [],
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
},
|
|
"tooltip": {
|
|
"mode": "single",
|
|
"sort": "none"
|
|
}
|
|
},
|
|
"targets": [
|
|
{
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${DS_PROMETHEUS}"
|
|
},
|
|
"expr": "telecom_subscribers_total",
|
|
"interval": "",
|
|
"legendFormat": "Total Subscribers",
|
|
"refId": "A"
|
|
}
|
|
],
|
|
"title": "Total Subscribers",
|
|
"type": "timeseries"
|
|
}
|
|
],
|
|
"refresh": "5s",
|
|
"schemaVersion": 38,
|
|
"style": "dark",
|
|
"tags": ["telecom"],
|
|
"templating": {
|
|
"list": []
|
|
},
|
|
"time": {
|
|
"from": "now-1h",
|
|
"to": "now"
|
|
},
|
|
"timepicker": {},
|
|
"timezone": "",
|
|
"title": "Telecom Platform Overview",
|
|
"uid": "telecom-overview",
|
|
"version": 1,
|
|
"weekStart": ""
|
|
}
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: prometheus-rules
|
|
namespace: telecom-monitoring
|
|
data:
|
|
alert_rules.yml: |
|
|
groups:
|
|
- name: telecom_alerts
|
|
rules:
|
|
- alert: HighErrorRate
|
|
expr: rate(telecom_http_requests_total{status_code=~"5.."}[5m]) > 0.1
|
|
for: 5m
|
|
labels:
|
|
severity: critical
|
|
annotations:
|
|
summary: "High error rate detected"
|
|
description: "Error rate is {{ $value }} errors per second"
|
|
|
|
- alert: LowCreditBalance
|
|
expr: telecom_credit_balance < 5
|
|
for: 2m
|
|
labels:
|
|
severity: warning
|
|
annotations:
|
|
summary: "Subscriber has low credit balance"
|
|
description: "Subscriber {{ $labels.subscriber_id }} has balance {{ $value }}"
|
|
|
|
- alert: HighMemoryUsage
|
|
expr: (container_memory_usage_bytes / container_spec_memory_limit_bytes) * 100 > 90
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
annotations:
|
|
summary: "High memory usage"
|
|
description: "Container {{ $labels.container }} memory usage is {{ $value }}%"
|
|
|
|
- alert: HighCPUUsage
|
|
expr: rate(container_cpu_usage_seconds_total[5m]) * 100 > 80
|
|
for: 5m
|
|
labels:
|
|
severity: warning
|
|
annotations:
|
|
summary: "High CPU usage"
|
|
description: "Container {{ $labels.container }} CPU usage is {{ $value }}%"
|
|
|
|
- alert: DatabaseConnectionFailure
|
|
expr: up{job="postgres"} == 0
|
|
for: 1m
|
|
labels:
|
|
severity: critical
|
|
annotations:
|
|
summary: "Database connection failure"
|
|
description: "PostgreSQL database is down"
|
|
|
|
- alert: RedisConnectionFailure
|
|
expr: up{job="redis"} == 0
|
|
for: 1m
|
|
labels:
|
|
severity: critical
|
|
annotations:
|
|
summary: "Redis connection failure"
|
|
description: "Redis cache is down"
|
|
|
|
- alert: ChargingEngineDown
|
|
expr: up{job="telecom-charging-engine"} == 0
|
|
for: 2m
|
|
labels:
|
|
severity: critical
|
|
annotations:
|
|
summary: "Charging engine is down"
|
|
description: "Rust charging engine service is not responding"
|
|
|
|
- alert: PacketGatewayDown
|
|
expr: up{job="telecom-packet-gateway"} == 0
|
|
for: 2m
|
|
labels:
|
|
severity: critical
|
|
annotations:
|
|
summary: "Packet gateway is down"
|
|
description: "eBPF packet gateway service is not responding"
|