
{{- $Values := (.helm).Values | default .Values }}
{{- $multicluster := ((($Values.grafana).sidecar).dashboards).multicluster | default false }}
{{- $defaultDatasource := "prometheus" -}}
{{- $clusterLabel := ($Values.global).clusterLabel | default "cluster" }}
{{- range (($Values.defaultDatasources).victoriametrics).datasources | default list }}
  {{- if and .isDefault .type }}{{ $defaultDatasource = .type }}{{- end }}
{{- end }}
title: Grafana Overview
templating:
  list:
  - name: datasource
    type: datasource
    query: {{ $defaultDatasource }}
    current:
      text: Prometheus
      value: prometheus
    options: []
    refresh: 1
    regex: ""
  - name: job
    multi: true
    includeAll: true
    datasource: $datasource
    type: query
    query:
      query: label_values(grafana_build_info, job)
      refId: Billing Admin-job-Variable-Query
    definition: label_values(grafana_build_info, job)
    allValue: .*
    current:
      text: All
      value:
      - $__all
    options: []
    refresh: 1
    regex: ""
  - name: instance
    multi: true
    includeAll: true
    datasource: $datasource
    type: query
    query:
      query: label_values(grafana_build_info, instance)
      refId: Billing Admin-instance-Variable-Query
    definition: label_values(grafana_build_info, instance)
    allValue: .*
    current:
      text: All
      value: $__all
    options: []
    refresh: 1
    regex: ""
  - name: cluster
    label: cluster
    multi: {{ ternary true false $multicluster }}
    includeAll: {{ ternary true false $multicluster }}
    datasource:
      type: {{ $defaultDatasource }}
    type: {{ ternary "query" "constant" $multicluster }}
    query: {{ ternary (printf "label_values(grafana_build_info, %s)" $clusterLabel) ".*" $multicluster }}
    hide: {{ ternary 0 2 $multicluster }}
    allValue: .*
editable: false
timezone: {{ default "utc" ($Values.defaultDashboards).defaultTimezone }}
tags:
- vm-k8s-stack
annotations:
  list:
  - name: Annotations & Alerts
    datasource:
      type: datasource
      uid: grafana
    builtIn: 1
    enable: true
    hide: true
    iconColor: rgba(0, 211, 255, 1)
    target:
      limit: 100
      matchAny: false
      tags: []
      type: dashboard
    type: dashboard
panels:
- title: Firing Alerts
  targets:
  - datasource:
      uid: $datasource
    expr: {{ printf "grafana_alerting_result_total{job=~\"$job\",instance=~\"$instance\",state=\"alerting\",%s=~\"$cluster\"}" $clusterLabel }}
    instant: true
    interval: 1m
    legendFormat: ""
    refId: A
  datasource:
    uid: $datasource
  fieldConfig:
    defaults:
      mappings: []
      noValue: "0"
      thresholds:
        mode: absolute
        steps:
        - color: green
        - color: red
          value: 80
    overrides: []
  gridPos:
    h: 5
    w: 6
    x: 0
    "y": 0
  id: 6
  options:
    colorMode: value
    graphMode: area
    justifyMode: auto
    orientation: auto
    percentChangeColorMode: standard
    reduceOptions:
      calcs:
      - mean
      fields: ""
      values: false
    showPercentChange: false
    text: {}
    textMode: auto
    wideLayout: true
  pluginVersion: 12.0.2
  type: stat
- title: Dashboards
  targets:
  - datasource:
      uid: $datasource
    expr: {{ printf "sum(grafana_stat_totals_dashboard{job=~\"$job\",instance=~\"$instance\",%s=~\"$cluster\"}) by(%s)" $clusterLabel $clusterLabel }}
    interval: 1m
    legendFormat: ""
    refId: A
  datasource:
    uid: $datasource
  fieldConfig:
    defaults:
      mappings: []
      thresholds:
        mode: absolute
        steps:
        - color: green
        - color: red
          value: 80
    overrides: []
  gridPos:
    h: 5
    w: 6
    x: 6
    "y": 0
  id: 8
  options:
    colorMode: value
    graphMode: area
    justifyMode: auto
    orientation: auto
    percentChangeColorMode: standard
    reduceOptions:
      calcs:
      - mean
      fields: ""
      values: false
    showPercentChange: false
    text: {}
    textMode: auto
    wideLayout: true
  pluginVersion: 12.0.2
  type: stat
- title: Build Info
  targets:
  - datasource:
      uid: $datasource
    expr: {{ printf "grafana_build_info{job=~\"$job\",instance=~\"$instance\",%s=~\"$cluster\"}" $clusterLabel }}
    instant: true
    interval: 1m
    legendFormat: ""
    refId: A
  datasource:
    uid: $datasource
  fieldConfig:
    defaults:
      custom:
        cellOptions:
          type: auto
        inspect: false
      mappings: []
      thresholds:
        mode: absolute
        steps:
        - color: green
        - color: red
          value: 80
    overrides: []
  gridPos:
    h: 5
    w: 12
    x: 12
    "y": 0
  id: 10
  options:
    cellHeight: sm
    footer:
      countRows: false
      fields: ""
      reducer:
      - sum
      show: false
    showHeader: true
  pluginVersion: 12.0.2
  transformations:
  - id: labelsToFields
    options: {}
  - id: merge
    options: {}
  - id: organize
    options:
      excludeByName:
        Time: true
        Value: true
        branch: true
        container: true
        goversion: true
        namespace: true
        pod: true
        revision: true
      indexByName:
        Time: 7
        Value: 11
        branch: 4
        container: 8
        edition: 2
        goversion: 6
        instance: 1
        job: 0
        namespace: 9
        pod: 10
        revision: 5
        version: 3
      renameByName: {}
  type: table
