diff --git a/squid-mixin/README.md b/squid-mixin/README.md index dc170f662..9574b7755 100644 --- a/squid-mixin/README.md +++ b/squid-mixin/README.md @@ -24,9 +24,7 @@ Squid logs are enabled by default in the `config.libsonnet` and can be removed b ``` { - _config+:: { - enableLokiLogs: false, - }, + enableLokiLogs: false, } ``` @@ -64,10 +62,8 @@ Default thresholds can be configured in `config.libsonnet` ```js { - _config+:: { - alertsCriticalHighPercentageRequestErrors: 5, - alertsWarningLowCacheHitRatio: 85, - }, + alertsCriticalHighPercentageRequestErrors: 5, + alertsWarningLowCacheHitRatio: 85, } ``` diff --git a/squid-mixin/alerts/alerts.libsonnet b/squid-mixin/alerts.libsonnet similarity index 84% rename from squid-mixin/alerts/alerts.libsonnet rename to squid-mixin/alerts.libsonnet index 222abe5bc..d37f42da6 100644 --- a/squid-mixin/alerts/alerts.libsonnet +++ b/squid-mixin/alerts.libsonnet @@ -1,14 +1,14 @@ { - prometheusAlerts+:: { - groups+: [ + new(this): { + groups: [ { - name: 'squid', + name: this.config.uid + '-alerts', rules: [ { - alert: 'SquidHighPercentageOfHTTPServerRequestErrors', + alert: 'SquidHighHTTPServerRequestErrors', expr: ||| rate(squid_server_http_errors_total[5m]) / clamp_min(rate(squid_server_http_requests_total[5m]),1) * 100 > %(alertsCriticalHighPercentageRequestErrors)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -17,14 +17,14 @@ summary: 'There are a high number of HTTP server errors.', description: ||| The percentage of HTTP server request errors is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of %(alertsCriticalHighPercentageRequestErrors)s. - ||| % $._config, + ||| % this.config, }, }, { - alert: 'SquidHighPercentageOfFTPServerRequestErrors', + alert: 'SquidHighFTPServerRequestErrors', expr: ||| rate(squid_server_ftp_errors_total[5m]) / clamp_min(rate(squid_server_ftp_requests_total[5m]),1) * 100 > %(alertsCriticalHighPercentageRequestErrors)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -33,14 +33,14 @@ summary: 'There are a high number of FTP server request errors.', description: ||| The percentage of FTP server request errors is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of %(alertsCriticalHighPercentageRequestErrors)s. - ||| % $._config, + ||| % this.config, }, }, { - alert: 'SquidHighPercentageOfOtherServerRequestErrors', + alert: 'SquidHighOtherServerRequestErrors', expr: ||| rate(squid_server_other_errors_total[5m]) / clamp_min(rate(squid_server_other_requests_total[5m]),1) * 100 > %(alertsCriticalHighPercentageRequestErrors)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -49,14 +49,14 @@ summary: 'There are a high number of other server request errors.', description: ||| The percentage of other server request errors is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of %(alertsCriticalHighPercentageRequestErrors)s. - ||| % $._config, + ||| % this.config, }, }, { - alert: 'SquidHighPercentageOfClientRequestErrors', + alert: 'SquidHighClientRequestErrors', expr: ||| rate(squid_client_http_errors_total[5m]) / clamp_min(rate(squid_client_http_requests_total[5m]),1) * 100 > %(alertsCriticalHighPercentageRequestErrors)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -65,14 +65,14 @@ summary: 'There are a high number of HTTP client request errors.', description: ||| The percentage of HTTP client request errors is {{ printf "%%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of %(alertsCriticalHighPercentageRequestErrors)s. - ||| % $._config, + ||| % this.config, }, }, { alert: 'SquidLowCacheHitRatio', expr: ||| rate(squid_client_http_hits_total[10m]) / clamp_min(rate(squid_client_http_requests_total[10m]),1) * 100 < %(alertsWarningLowCacheHitRatio)s - ||| % $._config, + ||| % this.config, 'for': '10m', labels: { severity: 'warning', @@ -81,7 +81,7 @@ summary: 'The cache hit ratio has fallen below the configured threshold (%).', description: ||| The cache hit ratio is {{ printf "%%.0f" $value }} over the last 10m on {{ $labels.instance }} which is below the threshold of %(alertsWarningLowCacheHitRatio)s. - ||| % $._config, + ||| % this.config, }, }, ], diff --git a/squid-mixin/config.libsonnet b/squid-mixin/config.libsonnet index 8a9d7428e..b217276c8 100644 --- a/squid-mixin/config.libsonnet +++ b/squid-mixin/config.libsonnet @@ -1,16 +1,33 @@ { - _config+:: { - dashboardTags: ['squid'], - dashboardPeriod: 'now-1h', - dashboardTimezone: 'default', - dashboardRefresh: '1m', + local this = self, - // alerts thresholds - alertsCriticalHighPercentageRequestErrors: 5, - alertsWarningLowCacheHitRatio: 85, - enableLokiLogs: true, - enableMultiCluster: false, - multiclusterSelector: 'job=~"$job"', - squidSelector: if self.enableMultiCluster then 'job=~"$job", cluster=~"$cluster"' else 'job=~"$job"', + // Basic filtering + filteringSelector: 'job="integrations/squid"', + groupLabels: ['job', 'cluster'], + logLabels: ['job', 'cluster', 'instance'], + instanceLabels: ['instance'], + + // Dashboard settings + uid: 'squid', + dashboardNamePrefix: 'Squid', + dashboardTags: [self.uid], + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + dashboardRefresh: '1m', + metricsSource: 'prometheus', + + // Logs configuration + enableLokiLogs: true, + extraLogLabels: ['level', 'severity'], + logsVolumeGroupBy: 'level', + showLogsVolume: true, + + // Alert thresholds + alertsCriticalHighPercentageRequestErrors: 5, // % + alertsWarningLowCacheHitRatio: 85, // % + + // Signal definitions + signals: { + overview: (import './signals/overview.libsonnet')(this), }, } diff --git a/squid-mixin/dashboards.libsonnet b/squid-mixin/dashboards.libsonnet new file mode 100644 index 000000000..1614dec0e --- /dev/null +++ b/squid-mixin/dashboards.libsonnet @@ -0,0 +1,81 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +local logslib = import 'logs-lib/logs/main.libsonnet'; + +{ + local root = self, + new(this): + local prefix = this.config.dashboardNamePrefix; + local links = this.grafana.links; + local tags = this.config.dashboardTags; + local uid = g.util.string.slugify(this.config.uid); + local vars = this.grafana.variables; + local annotations = this.grafana.annotations; + local refresh = this.config.dashboardRefresh; + local period = this.config.dashboardPeriod; + local timezone = this.config.dashboardTimezone; + local extraLogLabels = this.config.extraLogLabels; + { + 'squid-overview.json': + g.dashboard.new(prefix + ' overview') + + g.dashboard.withDescription('') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels([ + this.grafana.rows.clientRow, + this.grafana.rows.serverRow, + ]) + ) + ) + + root.applyCommon( + vars.multiInstance, + uid + '-overview', + tags, + links { squidOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + } + if this.config.enableLokiLogs then { + 'squid-logs.json': + logslib.new( + this.config.dashboardNamePrefix + ' logs', + datasourceName=this.grafana.variables.datasources.loki.name, + datasourceRegex=this.grafana.variables.datasources.loki.regex, + filterSelector=this.config.filteringSelector, + labels=this.config.groupLabels + this.config.extraLogLabels, + formatParser=null, + showLogsVolume=this.config.showLogsVolume, + ) + { + dashboards+: + { + logs+: + root.applyCommon(super.logs.templating.list, uid=uid + '-logs', tags=tags, links=links { logs+:: {} }, annotations=annotations, timezone=timezone, refresh=refresh, period=period), + }, + panels+: + { + logs+: + g.panel.logs.options.withEnableLogDetails(true) + + g.panel.logs.options.withShowTime(false) + + g.panel.logs.options.withWrapLogMessage(false), + }, + variables+: { + toArray+: [ + this.grafana.variables.datasources.prometheus { hide: 2 }, + ], + }, + }.dashboards.logs, + } else {}, + + applyCommon(vars, uid, tags, links, annotations, timezone, refresh, period): + g.dashboard.withTags(tags) + + g.dashboard.withUid(uid) + + g.dashboard.withLinks(std.objectValues(links)) + + g.dashboard.withTimezone(timezone) + + g.dashboard.withRefresh(refresh) + + g.dashboard.time.withFrom(period) + + g.dashboard.withVariables(vars) + + g.dashboard.withAnnotations(std.objectValues(annotations)), +} diff --git a/squid-mixin/dashboards/dashboards.libsonnet b/squid-mixin/dashboards/dashboards.libsonnet deleted file mode 100644 index 0cb8bcea2..000000000 --- a/squid-mixin/dashboards/dashboards.libsonnet +++ /dev/null @@ -1 +0,0 @@ -(import 'squid-overview.libsonnet') diff --git a/squid-mixin/dashboards/squid-overview.libsonnet b/squid-mixin/dashboards/squid-overview.libsonnet deleted file mode 100644 index cf20b4537..000000000 --- a/squid-mixin/dashboards/squid-overview.libsonnet +++ /dev/null @@ -1,1465 +0,0 @@ -local g = (import 'grafana-builder/grafana.libsonnet'); -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local prometheus = grafana.prometheus; - -local dashboardUid = 'squid-overview'; - -local promDatasourceName = 'prometheus_datasource'; -local lokiDatasourceName = 'loki_datasource'; -local getMatcher(cfg) = '%(squidSelector)s, instance=~"$instance"' % cfg; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local lokiDatasource = { - uid: '${%s}' % lokiDatasourceName, -}; - -local clientRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Client', - collapsed: false, -}; - -local clientRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_client_http_requests_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'Client requests', - description: 'The request rate of client.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local clientRequestErrorsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_client_http_errors_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'Client request errors', - description: 'The number of client HTTP errors.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'errors/s', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local clientCacheHitRatioPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - '(rate(squid_client_http_hits_total{' + matcher + '}[$__rate_interval]) / clamp_min(rate(squid_client_http_requests_total{' + matcher + '}[$__rate_interval]),1)) * 100', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'Client cache hit ratio', - description: 'The client cache hit ratio.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'percent', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local clientRequestSentThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_client_http_kbytes_out_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'Client request sent throughput', - description: 'The throughput of client HTTP data sent.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local clientHTTPReceivedThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_client_http_kbytes_in_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'Client HTTP received throughput', - description: 'The throughput of client HTTP data received.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local clientCacheHitThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_client_http_hit_kbytes_out_bytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'Client cache hit throughput', - description: 'The throughput of client cache hit.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local httpRequestServiceTimePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'squid_HTTP_Requests_All_50{' + matcher + '} ', - datasource=promDatasource, - legendFormat='50%', - ), - prometheus.target( - 'squid_HTTP_Requests_All_75{' + matcher + '}', - datasource=promDatasource, - legendFormat='75%', - ), - prometheus.target( - 'squid_HTTP_Requests_All_95{' + matcher + '}', - datasource=promDatasource, - legendFormat='95%', - ), - ], - type: 'timeseries', - title: 'HTTP request service time', - description: 'HTTP request service time percentiles.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local cacheHitServiceTimePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'squid_Cache_Hits_50{' + matcher + '}', - datasource=promDatasource, - legendFormat='50%', - ), - prometheus.target( - 'squid_Cache_Hits_75{' + matcher + '}', - datasource=promDatasource, - legendFormat='75%', - ), - prometheus.target( - 'squid_Cache_Hits_95{' + matcher + '}', - datasource=promDatasource, - legendFormat='95%', - ), - ], - type: 'timeseries', - title: 'Cache hit service time', - description: 'Cache hits service time percentiles.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local cacheMissesServiceTimePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'squid_Cache_Misses_50{' + matcher + '}', - datasource=promDatasource, - legendFormat='50%', - ), - prometheus.target( - 'squid_Cache_Misses_75{' + matcher + '}', - datasource=promDatasource, - legendFormat='75%', - ), - prometheus.target( - 'squid_Cache_Misses_95{' + matcher + '}', - datasource=promDatasource, - legendFormat='95%', - ), - ], - type: 'timeseries', - title: 'Cache misses service time', - description: 'Cache misses service time percentiles.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'none', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local serverRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Server', - collapsed: false, -}; - -local serverRequestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_server_ftp_requests_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='FTP', - ), - prometheus.target( - 'rate(squid_server_http_requests_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='HTTP', - ), - prometheus.target( - 'rate(squid_server_other_requests_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='other', - ), - ], - type: 'timeseries', - title: 'Server requests', - description: 'The number of HTTP, FTP, and other server requests.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'normal', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'reqps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local serverRequestErrorsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_server_ftp_errors_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='FTP', - ), - prometheus.target( - 'rate(squid_server_http_errors_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='HTTP', - ), - prometheus.target( - 'rate(squid_server_other_errors_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='other', - ), - ], - type: 'timeseries', - title: 'Server request errors', - description: 'The number of HTTP, FTP, and other server request errors.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'normal', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'errors/s', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local serverRequestSentThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_server_ftp_kbytes_out_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='FTP', - ), - prometheus.target( - 'rate(squid_server_http_kbytes_out_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='HTTP', - ), - prometheus.target( - 'rate(squid_server_other_kbytes_out_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='other', - ), - ], - type: 'timeseries', - title: 'Server request sent throughput', - description: 'The number of HTTP, FTP, and other server sent throughput.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'normal', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local serverObjectSwapPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_swap_ins_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}} - read', - ), - prometheus.target( - 'rate(squid_swap_outs_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{instance}} - saved', - ), - ], - type: 'timeseries', - title: 'Server object swap', - description: 'The number of objects read from disk and the number of objects saved to disk.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'normal', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'cps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local dnsLookupServiceTimePanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'squid_DNS_Lookups_50{' + matcher + '}', - datasource=promDatasource, - legendFormat='50%', - ), - prometheus.target( - 'squid_DNS_Lookups_75{' + matcher + '}', - datasource=promDatasource, - legendFormat='75%', - ), - prometheus.target( - 'squid_DNS_Lookups_95{' + matcher + '}', - datasource=promDatasource, - legendFormat='95%', - ), - ], - type: 'timeseries', - title: 'DNS lookup service time', - description: 'DNS lookup service time percentiles', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'normal', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local serverReceivedThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(squid_server_ftp_kbytes_in_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='FTP', - ), - prometheus.target( - 'rate(squid_server_http_kbytes_in_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='HTTP', - ), - prometheus.target( - 'rate(squid_server_other_kbytes_in_kbytes_total{' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='other', - ), - ], - type: 'timeseries', - title: 'Server received throughput', - description: 'The number of HTTP, FTP, and other server throughput.', - fieldConfig: { - defaults: { - color: { - mode: 'palette-classic', - }, - custom: { - axisCenteredZero: false, - axisColorMode: 'text', - axisLabel: '', - axisPlacement: 'auto', - barAlignment: 0, - drawStyle: 'line', - fillOpacity: 0, - gradientMode: 'none', - hideFrom: { - legend: false, - tooltip: false, - viz: false, - }, - lineInterpolation: 'linear', - lineWidth: 1, - pointSize: 5, - scaleDistribution: { - type: 'linear', - }, - showPoints: 'auto', - spanNulls: false, - stacking: { - group: 'A', - mode: 'normal', - }, - thresholdsStyle: { - mode: 'off', - }, - }, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'KBs', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local cacheLogsPanel(matcher) = { - datasource: lokiDatasource, - targets: [ - { - datasource: lokiDatasource, - editorMode: 'code', - expr: '{' + matcher + '} |= `` | (filename="/var/log/squid/cache.log" or log_type="cache")', - queryType: 'range', - refId: 'A', - }, - ], - type: 'logs', - title: 'Cache logs', - description: 'The log file that contains the debug and error messages that Squid generates.', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: false, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, -}; - -local accessLogsPanel(matcher) = { - datasource: lokiDatasource, - targets: [ - { - datasource: lokiDatasource, - editorMode: 'code', - expr: '{' + matcher + '} |= `` | (filename="/var/log/squid/access.log" or log_type="access")', - queryType: 'range', - refId: 'A', - }, - ], - type: 'logs', - title: 'Access logs', - description: 'The log file that contains a record of all HTTP requests and responses processed by the Squid proxy server.', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: false, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, -}; - -{ - grafanaDashboards+:: { - 'squid-overview.json': - dashboard.new( - 'Squid overview', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - - .addTemplates( - std.flattenArrays([ - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data Source', - refresh='load' - ), - ], - if $._config.enableLokiLogs then [ - template.datasource( - lokiDatasourceName, - 'loki', - null, - label='Loki Datasource', - refresh='load' - ), - ] else [], - [ - template.new( - 'job', - promDatasource, - 'label_values(squid_server_http_requests_total{}, job)', - label='Job', - refresh=2, - includeAll=true, - multi=true, - allValues='.+', - sort=0 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(squid_server_http_requests_total{%(multiclusterSelector)s}, cluster)' % $._config, - label='Cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='.*', - hide=if $._config.enableMultiCluster then '' else 'variable', - sort=0 - ), - template.new( - 'instance', - promDatasource, - 'label_values(squid_server_http_requests_total{%(multiclusterSelector)s}, instance)' % $._config, - label='Instance', - refresh=2, - includeAll=true, - multi=false, - allValues='', - sort=0 - ), - ], - ]) - ) - .addPanels( - std.flattenArrays([ - [ - clientRow { gridPos: { h: 1, w: 24, x: 0, y: 0 } }, - clientRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 1 } }, - clientRequestErrorsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 1 } }, - clientCacheHitRatioPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 1 } }, - clientRequestSentThroughputPanel(getMatcher($._config)) { gridPos: { h: 7, w: 8, x: 0, y: 9 } }, - clientHTTPReceivedThroughputPanel(getMatcher($._config)) { gridPos: { h: 7, w: 8, x: 8, y: 9 } }, - clientCacheHitThroughputPanel(getMatcher($._config)) { gridPos: { h: 7, w: 8, x: 16, y: 9 } }, - httpRequestServiceTimePanel(getMatcher($._config)) { gridPos: { h: 7, w: 8, x: 0, y: 16 } }, - cacheHitServiceTimePanel(getMatcher($._config)) { gridPos: { h: 7, w: 8, x: 8, y: 16 } }, - cacheMissesServiceTimePanel(getMatcher($._config)) { gridPos: { h: 7, w: 8, x: 16, y: 16 } }, - serverRow { gridPos: { h: 1, w: 24, x: 0, y: 23 } }, - serverRequestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 24 } }, - serverRequestErrorsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 24 } }, - serverRequestSentThroughputPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 24 } }, - serverObjectSwapPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 0, y: 32 } }, - dnsLookupServiceTimePanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 8, y: 32 } }, - serverReceivedThroughputPanel(getMatcher($._config)) { gridPos: { h: 8, w: 8, x: 16, y: 32 } }, - ], - if $._config.enableLokiLogs then [ - cacheLogsPanel(getMatcher($._config)) { gridPos: { h: 6, w: 24, x: 0, y: 40 } }, - ] else [], - [ - ], - if $._config.enableLokiLogs then [ - accessLogsPanel(getMatcher($._config)) { gridPos: { h: 6, w: 24, x: 0, y: 46 } }, - ] else [], - [ - ], - ]) - ), - - }, -} diff --git a/squid-mixin/dashboards_out/squid-logs.json b/squid-mixin/dashboards_out/squid-logs.json new file mode 100644 index 000000000..891cf00ea --- /dev/null +++ b/squid-mixin/dashboards_out/squid-logs.json @@ -0,0 +1,320 @@ +{ + "annotations": { + "list": [ ] + }, + "editable": false, + "id": null, + "links": [ + { + "keepTime": true, + "title": "Squid overview", + "type": "link", + "url": "/d/squid-overview" + } + ], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "description": "Logs volume grouped by \"level\" label.", + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "bars", + "fillOpacity": 50, + "stacking": { + "mode": "normal" + } + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)merg|(F|f)atal|(A|a)lert|(C|c)rit.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)(rr.*|RR.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(W|w)(arn.*|ARN.*|rn|RN)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(N|n)(otice|ote)|(I|i)(nf.*|NF.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "dbg.*|DBG.*|(D|d)(EBUG|ebug)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(T|t)(race|RACE)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "logs" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "maxDataPoints": 100, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "sum by (level) (count_over_time({job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",level=~\"$level\",severity=~\"$severity\"}\n|~ \"$regex_search\"\n\n[$__auto]))\n", + "legendFormat": "{{ level }}" + } + ], + "title": "Logs volume", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "Value", + "renamePattern": "logs" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 2, + "options": { + "dedupStrategy": "exact", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showTime": false, + "wrapLogMessage": false + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",level=~\"$level\",severity=~\"$severity\"} \n|~ \"$regex_search\"\n\n\n" + } + ], + "title": "Logs", + "type": "logs" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "squid" + ], + "templating": { + "list": [ + { + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "(?!grafanacloud.+usage-insights|grafanacloud.+alert-state-history).+", + "type": "datasource" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values({job=\"integrations/squid\"}, job)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Cluster", + "multi": true, + "name": "cluster", + "query": "label_values({job=\"integrations/squid\",job=~\"$job\"}, cluster)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Level", + "multi": true, + "name": "level", + "query": "label_values({job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\"}, level)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Severity", + "multi": true, + "name": "severity", + "query": "label_values({job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",level=~\"$level\"}, severity)", + "refresh": 2, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "label": "Regex search", + "name": "regex_search", + "options": [ + { + "selected": true, + "text": "", + "value": "" + } + ], + "query": "", + "type": "textbox" + }, + { + "hide": 2, + "label": "Prometheus data source", + "name": "prometheus_datasource", + "query": "prometheus", + "regex": "(?!grafanacloud-usage|grafanacloud-ml-metrics).+", + "type": "datasource" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timezone": "default", + "title": "Squid logs", + "uid": "squid-logs" + } \ No newline at end of file diff --git a/squid-mixin/dashboards_out/squid-overview.json b/squid-mixin/dashboards_out/squid-overview.json index 151040aa5..b35a02586 100644 --- a/squid-mixin/dashboards_out/squid-overview.json +++ b/squid-mixin/dashboards_out/squid-overview.json @@ -1,90 +1,49 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, "description": "", "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, "id": null, - "links": [ ], + "links": [ + { + "keepTime": true, + "title": "Squid logs", + "type": "link", + "url": "/d/squid-logs" + } + ], "panels": [ { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, "y": 0 }, - "id": 2, - "targets": [ ], + "id": 1, + "panels": [ ], "title": "Client", "type": "row" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The request rate of client.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -92,28 +51,31 @@ "x": 0, "y": 1 }, - "id": 3, + "id": 2, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_client_http_requests_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_client_http_requests_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Client HTTP requests" } ], "title": "Client requests", @@ -121,61 +83,21 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The number of client HTTP errors.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "errors/s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -183,28 +105,31 @@ "x": 8, "y": 1 }, - "id": 4, + "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_client_http_errors_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_client_http_errors_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Client HTTP errors" } ], "title": "Client request errors", @@ -212,61 +137,21 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The client cache hit ratio.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "percent" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -274,28 +159,31 @@ "x": 16, "y": 1 }, - "id": 5, + "id": 4, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "(rate(squid_client_http_hits_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]) / clamp_min(rate(squid_client_http_requests_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval]),1)) * 100", + "expr": "(rate(squid_client_http_hits_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval]) / clamp_min(rate(squid_client_http_requests_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval]),1)) * 100", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Client cache hit ratio" } ], "title": "Client cache hit ratio", @@ -303,90 +191,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The throughput of client HTTP data sent.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 7, "w": 8, "x": 0, - "y": 9 + "y": 8 }, - "id": 6, + "id": 5, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_client_http_kbytes_out_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_client_http_kbytes_out_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Client HTTP sent throughput" } ], "title": "Client request sent throughput", @@ -394,90 +245,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The throughput of client HTTP data received.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 9 + "y": 8 }, - "id": 7, + "id": 6, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_client_http_kbytes_in_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_client_http_kbytes_in_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Client HTTP received throughput" } ], "title": "Client HTTP received throughput", @@ -485,90 +299,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The throughput of client cache hit.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 9 + "y": 8 }, - "id": 8, + "id": 7, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_client_http_hit_kbytes_out_bytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_client_http_hit_kbytes_out_bytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Client cache hit throughput" } ], "title": "Client cache hit throughput", @@ -576,108 +353,73 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "HTTP request service time percentiles.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 7, "w": 8, "x": 0, - "y": 16 + "y": 15 }, - "id": 9, + "id": 8, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_HTTP_Requests_All_50{job=~\"$job\", instance=~\"$instance\"} ", + "expr": "squid_HTTP_Requests_All_50{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "50%" + "instant": false, + "legendFormat": "50%", + "refId": "HTTP requests service time p50" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_HTTP_Requests_All_75{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_HTTP_Requests_All_75{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "75%" + "instant": false, + "legendFormat": "75%", + "refId": "HTTP requests service time p75" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_HTTP_Requests_All_95{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_HTTP_Requests_All_95{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", - "intervalFactor": 2, - "legendFormat": "95%" + "instant": false, + "legendFormat": "95%", + "refId": "HTTP requests service time p95" } ], "title": "HTTP request service time", @@ -685,108 +427,76 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Cache hits service time percentiles.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 7, "w": 8, "x": 8, - "y": 16 + "y": 15 }, - "id": 10, + "id": 9, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_Cache_Hits_50{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_Cache_Hits_50{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "50%" + "legendFormat": "50%", + "refId": "Cache hits service time p50" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_Cache_Hits_75{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_Cache_Hits_75{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "75%" + "legendFormat": "75%", + "refId": "Cache hits service time p75" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_Cache_Hits_95{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_Cache_Hits_95{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "95%" + "legendFormat": "95%", + "refId": "Cache hits service time p95" } ], "title": "Cache hit service time", @@ -794,108 +504,76 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Cache misses service time percentiles.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 7, "w": 8, "x": 16, - "y": 16 + "y": 15 }, - "id": 11, + "id": 10, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_Cache_Misses_50{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_Cache_Nisses_50{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "50%" + "legendFormat": "50%", + "refId": "Cache misses service time p50" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_Cache_Misses_75{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_Cache_Misses_75{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "75%" + "legendFormat": "75%", + "refId": "Cache misses service time p75" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_Cache_Misses_95{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_Cache_Misses_95{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "95%" + "legendFormat": "95%", + "refId": "Cache misses service time p95" } ], "title": "Cache misses service time", @@ -903,77 +581,37 @@ }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, "y": 23 }, - "id": 12, - "targets": [ ], + "id": 11, + "panels": [ ], "title": "Server", "type": "row" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The number of HTTP, FTP, and other server requests.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "stacking": { - "group": "A", "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -981,46 +619,57 @@ "x": 0, "y": 24 }, - "id": 13, + "id": 12, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_ftp_requests_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_ftp_requests_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "FTP" + "legendFormat": "FTP", + "refId": "Server FTP requests" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_http_requests_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_http_requests_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "HTTP" + "legendFormat": "HTTP", + "refId": "Server HTTP requests" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_other_requests_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_other_requests_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "other" + "legendFormat": "other", + "refId": "Server other requests" } ], "title": "Server requests", @@ -1028,61 +677,24 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The number of HTTP, FTP, and other server request errors.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "stacking": { - "group": "A", "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "errors/s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1090,46 +702,57 @@ "x": 8, "y": 24 }, - "id": 14, + "id": 13, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_ftp_errors_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_ftp_errors_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "FTP" + "legendFormat": "FTP", + "refId": "Server FTP errors" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_http_errors_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_http_errors_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "HTTP" + "legendFormat": "HTTP", + "refId": "Server HTTP errors" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_other_errors_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_other_errors_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "other" + "legendFormat": "other", + "refId": "Server other errors" } ], "title": "Server request errors", @@ -1137,61 +760,24 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The number of HTTP, FTP, and other server sent throughput.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "stacking": { - "group": "A", "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1199,46 +785,57 @@ "x": 16, "y": 24 }, - "id": 15, + "id": 14, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_ftp_kbytes_out_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_ftp_kbytes_out_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "FTP" + "legendFormat": "FTP", + "refId": "Server FTP sent throughput" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_http_kbytes_out_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_http_kbytes_out_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "HTTP" + "legendFormat": "HTTP", + "refId": "Server HTTP sent throughput" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_other_kbytes_out_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_other_kbytes_out_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "other" + "legendFormat": "other", + "refId": "Server other sent throughput" } ], "title": "Server request sent throughput", @@ -1246,61 +843,24 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The number of objects read from disk and the number of objects saved to disk.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "stacking": { - "group": "A", "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "cps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1308,37 +868,44 @@ "x": 0, "y": 32 }, - "id": 16, + "id": 15, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_swap_ins_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_swap_ins_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}} - read" + "legendFormat": "{{instance}} - read", + "refId": "Server object swap ins" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_swap_outs_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_swap_outs_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "{{instance}} - saved" + "legendFormat": "{{instance}} - saved", + "refId": "Server object swap outs" } ], "title": "Server object swap", @@ -1346,61 +913,21 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "DNS lookup service time percentiles", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never" }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1408,46 +935,54 @@ "x": 8, "y": 32 }, - "id": 17, + "id": 16, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_DNS_Lookups_50{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_DNS_Lookups_50{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "50%" + "legendFormat": "50%", + "refId": "DNS lookup service time p50" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_DNS_Lookups_75{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_DNS_Lookups_75{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "75%" + "legendFormat": "75%", + "refId": "DNS lookup service time p75" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "squid_DNS_Lookups_95{job=~\"$job\", instance=~\"$instance\"}", + "expr": "squid_DNS_Lookups_95{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "95%" + "legendFormat": "95%", + "refId": "DNS lookup service time p95" } ], "title": "DNS lookup service time", @@ -1455,61 +990,24 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "The number of HTTP, FTP, and other server throughput.", "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, + "fillOpacity": 30, + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", "stacking": { - "group": "A", "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" } }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, "unit": "KBs" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, @@ -1517,254 +1015,137 @@ "x": 16, "y": 32 }, - "id": 18, + "id": 17, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_ftp_kbytes_in_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_ftp_kbytes_in_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "FTP" + "legendFormat": "FTP", + "refId": "Server FTP received throughput" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_http_kbytes_in_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_http_kbytes_in_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "HTTP" + "legendFormat": "HTTP", + "refId": "Server HTTP received throughput" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(squid_server_other_kbytes_in_kbytes_total{job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(squid_server_other_kbytes_in_kbytes_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", + "instant": false, + "interval": "2m", "intervalFactor": 2, - "legendFormat": "other" + "legendFormat": "other", + "refId": "Server other received throughput" } ], "title": "Server received throughput", "type": "timeseries" - }, - { - "datasource": { - "uid": "${loki_datasource}" - }, - "description": "The log file that contains the debug and error messages that Squid generates.", - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 40 - }, - "id": 19, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "targets": [ - { - "datasource": { - "uid": "${loki_datasource}" - }, - "editorMode": "code", - "expr": "{job=~\"$job\", instance=~\"$instance\"} |= `` | (filename=\"/var/log/squid/cache.log\" or log_type=\"cache\")", - "queryType": "range", - "refId": "A" - } - ], - "title": "Cache logs", - "type": "logs" - }, - { - "datasource": { - "uid": "${loki_datasource}" - }, - "description": "The log file that contains a record of all HTTP requests and responses processed by the Squid proxy server.", - "gridPos": { - "h": 6, - "w": 24, - "x": 0, - "y": 46 - }, - "id": 20, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "targets": [ - { - "datasource": { - "uid": "${loki_datasource}" - }, - "editorMode": "code", - "expr": "{job=~\"$job\", instance=~\"$instance\"} |= `` | (filename=\"/var/log/squid/access.log\" or log_type=\"access\")", - "queryType": "range", - "refId": "A" - } - ], - "title": "Access logs", - "type": "logs" } ], - "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "refresh": "30s", + "schemaVersion": 39, "tags": [ "squid" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data Source", + "label": "Prometheus data source", "name": "prometheus_datasource", - "options": [ ], "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "current": { }, - "hide": 0, - "label": "Loki Datasource", - "name": "loki_datasource", - "options": [ ], - "query": "loki", - "refresh": 1, - "regex": "", + "regex": "(?!grafanacloud-usage|grafanacloud-ml-metrics).+", "type": "datasource" }, { "allValue": ".+", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "Job", "multi": true, "name": "job", - "options": [ ], - "query": "label_values(squid_server_http_requests_total{}, job)", + "query": "label_values(squid_client_http_requests_total{job=\"integrations/squid\"}, job)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { "allValue": ".*", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 2, "includeAll": true, "label": "Cluster", "multi": true, "name": "cluster", - "options": [ ], - "query": "label_values(squid_server_http_requests_total{job=~\"$job\"}, cluster)", + "query": "label_values(squid_client_http_requests_total{job=\"integrations/squid\",job=~\"$job\"}, cluster)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" }, { - "allValue": "", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "Instance", - "multi": false, + "multi": true, "name": "instance", - "options": [ ], - "query": "label_values(squid_server_http_requests_total{job=~\"$job\"}, instance)", + "query": "label_values(squid_client_http_requests_total{job=\"integrations/squid\",job=~\"$job\",cluster=~\"$cluster\"}, instance)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "sort": 1, + "type": "query" + }, + { + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "(?!grafanacloud.+usage-insights|grafanacloud.+alert-state-history).+", + "type": "datasource" } ] }, "time": { - "from": "now-1h", + "from": "now-30m", "to": "now" }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, "timezone": "default", "title": "Squid overview", - "uid": "squid-overview", - "version": 0 + "uid": "squid-overview" } \ No newline at end of file diff --git a/squid-mixin/g.libsonnet b/squid-mixin/g.libsonnet new file mode 100644 index 000000000..f89dcc064 --- /dev/null +++ b/squid-mixin/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' diff --git a/squid-mixin/jsonnetfile.json b/squid-mixin/jsonnetfile.json index 93f3316ec..6354d0e12 100644 --- a/squid-mixin/jsonnetfile.json +++ b/squid-mixin/jsonnetfile.json @@ -1,15 +1,42 @@ { "version": 1, "dependencies": [ - { - "source": { - "git": { - "remote": "https://github.com/grafana/grafonnet-lib.git", - "subdir": "grafonnet" - } + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet-lib.git", + "subdir": "grafonnet" + } + }, + "version": "master" }, - "version": "master" - } + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "common-lib" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "grafana-cloud-integration-utils" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "logs-lib" + } + }, + "version": "master" + } ], "legacyImports": true } diff --git a/squid-mixin/links.libsonnet b/squid-mixin/links.libsonnet new file mode 100644 index 000000000..4d8adc365 --- /dev/null +++ b/squid-mixin/links.libsonnet @@ -0,0 +1,17 @@ +local g = import './g.libsonnet'; + +{ + local link = g.dashboard.link, + new(this): + { + squidOverview: + link.link.new('Squid overview', '/d/' + this.grafana.dashboards['squid-overview.json'].uid) + + link.link.options.withKeepTime(true), + } + if this.config.enableLokiLogs then + { + logs: + link.link.new('Squid logs', '/d/' + this.grafana.dashboards['squid-logs.json'].uid) + + link.link.options.withKeepTime(true), + } + else {}, +} diff --git a/squid-mixin/main.libsonnet b/squid-mixin/main.libsonnet new file mode 100644 index 000000000..dcc3da60c --- /dev/null +++ b/squid-mixin/main.libsonnet @@ -0,0 +1,49 @@ +local alerts = import './alerts.libsonnet'; +local config = import './config.libsonnet'; +local dashboards = import './dashboards.libsonnet'; +local g = import './g.libsonnet'; +local links = import './links.libsonnet'; +local panels = import './panels.libsonnet'; +local rows = import './rows.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + withConfigMixin(config): { + config+: config, + }, + + new(): { + local this = self, + config: config, + + signals: + { + [category]: commonlib.signals.unmarshallJsonMulti( + this.config.signals[category], + type=this.config.metricsSource + ) + for category in std.objectFields(this.config.signals) + }, + + grafana: { + variables: commonlib.variables.new( + filteringSelector=this.config.filteringSelector, + groupLabels=this.config.groupLabels, + instanceLabels=this.config.instanceLabels, + varMetric='squid_client_http_requests_total', + customAllValue='.+', + enableLokiLogs=this.config.enableLokiLogs, + ), + annotations: {}, + links: links.new(this), + panels: panels.new(this), + dashboards: dashboards.new(this), + rows: rows.new(this), + }, + + prometheus: { + alerts: alerts.new(this), + recordingRules: {}, + }, + }, +} diff --git a/squid-mixin/mixin.libsonnet b/squid-mixin/mixin.libsonnet index 4d987cf31..2e8bd294c 100644 --- a/squid-mixin/mixin.libsonnet +++ b/squid-mixin/mixin.libsonnet @@ -1,3 +1,31 @@ -(import 'dashboards/dashboards.libsonnet') + -(import 'alerts/alerts.libsonnet') + -(import 'config.libsonnet') +local mixinlib = import './main.libsonnet'; +local config = (import './config.libsonnet'); +local util = import 'grafana-cloud-integration-utils/util.libsonnet'; + + +local mixin = mixinlib.new() + + mixinlib.withConfigMixin( + { + filteringSelector: config.filteringSelector, + uid: config.uid, + enableLokiLogs: true, + } + ); + +local label_patch = { + cluster+: { + allValue: '.*', + }, +}; + +{ + grafanaDashboards+:: { + [fname]: + local dashboard = util.decorate_dashboard(mixin.grafana.dashboards[fname], tags=config.dashboardTags); + dashboard + util.patch_variables(dashboard, label_patch) + + for fname in std.objectFields(mixin.grafana.dashboards) + }, + prometheusAlerts+:: mixin.prometheus.alerts, + prometheusRules+:: mixin.prometheus.recordingRules, +} diff --git a/squid-mixin/panels.libsonnet b/squid-mixin/panels.libsonnet new file mode 100644 index 000000000..75feea59a --- /dev/null +++ b/squid-mixin/panels.libsonnet @@ -0,0 +1,172 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + new(this): + { + local signals = this.signals, + + // Client panels + clientRequests: + commonlib.panels.generic.timeSeries.base.new( + 'Client requests', + targets=[signals.overview.clientHTTPRequests.asTarget() { interval: '2m', intervalFactor: 2 }], + description='The request rate of client.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps'), + + clientRequestErrors: + commonlib.panels.generic.timeSeries.base.new( + 'Client request errors', + targets=[signals.overview.clientHTTPErrors.asTarget() { interval: '2m', intervalFactor: 2 }], + description='The number of client HTTP errors.' + ) + + g.panel.timeSeries.standardOptions.withUnit('errors/s'), + + clientCacheHitRatio: + commonlib.panels.generic.timeSeries.base.new( + 'Client cache hit ratio', + targets=[signals.overview.clientCacheHitRatio.asTarget() { interval: '2m', intervalFactor: 2 }], + description='The client cache hit ratio.' + ) + + g.panel.timeSeries.standardOptions.withUnit('percent'), + + clientRequestSentThroughput: + commonlib.panels.generic.timeSeries.base.new( + 'Client request sent throughput', + targets=[signals.overview.clientHTTPSentThroughput.asTarget() { interval: '2m', intervalFactor: 2 }], + description='The throughput of client HTTP data sent.' + ) + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + clientHTTPReceivedThroughput: + commonlib.panels.generic.timeSeries.base.new( + 'Client HTTP received throughput', + targets=[signals.overview.clientHTTPReceivedThroughput.asTarget() { interval: '2m', intervalFactor: 2 }], + description='The throughput of client HTTP data received.' + ) + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + clientCacheHitThroughput: + commonlib.panels.generic.timeSeries.base.new( + 'Client cache hit throughput', + targets=[signals.overview.clientCacheHitThroughput.asTarget() { interval: '2m', intervalFactor: 2 }], + description='The throughput of client cache hit.' + ) + + g.panel.timeSeries.standardOptions.withUnit('KBs'), + + httpRequestServiceTime: + commonlib.panels.generic.timeSeries.base.new( + 'HTTP request service time', + targets=[ + signals.overview.httpRequestsAll50.asTarget(), + signals.overview.httpRequestsAll75.asTarget(), + signals.overview.httpRequestsAll95.asTarget(), + ], + description='HTTP request service time percentiles.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s'), + + cacheHitServiceTime: + commonlib.panels.generic.timeSeries.base.new( + 'Cache hit service time', + targets=[ + signals.overview.cacheHits50.asTarget() { intervalFactor: 2 }, + signals.overview.cacheHits75.asTarget() { intervalFactor: 2 }, + signals.overview.cacheHits95.asTarget() { intervalFactor: 2 }, + ], + description='Cache hits service time percentiles.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s'), + + cacheMissesServiceTime: + commonlib.panels.generic.timeSeries.base.new( + 'Cache misses service time', + targets=[ + signals.overview.cacheMisses50.asTarget() { intervalFactor: 2 }, + signals.overview.cacheMisses75.asTarget() { intervalFactor: 2 }, + signals.overview.cacheMisses95.asTarget() { intervalFactor: 2 }, + ], + description='Cache misses service time percentiles.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s'), + + // Server panels + serverRequests: + commonlib.panels.generic.timeSeries.base.new( + 'Server requests', + targets=[ + signals.overview.serverFTPRequests.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverHTTPRequests.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverOtherRequests.asTarget() { interval: '2m', intervalFactor: 2 }, + ], + description='The number of HTTP, FTP, and other server requests.' + ) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'), + + serverRequestErrors: + commonlib.panels.generic.timeSeries.base.new( + 'Server request errors', + targets=[ + signals.overview.serverFTPErrors.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverHTTPErrors.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverOtherErrors.asTarget() { interval: '2m', intervalFactor: 2 }, + ], + description='The number of HTTP, FTP, and other server request errors.' + ) + + g.panel.timeSeries.standardOptions.withUnit('errors/s') + + g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'), + + serverRequestSentThroughput: + commonlib.panels.generic.timeSeries.base.new( + 'Server request sent throughput', + targets=[ + signals.overview.serverFTPSentThroughput.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverHTTPSentThroughput.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverOtherSentThroughput.asTarget() { interval: '2m', intervalFactor: 2 }, + ], + description='The number of HTTP, FTP, and other server sent throughput.' + ) + + g.panel.timeSeries.standardOptions.withUnit('KBs') + + g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'), + + serverObjectSwap: + commonlib.panels.generic.timeSeries.base.new( + 'Server object swap', + targets=[ + signals.overview.swapIns.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.swapOuts.asTarget() { interval: '2m', intervalFactor: 2 }, + ], + description='The number of objects read from disk and the number of objects saved to disk.' + ) + + g.panel.timeSeries.standardOptions.withUnit('cps') + + g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'), + + dnsLookupServiceTime: + commonlib.panels.generic.timeSeries.base.new( + 'DNS lookup service time', + targets=[ + signals.overview.dnsLookups50.asTarget() { intervalFactor: 2 }, + signals.overview.dnsLookups75.asTarget() { intervalFactor: 2 }, + signals.overview.dnsLookups95.asTarget() { intervalFactor: 2 }, + ], + description='DNS lookup service time percentiles' + ) + + g.panel.timeSeries.standardOptions.withUnit('s'), + // NOTE: Removed stacking.withMode('normal') - percentiles should not be stacked! + + serverReceivedThroughput: + commonlib.panels.generic.timeSeries.base.new( + 'Server received throughput', + targets=[ + signals.overview.serverFTPReceivedThroughput.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverHTTPReceivedThroughput.asTarget() { interval: '2m', intervalFactor: 2 }, + signals.overview.serverOtherReceivedThroughput.asTarget() { interval: '2m', intervalFactor: 2 }, + ], + description='The number of HTTP, FTP, and other server throughput.' + ) + + g.panel.timeSeries.standardOptions.withUnit('KBs') + + g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'), + }, +} diff --git a/squid-mixin/prometheus_rules_out/prometheus_alerts.yaml b/squid-mixin/prometheus_rules_out/prometheus_alerts.yaml index 7b7966f8a..add490baa 100644 --- a/squid-mixin/prometheus_rules_out/prometheus_alerts.yaml +++ b/squid-mixin/prometheus_rules_out/prometheus_alerts.yaml @@ -1,7 +1,7 @@ groups: - - name: squid + - name: squid-alerts rules: - - alert: SquidHighPercentageOfHTTPServerRequestErrors + - alert: SquidHighHTTPServerRequestErrors annotations: description: | The percentage of HTTP server request errors is {{ printf "%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of 5. @@ -11,7 +11,7 @@ groups: for: 5m labels: severity: critical - - alert: SquidHighPercentageOfFTPServerRequestErrors + - alert: SquidHighFTPServerRequestErrors annotations: description: | The percentage of FTP server request errors is {{ printf "%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of 5. @@ -21,7 +21,7 @@ groups: for: 5m labels: severity: critical - - alert: SquidHighPercentageOfOtherServerRequestErrors + - alert: SquidHighOtherServerRequestErrors annotations: description: | The percentage of other server request errors is {{ printf "%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of 5. @@ -31,7 +31,7 @@ groups: for: 5m labels: severity: critical - - alert: SquidHighPercentageOfClientRequestErrors + - alert: SquidHighClientRequestErrors annotations: description: | The percentage of HTTP client request errors is {{ printf "%.0f" $value }} over the last 5m on {{ $labels.instance }} which is above the threshold of 5. diff --git a/squid-mixin/rows.libsonnet b/squid-mixin/rows.libsonnet new file mode 100644 index 000000000..fbff02627 --- /dev/null +++ b/squid-mixin/rows.libsonnet @@ -0,0 +1,39 @@ +local g = import './g.libsonnet'; + +{ + new(this): { + local panels = this.grafana.panels, + + clientRow: + g.panel.row.new('Client') + + g.panel.row.withPanels([ + panels.clientRequests { gridPos: { h: 8, w: 8, x: 0, y: 1 } }, + panels.clientRequestErrors { gridPos: { h: 8, w: 8, x: 8, y: 1 } }, + panels.clientCacheHitRatio { gridPos: { h: 8, w: 8, x: 16, y: 1 } }, + panels.clientRequestSentThroughput { gridPos: { h: 7, w: 8, x: 0, y: 9 } }, + panels.clientHTTPReceivedThroughput { gridPos: { h: 7, w: 8, x: 8, y: 9 } }, + panels.clientCacheHitThroughput { gridPos: { h: 7, w: 8, x: 16, y: 9 } }, + panels.httpRequestServiceTime { gridPos: { h: 7, w: 8, x: 0, y: 16 } }, + panels.cacheHitServiceTime { gridPos: { h: 7, w: 8, x: 8, y: 16 } }, + panels.cacheMissesServiceTime { gridPos: { h: 7, w: 8, x: 16, y: 16 } }, + ]), + + serverRow: + g.panel.row.new('Server') + + g.panel.row.withPanels([ + panels.serverRequests { gridPos: { h: 8, w: 8, x: 0, y: 24 } }, + panels.serverRequestErrors { gridPos: { h: 8, w: 8, x: 8, y: 24 } }, + panels.serverRequestSentThroughput { gridPos: { h: 8, w: 8, x: 16, y: 24 } }, + panels.serverObjectSwap { gridPos: { h: 8, w: 8, x: 0, y: 32 } }, + panels.dnsLookupServiceTime { gridPos: { h: 8, w: 8, x: 8, y: 32 } }, + panels.serverReceivedThroughput { gridPos: { h: 8, w: 8, x: 16, y: 32 } }, + ]), + + logsRow: + g.panel.row.new('Logs') + + g.panel.row.withPanels([ + panels.cacheLogs { gridPos: { h: 6, w: 24, x: 0, y: 40 } }, + panels.accessLogs { gridPos: { h: 6, w: 24, x: 0, y: 46 } }, + ]), + }, +} diff --git a/squid-mixin/signals/overview.libsonnet b/squid-mixin/signals/overview.libsonnet new file mode 100644 index 000000000..3186dadcd --- /dev/null +++ b/squid-mixin/signals/overview.libsonnet @@ -0,0 +1,436 @@ +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'squid_client_http_requests_total', + }, + + signals: { + + clientHTTPRequests: { + name: 'Client HTTP requests', + type: 'counter', + unit: 'reqps', + description: 'The request rate of client.', + sources: { + prometheus: { + expr: 'squid_client_http_requests_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + + clientHTTPErrors: { + name: 'Client HTTP errors', + type: 'counter', + unit: 'errors/s', + description: 'The number of client HTTP errors.', + sources: { + prometheus: { + expr: 'squid_client_http_errors_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + + clientCacheHitRatio: { + name: 'Client cache hit ratio', + type: 'raw', + unit: 'percent', + description: 'The client cache hit ratio.', + sources: { + prometheus: { + expr: '(rate(squid_client_http_hits_total{%(queriesSelector)s}[$__rate_interval]) / clamp_min(rate(squid_client_http_requests_total{%(queriesSelector)s}[$__rate_interval]),1)) * 100', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + + clientHTTPSentThroughput: { + name: 'Client HTTP sent throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of client HTTP data sent.', + sources: { + prometheus: { + expr: 'squid_client_http_kbytes_out_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + + clientHTTPReceivedThroughput: { + name: 'Client HTTP received throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of client HTTP data received.', + sources: { + prometheus: { + expr: 'squid_client_http_kbytes_in_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + + clientCacheHitThroughput: { + name: 'Client cache hit throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of client cache hit.', + sources: { + prometheus: { + expr: 'squid_client_http_hit_kbytes_out_bytes_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + + serverFTPRequests: { + name: 'Server FTP requests', + type: 'counter', + unit: 'reqps', + description: 'The number of FTP server requests.', + sources: { + prometheus: { + expr: 'squid_server_ftp_requests_total{%(queriesSelector)s}', + legendCustomTemplate: 'FTP', + }, + }, + }, + + serverHTTPRequests: { + name: 'Server HTTP requests', + type: 'counter', + unit: 'reqps', + description: 'The number of HTTP server requests.', + sources: { + prometheus: { + expr: 'squid_server_http_requests_total{%(queriesSelector)s}', + legendCustomTemplate: 'HTTP', + }, + }, + }, + + serverOtherRequests: { + name: 'Server other requests', + type: 'counter', + unit: 'reqps', + description: 'The number of other server requests.', + sources: { + prometheus: { + expr: 'squid_server_other_requests_total{%(queriesSelector)s}', + legendCustomTemplate: 'other', + }, + }, + }, + + serverFTPErrors: { + name: 'Server FTP errors', + type: 'counter', + unit: 'errors/s', + description: 'The number of FTP server request errors.', + sources: { + prometheus: { + expr: 'squid_server_ftp_errors_total{%(queriesSelector)s}', + legendCustomTemplate: 'FTP', + }, + }, + }, + + serverHTTPErrors: { + name: 'Server HTTP errors', + type: 'counter', + unit: 'errors/s', + description: 'The number of HTTP server request errors.', + sources: { + prometheus: { + expr: 'squid_server_http_errors_total{%(queriesSelector)s}', + legendCustomTemplate: 'HTTP', + }, + }, + }, + + serverOtherErrors: { + name: 'Server other errors', + type: 'counter', + unit: 'errors/s', + description: 'The number of other server request errors.', + sources: { + prometheus: { + expr: 'squid_server_other_errors_total{%(queriesSelector)s}', + legendCustomTemplate: 'other', + }, + }, + }, + + serverFTPSentThroughput: { + name: 'Server FTP sent throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of FTP server data sent.', + sources: { + prometheus: { + expr: 'squid_server_ftp_kbytes_out_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: 'FTP', + }, + }, + }, + + serverHTTPSentThroughput: { + name: 'Server HTTP sent throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of HTTP server data sent.', + sources: { + prometheus: { + expr: 'squid_server_http_kbytes_out_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: 'HTTP', + }, + }, + }, + + serverOtherSentThroughput: { + name: 'Server other sent throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of other server data sent.', + sources: { + prometheus: { + expr: 'squid_server_other_kbytes_out_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: 'other', + }, + }, + }, + + swapIns: { + name: 'Server object swap ins', + type: 'counter', + unit: 'cps', + description: 'The number of objects read from disk.', + sources: { + prometheus: { + expr: 'squid_swap_ins_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}} - read', + }, + }, + }, + + swapOuts: { + name: 'Server object swap outs', + type: 'counter', + unit: 'cps', + description: 'The number of objects saved to disk.', + sources: { + prometheus: { + expr: 'squid_swap_outs_total{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}} - saved', + }, + }, + }, + + serverFTPReceivedThroughput: { + name: 'Server FTP received throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of FTP server data received.', + sources: { + prometheus: { + expr: 'squid_server_ftp_kbytes_in_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: 'FTP', + }, + }, + }, + + serverHTTPReceivedThroughput: { + name: 'Server HTTP received throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of HTTP server data received.', + sources: { + prometheus: { + expr: 'squid_server_http_kbytes_in_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: 'HTTP', + }, + }, + }, + + serverOtherReceivedThroughput: { + name: 'Server other received throughput', + type: 'counter', + unit: 'KBs', + description: 'The throughput of other server data received.', + sources: { + prometheus: { + expr: 'squid_server_other_kbytes_in_kbytes_total{%(queriesSelector)s}', + legendCustomTemplate: 'other', + }, + }, + }, + + // HTTP Request service time percentiles + httpRequestsAll50: { + name: 'HTTP requests service time p50', + type: 'gauge', + unit: 's', + description: 'HTTP request service time 50th percentile.', + sources: { + prometheus: { + expr: 'squid_HTTP_Requests_All_50{%(queriesSelector)s}', + legendCustomTemplate: '50%%', + }, + }, + }, + + httpRequestsAll75: { + name: 'HTTP requests service time p75', + type: 'gauge', + unit: 's', + description: 'HTTP request service time 75th percentile.', + sources: { + prometheus: { + expr: 'squid_HTTP_Requests_All_75{%(queriesSelector)s}', + legendCustomTemplate: '75%%', + }, + }, + }, + + httpRequestsAll95: { + name: 'HTTP requests service time p95', + type: 'gauge', + unit: 's', + description: 'HTTP request service time 95th percentile.', + sources: { + prometheus: { + expr: 'squid_HTTP_Requests_All_95{%(queriesSelector)s}', + legendCustomTemplate: '95%%', + }, + }, + }, + + // Cache hits service time percentiles + cacheHits50: { + name: 'Cache hits service time p50', + type: 'gauge', + unit: 's', + description: 'Cache hits service time 50th percentile.', + sources: { + prometheus: { + expr: 'squid_Cache_Hits_50{%(queriesSelector)s}', + legendCustomTemplate: '50%%', + }, + }, + }, + + cacheHits75: { + name: 'Cache hits service time p75', + type: 'gauge', + unit: 's', + description: 'Cache hits service time 75th percentile.', + sources: { + prometheus: { + expr: 'squid_Cache_Hits_75{%(queriesSelector)s}', + legendCustomTemplate: '75%%', + }, + }, + }, + + cacheHits95: { + name: 'Cache hits service time p95', + type: 'gauge', + unit: 's', + description: 'Cache hits service time 95th percentile.', + sources: { + prometheus: { + expr: 'squid_Cache_Hits_95{%(queriesSelector)s}', + legendCustomTemplate: '95%%', + }, + }, + }, + + // Cache misses service time percentiles + cacheMisses50: { + name: 'Cache misses service time p50', + type: 'gauge', + unit: 's', + description: 'Cache misses service time 50th percentile.', + sources: { + prometheus: { + expr: 'squid_Cache_Nisses_50{%(queriesSelector)s}', + legendCustomTemplate: '50%%', + }, + }, + }, + + cacheMisses75: { + name: 'Cache misses service time p75', + type: 'gauge', + unit: 's', + description: 'Cache misses service time 75th percentile.', + sources: { + prometheus: { + expr: 'squid_Cache_Misses_75{%(queriesSelector)s}', + legendCustomTemplate: '75%%', + }, + }, + }, + + cacheMisses95: { + name: 'Cache misses service time p95', + type: 'gauge', + unit: 's', + description: 'Cache misses service time 95th percentile.', + sources: { + prometheus: { + expr: 'squid_Cache_Misses_95{%(queriesSelector)s}', + legendCustomTemplate: '95%%', + }, + }, + }, + + // DNS lookup service time percentiles + dnsLookups50: { + name: 'DNS lookup service time p50', + type: 'gauge', + unit: 's', + description: 'DNS lookup service time 50th percentile.', + sources: { + prometheus: { + expr: 'squid_DNS_Lookups_50{%(queriesSelector)s}', + legendCustomTemplate: '50%%', + }, + }, + }, + + dnsLookups75: { + name: 'DNS lookup service time p75', + type: 'gauge', + unit: 's', + description: 'DNS lookup service time 75th percentile.', + sources: { + prometheus: { + expr: 'squid_DNS_Lookups_75{%(queriesSelector)s}', + legendCustomTemplate: '75%%', + }, + }, + }, + + dnsLookups95: { + name: 'DNS lookup service time p95', + type: 'gauge', + unit: 's', + description: 'DNS lookup service time 95th percentile.', + sources: { + prometheus: { + expr: 'squid_DNS_Lookups_95{%(queriesSelector)s}', + legendCustomTemplate: '95%%', + }, + }, + }, + }, + }