nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

caddy.jsonnet (17744B)


      1 {
      2   local matcher = 'job=~"$job", instance=~"$instance"',
      3   annotations: {
      4     list: [
      5       {
      6         builtIn: 1,
      7         datasource: {
      8           type: 'datasource',
      9           uid: 'grafana',
     10         },
     11         enable: true,
     12         hide: true,
     13         iconColor: 'rgba(0, 211, 255, 1)',
     14         limit: 100,
     15         name: 'Annotations & Alerts',
     16         showIn: 0,
     17         target: {
     18           limit: 100,
     19           matchAny: false,
     20           tags: [],
     21           type: 'dashboard',
     22         },
     23         type: 'dashboard',
     24       },
     25     ],
     26   },
     27   editable: false,
     28   gnetId: 13460,
     29   graphTooltip: 0,
     30   id: 10,
     31   iteration: 1633116262227,
     32   links: [],
     33   panels: [
     34     {
     35       datasource: {
     36         uid: '$datasource',
     37       },
     38       fieldConfig: {
     39         defaults: {
     40           color: {
     41             mode: 'palette-classic',
     42           },
     43           custom: {
     44             axisBorderShow: false,
     45             axisCenteredZero: false,
     46             axisColorMode: 'text',
     47             axisLabel: '',
     48             axisPlacement: 'auto',
     49             barAlignment: 0,
     50             drawStyle: 'line',
     51             fillOpacity: 10,
     52             gradientMode: 'none',
     53             hideFrom: {
     54               legend: false,
     55               tooltip: false,
     56               viz: false,
     57             },
     58             insertNulls: false,
     59             lineInterpolation: 'linear',
     60             lineWidth: 2,
     61             pointSize: 5,
     62             scaleDistribution: {
     63               log: 10,
     64               type: 'log',
     65             },
     66             showPoints: 'never',
     67             spanNulls: false,
     68             stacking: {
     69               group: 'A',
     70               mode: 'none',
     71             },
     72             thresholdsStyle: {
     73               mode: 'off',
     74             },
     75           },
     76           mappings: [],
     77           thresholds: {
     78             mode: 'absolute',
     79             steps: [
     80               {
     81                 color: 'green',
     82                 value: null,
     83               },
     84               {
     85                 color: 'red',
     86                 value: 80,
     87               },
     88             ],
     89           },
     90           unit: 'short',
     91         },
     92         overrides: [],
     93       },
     94       gridPos: {
     95         h: 11,
     96         w: 12,
     97         x: 0,
     98         y: 0,
     99       },
    100       id: 2,
    101       options: {
    102         legend: {
    103           calcs: [],
    104           displayMode: 'list',
    105           placement: 'bottom',
    106           showLegend: false,
    107         },
    108         tooltip: {
    109           mode: 'multi',
    110           sort: 'none',
    111         },
    112       },
    113       pluginVersion: '10.2.0',
    114       targets: [
    115         {
    116           datasource: {
    117             uid: '$datasource',
    118           },
    119           expr: 'sum(rate(caddy_http_requests_total{' + matcher + '}[$__rate_interval])) by (handler)',
    120           interval: '',
    121           legendFormat: '{{handler}}',
    122           refId: 'A',
    123         },
    124       ],
    125       title: 'Requests',
    126       type: 'timeseries',
    127     },
    128     {
    129       datasource: {
    130         uid: '$datasource',
    131       },
    132       description: '',
    133       fieldConfig: {
    134         defaults: {
    135           color: {
    136             mode: 'palette-classic',
    137           },
    138           custom: {
    139             axisBorderShow: false,
    140             axisCenteredZero: false,
    141             axisColorMode: 'text',
    142             axisLabel: '',
    143             axisPlacement: 'auto',
    144             barAlignment: 0,
    145             drawStyle: 'line',
    146             fillOpacity: 10,
    147             gradientMode: 'none',
    148             hideFrom: {
    149               legend: false,
    150               tooltip: false,
    151               viz: false,
    152             },
    153             insertNulls: false,
    154             lineInterpolation: 'linear',
    155             lineWidth: 2,
    156             pointSize: 5,
    157             scaleDistribution: {
    158               type: 'linear',
    159             },
    160             showPoints: 'never',
    161             spanNulls: false,
    162             stacking: {
    163               group: 'A',
    164               mode: 'normal',
    165             },
    166             thresholdsStyle: {
    167               mode: 'off',
    168             },
    169           },
    170           mappings: [],
    171           thresholds: {
    172             mode: 'absolute',
    173             steps: [
    174               {
    175                 color: 'green',
    176                 value: null,
    177               },
    178               {
    179                 color: 'red',
    180                 value: 80,
    181               },
    182             ],
    183           },
    184           unit: 'short',
    185         },
    186         overrides: [],
    187       },
    188       gridPos: {
    189         h: 11,
    190         w: 12,
    191         x: 12,
    192         y: 0,
    193       },
    194       id: 7,
    195       options: {
    196         legend: {
    197           calcs: [],
    198           displayMode: 'list',
    199           placement: 'bottom',
    200           showLegend: true,
    201         },
    202         tooltip: {
    203           mode: 'multi',
    204           sort: 'none',
    205         },
    206       },
    207       pluginVersion: '10.2.0',
    208       targets: [
    209         {
    210           datasource: {
    211             uid: '$datasource',
    212           },
    213           expr: 'sum(irate(caddy_http_request_duration_seconds_count{' + matcher + '}[$__rate_interval])) by (code)',
    214           interval: '',
    215           legendFormat: '{{code}}',
    216           refId: 'A',
    217         },
    218       ],
    219       title: 'Requests by Response Code',
    220       type: 'timeseries',
    221     },
    222     {
    223       datasource: {
    224         uid: '$datasource',
    225       },
    226       fieldConfig: {
    227         defaults: {
    228           color: {
    229             mode: 'palette-classic',
    230           },
    231           custom: {
    232             axisBorderShow: false,
    233             axisCenteredZero: false,
    234             axisColorMode: 'text',
    235             axisLabel: '',
    236             axisPlacement: 'auto',
    237             barAlignment: 0,
    238             drawStyle: 'line',
    239             fillOpacity: 10,
    240             gradientMode: 'none',
    241             hideFrom: {
    242               legend: false,
    243               tooltip: false,
    244               viz: false,
    245             },
    246             insertNulls: false,
    247             lineInterpolation: 'linear',
    248             lineWidth: 2,
    249             pointSize: 5,
    250             scaleDistribution: {
    251               type: 'linear',
    252             },
    253             showPoints: 'never',
    254             spanNulls: false,
    255             stacking: {
    256               group: 'A',
    257               mode: 'none',
    258             },
    259             thresholdsStyle: {
    260               mode: 'off',
    261             },
    262           },
    263           mappings: [],
    264           thresholds: {
    265             mode: 'absolute',
    266             steps: [
    267               {
    268                 color: 'green',
    269                 value: null,
    270               },
    271               {
    272                 color: 'red',
    273                 value: 80,
    274               },
    275             ],
    276           },
    277           unit: 'short',
    278         },
    279         overrides: [],
    280       },
    281       gridPos: {
    282         h: 9,
    283         w: 12,
    284         x: 0,
    285         y: 11,
    286       },
    287       id: 8,
    288       options: {
    289         legend: {
    290           calcs: [],
    291           displayMode: 'list',
    292           placement: 'bottom',
    293           showLegend: false,
    294         },
    295         tooltip: {
    296           mode: 'multi',
    297           sort: 'none',
    298         },
    299       },
    300       pluginVersion: '10.2.0',
    301       targets: [
    302         {
    303           datasource: {
    304             uid: '$datasource',
    305           },
    306           expr: 'avg(avg_over_time(caddy_http_requests_in_flight{' + matcher + '}[$__rate_interval])) by (handler)',
    307           hide: false,
    308           interval: '',
    309           legendFormat: '{{handler}}',
    310           refId: 'E',
    311         },
    312       ],
    313       title: 'Requests In Flight',
    314       type: 'timeseries',
    315     },
    316     {
    317       datasource: {
    318         uid: '$datasource',
    319       },
    320       description: '',
    321       fieldConfig: {
    322         defaults: {
    323           color: {
    324             mode: 'palette-classic',
    325           },
    326           custom: {
    327             axisBorderShow: false,
    328             axisCenteredZero: false,
    329             axisColorMode: 'text',
    330             axisLabel: '',
    331             axisPlacement: 'auto',
    332             barAlignment: 0,
    333             drawStyle: 'bars',
    334             fillOpacity: 100,
    335             gradientMode: 'none',
    336             hideFrom: {
    337               legend: false,
    338               tooltip: false,
    339               viz: false,
    340             },
    341             insertNulls: false,
    342             lineInterpolation: 'linear',
    343             lineWidth: 2,
    344             pointSize: 5,
    345             scaleDistribution: {
    346               type: 'linear',
    347             },
    348             showPoints: 'never',
    349             spanNulls: false,
    350             stacking: {
    351               group: 'A',
    352               mode: 'normal',
    353             },
    354             thresholdsStyle: {
    355               mode: 'off',
    356             },
    357           },
    358           mappings: [],
    359           min: 0,
    360           thresholds: {
    361             mode: 'absolute',
    362             steps: [
    363               {
    364                 color: 'green',
    365                 value: null,
    366               },
    367               {
    368                 color: 'red',
    369                 value: 80,
    370               },
    371             ],
    372           },
    373           unit: 'none',
    374         },
    375         overrides: [],
    376       },
    377       gridPos: {
    378         h: 9,
    379         w: 12,
    380         x: 12,
    381         y: 11,
    382       },
    383       id: 5,
    384       options: {
    385         legend: {
    386           calcs: [],
    387           displayMode: 'list',
    388           placement: 'bottom',
    389           showLegend: true,
    390         },
    391         tooltip: {
    392           mode: 'multi',
    393           sort: 'none',
    394         },
    395       },
    396       pluginVersion: '10.2.0',
    397       targets: [
    398         {
    399           datasource: {
    400             uid: '$datasource',
    401           },
    402           expr: 'sum(irate(caddy_http_request_duration_seconds_count{' + matcher + '}[$__rate_interval])) by (code)',
    403           interval: '',
    404           legendFormat: '{{code}}',
    405           refId: 'A',
    406         },
    407       ],
    408       title: 'Requests by Response Code (%)',
    409       type: 'timeseries',
    410     },
    411     {
    412       datasource: {
    413         uid: '$datasource',
    414       },
    415       fieldConfig: {
    416         defaults: {
    417           color: {
    418             mode: 'palette-classic',
    419           },
    420           custom: {
    421             axisBorderShow: false,
    422             axisCenteredZero: false,
    423             axisColorMode: 'text',
    424             axisLabel: '',
    425             axisPlacement: 'auto',
    426             barAlignment: 0,
    427             drawStyle: 'line',
    428             fillOpacity: 10,
    429             gradientMode: 'none',
    430             hideFrom: {
    431               legend: false,
    432               tooltip: false,
    433               viz: false,
    434             },
    435             insertNulls: false,
    436             lineInterpolation: 'linear',
    437             lineWidth: 2,
    438             pointSize: 5,
    439             scaleDistribution: {
    440               log: 2,
    441               type: 'log',
    442             },
    443             showPoints: 'never',
    444             spanNulls: false,
    445             stacking: {
    446               group: 'A',
    447               mode: 'none',
    448             },
    449             thresholdsStyle: {
    450               mode: 'off',
    451             },
    452           },
    453           mappings: [],
    454           thresholds: {
    455             mode: 'absolute',
    456             steps: [
    457               {
    458                 color: 'green',
    459                 value: null,
    460               },
    461               {
    462                 color: 'red',
    463                 value: 80,
    464               },
    465             ],
    466           },
    467           unit: 's',
    468         },
    469         overrides: [],
    470       },
    471       gridPos: {
    472         h: 9,
    473         w: 12,
    474         x: 0,
    475         y: 20,
    476       },
    477       id: 4,
    478       options: {
    479         legend: {
    480           calcs: [],
    481           displayMode: 'list',
    482           placement: 'bottom',
    483           showLegend: true,
    484         },
    485         tooltip: {
    486           mode: 'multi',
    487           sort: 'none',
    488         },
    489       },
    490       pluginVersion: '10.2.0',
    491       targets: [
    492         {
    493           datasource: {
    494             uid: '$datasource',
    495           },
    496           expr: 'histogram_quantile(0.99, sum(rate(caddy_http_request_duration_seconds_bucket{' + matcher + '}[$__rate_interval])) by (le))',
    497           interval: '',
    498           legendFormat: 'p99',
    499           refId: 'A',
    500         },
    501         {
    502           datasource: {
    503             uid: '$datasource',
    504           },
    505           expr: 'histogram_quantile(0.95, sum(rate(caddy_http_request_duration_seconds_bucket{' + matcher + '}[$__rate_interval])) by (le))',
    506           interval: '',
    507           legendFormat: 'p95',
    508           refId: 'B',
    509         },
    510         {
    511           datasource: {
    512             uid: '$datasource',
    513           },
    514           expr: 'histogram_quantile(0.90, sum(rate(caddy_http_request_duration_seconds_bucket{' + matcher + '}[$__rate_interval])) by (le))',
    515           interval: '',
    516           legendFormat: 'p90',
    517           refId: 'C',
    518         },
    519         {
    520           datasource: {
    521             uid: '$datasource',
    522           },
    523           expr: 'histogram_quantile(0.75, sum(rate(caddy_http_request_duration_seconds_bucket{' + matcher + '}[$__rate_interval])) by (le))',
    524           interval: '',
    525           legendFormat: 'p75',
    526           refId: 'D',
    527         },
    528         {
    529           datasource: {
    530             uid: '$datasource',
    531           },
    532           expr: 'histogram_quantile(0.5, sum(rate(caddy_http_request_duration_seconds_bucket{' + matcher + '}[$__rate_interval])) by (le))',
    533           interval: '',
    534           legendFormat: 'p50',
    535           refId: 'E',
    536         },
    537       ],
    538       title: 'Request Duration (percentile)',
    539       type: 'timeseries',
    540     },
    541     {
    542       cards: {},
    543       color: {
    544         cardColor: '#b4ff00',
    545         colorScale: 'linear',
    546         colorScheme: 'interpolateInferno',
    547         exponent: 0.5,
    548         mode: 'spectrum',
    549       },
    550       dataFormat: 'tsbuckets',
    551       datasource: {
    552         uid: '$datasource',
    553       },
    554       fieldConfig: {
    555         defaults: {
    556           custom: {
    557             hideFrom: {
    558               legend: false,
    559               tooltip: false,
    560               viz: false,
    561             },
    562             scaleDistribution: {
    563               type: 'linear',
    564             },
    565           },
    566         },
    567         overrides: [],
    568       },
    569       gridPos: {
    570         h: 9,
    571         w: 12,
    572         x: 12,
    573         y: 20,
    574       },
    575       heatmap: {},
    576       hideZeroBuckets: true,
    577       highlightCards: true,
    578       id: 6,
    579       interval: '',
    580       legend: {
    581         show: true,
    582       },
    583       maxDataPoints: 25,
    584       options: {
    585         calculate: false,
    586         calculation: {},
    587         cellGap: 2,
    588         cellValues: {},
    589         color: {
    590           exponent: 0.5,
    591           fill: '#b4ff00',
    592           mode: 'scheme',
    593           reverse: false,
    594           scale: 'exponential',
    595           scheme: 'Inferno',
    596           steps: 128,
    597         },
    598         exemplars: {
    599           color: 'rgba(255,0,255,0.7)',
    600         },
    601         filterValues: {
    602           le: 1e-9,
    603         },
    604         legend: {
    605           show: true,
    606         },
    607         rowsFrame: {
    608           layout: 'auto',
    609         },
    610         showValue: 'never',
    611         tooltip: {
    612           show: true,
    613           yHistogram: false,
    614         },
    615         yAxis: {
    616           axisPlacement: 'left',
    617           reverse: false,
    618           unit: 's',
    619         },
    620       },
    621       pluginVersion: '10.2.0',
    622       reverseYBuckets: false,
    623       targets: [
    624         {
    625           datasource: {
    626             uid: '$datasource',
    627           },
    628           expr: 'sum(increase(caddy_http_request_duration_seconds_bucket{' + matcher + '}[$__rate_interval])) by (le)',
    629           format: 'heatmap',
    630           interval: '',
    631           legendFormat: '{{le}}',
    632           refId: 'A',
    633         },
    634       ],
    635       title: 'Request Duration (heatmap)',
    636       tooltip: {
    637         show: true,
    638         showHistogram: false,
    639       },
    640       type: 'heatmap',
    641       xAxis: {
    642         show: true,
    643       },
    644       yAxis: {
    645         format: 's',
    646         logBase: 1,
    647         show: true,
    648       },
    649       yBucketBound: 'auto',
    650     },
    651   ],
    652   refresh: '30s',
    653   schemaVersion: 38,
    654   style: 'dark',
    655   tags: [
    656     'caddy-integration',
    657   ],
    658   templating: {
    659     list: [
    660       {
    661         current: {
    662           selected: false,
    663           text: 'Prometheus',
    664           value: 'Prometheus',
    665         },
    666         hide: 0,
    667         includeAll: false,
    668         label: 'Data source',
    669         multi: false,
    670         name: 'datasource',
    671         options: [],
    672         query: 'prometheus',
    673         queryValue: '',
    674         refresh: 1,
    675         regex: '(?!grafanacloud-usage|grafanacloud-ml-metrics).+',
    676         skipUrlSync: false,
    677         type: 'datasource',
    678       },
    679       {
    680         allValue: '.+',
    681         current: {
    682           selected: false,
    683           text: 'All',
    684           value: '$__all',
    685         },
    686         datasource: {
    687           uid: '$datasource',
    688         },
    689         definition: '',
    690         hide: 0,
    691         includeAll: true,
    692         label: 'Job',
    693         multi: true,
    694         name: 'job',
    695         options: [],
    696         query: 'label_values(caddy_http_requests_total, job)',
    697         refresh: 2,
    698         regex: '',
    699         skipUrlSync: false,
    700         sort: 1,
    701         tagValuesQuery: '',
    702         tags: [],
    703         tagsQuery: '',
    704         type: 'query',
    705         useTags: false,
    706       },
    707       {
    708         allValue: '.+',
    709         current: {
    710           selected: false,
    711           text: 'All',
    712           value: '$__all',
    713         },
    714         datasource: {
    715           uid: '$datasource',
    716         },
    717         definition: 'label_values(caddy_http_requests_total{job=~"$job"}, instance)',
    718         hide: 0,
    719         includeAll: true,
    720         label: 'Instance',
    721         multi: true,
    722         name: 'instance',
    723         options: [],
    724         query: {
    725           qryType: 1,
    726           query: 'label_values(caddy_http_requests_total{job=~"$job"}, instance)',
    727           refId: 'PrometheusVariableQueryEditor-VariableQuery',
    728         },
    729         refresh: 2,
    730         regex: '',
    731         skipUrlSync: false,
    732         sort: 1,
    733         tagValuesQuery: '',
    734         tags: [],
    735         tagsQuery: '',
    736         type: 'query',
    737         useTags: false,
    738       },
    739     ],
    740   },
    741   time: {
    742     from: 'now-30m',
    743     to: 'now',
    744   },
    745   timepicker: {
    746     refresh_intervals: [
    747       '10s',
    748       '30s',
    749       '1m',
    750       '5m',
    751       '15m',
    752       '30m',
    753       '1h',
    754       '2h',
    755       '1d',
    756     ],
    757   },
    758   timezone: '',
    759   title: 'Caddy Overview',
    760   uid: '9B0qPnfMz',
    761   version: 9,
    762 }