- title: RPS
  targets:
  - datasource:
      uid: $datasource
    expr: {{ printf "sum(irate(grafana_http_request_duration_seconds_count{job=~\"$job\",instance=~\"$instance\",%s=~\"$cluster\"}[1m])) by(status_code,%s)" $clusterLabel $clusterLabel }}
    interval: 1m
    legendFormat: '{{`{{`}}status_code{{`}}`}}'
    refId: A
  datasource:
    uid: $datasource
  fieldConfig:
    defaults:
      color:
        mode: palette-classic
      custom:
        axisBorderShow: false
        axisCenteredZero: false
        axisColorMode: text
        axisLabel: ""
        axisPlacement: auto
        barAlignment: 0
        barWidthFactor: 0.6
        drawStyle: line
        fillOpacity: 10
        gradientMode: none
        hideFrom:
          legend: false
          tooltip: false
          viz: false
        insertNulls: false
        lineInterpolation: linear
        lineWidth: 1
        pointSize: 5
        scaleDistribution:
          type: linear
        showPoints: never
        spanNulls: false
        stacking:
          group: A
          mode: normal
        thresholdsStyle:
          mode: "off"
      links: []
      mappings: []
      thresholds:
        mode: absolute
        steps:
        - color: green
        - color: red
          value: 80
      unit: reqps
    overrides: []
  gridPos:
    h: 8
    w: 12
    x: 0
    "y": 5
  id: 2
  options:
    alertThreshold: true
    legend:
      calcs: []
      displayMode: list
      placement: bottom
      showLegend: true
    tooltip:
      hideZeros: false
      mode: multi
      sort: none
  pluginVersion: 12.0.2
  type: timeseries
- title: Request Latency
  targets:
  - datasource:
      uid: $datasource
    expr: {{ printf "histogram_quantile(0.99, sum(irate(grafana_http_request_duration_seconds_bucket{instance=~\"$instance\",job=~\"$job\",%s=~\"$cluster\"}[$__rate_interval])) by(le,%s)) * 1" $clusterLabel $clusterLabel }}
    exemplar: true
    interval: 1m
    legendFormat: 99th Percentile
    refId: A
  - datasource:
      uid: $datasource
    expr: {{ printf "histogram_quantile(0.50, sum(irate(grafana_http_request_duration_seconds_bucket{instance=~\"$instance\",job=~\"$job\",%s=~\"$cluster\"}[$__rate_interval])) by(le,%s)) * 1" $clusterLabel $clusterLabel }}
    exemplar: true
    interval: 1m
    legendFormat: 50th Percentile
    refId: B
  - datasource:
      uid: $datasource
    expr: {{ printf "(sum(irate(grafana_http_request_duration_seconds_sum{instance=~\"$instance\",job=~\"$job\",%s=~\"$cluster\"}[$__rate_interval])) by(%s) * 1) / sum(irate(grafana_http_request_duration_seconds_count{instance=~\"$instance\",job=~\"$job\",%s=~\"$cluster\"}[$__rate_interval])) by(%s)" $clusterLabel $clusterLabel $clusterLabel $clusterLabel }}
    exemplar: true
    interval: 1m
    legendFormat: Average
    refId: C
  datasource:
    uid: $datasource
  fieldConfig:
    defaults:
      color:
        mode: palette-classic
      custom:
        axisBorderShow: false
        axisCenteredZero: false
        axisColorMode: text
        axisLabel: ""
        axisPlacement: auto
        barAlignment: 0
        barWidthFactor: 0.6
        drawStyle: line
        fillOpacity: 10
        gradientMode: none
        hideFrom:
          legend: false
          tooltip: false
          viz: false
        insertNulls: false
        lineInterpolation: linear
        lineWidth: 1
        pointSize: 5
        scaleDistribution:
          type: linear
        showPoints: never
        spanNulls: false
        stacking:
          group: A
          mode: none
        thresholdsStyle:
          mode: "off"
      links: []
      mappings: []
      thresholds:
        mode: absolute
        steps:
        - color: green
        - color: red
          value: 80
      unit: ms
    overrides: []
  gridPos:
    h: 8
    w: 12
    x: 12
    "y": 5
  id: 4
  options:
    alertThreshold: true
    legend:
      calcs: []
      displayMode: list
      placement: bottom
      showLegend: true
    tooltip:
      hideZeros: false
      mode: multi
      sort: none
  pluginVersion: 12.0.2
  type: timeseries
condition: {{ ($Values.grafana).enabled }}
fiscalYearStartMonth: 0
graphTooltip: 0
id: 23
links: []
preload: false
refresh: ""
schemaVersion: 41
time:
  from: now-6h
  to: now
timepicker:
  refresh_intervals:
  - 10s
  - 30s
  - 1m
  - 5m
  - 15m
  - 30m
  - 1h
  - 2h
  - 1d
uid: 6be0s85Mk
version: 1
