github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/monitoring/benchmark-pr.jsonnet (about)

     1  local grafana = import 'grafonnet/grafana.libsonnet';
     2  
     3  local width = 12;
     4  local height = 10;
     5  
     6  // Dashboard to be used by Server benchmark PRs
     7  grafana.dashboard.new(
     8    'Pyroscope Server PR Dashboard',
     9    tags=['pyroscope'],
    10    time_from='now-1h',
    11    uid='QF9YgRbUbt3BA5Qd',
    12    editable='true',
    13    refresh = '5s',
    14  )
    15  .addTemplate(
    16    grafana.template.datasource(
    17      name='PROMETHEUS_DS',
    18      query='prometheus',
    19      current='prometheus',
    20      hide='hidden', // anything other than '' and 'label works
    21    )
    22  )
    23  .addRow(
    24    grafana.row.new(
    25      title='Benchmark',
    26    )
    27    .addPanel(
    28      grafana.graphPanel.new(
    29        'Throughput',
    30        datasource='$PROMETHEUS_DS',
    31      )
    32      .addTarget(grafana.prometheus.target('rate(pyroscope_http_request_duration_seconds_count{handler="/ingest"}[5m])')),
    33    )
    34    .addPanel(
    35      grafana.graphPanel.new(
    36        'Disk Usage',
    37        datasource='$PROMETHEUS_DS',
    38        format='bytes',
    39        legend_values='true',
    40        legend_rightSide='true',
    41        legend_alignAsTable='true',
    42        legend_current='true',
    43        legend_sort='current',
    44        legend_sortDesc=true,
    45      )
    46      .addTarget(
    47        grafana.prometheus.target(
    48          'sum(pyroscope_storage_db_size_bytes) by (instance)',
    49          legendFormat='total {{ instance }}',
    50        )
    51      ),
    52    )
    53    .addPanel(
    54      grafana.graphPanel.new(
    55        'Memory',
    56        datasource='$PROMETHEUS_DS',
    57        format='bytes',
    58        legend_values='true',
    59        legend_rightSide='true',
    60        legend_alignAsTable='true',
    61        legend_current=true,
    62        legend_max=true,
    63        legend_sort='current',
    64        legend_sortDesc=true,
    65        logBase1Y=2,
    66      )
    67      .addTarget(
    68        grafana.prometheus.target(
    69          'go_memstats_heap_alloc_bytes{job="pyroscope"}',
    70          legendFormat='heap size {{ instance  }}',
    71        ),
    72      )
    73    )
    74    .addPanel(
    75      grafana.graphPanel.new(
    76        'Upload Errors (Total)',
    77        datasource='$PROMETHEUS_DS',
    78        span=4,
    79      )
    80      .addTarget(
    81        grafana.prometheus.target(
    82          'pyroscope_benchmark_upload_errors{}',
    83        )
    84      ),
    85    )
    86    .addPanel(
    87      grafana.graphPanel.new(
    88        'Successful Uploads (Total)',
    89        datasource='$PROMETHEUS_DS',
    90        span=4,
    91      )
    92      .addTarget(
    93        grafana.prometheus.target(
    94          'pyroscope_benchmark_successful_uploads{}',
    95        )
    96      ),
    97    )
    98    .addPanel(
    99      grafana.graphPanel.new(
   100        'CPU Utilization',
   101        datasource='$PROMETHEUS_DS',
   102        format='percent',
   103        min='0',
   104        max='100',
   105      )
   106      .addTarget(
   107        grafana.prometheus.target(
   108          'process_cpu_seconds_total{job="pyroscope"}',
   109        )
   110      )
   111    )
   112  )