k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/config/prow/cluster/monitoring/mixins/grafana_dashboards/boskos.jsonnet (about)

     1  local grafana = import 'grafonnet/grafana.libsonnet';
     2  local config =  import 'config.libsonnet';
     3  local dashboard = grafana.dashboard;
     4  local graphPanel = grafana.graphPanel;
     5  local prometheus = grafana.prometheus;
     6  
     7  
     8  local dashboardConfig = {
     9          uid: 'wSrfvNxWz',
    10      };
    11  
    12  dashboard.new(
    13          'Boskos Resource Usage',
    14          time_from='now-1d',
    15          schemaVersion=18,
    16        )
    17  .addPanels([
    18      graphPanel.new(
    19          '%s usage status' % resource.friendly,
    20          description='The number of %ss in each state.' % resource.friendly,
    21          datasource='prometheus',
    22          stack=true,
    23          fill=3,
    24          linewidth=0,
    25          aliasColors={'busy': '#ff0000', 'cleaning': '#00eeff', 'dirty': '#ff8000', 'free': '#00ff00', 'leased': '#ee00ff', 'other': '#aaaaff', 'toBeDeleted': '#fafa00', 'tombstone': '#cccccc'}
    26      )
    27      .addTarget(prometheus.target(
    28          std.format('sum(boskos_resources{type="%s",job="%s"}) by (state)', [resource.type, resource.job]),
    29          legendFormat='{{state}}',
    30      ))
    31      {gridPos: {
    32          h: 9,
    33          w: 24,
    34          x: 0,
    35          y: 0,
    36      }}
    37        for resource in config._config.boskosResourcetypes
    38    ])
    39  + dashboardConfig