Prometheus/Grafana
monitoring.prometheus
Protects against destructive Prometheus/Grafana operations like deleting time series data or dashboards/datasources.
- 7blocking rules
- 4safe patterns
- 2Critical
- 5High
[packs]
enabled = ["monitoring.prometheus"]Evaluated when a command contains promtool, grafana-cli, delete_series, rules.d, prometheusrule, servicemonitor, podmonitor.
Blocking rules
Each rule ID is monitoring.prometheus:<name>. Use it in allowlists and [policy.rules].
Criticalprometheus-rules-file-deleteDeleting Prometheus rule/config files can break alerting and monitoring coverage.
Explanation
Deleting Prometheus configuration or rule files stops alerting for the defined conditions. After Prometheus reloads, those alerts will no longer fire, potentially leaving critical conditions unmonitored. Safer alternatives: - promtool check rules: Validate rule files before changes - Back up files before deletion - Use version control (git) for rule files
Criticalprometheus-tsdb-delete-seriesPrometheus TSDB delete_series permanently deletes time series data.
Explanation
The delete_series admin endpoint permanently removes time series data matching the specified selectors. This data cannot be recovered. Historical metrics for the deleted series will show gaps. Safer alternatives: - Query the series first to verify what will be deleted - Use retention policies instead of manual deletion - Take a TSDB snapshot before deletion
Highgrafana-api-delete-alert-notificationGrafana API DELETE /api/alert-notifications/... deletes alert notification channels.
Explanation
Deleting a notification channel stops alert delivery to that destination. Alerts using this channel will fire but notifications won't be sent. Safer alternatives: - GET the notification channel first to verify the ID - Check which alerts use this notification channel - Disable the channel instead of deleting
Highgrafana-api-delete-dashboardGrafana API DELETE /api/dashboards/... deletes dashboards.
Explanation
Deleting a Grafana dashboard removes all panels, queries, and configuration. Teams relying on this dashboard for monitoring will lose visibility. Safer alternatives: - GET /api/dashboards/uid/<uid> to export JSON first - Use Grafana provisioning for version-controlled dashboards - Use dashboard versioning in Grafana to restore later
Highgrafana-api-delete-datasourceGrafana API DELETE /api/datasources/... deletes datasources.
Explanation
Deleting a datasource breaks all dashboards and alerts using it. Panels will show 'Data source not found' errors, and alerting queries will fail. Safer alternatives: - GET the datasource first to verify the ID - Check which dashboards use this datasource - Use Grafana provisioning for datasource-as-code
Highgrafana-cli-plugins-uninstallgrafana-cli plugins uninstall removes a Grafana plugin, potentially breaking dashboards.
Explanation
Uninstalling a Grafana plugin breaks all dashboards using that plugin's panels or datasources. Users will see error messages where those panels were. Safer alternatives: - grafana-cli plugins list: Review installed plugins first - Check which dashboards use the plugin before removal - Update the plugin instead of uninstalling
Highkubectl-delete-prometheus-operator-resourceskubectl delete of Prometheus Operator resources (PrometheusRule/ServiceMonitor/PodMonitor) removes alerting/target configuration.
Explanation
Deleting Prometheus Operator CRDs removes alerting rules or scrape targets. The Prometheus Operator will update Prometheus configuration, potentially leaving services unmonitored. Safer alternatives: - kubectl get to review the resource first - kubectl describe to see what it configures - Export YAML before deletion: kubectl get -o yaml
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
promtool-check-rulespromtool-queryprometheus-api-getgrafana-api-get