# # Configuration for API group monitoring.coreos.com # nodes: # Prometheus resources Alertmanager/monitoring.coreos.com/v1: scope: Namespaced custom_icon: icons/Alertmanager.png edges: | edges.add_owned_resources() edges.add_service_account("spec") #TODO: spec.alertmanagerConfigSelector #TODO: spec.alertmanagerConfigNamespaceSelector Prometheus/monitoring.coreos.com/v1: scope: Namespaced custom_icon: icons/Prometheus.png edges: | edges.add_owned_resources() edges.add_service_account("spec") for alertManager in query_path(resource, "spec.alerting.alertmanagers", []): edges.append([ "%s/%s/Alertmanager/monitoring.coreos.com/v1" % ( alertManager["name"], alertManager["namespace"] ), "REFERENCE" ]) if not edges.add_all_resources_matching_labels("ServiceMonitor", "spec.serviceMonitorSelector.matchLabels"): edges.warning("spec.serviceMonitorSelector.matchLabels", f"No service monitor matches metadata labels {query_path(resource, 'spec.serviceMonitorSelector.matchLabels')}") #TODO: spec.serviceMonitorNamespaceSelector #TODO: spec.podMonitorSelector #TODO: spec.podMonitorNamespaceSelector #TODO: spec.probeSelector #TODO: spec.probeNamespaceSelector #TODO: spec.ruleNamespaceSelector if not edges.add_all_resources_matching_labels("PrometheusRule", "spec.ruleSelector.matchLabels"): edges.warning("spec.ruleSelector.matchLabels", f"No Prometheus rule matches metadata labels {query_path(resource, 'spec.ruleSelector.matchLabels')}") #TODO: spec.scrapeConfigSelector #TODO: spec.scrapeConfigNamespaceSelector PrometheusRule/monitoring.coreos.com/v1: scope: Namespaced custom_icon: icons/PrometheusRule.png # no edges ServiceMonitor/monitoring.coreos.com/v1: scope: Namespaced custom_icon: icons/ServiceMonitor.png edges: | edges.add_owned_resources() if not edges.add_all_resources_matching_labels("Service", "spec.selector.matchLabels"): edges.warning("spec.selector.matchLabels", f"No service matches metadata labels {query_path(resource, 'spec.selector.matchLabels')}") #TODO: spec.namespaceSelector