K-Phoen / dark

(grafana) Dashboards As Resources in Kubernetes
MIT License
428 stars 21 forks source link

List of enhancements #137

Open KalenWessel opened 2 years ago

KalenWessel commented 2 years ago

Info

Grafana version: v8.4.3 Dark: v0.9.2

First of all, I want to say this is an awesome tool! Out of everything I've looked at DARK seems to work the best for supporting the idea of Dashboards as Code in an easy-to-read YAML format.

Grafana is a very feature-rich product so it comes with no surprise that DARK and Grabana don't currently handle every option. Here is a list of settings and issues I have come across while trying to port some pre-existing dashboards over to DARK.

The converter tool does not handle converting most of my pre-existing dashboards. I'm guessing my dashboards contain settings which DARK is unable to convert.

Example:

❯ docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/workspace kphoen/dark-converter:latest convert-yaml \
        -i dashboard.json \
        -o converted-dashboard.yaml

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
2022-04-12T22:32:34Z    ERROR   converter/json.go:113   could not unmarshall dashboard  {"error": "json: cannot unmarshal object into Go struct field Board.panels of type string"}
2022-04-12T22:32:34Z    ERROR   converter/json.go:55    could parse input   {"error": "json: cannot unmarshal object into Go struct field Board.panels of type string"}
2022-04-12T22:32:34Z    FATAL   cmd/toyaml.go:30    Could not convert dashboard {"error": "json: cannot unmarshal object into Go struct field Board.panels of type string"}

When trying to manually port dashboards from grafana over to DARK I have run into some missing features:

Missing Features

I tried to look through all the docs and code. It's possible I simply missed the correct fields.

Alerts

Example:

apiVersion: k8s.kevingomez.fr/v1
kind: GrafanaDashboard
metadata:
  name: sample-dashboard
folder: Sample
spec:
  title: Sample Dashboard
  editable: true
  shared_crosshair: true
  tags: [dark, generated]
  auto_refresh: 5s
  time: [now-6h, now]
  timezone: utc

  variables:
    - datasource:
        name: Source
        label: Prometheus
        type: prometheus
  rows:
    - name: SLIs
      panels:
        - timeseries:
            title: Uptime
            description: Synthetic probe success rate for ArgoCD
            datasource: $Source
            span: 4
            height: 350px
            targets:
              - prometheus:
                  query: probe_success{instance="https://argocd.localhost", environment="mgmt"}
                  legend: Uptime
                  ref: A
            visualization:
              gradient_mode: opacity
              fill_opacity: 10
              tooltip:
                "all_series"
            axis:
              unit: percentunit
              max: 1
            alert:
              title: "WARNING: ArgoCD Uptime alert"
              message: "ArgoCD uptime has dropped below 99%"
              evaluate_every: 1m
              for: 5m
              notify: 1
              tags:
                severity: warning
              on_no_data: no_data
              on_execution_error: alerting
              if:
                - operand: and
                  value: {func: last, ref: A, from: 5m, to: now}
                  threshold: {below: 0.99}

Time Series

Unable to set the following:

Single Stats Panel

Unable to set the following:

Misc

K-Phoen commented 2 years ago

Hey!

Thanks for this very good feedback :)

I'm going to answer it in order:

KalenWessel commented 2 years ago

Amazing, thanks for working on these! I'll spend some time building some more dashboards and report back any more findings. Cheers!