kind: ConfigMap
apiVersion: v1
metadata:
  name: monitoring
  namespace: grafana
  labels:
    app: grafana
  annotations:
    jsonnet/library: "true"
data:
  monitoring.libsonnet: |-
    local grafana = import 'grafonnet/grafana.libsonnet';

    {
      // Adds common monitoring panels to the given dashboard
      addCommonPanels(dashboard)::
          local panel = grafana.singlestat.new(
          'uptime',
          format='s',
          datasource='Prometheus',
          span=2,
          valueName='current',
        );
        dashboard.addPanel(panel, gridPos={
          x: 0,
          y: 0,
          w: 12,
          h: 2,
        })
    }