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

     1  local grafana = import 'grafonnet/grafana.libsonnet';
     2  local dashboard = grafana.dashboard;
     3  local graphPanel = grafana.graphPanel;
     4  local singlestat = grafana.singlestat;
     5  local prometheus = grafana.prometheus;
     6  
     7  local legendConfig = {
     8          legend+: {
     9              sideWidth: 250
    10          },
    11      };
    12  
    13  local dashboardConfig = {
    14          uid: '6123f547a129441c2cdeac6c5ce802eb',
    15      };
    16  
    17  dashboard.new(
    18          'hook dashboard',
    19          time_from='now-1h',
    20          schemaVersion=18,
    21        )
    22  .addPanel(
    23      singlestat.new(
    24          'webhook counter',
    25          description='sum(prow_webhook_counter)',
    26          datasource='prometheus',
    27      )
    28      .addTarget(prometheus.target(
    29          'sum(prow_webhook_counter)',
    30          instant=true,
    31      )), gridPos={
    32      h: 4,
    33      w: 12,
    34      x: 0,
    35      y: 0,
    36    })
    37  .addPanel(
    38      singlestat.new(
    39          'webhook response codes',
    40          description='sum(prow_webhook_response_codes)',
    41          datasource='prometheus',
    42      )
    43      .addTarget(prometheus.target(
    44          'sum(prow_webhook_response_codes)',
    45          instant=true,
    46      )), gridPos={
    47      h: 4,
    48      w: 12,
    49      x: 12,
    50      y: 0,
    51    })
    52  .addPanel(
    53      (graphPanel.new(
    54          'incoming webhooks by event type',
    55          description='sum(rate(prow_webhook_counter[1m])) by (event_type)',
    56          datasource='prometheus',
    57          legend_alignAsTable=true,
    58          legend_rightSide=true,
    59      ) + legendConfig)
    60      .addTarget(prometheus.target(
    61          'sum(rate(prow_webhook_counter[1m])) by (event_type)',
    62          legendFormat='{{event_type}}',
    63      )), gridPos={
    64      h: 9,
    65      w: 24,
    66      x: 0,
    67      y: 4,
    68    })
    69  .addPanel(
    70      (graphPanel.new(
    71          'webhook response codes',
    72          description='sum(rate(prow_webhook_response_codes[1m])) by (response_code)',
    73          datasource='prometheus',
    74          legend_alignAsTable=true,
    75          legend_rightSide=true,
    76      ) + legendConfig)
    77      .addTarget(prometheus.target(
    78          'sum(rate(prow_webhook_response_codes[1m])) by (response_code)',
    79          legendFormat='{{response_code}}',
    80      )), gridPos={
    81      h: 9,
    82      w: 24,
    83      x: 12,
    84      y: 13,
    85    })
    86  .addPanel(
    87      (graphPanel.new(
    88          'configmap capacities',
    89          description='prow_configmap_size_bytes / 1048576',
    90          datasource='prometheus',
    91          legend_alignAsTable=true,
    92          legend_rightSide=true,
    93          legend_values=true,
    94          legend_current=true,
    95          legend_sort='current',
    96          legend_sortDesc=true,
    97          formatY1='percentunit',
    98      ) + legendConfig)
    99      .addTarget(prometheus.target(
   100          'prow_configmap_size_bytes / 1048576',
   101          legendFormat='{{namespace}}/{{name}}',
   102      )), gridPos={
   103      h: 9,
   104      w: 24,
   105      x: 12,
   106      y: 13,
   107    })
   108  + dashboardConfig