From 3f692f24c1d0f53304deb57d0d16e1903b26896b Mon Sep 17 00:00:00 2001 From: nutcas3 Date: Fri, 17 Apr 2026 17:33:39 +0300 Subject: [PATCH] feat: Add Grafana provisioning and Prometheus configuration for telecom platform monitoring - Add Grafana dashboard provisioning with telecom-dashboards provider, 10s update interval, UI updates enabled - Add Grafana datasource provisioning with Prometheus (default) and InfluxDB Flux datasources - Add InfluxDB datasource with telecom org/bucket, admin credentials, token authentication - Add Prometheus configuration with 15s scrape/evaluation intervals, alert_rules.yml integration - Add Alertmanager integration --- .../provisioning/dashboards/dashboards.yml | 12 +++++ .../provisioning/datasources/datasources.yml | 25 ++++++++++ monitoring/prometheus/prometheus.yml | 48 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 monitoring/grafana/provisioning/dashboards/dashboards.yml create mode 100644 monitoring/grafana/provisioning/datasources/datasources.yml create mode 100644 monitoring/prometheus/prometheus.yml diff --git a/monitoring/grafana/provisioning/dashboards/dashboards.yml b/monitoring/grafana/provisioning/dashboards/dashboards.yml new file mode 100644 index 0000000..fc0c760 --- /dev/null +++ b/monitoring/grafana/provisioning/dashboards/dashboards.yml @@ -0,0 +1,12 @@ +apiVersion: 1 + +providers: + - name: 'telecom-dashboards' + orgId: 1 + folder: '' + type: file + disableDeletion: false + updateIntervalSeconds: 10 + allowUiUpdates: true + options: + path: /var/lib/grafana/dashboards diff --git a/monitoring/grafana/provisioning/datasources/datasources.yml b/monitoring/grafana/provisioning/datasources/datasources.yml new file mode 100644 index 0000000..774c44e --- /dev/null +++ b/monitoring/grafana/provisioning/datasources/datasources.yml @@ -0,0 +1,25 @@ +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:8086 + database: telecom + user: admin + password: password123 + jsonData: + version: Flux + organization: telecom + defaultBucket: telecom + tlsSkipVerify: true + secureJsonData: + token: telecom-super-secret-auth-token + editable: true diff --git a/monitoring/prometheus/prometheus.yml b/monitoring/prometheus/prometheus.yml new file mode 100644 index 0000000..71db8e0 --- /dev/null +++ b/monitoring/prometheus/prometheus.yml @@ -0,0 +1,48 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +rule_files: + - "alert_rules.yml" + +alerting: + alertmanagers: + - static_configs: + - targets: + - alertmanager:9093 + +scrape_configs: + - job_name: 'telecom-api-server' + static_configs: + - targets: ['host.docker.internal:8000'] + metrics_path: '/metrics' + scrape_interval: 5s + + - job_name: 'telecom-charging-engine' + static_configs: + - targets: ['host.docker.internal:3001'] + metrics_path: '/metrics' + scrape_interval: 5s + + - job_name: 'telecom-packet-gateway' + static_configs: + - targets: ['host.docker.internal:9000'] + metrics_path: '/metrics' + scrape_interval: 5s + + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + + - job_name: 'node-exporter' + static_configs: + - targets: ['node-exporter:9100'] + + - job_name: 'redis' + static_configs: + - targets: ['redis:6379'] + + - job_name: 'influxdb' + static_configs: + - targets: ['influxdb:8086'] + metrics_path: '/metrics'