From ad8102d47a67ae8b3aa032297f72d342fc9f3ee7 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Oct 15 2020 12:48:41 +0000 Subject: POC --- diff --git a/gating_dashboards.dhall b/gating_dashboards.dhall new file mode 100644 index 0000000..ad4fce3 --- /dev/null +++ b/gating_dashboards.dhall @@ -0,0 +1,680 @@ +let kubernetes = + https://raw.githubusercontent.com/TristanCacqueray/dhall-openshift/master/package.dhall + +let union = + https://raw.githubusercontent.com/TristanCacqueray/dhall-openshift/master/typesUnion.dhall + +let grafanaDatasources = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "grafana-datasources-provision" + } + , data = Some + [ { mapKey = "datasource.yaml", mapValue = ./grafana/datasource.yaml as Text } ] + } + +let grafanaDashboardsProvision = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "grafana-dashboards-provision" + } + , data = Some + [ { mapKey = "dashboards.yml", mapValue = ./grafana/dashboards.yaml as Text } ] + } + +let grafanaDashboards = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "grafana-dashboards" } + , data = Some + [ { mapKey = "monitor_gating.json" + , mapValue = ./grafana/monitor_gating.json as Text + } + ] + } + +let grafanaDeployment = + kubernetes.Deployment::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "grafana" } + , spec = Some kubernetes.DeploymentSpec::{ + , selector = kubernetes.LabelSelector::{ + , matchLabels = Some (toMap { name = "grafana" }) + } + , replicas = Some 1 + , template = kubernetes.PodTemplateSpec::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "grafana" + , labels = Some (toMap { name = "grafana" }) + } + , spec = Some kubernetes.PodSpec::{ + , serviceAccountName = Some "grafana" + , containers = + [ kubernetes.Container::{ + , name = "oauth-proxy" + , image = Some + "registry.hub.docker.com/openshift/oauth-proxy:latest" + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 8443 } ] + , args = Some + [ "-provider=openshift" + , "-openshift-service-account=grafana" + , "-upstream=http://localhost:3000" + , "-client-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token" + , "-cookie-secret=9876543210" + , "-tls-cert=/etc/tls/private/tls.crt" + , "-tls-key=/etc/tls/private/tls.key" + , "-pass-basic-auth=false" + ] + , volumeMounts = Some + [ kubernetes.VolumeMount::{ + , name = "grafana-tls" + , mountPath = "/etc/tls/private" + } + ] + } + , kubernetes.Container::{ + , name = "grafana" + , image = Some "registry.hub.docker.com/grafana/grafana:latest" + , envFrom = Some + [ kubernetes.EnvFromSource::{ + , secretRef = Some kubernetes.SecretEnvSource::{ + , name = Some "grafana-secret" + } + } + ] + , env = Some + [ kubernetes.EnvVar::{ + , name = "GF_INSTALL_PLUGINS" + , value = Some + "grafana-clock-panel,simpod-json-datasource,grafana-googlesheets-datasource" + } + , kubernetes.EnvVar::{ + , name = "GF_AUTH_BASIC_ENABLED" + , value = Some "true" + } + , kubernetes.EnvVar::{ + , name = "GF_AUTH_PROXY_ENABLED" + , value = Some "true" + } + , kubernetes.EnvVar::{ + , name = "GF_AUTH_PROXY_HEADER_NAME" + , value = Some "X-Forwarded-User" + } + , kubernetes.EnvVar::{ + , name = "GF_AUTH_PROXY_HEADER_PROPERTY" + , value = Some "username" + } + , kubernetes.EnvVar::{ + , name = "GF_AUTH_PROXY_AUTO_SIGN_UP" + , value = Some "true" + } + , kubernetes.EnvVar::{ + , name = "GF_AUTH_DISABLE_LOGIN_FORM" + , value = Some "true" + } + , kubernetes.EnvVar::{ + , name = "GF_USERS_ALLOW_SIGN_UP" + , value = Some "false" + } + , kubernetes.EnvVar::{ + , name = "GF_USERS_AUTO_ASSIGN_ORG_ROLE" + , value = Some "Admin" + } + , kubernetes.EnvVar::{ name = "V", value = Some "2" } + ] + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 3000 } ] + , volumeMounts = Some + [ kubernetes.VolumeMount::{ + , name = "grafana-datasources-provision" + , mountPath = "/etc/grafana/provisioning/datasources" + } + , kubernetes.VolumeMount::{ + , name = "grafana-dashboards-provision" + , mountPath = "/etc/grafana/provisioning/dashboards" + } + , kubernetes.VolumeMount::{ + , name = "grafana-dashboards" + , mountPath = "/var/lib/grafana/dashboards" + } + ] + } + ] + , volumes = Some + [ kubernetes.Volume::{ + , name = "grafana-tls" + , secret = Some kubernetes.SecretVolumeSource::{ + , secretName = Some "grafana-tls" + } + } + , kubernetes.Volume::{ + , name = "grafana-datasources-provision" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "grafana-datasources-provision" + } + } + , kubernetes.Volume::{ + , name = "grafana-dashboards-provision" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "grafana-dashboards-provision" + } + } + , kubernetes.Volume::{ + , name = "grafana-dashboards" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "grafana-dashboards" + } + } + ] + } + } + } + } + +let postgresSchema = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "postgres-schema" } + , data = Some + [ { mapKey = "pg_schema.dump", mapValue = ./postgresql/pg_schema.dump as Text } ] + } + +let postgresInit = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "postgres-init" } + , data = Some [ { mapKey = "init.sh", mapValue = ./postgresql/init.sh as Text } ] + } + +let postgresDeployment = + kubernetes.Deployment::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "postgresql" } + , spec = Some kubernetes.DeploymentSpec::{ + , selector = kubernetes.LabelSelector::{ + , matchLabels = Some (toMap { name = "postgresql" }) + } + , replicas = Some 1 + , template = kubernetes.PodTemplateSpec::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "grafana" + , labels = Some (toMap { name = "postgresql" }) + } + , spec = Some kubernetes.PodSpec::{ + , volumes = Some + [ kubernetes.Volume::{ + , name = "postgresql-data" + , emptyDir = Some kubernetes.EmptyDirVolumeSource::{=} + } + , kubernetes.Volume::{ + , name = "postgres-schema" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "postgres-schema" + } + } + , kubernetes.Volume::{ + , name = "postgres-init" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "postgres-init" + } + } + ] + , containers = + [ kubernetes.Container::{ + , env = Some + [ kubernetes.EnvVar::{ + , name = "DB_USER" + , value = Some "postgres" + } + , kubernetes.EnvVar::{ + , name = "DB_PASSW" + , value = Some "correcthorsebatterystaple" + } + , kubernetes.EnvVar::{ + , name = "DB_NAME" + , value = Some "datanommer" + } + , kubernetes.EnvVar::{ + , name = "POSTGRESQL_USER" + , value = Some "postgres" + } + , kubernetes.EnvVar::{ + , name = "POSTGRESQL_PASSWORD" + , value = Some "correcthorsebatterystaple" + } + , kubernetes.EnvVar::{ + , name = "POSTGRESQL_DATABASE" + , value = Some "datanommer" + } + , kubernetes.EnvVar::{ name = "V", value = Some "3" } + ] + , image = Some + "registry.hub.docker.com/centos/postgresql-12-centos7@sha256:f66bcb0fe5952841da059c455b1fc5f618f1ef5b37cc485f31c157b84a04a54d" + , livenessProbe = Some kubernetes.Probe::{ + , exec = Some kubernetes.ExecAction::{ + , command = Some + [ "/usr/libexec/check-container", "--live" ] + } + , failureThreshold = Some 3 + , initialDelaySeconds = Some 120 + , periodSeconds = Some 10 + , successThreshold = Some 1 + , timeoutSeconds = Some 10 + } + , readinessProbe = Some kubernetes.Probe::{ + , exec = Some kubernetes.ExecAction::{ + , command = Some [ "/usr/libexec/check-container" ] + } + , failureThreshold = Some 3 + , initialDelaySeconds = Some 120 + , periodSeconds = Some 10 + , successThreshold = Some 1 + , timeoutSeconds = Some 10 + } + , name = "postgresql" + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 5432 } ] + , volumeMounts = Some + [ kubernetes.VolumeMount::{ + , name = "postgresql-data" + , mountPath = "/var/lib/pgsql/data" + } + , kubernetes.VolumeMount::{ + , name = "postgres-schema" + , mountPath = "/opt/pg_schema" + } + , kubernetes.VolumeMount::{ + , name = "postgres-init" + , mountPath = + "/usr/share/container-scripts/postgresql/start" + } + ] + } + ] + } + } + } + } + +let postgresService = + kubernetes.Service::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "postgresql" + , labels = Some (toMap { name = "postgresql" }) + } + , spec = Some kubernetes.ServiceSpec::{ + , selector = Some (toMap { name = "postgresql" }) + , type = Some "ClusterIP" + , ports = Some + [ kubernetes.ServicePort::{ + , name = Some "postgresql" + , targetPort = Some (kubernetes.IntOrString.Int 5432) + , port = 5432 + } + ] + } + } + +let lokiConfigMap = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "loki-config" } + , data = Some + [ { mapKey = "loki-config.yaml", mapValue = ./loki/loki-config.yaml as Text } + ] + } + +let prometheusConfigMap = + kubernetes.ConfigMap::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "prometheus-config" } + , data = Some + [ { mapKey = "prometheus-config.yaml" + , mapValue = ./prometheus/prometheus-config.yaml as Text + } + ] + } + +let grafanaService = + kubernetes.Service::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "grafana" + , labels = Some (toMap { name = "grafana" }) + , annotations = Some + [ { mapKey = "service.alpha.openshift.io/serving-cert-secret-name" + , mapValue = "grafana-tls" + } + ] + } + , spec = Some kubernetes.ServiceSpec::{ + , selector = Some (toMap { name = "grafana" }) + , type = Some "ClusterIP" + , ports = Some + [ kubernetes.ServicePort::{ + , name = Some "grafana" + , targetPort = Some (kubernetes.IntOrString.Int 8443) + , port = 8443 + } + ] + } + } + +let lokiService = + kubernetes.Service::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "loki" + , labels = Some (toMap { name = "loki" }) + } + , spec = Some kubernetes.ServiceSpec::{ + , selector = Some (toMap { name = "loki" }) + , type = Some "ClusterIP" + , ports = Some + [ kubernetes.ServicePort::{ + , name = Some "loki" + , targetPort = Some (kubernetes.IntOrString.Int 3100) + , port = 3100 + } + ] + } + } + +let prometheusService = + kubernetes.Service::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "prometheus" + , labels = Some (toMap { name = "prometheus" }) + } + , spec = Some kubernetes.ServiceSpec::{ + , selector = Some (toMap { name = "prometheus" }) + , type = Some "ClusterIP" + , ports = Some + [ kubernetes.ServicePort::{ + , name = Some "prometheus" + , targetPort = Some (kubernetes.IntOrString.Int 9090) + , port = 9090 + } + ] + } + } + +let lokiDeployment = + kubernetes.Deployment::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "loki" } + , spec = Some kubernetes.DeploymentSpec::{ + , selector = kubernetes.LabelSelector::{ + , matchLabels = Some (toMap { name = "loki" }) + } + , replicas = Some 1 + , template = kubernetes.PodTemplateSpec::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "loki" + , labels = Some (toMap { name = "loki" }) + } + , spec = Some kubernetes.PodSpec::{ + , containers = + [ kubernetes.Container::{ + , name = "loki" + , image = Some "registry.hub.docker.com/grafana/loki:1.5.0" + , command = Some [ "loki" ] + , args = Some [ "-config.file=/etc/loki-config.yaml" ] + , volumeMounts = Some + [ kubernetes.VolumeMount::{ + , name = "loki-config" + , mountPath = "/etc/loki-config.yaml" + , subPath = Some "loki-config.yaml" + } + , kubernetes.VolumeMount::{ + , name = "loki-data" + , mountPath = "/loki" + } + ] + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 3100 } ] + } + ] + , volumes = Some + [ kubernetes.Volume::{ + , name = "loki-config" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "loki-config" + } + } + , kubernetes.Volume::{ + , name = "loki-data" + , emptyDir = Some kubernetes.EmptyDirVolumeSource::{=} + } + ] + } + } + } + } + +let prometheusDeployment = + kubernetes.Deployment::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "prometheus" } + , spec = Some kubernetes.DeploymentSpec::{ + , selector = kubernetes.LabelSelector::{ + , matchLabels = Some (toMap { name = "prometheus" }) + } + , replicas = Some 1 + , template = kubernetes.PodTemplateSpec::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "prometheus" + , labels = Some (toMap { name = "prometheus" }) + } + , spec = Some kubernetes.PodSpec::{ + , containers = + [ kubernetes.Container::{ + , name = "prometheus" + , image = Some "registry.hub.docker.com/prom/prometheus:v2.0.0" + , command = Some [ "prometheus" ] + , args = Some [ "--config.file=/etc/prometheus-config.yaml" ] + , volumeMounts = Some + [ kubernetes.VolumeMount::{ + , name = "prometheus-config" + , mountPath = "/etc/prometheus-config.yaml" + , subPath = Some "prometheus-config.yaml" + } + , kubernetes.VolumeMount::{ + , name = "prometheus-data" + , mountPath = "/prometheus" + } + ] + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 9090 } ] + } + ] + , volumes = Some + [ kubernetes.Volume::{ + , name = "prometheus-config" + , configMap = Some kubernetes.ConfigMapVolumeSource::{ + , name = Some "prometheus-config" + } + } + , kubernetes.Volume::{ + , name = "prometheus-data" + , emptyDir = Some kubernetes.EmptyDirVolumeSource::{=} + } + ] + } + } + } + } + +let prometheusproxyDeployment = + kubernetes.Deployment::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "prometheusproxy" } + , spec = Some kubernetes.DeploymentSpec::{ + , selector = kubernetes.LabelSelector::{ + , matchLabels = Some (toMap { name = "prometheusproxy" }) + } + , replicas = Some 1 + , template = kubernetes.PodTemplateSpec::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "prometheusproxy" + , labels = Some (toMap { name = "prometheusproxy" }) + } + , spec = Some kubernetes.PodSpec::{ + , volumes = Some + [ kubernetes.Volume::{ + , name = "prometheus-tls" + , secret = Some kubernetes.SecretVolumeSource::{ + , secretName = Some "prometheus-tls" + } + } + ] + , serviceAccountName = Some "prometheusproxy" + , containers = + [ kubernetes.Container::{ + , name = "prometheusproxy" + , image = Some + "registry.hub.docker.com/openshift/oauth-proxy:latest" + , args = Some + [ "-provider=openshift" + , "-openshift-service-account=prometheusproxy" + , "-upstream=http://prometheus:9090" + , "-client-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token" + , "-cookie-secret=SECRET" + , "-tls-cert=/etc/tls/private/tls.crt" + , "-tls-key=/etc/tls/private/tls.key" + ] + , volumeMounts = Some + [ kubernetes.VolumeMount::{ + , name = "prometheus-tls" + , mountPath = "/etc/tls/private" + } + ] + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 8443 } ] + } + ] + } + } + } + } + +let prometheusproxyService = + kubernetes.Service::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "prometheusproxy" + , labels = Some (toMap { name = "prometheusproxy" }) + , annotations = Some + [ { mapKey = "service.alpha.openshift.io/serving-cert-secret-name" + , mapValue = "prometheus-tls" + } + ] + } + , spec = Some kubernetes.ServiceSpec::{ + , selector = Some (toMap { name = "prometheusproxy" }) + , type = Some "ClusterIP" + , ports = Some + [ kubernetes.ServicePort::{ + , name = Some "prometheusproxy" + , targetPort = Some (kubernetes.IntOrString.Int 8443) + , port = 8443 + } + ] + } + } + +let postgrestDeployment = + kubernetes.Deployment::{ + , metadata = kubernetes.ObjectMeta::{ name = Some "postgrest" } + , spec = Some kubernetes.DeploymentSpec::{ + , selector = kubernetes.LabelSelector::{ + , matchLabels = Some (toMap { name = "postgrest" }) + } + , replicas = Some 1 + , template = kubernetes.PodTemplateSpec::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "postgrest" + , labels = Some (toMap { name = "postgrest" }) + } + , spec = Some kubernetes.PodSpec::{ + , containers = + [ kubernetes.Container::{ + , name = "postgrest" + , image = Some + "registry.hub.docker.com/postgrest/postgrest:latest" + , env = Some + [ kubernetes.EnvVar::{ + , name = "PGRST_DB_URI" + , value = Some + "postgres://postgres:correcthorsebatterystaple@postgresql:5432/datanommer" + } + , kubernetes.EnvVar::{ + , name = "PGRST_DB_ANON_ROLE" + , value = Some "postgres" + } + , kubernetes.EnvVar::{ name = "V", value = Some "2" } + ] + , ports = Some + [ kubernetes.ContainerPort::{ containerPort = 3000 } ] + } + ] + } + } + } + } + +let postgrestService = + kubernetes.Service::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "postgrest" + , labels = Some (toMap { name = "postgrest" }) + } + , spec = Some kubernetes.ServiceSpec::{ + , selector = Some (toMap { name = "postgrest" }) + , type = Some "ClusterIP" + , ports = Some + [ kubernetes.ServicePort::{ + , name = Some "postgrest" + , targetPort = Some (kubernetes.IntOrString.Int 3000) + , port = 3000 + } + ] + } + } + +let grafanaRoute = + kubernetes.Route::{ + , metadata = kubernetes.ObjectMeta::{ + , name = Some "grafana" + , labels = Some (toMap { name = "grafana" }) + } + , spec = kubernetes.RouteSpec::{ + , host = "grafana-gating-dashboards.apps.ocp.ci.centos.org" + , to = kubernetes.RouteTargetReference::{ + , kind = "Service" + , name = "grafana" + , weight = 100 + } + , port = Some kubernetes.RoutePort::{ + , targetPort = kubernetes.IntOrString.String "grafana" + } + , tls = Some kubernetes.TLSConfig::{ termination = "reencrypt" } + } + } + +in { apiVersion = "v1" + , kind = "List" + , items = + [ union.ConfigMap grafanaDatasources + , union.ConfigMap grafanaDashboards + , union.Deployment grafanaDeployment + , union.Secret grafanaSecrets + , union.ConfigMap postgresSchema + , union.ConfigMap postgresInit + , union.Deployment postgrestDeployment + , union.Service postgrestService + , union.Deployment postgresDeployment + , union.ConfigMap grafanaDashboardsProvision + , union.ConfigMap grafanaDatasources + , union.ConfigMap grafanaDashboards + , union.ConfigMap lokiConfigMap + , union.Deployment lokiDeployment + , union.Service lokiService + , union.ConfigMap prometheusConfigMap + , union.Deployment prometheusDeployment + , union.Service prometheusService + , union.Deployment prometheusproxyDeployment + , union.Service prometheusproxyService + , union.Service grafanaService + , union.Service postgresService + , union.Route grafanaRoute + ] + } diff --git a/grafana/dashboards.yaml b/grafana/dashboards.yaml new file mode 100644 index 0000000..b4e9c8c --- /dev/null +++ b/grafana/dashboards.yaml @@ -0,0 +1,24 @@ +apiVersion: 1 + +providers: + # an unique provider name. Required + - name: 'Preset Dashboards' + # Org id. Default to 1 + orgId: 1 + # name of the dashboard folder. + folder: '' + # folder UID. will be automatically generated if not specified + folderUid: '' + # provider type. Default to 'file' + type: file + # disable dashboard deletion + disableDeletion: false + # how often Grafana will scan for changed dashboards + updateIntervalSeconds: 10 + # allow updating provisioned dashboards from the UI + allowUiUpdates: false + options: + # path to dashboard files on disk. Required when using the 'file' type + path: /var/lib/grafana/dashboards + # use folder names from filesystem to create folders in Grafana + foldersFromFilesStructure: true diff --git a/grafana/dashoard.json b/grafana/dashoard.json new file mode 100644 index 0000000..4fc0f80 --- /dev/null +++ b/grafana/dashoard.json @@ -0,0 +1,368 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0.5 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 4, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.0.1", + "targets": [ + { + "expr": "\rsum(rate({topic=\"org.fedoraproject.prod.monitor-gating.single-build.end.succeeded\"}[24h])) / sum(rate({topic=\"org.fedoraproject.prod.monitor-gating.single-build.start\"}[24h]))\r", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Single build success in past 24h", + "type": "gauge" + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0.5 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 5, + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.0.1", + "targets": [ + { + "expr": "\rsum(rate({topic=\"org.fedoraproject.prod.monitor-gating.multi-build.end.succeeded\"}[24h])) / sum(rate({topic=\"org.fedoraproject.prod.monitor-gating.multi-build.start\"}[24h]))\r", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Multi build success in past 24h", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 16, + "w": 12, + "x": 0, + "y": 8 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/failed/", + "color": "#E02F44" + }, + { + "alias": "/start/", + "color": "#37872D" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "count_over_time({topic=\"org.fedoraproject.prod.monitor-gating.single-build.end.failed\"}[24h])", + "refId": "B" + }, + { + "expr": "count_over_time({topic=\"org.fedoraproject.prod.monitor-gating.single-build.start\"}[24h])", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Single build started vs failed (24h sliding aggregate)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 16, + "w": 12, + "x": 12, + "y": 8 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/failed/", + "color": "#E02F44" + }, + { + "alias": "/start/", + "color": "#37872D" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "count_over_time({topic=\"org.fedoraproject.prod.monitor-gating.multi-build.end.failed\"}[24h])", + "refId": "B" + }, + { + "expr": "count_over_time({topic=\"org.fedoraproject.prod.monitor-gating.multi-build.start\"}[24h])", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Multi build started vs failed (24h sliding aggregate)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 25, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30d", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Single Builds Started and Failed", + "uid": "IdAtalzGk", + "version": 2 +} \ No newline at end of file diff --git a/grafana/datasource.yaml b/grafana/datasource.yaml new file mode 100644 index 0000000..2507014 --- /dev/null +++ b/grafana/datasource.yaml @@ -0,0 +1,16 @@ +apiVersion: 1 +datasources: +- name: Datanommer + type: postgres + url: postgresql:5432 + database: datanommer + user: postgres + isDefault: true + secureJsonData: + password: correcthorsebatterystaple + jsonData: + sslmode: "disable" # disable/require/verify-ca/verify-full + maxOpenConns: 0 # Grafana v5.4+ + maxIdleConns: 2 # Grafana v5.4+ + connMaxLifetime: 14400 # Grafana v5.4+ + postgresVersion: 12000 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10 \ No newline at end of file diff --git a/grafana/monitor_gating.json b/grafana/monitor_gating.json new file mode 100644 index 0000000..776780a --- /dev/null +++ b/grafana/monitor_gating.json @@ -0,0 +1,2878 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "iteration": 1601285697167, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 39, + "options": { + "content": "# Monitor-gating analysis\n\nAnalysis of runs of the https://pagure.io/fedora-ci/monitor-gating project over time.\n\nNotes on triaging problems here: https://hackmd.io/3NWpzzutTDu8CXFrIT1JqQ?both ", + "mode": "markdown" + }, + "pluginVersion": "7.1.0", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Monitor-gating analysis", + "type": "text" + }, + { + "datasource": null, + "description": "Percentage of successful runs (as noted by monitor-gating sending org.fedoraproject.prod.monitor-gating.$test.end.success message) out of all of org.fedoraproject.prod.monitor-gating.$test.end.* messages ", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 0, + "y": 5 + }, + "id": 8, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Full Run Success in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs that reached the step in the build where the package was successfully cloned, its version was bumped and it was pushed again.", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 3, + "y": 5 + }, + "id": 9, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' ~ '.*Pushing changes\\s+\\[DONE\\]') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Pagure Success in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs that reached the step of Koji successfully finishing the package build.", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 6, + "y": 5 + }, + "id": 11, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' ~ '.*uilding the package.+\\[DONE\\]') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Koji Success in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs that successfuly reached the step of initial creation of the update in Bodhi", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 9, + "y": 5 + }, + "id": 10, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' ~ 'bodhi[^\\n]+\\[DONE\\]') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Bodhi Success in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs, where it reached the notification for the test failing in CI in a given time-limit.", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 12, + "y": 5 + }, + "id": 7, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' LIKE '%CI (complete) results in datagrepper returned error%') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "CI Fast & Correct in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs where resultsdb send out the notification for learning about the result in the given time-limit.", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 15, + "y": 5 + }, + "id": 14, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' ~ 'resultsdb results in datagrepper returned FAILED[^\\n]+\\[DONE\\]') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "ResultsDB Fast & Correct in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs that reached the Greenwave gating a release of a backage based on a failed CI run", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 18, + "y": 5 + }, + "id": 12, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' ~ 'greenwave results in datagrepper returned False[^\\n]+\\[DONE\\]') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Greenwave Fast & Correct in %", + "type": "gauge" + }, + { + "datasource": null, + "description": "Percentage of runs successfully waived", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 3, + "x": 21, + "y": 5 + }, + "id": 13, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^percent_ci_done$/", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' ~ 'greenwave results in datagrepper returned True[^\\n]+\\[DONE\\]') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where $__timeFilter(c.time) and c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Waiverdb Fast & Correct in %", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 20 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 0, + "y": 12 + }, + "id": 17, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \"timestamp\" as time, CAST(array_to_string(REGEXP_MATCHES(_msg::jsonb->'output'->>-1, 'Ran for (\\d+).*'),'') as integer)/60 from test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median run in minutes", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 6, + "y": 12 + }, + "id": 37, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \r\n \"timestamp\" as time,\r\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*updates-candidate.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \r\n - \r\n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*uilding the package.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\r\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median build in minutes", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 12, + "y": 12 + }, + "id": 26, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*running.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*bodhi to CI.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median queue in minutes", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 15, + "y": 12 + }, + "id": 30, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*resultsdb results in datagrepper returned FAILED[^\\n]+\\[.*D.*\\]\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*complete.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) AND topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median to resultsdb", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 18, + "y": 12 + }, + "id": 29, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*greenwave results in datagrepper returned False.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*resultsdb results in datagrepper returned FAILED[^\\n]+\\[.*D.*\\]\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) AND topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median from resultsbd to greenwave", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 21, + "y": 12 + }, + "id": 28, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*greenwave results in datagrepper returned True.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*greenwave results in datagrepper returned False.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) AND topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median from unwaived to waived", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 6, + "y": 16 + }, + "id": 25, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n timestamp as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*testing-.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*updates-candidate.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median signing in minutes", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 12, + "y": 16 + }, + "id": 27, + "options": { + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*complete.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*running.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Median testing in minutes", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 20 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 0, + "y": 20 + }, + "id": 31, + "options": { + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \"timestamp\" as time, CAST(array_to_string(REGEXP_MATCHES(_msg::jsonb->'output'->>-1, 'Ran for (\\d+).*'),'') as integer)/60 from test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Max run in minutes", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 10 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 12, + "y": 20 + }, + "id": 34, + "options": { + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*running.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*bodhi to CI.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Max queue in minutes", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 10 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 3, + "x": 15, + "y": 20 + }, + "id": 36, + "options": { + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI results in resultsdb.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*complete.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) AND topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Max to resultsdb", + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 10 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 6, + "y": 21 + }, + "id": 32, + "options": { + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*updates-candidate.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Building the package.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Max build in minutes", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 10 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 12, + "y": 24 + }, + "id": 35, + "options": { + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*complete.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*running.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Max testing in minutes", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 10 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 6, + "y": 25 + }, + "id": 33, + "options": { + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.1.5", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n timestamp as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*testing-.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*updates-candidate.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Max signing in minutes", + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 29 + }, + "hiddenSeries": false, + "id": 23, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select timestamp as time, CAST(array_to_string(REGEXP_MATCHES(_msg::jsonb->'output'->>-1, 'Ran for (\\d+).*'),'') as integer)/60 from test_query_tb where topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time to complete in minutes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 37 + }, + "hiddenSeries": false, + "id": 18, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*updates-candidate.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Building the package.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time for build in minutes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 45 + }, + "hiddenSeries": false, + "id": 19, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n timestamp as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*testing-.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*Retrieving koji tags:.*updates-candidate.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time for signing in minutes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 53 + }, + "hiddenSeries": false, + "id": 20, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*running.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*bodhi to CI.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where $__timeFilter(\"timestamp\") and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time in queue in minutes", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 61 + }, + "hiddenSeries": false, + "id": 21, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*complete.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*running.*DONE.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) and topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time in testing", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": { + "custom": { + "align": null + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 69 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select \n \"timestamp\" as time,\n EXTRACT (MINUTES FROM (TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI results in resultsdb.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME \n - \n TO_TIMESTAMP(substring(jsonb_path_query_first(_msg::jsonb,'$.output[*] ? (@ like_regex \".*CI.*complete.*D.*\")')::text,2,8), 'HH24:MI:SS')::TIME)::TIME) as interval\nfrom test_query_tb where ($__timeFilter(\"timestamp\")) AND topic like '%gating%$test%.end.%' order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Time from testing to resultsdb", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Datanommer", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 77 + }, + "hiddenSeries": false, + "id": 15, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\ns as (select date(\"timestamp\") as time, count(*) as successful_gating_runs from test_query_tb where topic like '%gating%$test%.end%succe%' group by time)\nselect s.time as time, (s.successful_gating_runs*100)/c.finished_gating_runs as percent_succesful from c,s where c.time = s.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with c as (select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time),\r\ns as (select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' LIKE '%CI (complete) results in datagrepper returned error%') or topic like '%gating%$test%.end%succe%' group by time)\r\nselect s.time as time, (s.ci_completed*100)/c.finished_gating_runs as percent_ci_done from c,s where c.time = s.time order by time", + "refId": "B", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Monitor Gating Success Percentage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Datanommer", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 89 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select date(\"timestamp\") as time, count(*) as finished_gating_runs from test_query_tb where topic like '%gating%$test%.end.%' group by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select date(\"timestamp\") as time, count(*) as successful_gating_runs from test_query_tb where topic like '%gating%$test%.end%succe%' group by time", + "refId": "B", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select date(\"timestamp\") as time, count(*) as ci_completed from test_query_tb where (topic like '%gating%$test%.end%fail%' and _msg::jsonb#>>'{output_text}' LIKE '%CI (complete) results in datagrepper returned error%') or topic like '%gating%$test%.end%succe%' group by time", + "refId": "C", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Monitor Gating", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": false, + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": false, + "text": "single", + "value": "single" + }, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "test", + "options": [ + { + "selected": true, + "text": "single", + "value": "single" + }, + { + "selected": false, + "text": "multi", + "value": "multi" + } + ], + "query": "single, multi", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "2020-03-22T19:35:01.854Z", + "to": "2020-05-25T21:23:27.434Z" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Monitor Gating", + "uid": "6q2qpcvGz", + "version": 24 +} \ No newline at end of file diff --git a/grafana/package_tests.json b/grafana/package_tests.json new file mode 100644 index 0000000..f8b65f0 --- /dev/null +++ b/grafana/package_tests.json @@ -0,0 +1,347 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Datanommer", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select date(\"timestamp\") as time, count(*) as infra_fail_count from test_query_tb where topic like '%test.error' and _msg::jsonb#>>'{error,reason}' like '%Infra%' group by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select date(\"timestamp\") as time, count(*) as execution_error_count from test_query_tb where topic like '%test.error' and _msg::jsonb#>>'{error,reason}' like '%exec%' group by time", + "refId": "B", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "select date(\"timestamp\") as time, count(*) as faild_or_complete_total from test_query_tb where topic like '%test.error' or topic like '%test.complete' group by time", + "refId": "C", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Package tests completion and error counts", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Datanommer", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 11 + }, + "hiddenSeries": false, + "id": 3, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "percentage": false, + "pluginVersion": "7.1.5", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with \n complete as (\n select date(\"timestamp\") as time, count(*) as faild_or_complete_total \n from test_query_tb where topic like '%test.error' or topic like '%test.complete' group by time),\n infra as (select date(\"timestamp\") as time, count(*) as infra_fail_count from test_query_tb where topic like '%test.error' and _msg::jsonb#>>'{error,reason}' like '%Infra%' group by time)\nselect infra.time as time, (infra.infra_fail_count*100)/complete.faild_or_complete_total as infra_failure_percent from infra, complete where infra.time = complete.time order by time", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with \r\n complete as (\r\n select date(\"timestamp\") as time, count(*) as faild_or_complete_total \r\n from test_query_tb where topic like '%test.error' or topic like '%test.complete' group by time),\r\n infra as (select date(\"timestamp\") as time, count(*) as infra_fail_count from test_query_tb where topic like '%test.error' and _msg::jsonb#>>'{error,reason}' like '%execution%' group by time)\r\nselect infra.time as time, (infra.infra_fail_count*100)/complete.faild_or_complete_total as execution_error_percent from infra, complete where infra.time = complete.time order by time", + "refId": "B", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Percent of failed package tests ", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "schemaVersion": 26, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now/y", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Package tests completion and errors", + "uid": "PDzad5DMk", + "version": 3 + } \ No newline at end of file diff --git a/loki/loki-config.yaml b/loki/loki-config.yaml new file mode 100644 index 0000000..e5e947f --- /dev/null +++ b/loki/loki-config.yaml @@ -0,0 +1,45 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + +ingester: + lifecycler: + address: 127.0.0.1 + ring: + kvstore: + store: inmemory + replication_factor: 1 + final_sleep: 0s + chunk_idle_period: 5m + chunk_retain_period: 30s + max_transfer_retries: 0 + +schema_config: + configs: + - from: 2018-04-15 + store: boltdb + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 1680h + +storage_config: + boltdb: + directory: /loki/index + + filesystem: + directory: /loki/chunks + +limits_config: + enforce_metric_name: false + reject_old_samples: true + reject_old_samples_max_age: 1680h + +chunk_store_config: + max_look_back_period: 0s + +table_manager: + retention_deletes_enabled: false + retention_period: 0s \ No newline at end of file diff --git a/postgresql/init.sh b/postgresql/init.sh new file mode 100644 index 0000000..73e9e0d --- /dev/null +++ b/postgresql/init.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +_psql () { psql --set ON_ERROR_STOP=1 "$@" ; } + +if [[ ",$postinitdb_actions," = *,simple_db,* ]]; then +_psql --set=username="$POSTGRESQL_USER" \ + --set=password="$POSTGRESQL_PASSWORD" \ +<<< "ALTER USER :\"username\" WITH ENCRYPTED PASSWORD :'password';" +fi + +if [ -v POSTGRESQL_MASTER_USER ]; then +_psql --set=masteruser="$POSTGRESQL_MASTER_USER" \ + --set=masterpass="$POSTGRESQL_MASTER_PASSWORD" \ +<<'EOF' +ALTER USER :"masteruser" WITH REPLICATION; +ALTER USER :"masteruser" WITH ENCRYPTED PASSWORD :'masterpass'; +EOF +fi + +if [ -v POSTGRESQL_ADMIN_PASSWORD ]; then +_psql --set=adminpass="$POSTGRESQL_ADMIN_PASSWORD" \ +<<<"ALTER USER \"postgres\" WITH ENCRYPTED PASSWORD :'adminpass';" +fi + +echo "SELECT 'CREATE DATABASE datanommer' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'datanommer')\gexec" | _psql + +_psql -a -f /opt/pg_schema/pg_schema.dump datanommer \ No newline at end of file diff --git a/postgresql/pg_schema.dump b/postgresql/pg_schema.dump new file mode 100644 index 0000000..d509755 --- /dev/null +++ b/postgresql/pg_schema.dump @@ -0,0 +1,49 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 12.1 +-- Dumped by pg_dump version 12.1 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: test_query_tb; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.test_query_tb ( + "timestamp" timestamp without time zone, + topic text, + _msg jsonb +); + + +ALTER TABLE public.test_query_tb OWNER TO postgres; + +-- +-- Name: latestmsg; Type: VIEW; Schema: public; Owner: postgres +-- + +CREATE VIEW public.latestmsg AS + SELECT max(test_query_tb."timestamp") AS max + FROM public.test_query_tb; + + +ALTER TABLE public.latestmsg OWNER TO postgres; + +-- +-- PostgreSQL database dump complete +-- \ No newline at end of file diff --git a/prometheus/prometheus-config.yaml b/prometheus/prometheus-config.yaml new file mode 100644 index 0000000..8a37d80 --- /dev/null +++ b/prometheus/prometheus-config.yaml @@ -0,0 +1,27 @@ + +global: + scrape_interval: 15s # By default, scrape targets every 15 seconds. + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'gating-monitor' + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: 'prometheus' + + # Override the global default and scrape targets from this job every 5 seconds. + scrape_interval: 5s + + static_configs: + - targets: ['localhost:9090'] + - job_name: 'bodhi' + + # Override the global default and scrape targets from this job every 5 seconds. + scrape_interval: 5s + scheme: 'https' + static_configs: + - targets: ['bodhi.fedoraproject.org:443']