From 216eb64bacca0d807f24125135129e53db3a8f34 Mon Sep 17 00:00:00 2001 From: Greg Pattison Date: Thu, 30 Oct 2025 13:29:06 -0400 Subject: [PATCH 1/2] Modernize wildfly-mixin to grafonnet v11 and signals architecture --- wildfly-mixin/{alerts => }/alerts.libsonnet | 16 +- wildfly-mixin/config.libsonnet | 42 +- wildfly-mixin/dashboards.libsonnet | 115 +++ wildfly-mixin/dashboards/dashboards.libsonnet | 2 - .../dashboards/wildfly-datasource.libsonnet | 498 ------------ .../dashboards/wildfly-overview.libsonnet | 735 ------------------ .../dashboards_out/wildfly-datasource.json | 493 ++++-------- .../dashboards_out/wildfly-logs.json | 336 ++++++++ .../dashboards_out/wildfly-overview.json | 714 ++++------------- wildfly-mixin/g.libsonnet | 1 + wildfly-mixin/jsonnetfile.json | 43 +- wildfly-mixin/links.libsonnet | 29 + wildfly-mixin/main.libsonnet | 48 ++ wildfly-mixin/mixin.libsonnet | 34 +- wildfly-mixin/panels.libsonnet | 166 ++++ .../prometheus_alerts.yaml | 6 +- wildfly-mixin/rows.libsonnet | 43 + wildfly-mixin/signals/connections.libsonnet | 40 + wildfly-mixin/signals/network.libsonnet | 42 + wildfly-mixin/signals/requests.libsonnet | 42 + wildfly-mixin/signals/sessions.libsonnet | 52 ++ wildfly-mixin/signals/transactions.libsonnet | 52 ++ 22 files changed, 1365 insertions(+), 2184 deletions(-) rename wildfly-mixin/{alerts => }/alerts.libsonnet (82%) create mode 100644 wildfly-mixin/dashboards.libsonnet delete mode 100644 wildfly-mixin/dashboards/dashboards.libsonnet delete mode 100644 wildfly-mixin/dashboards/wildfly-datasource.libsonnet delete mode 100644 wildfly-mixin/dashboards/wildfly-overview.libsonnet create mode 100644 wildfly-mixin/dashboards_out/wildfly-logs.json create mode 100644 wildfly-mixin/g.libsonnet create mode 100644 wildfly-mixin/links.libsonnet create mode 100644 wildfly-mixin/main.libsonnet create mode 100644 wildfly-mixin/panels.libsonnet create mode 100644 wildfly-mixin/rows.libsonnet create mode 100644 wildfly-mixin/signals/connections.libsonnet create mode 100644 wildfly-mixin/signals/network.libsonnet create mode 100644 wildfly-mixin/signals/requests.libsonnet create mode 100644 wildfly-mixin/signals/sessions.libsonnet create mode 100644 wildfly-mixin/signals/transactions.libsonnet diff --git a/wildfly-mixin/alerts/alerts.libsonnet b/wildfly-mixin/alerts.libsonnet similarity index 82% rename from wildfly-mixin/alerts/alerts.libsonnet rename to wildfly-mixin/alerts.libsonnet index fc9acb054..52ca01feb 100644 --- a/wildfly-mixin/alerts/alerts.libsonnet +++ b/wildfly-mixin/alerts.libsonnet @@ -1,14 +1,14 @@ { - prometheusAlerts+:: { + new(this): { groups+: [ { - name: 'wildfly', + name: 'WildflyAlerts', rules: [ { alert: 'HighPercentageOfErrorResponses', expr: ||| sum by (job, instance, server) (increase(wildfly_undertow_error_count_total{}[5m]) / increase(wildfly_undertow_request_count_total{}[5m])) * 100 > %(alertsErrorRequestErrorRate)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -17,14 +17,14 @@ summary: 'Large percentage of requests are resulting in 5XX responses.', description: ||| The percentage of error responses is {{ printf "%%.2f" $value }} on {{ $labels.instance }} - {{ $labels.server }} which is higher than {{%(alertsErrorRequestErrorRate)s }}. - ||| % $._config, + ||| % this.config, }, }, { - alert: 'HighNumberOfRejectedSessionsForDeployment', + alert: 'HighRejectedSessionsForDeployment', expr: ||| sum by (deployment, instance, job) (increase(wildfly_undertow_rejected_sessions_total{}[5m])) > %(alertsErrorRejectedSessions)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', @@ -32,8 +32,8 @@ annotations: { summary: 'Large number of sessions are being rejected for a deployment.', description: ||| - Deployemnt {{ $labels.deployment }} on {{ $labels.instance }} is exceeding the threshold for rejected sessions {{ printf "%%.0f" $value }} is higher than %(alertsErrorRejectedSessions)s. - ||| % $._config, + Deployment {{ $labels.deployment }} on {{ $labels.instance }} is exceeding the threshold for rejected sessions {{ printf "%%.0f" $value }} is higher than %(alertsErrorRejectedSessions)s. + ||| % this.config, }, }, ], diff --git a/wildfly-mixin/config.libsonnet b/wildfly-mixin/config.libsonnet index 7b92cd55a..903505d78 100644 --- a/wildfly-mixin/config.libsonnet +++ b/wildfly-mixin/config.libsonnet @@ -1,17 +1,35 @@ { - _config+:: { - enableMultiCluster: false, - multiclusterSelector: 'job=~"$job"', - wildflySelector: if self.enableMultiCluster then 'job=~"$job", cluster=~"$cluster"' else 'job=~"$job"', - dashboardTags: ['wildfly-mixin'], - dashboardPeriod: 'now-1h', - dashboardTimezone: 'default', - dashboardRefresh: '1m', + local this = self, + enableMultiCluster: false, + filteringSelector: '', // set to apply static filters to all queries and alerts, i.e. job="integrations/wildfly" + groupLabels: ['job', 'cluster'], + logLabels: ['job', 'cluster', 'instance'], + instanceLabels: ['instance'], - // alerts thresholds - alertsErrorRequestErrorRate: '30', - alertsErrorRejectedSessions: '20', + dashboardTags: [self.uid], + uid: 'wildfly', + dashboardNamePrefix: 'Wildfly', + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + dashboardRefresh: '1m', + metricsSource: 'prometheus', // metrics source for signals - enableLokiLogs: true, + // Logging configuration + enableLokiLogs: true, + extraLogLabels: ['level', 'severity'], // Required by logs-lib + logsVolumeGroupBy: 'level', + showLogsVolume: true, + + // alerts thresholds + alertsErrorRequestErrorRate: '30', + alertsErrorRejectedSessions: '20', + + // Signals configuration + signals+: { + requests: (import './signals/requests.libsonnet')(this), + network: (import './signals/network.libsonnet')(this), + connections: (import './signals/connections.libsonnet')(this), + sessions: (import './signals/sessions.libsonnet')(this), + transactions: (import './signals/transactions.libsonnet')(this), }, } diff --git a/wildfly-mixin/dashboards.libsonnet b/wildfly-mixin/dashboards.libsonnet new file mode 100644 index 000000000..89356160f --- /dev/null +++ b/wildfly-mixin/dashboards.libsonnet @@ -0,0 +1,115 @@ +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 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; + { + + 'wildfly-overview.json': + g.dashboard.new(this.config.dashboardNamePrefix + ' Overview') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels([ + this.grafana.rows.requestsRow, + this.grafana.rows.networkRow, + this.grafana.rows.sessionsRow, + ]) + ) + ) + root.applyCommon( + vars.multiInstance + [ + g.dashboard.variable.query.new('server') + + g.dashboard.variable.custom.selectionOptions.withMulti(true) + + g.dashboard.variable.query.queryTypes.withLabelValues(label='server', metric='wildfly_undertow_request_count_total{%(queriesSelectorGroupOnly)s}' % vars) + + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), + g.dashboard.variable.query.new('deployment') + + g.dashboard.variable.custom.selectionOptions.withMulti(true) + + g.dashboard.variable.query.queryTypes.withLabelValues(label='deployment', metric='wildfly_undertow_active_sessions{%(queriesSelectorGroupOnly)s}' % vars) + + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), + ], + uid + '-overview', + tags, + links { wildflyOverview+:: {} }, + annotations, + timezone, + refresh, + period, + ), + 'wildfly-datasource.json': + g.dashboard.new(this.config.dashboardNamePrefix + ' Datasource') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels([ + this.grafana.rows.connectionsRow, + this.grafana.rows.transactionsRow, + ]) + ) + ) + root.applyCommon( + vars.multiInstance + [ + g.dashboard.variable.query.new('datasource') + + g.dashboard.variable.custom.selectionOptions.withMulti(true) + + g.dashboard.variable.query.queryTypes.withLabelValues(label='data_source', metric='wildfly_datasources_pool_in_use_count{%(queriesSelectorGroupOnly)s}' % vars) + + g.dashboard.variable.query.withDatasourceFromVariable(vars.datasources.prometheus), + ], + uid + '-datasource', + tags, + links { wildflyDatasource+:: {} }, + annotations, + timezone, + refresh, + period, + ), + + } + if this.config.enableLokiLogs then { + 'wildfly-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/wildfly-mixin/dashboards/dashboards.libsonnet b/wildfly-mixin/dashboards/dashboards.libsonnet deleted file mode 100644 index 5778b7f72..000000000 --- a/wildfly-mixin/dashboards/dashboards.libsonnet +++ /dev/null @@ -1,2 +0,0 @@ -(import 'wildfly-overview.libsonnet') + -(import 'wildfly-datasource.libsonnet') diff --git a/wildfly-mixin/dashboards/wildfly-datasource.libsonnet b/wildfly-mixin/dashboards/wildfly-datasource.libsonnet deleted file mode 100644 index dfd64c9ed..000000000 --- a/wildfly-mixin/dashboards/wildfly-datasource.libsonnet +++ /dev/null @@ -1,498 +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 = 'wildfly-datasource'; - -local promDatasourceName = 'prometheus_datasource'; -local getMatcher(cfg) = '%(wildflySelector)s, instance=~"$instance"' % cfg; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local activeConnectionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'wildfly_datasources_pool_in_use_count{' + matcher + ', data_source=~"$datasource"}', - datasource=promDatasource, - legendFormat='{{data_source}}', - ), - ], - type: 'timeseries', - title: 'Active connections', - description: 'Connections to the datasource over time', - 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, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local idleConnectionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'wildfly_datasources_pool_idle_count{' + matcher + ', data_source=~"$datasource"}', - datasource=promDatasource, - legendFormat='{{data_source}}', - ), - ], - type: 'timeseries', - title: 'Idle connections', - description: 'Connections to the datasource over time', - 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, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local createdTransactionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'increase(wildfly_transactions_number_of_transactions_total{' + matcher + '}[$__interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - interval='1m', - intervalFactor=2, - ), - ], - type: 'timeseries', - title: 'Created transactions', - description: 'Number of transactions that were created over time', - 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, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local inflightTransactionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'wildfly_transactions_number_of_inflight_transactions{' + matcher + '}', - datasource=promDatasource, - legendFormat='{{instance}}', - ), - ], - type: 'timeseries', - title: 'In-flight transactions', - description: 'Number of transactions that are in-flight over time', - 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, - }, - ], - }, - }, - overrides: [ - ], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local abortedTransactionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'increase(wildfly_transactions_number_of_aborted_transactions_total{' + matcher + '}[$__interval])', - datasource=promDatasource, - legendFormat='{{instance}}', - interval='1m', - intervalFactor=2, - ), - ], - type: 'timeseries', - title: 'Aborted transactions', - description: 'Number of transactions that have been aborted over time', - 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, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -{ - grafanaDashboards+:: { - 'wildfly-datasource.json': - dashboard.new( - 'Wildfly datasource', - time_from='%s' % $._config.dashboardPeriod, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - description='', - uid=dashboardUid, - ) - .addTemplates( - [ - template.datasource( - promDatasourceName, - 'prometheus', - null, - label='Data Source', - refresh='load' - ), - template.new( - 'job', - promDatasource, - 'label_values(wildfly_batch_jberet_active_count{}, job)', - label='Job', - refresh=2, - includeAll=true, - multi=true, - allValues='.+', - sort=1 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(wildfly_batch_jberet_active_count{%(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(wildfly_batch_jberet_active_count{%(wildflySelector)s}, instance)' % $._config, - label='Instance', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'datasource', - promDatasource, - 'label_values(wildfly_datasources_pool_idle_count{%(wildflySelector)s}, data_source)' % $._config, - label='Wildfly datasource', - refresh=2, - includeAll=false, - multi=true, - allValues='.+', - sort=0 - ), - ] - ) - - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Wildfly Dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - - .addPanels( - [ - activeConnectionsPanel(getMatcher($._config)) { gridPos: { h: 7, w: 12, x: 0, y: 1 } }, - idleConnectionsPanel(getMatcher($._config)) { gridPos: { h: 7, w: 12, x: 12, y: 1 } }, - createdTransactionsPanel(getMatcher($._config)) { gridPos: { h: 7, w: 12, x: 0, y: 8 } }, - inflightTransactionsPanel(getMatcher($._config)) { gridPos: { h: 7, w: 12, x: 12, y: 8 } }, - abortedTransactionsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 24, x: 0, y: 15 } }, - ] - ), - }, -} diff --git a/wildfly-mixin/dashboards/wildfly-overview.libsonnet b/wildfly-mixin/dashboards/wildfly-overview.libsonnet deleted file mode 100644 index 57bfdabea..000000000 --- a/wildfly-mixin/dashboards/wildfly-overview.libsonnet +++ /dev/null @@ -1,735 +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 = 'wildfly-overview'; - -local promDatasourceName = 'prometheus_datasource'; -local lokiDatasourceName = 'loki_datasource'; -local getMatcher(cfg) = '%(wildflySelector)s, instance=~"$instance"' % cfg; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local lokiDatasource = { - uid: '${%s}' % lokiDatasourceName, -}; - -local requestsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(wildfly_undertow_request_count_total{server=~"$server",' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{server}} - {{http_listener}}{{https_listener}}', - ), - ], - type: 'timeseries', - title: 'Requests', - description: 'Requests rate over time', - 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 requestErrorsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(wildfly_undertow_error_count_total{server=~"$server",' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{server}} - {{http_listener}}{{https_listener}}', - ), - ], - type: 'timeseries', - title: 'Request errors', - description: 'Rate of requests that result in 500 over time', - 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 networkReceivedThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(wildfly_undertow_bytes_received_total_bytes{server=~"$server",' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{server}} - {{http_listener}}{{https_listener}}', - ), - ], - type: 'timeseries', - title: 'Network received throughput', - description: 'Throughput rate of data received over time', - 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: 'binBps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local networkSentThroughputPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'rate(wildfly_undertow_bytes_sent_total_bytes{server=~"$server",' + matcher + '}[$__rate_interval])', - datasource=promDatasource, - legendFormat='{{server}} - {{http_listener}}{{https_listener}}', - ), - ], - type: 'timeseries', - title: 'Network sent throughput', - description: 'Throughput rate of data sent over time', - 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: 'binBps', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local serverLogsPanel(matcher) = { - datasource: lokiDatasource, - targets: [ - { - datasource: lokiDatasource, - editorMode: 'code', - expr: '{' + matcher + '} |= `` | (filename=~"/opt/wildfly/.*/server.log" or log_type="wildfly")', - queryType: 'range', - refId: 'A', - }, - ], - type: 'logs', - title: 'Server logs', - description: 'Recent logs from server log file', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: false, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, - pluginVersion: '9.1.7', -}; - -local sessionsRow = { - datasource: promDatasource, - targets: [], - type: 'row', - title: 'Sessions', - collapsed: false, -}; - -local activeSessionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'wildfly_undertow_active_sessions{deployment=~"$deployment",' + matcher + '}', - datasource=promDatasource, - legendFormat='{{deployment}}', - ), - ], - type: 'timeseries', - title: 'Active sessions', - description: 'Number of active sessions to deployment over time', - 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, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local expiredSessionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'increase(wildfly_undertow_expired_sessions_total{deployment=~"$deployment",' + matcher + '}[$__interval])', - datasource=promDatasource, - legendFormat='{{deployment}}', - interval='1m', - intervalFactor=2, - ), - ], - type: 'timeseries', - title: 'Expired sessions', - description: 'Number of sessions that have expired for a deployment over time', - 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', - }, - }, - decimals: 0, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -local rejectedSessionsPanel(matcher) = { - datasource: promDatasource, - targets: [ - prometheus.target( - 'increase(wildfly_undertow_rejected_sessions_total{deployment=~"$deployment", job=~"$job", instance=~"$instance"}[$__interval])', - datasource=promDatasource, - legendFormat='{{deployment}}', - interval='1m', - intervalFactor=2, - ), - ], - type: 'timeseries', - title: 'Rejected sessions', - description: 'Number of sessions that have been rejected from a deployment over time', - 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', - }, - }, - decimals: 0, - mappings: [], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'green', - value: null, - }, - { - color: 'red', - value: 80, - }, - ], - }, - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, -}; - -{ - grafanaDashboards+:: { - 'wildfly-overview.json': - dashboard.new( - 'Wildfly 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(wildfly_batch_jberet_active_count{}, job)', - label='Job', - refresh=2, - includeAll=true, - multi=true, - allValues='.+', - sort=1 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(wildfly_batch_jberet_active_count{%(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(wildfly_batch_jberet_active_count{%(wildflySelector)s}, instance)' % $._config, - label='Instance', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'server', - promDatasource, - 'label_values(wildfly_undertow_request_count_total{%(wildflySelector)s}, server)' % $._config, - label='Server', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - template.new( - 'deployment', - promDatasource, - 'label_values(wildfly_undertow_active_sessions{%(wildflySelector)s}, deployment)' % $._config, - label='Deployment', - refresh=2, - includeAll=false, - multi=false, - allValues='', - sort=0 - ), - ], - ]) - ) - - .addLink(grafana.link.dashboards( - asDropdown=false, - title='Wildfly Dashboards', - includeVars=true, - keepTime=true, - tags=($._config.dashboardTags), - )) - - .addPanels( - std.flattenArrays([ - [ - requestsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 0 } }, - requestErrorsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 0 } }, - networkReceivedThroughputPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 8 } }, - networkSentThroughputPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 8 } }, - ], - if $._config.enableLokiLogs then [ - serverLogsPanel(getMatcher($._config)) { gridPos: { h: 9, w: 24, x: 0, y: 16 } }, - ] else [], - [ - sessionsRow { gridPos: { h: 1, w: 24, x: 0, y: 25 } }, - activeSessionsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 24, x: 0, y: 26 } }, - expiredSessionsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 0, y: 34 } }, - rejectedSessionsPanel(getMatcher($._config)) { gridPos: { h: 8, w: 12, x: 12, y: 34 } }, - ], - ]) - ), - - }, -} diff --git a/wildfly-mixin/dashboards_out/wildfly-datasource.json b/wildfly-mixin/dashboards_out/wildfly-datasource.json index d80a93c29..0ceb5da0f 100644 --- a/wildfly-mixin/dashboards_out/wildfly-datasource.json +++ b/wildfly-mixin/dashboards_out/wildfly-datasource.json @@ -1,74 +1,59 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, "id": null, "links": [ { - "asDropdown": false, - "icon": "external link", + "keepTime": true, + "title": "Wildfly logs", + "type": "link", + "url": "/d/wildfly-logs" + }, + { + "asDropdown": true, "includeVars": true, "keepTime": true, "tags": [ - "wildfly-mixin" + "wildfly" ], - "targetBlank": false, - "title": "Wildfly Dashboards", - "type": "dashboards", - "url": "" + "title": "All dashboards", + "type": "dashboards" + }, + { + "keepTime": true, + "title": "Wildfly Overview", + "type": "link", + "url": "/d/wildfly-overview" } ], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "Connections", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Connections to the datasource over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -80,37 +65,28 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { - "h": 7, + "h": 8, "w": 12, "x": 0, "y": 1 }, "id": 2, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "wildfly_datasources_pool_in_use_count{job=~\"$job\", instance=~\"$instance\", data_source=~\"$datasource\"}", + "expr": "wildfly_datasources_pool_in_use_count{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",data_source=~\"$datasource\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{data_source}}" + "legendFormat": "{{data_source}}", + "refId": "Active Connections" } ], "title": "Active connections", @@ -118,47 +94,16 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Connections to the datasource over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -170,85 +115,58 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { - "h": 7, + "h": 8, "w": 12, "x": 12, "y": 1 }, "id": 3, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "wildfly_datasources_pool_idle_count{job=~\"$job\", instance=~\"$instance\", data_source=~\"$datasource\"}", + "expr": "wildfly_datasources_pool_idle_count{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",data_source=~\"$datasource\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{data_source}}" + "legendFormat": "{{data_source}}", + "refId": "Idle Connections" } ], "title": "Idle connections", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 9 + }, + "id": 4, + "panels": [ ], + "title": "Transactions", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of transactions that were created over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -260,38 +178,29 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { - "h": 7, + "h": 8, "w": 12, "x": 0, - "y": 8 - }, - "id": 4, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "y": 10 }, + "id": 5, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_transactions_number_of_transactions_total{job=~\"$job\", instance=~\"$instance\"}[$__interval])", + "expr": "increase(wildfly_transactions_number_of_transactions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__interval])", "format": "time_series", + "instant": false, "interval": "1m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Created Transactions" } ], "title": "Created transactions", @@ -299,47 +208,16 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of transactions that are in-flight over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -351,37 +229,28 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { - "h": 7, + "h": 8, "w": 12, "x": 12, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "y": 10 }, + "id": 6, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "wildfly_transactions_number_of_inflight_transactions{job=~\"$job\", instance=~\"$instance\"}", + "expr": "wildfly_transactions_number_of_inflight_transactions{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "In-flight Transactions" } ], "title": "In-flight transactions", @@ -389,47 +258,16 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of transactions that have been aborted over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -441,185 +279,120 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 24, "x": 0, - "y": 15 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "y": 18 }, + "id": 7, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_transactions_number_of_aborted_transactions_total{job=~\"$job\", instance=~\"$instance\"}[$__interval])", + "expr": "increase(wildfly_transactions_number_of_aborted_transactions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__interval])", "format": "time_series", + "instant": false, "interval": "1m", "intervalFactor": 2, - "legendFormat": "{{instance}}" + "legendFormat": "{{instance}}", + "refId": "Aborted Transactions" } ], "title": "Aborted transactions", "type": "timeseries" } ], - "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "refresh": "30s", + "schemaVersion": 39, "tags": [ - "wildfly-mixin" + "wildfly" ], "templating": { "list": [ { - "current": { }, - "hide": 0, - "label": "Data Source", + "label": "Prometheus data source", "name": "prometheus_datasource", - "options": [ ], "query": "prometheus", - "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(wildfly_batch_jberet_active_count{}, job)", "refresh": 2, - "regex": "", "sort": 1, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" }, { "allValue": ".*", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 2, "includeAll": true, "label": "Cluster", "multi": true, "name": "cluster", - "options": [ ], "query": "label_values(wildfly_batch_jberet_active_count{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": false, + "includeAll": true, "label": "Instance", - "multi": false, + "multi": true, "name": "instance", - "options": [ ], - "query": "label_values(wildfly_batch_jberet_active_count{job=~\"$job\"}, instance)", + "query": "label_values(wildfly_batch_jberet_active_count{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" }, { - "allValue": ".+", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, - "label": "Wildfly datasource", "multi": true, "name": "datasource", - "options": [ ], - "query": "label_values(wildfly_datasources_pool_idle_count{job=~\"$job\"}, data_source)", + "query": "label_values(wildfly_datasources_pool_in_use_count{job=~\"$job\",cluster=~\"$cluster\"}, data_source)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" } ] }, "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": "Wildfly datasource", - "uid": "wildfly-datasource", - "version": 0 + "title": "Wildfly Datasource", + "uid": "wildfly-datasource" } \ No newline at end of file diff --git a/wildfly-mixin/dashboards_out/wildfly-logs.json b/wildfly-mixin/dashboards_out/wildfly-logs.json new file mode 100644 index 000000000..b6ce50ed9 --- /dev/null +++ b/wildfly-mixin/dashboards_out/wildfly-logs.json @@ -0,0 +1,336 @@ +{ + "annotations": { + "list": [ ] + }, + "editable": false, + "id": null, + "links": [ + { + "asDropdown": true, + "includeVars": true, + "keepTime": true, + "tags": [ + "wildfly" + ], + "title": "All dashboards", + "type": "dashboards" + }, + { + "keepTime": true, + "title": "Wildfly Datasource", + "type": "link", + "url": "/d/wildfly-datasource" + }, + { + "keepTime": true, + "title": "Wildfly Overview", + "type": "link", + "url": "/d/wildfly-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=~\"$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=~\"$job\",cluster=~\"$cluster\",level=~\"$level\",severity=~\"$severity\"} \n|~ \"$regex_search\"\n\n\n" + } + ], + "title": "Logs", + "type": "logs" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "wildfly" + ], + "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)", + "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=~\"$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=~\"$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=~\"$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": "Wildfly Logs", + "uid": "wildfly-logs" + } \ No newline at end of file diff --git a/wildfly-mixin/dashboards_out/wildfly-overview.json b/wildfly-mixin/dashboards_out/wildfly-overview.json index db523b8e8..98666fea7 100644 --- a/wildfly-mixin/dashboards_out/wildfly-overview.json +++ b/wildfly-mixin/dashboards_out/wildfly-overview.json @@ -1,117 +1,78 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "description": "", "editable": false, - "gnetId": null, - "graphTooltip": 0, - "hideControls": false, "id": null, "links": [ { - "asDropdown": false, - "icon": "external link", + "keepTime": true, + "title": "Wildfly logs", + "type": "link", + "url": "/d/wildfly-logs" + }, + { + "asDropdown": true, "includeVars": true, "keepTime": true, "tags": [ - "wildfly-mixin" + "wildfly" ], - "targetBlank": false, - "title": "Wildfly Dashboards", - "type": "dashboards", - "url": "" + "title": "All dashboards", + "type": "dashboards" + }, + { + "keepTime": true, + "title": "Wildfly Datasource", + "type": "link", + "url": "/d/wildfly-datasource" } ], "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "Requests", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Requests rate over time", "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": [ ] + } }, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 0 + "y": 1 }, "id": 2, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(wildfly_undertow_request_count_total{server=~\"$server\",job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(wildfly_undertow_request_count_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",server=~\"$server\"}[$__rate_interval])", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}" + "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", + "refId": "Requests Rate" } ], "title": "Requests", @@ -119,47 +80,16 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Rate of requests that result in 500 over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -172,128 +102,80 @@ ] }, "unit": "reqps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 12, "x": 12, - "y": 0 + "y": 1 }, "id": 3, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(wildfly_undertow_error_count_total{server=~\"$server\",job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(wildfly_undertow_error_count_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",server=~\"$server\"}[$__rate_interval])", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}" + "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", + "refId": "Request Errors Rate" } ], "title": "Request errors", "type": "timeseries" }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 9 + }, + "id": 4, + "panels": [ ], + "title": "Network", + "type": "row" + }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Throughput rate of data received over time", "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 - } - ] + "spanNulls": false }, "unit": "binBps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 8 - }, - "id": 4, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "y": 10 }, + "id": 5, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(wildfly_undertow_bytes_received_total_bytes{server=~\"$server\",job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(wildfly_undertow_bytes_received_total_bytes{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",server=~\"$server\"}[$__rate_interval])", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}" + "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", + "refId": "Network Received Throughput" } ], "title": "Network received throughput", @@ -301,47 +183,16 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Throughput rate of data sent over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -354,138 +205,58 @@ ] }, "unit": "binBps" - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 12, "x": 12, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "y": 10 }, + "id": 6, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "rate(wildfly_undertow_bytes_sent_total_bytes{server=~\"$server\",job=~\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "expr": "rate(wildfly_undertow_bytes_sent_total_bytes{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",server=~\"$server\"}[$__rate_interval])", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}" + "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", + "refId": "Network Sent Throughput" } ], "title": "Network sent throughput", "type": "timeseries" }, - { - "datasource": { - "uid": "${loki_datasource}" - }, - "description": "Recent logs from server log file", - "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 16 - }, - "id": 6, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "pluginVersion": "9.1.7", - "targets": [ - { - "datasource": { - "uid": "${loki_datasource}" - }, - "editorMode": "code", - "expr": "{job=~\"$job\", instance=~\"$instance\"} |= `` | (filename=~\"/opt/wildfly/.*/server.log\" or log_type=\"wildfly\")", - "queryType": "range", - "refId": "A" - } - ], - "title": "Server logs", - "type": "logs" - }, { "collapsed": false, - "datasource": { - "uid": "${prometheus_datasource}" - }, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 25 + "y": 18 }, "id": 7, - "targets": [ ], + "panels": [ ], "title": "Sessions", "type": "row" }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of active sessions to deployment over time", "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" - } + "spanNulls": false }, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -497,37 +268,28 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 24, "x": 0, - "y": 26 + "y": 19 }, "id": 8, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "wildfly_undertow_active_sessions{deployment=~\"$deployment\",job=~\"$job\", instance=~\"$instance\"}", + "expr": "wildfly_undertow_active_sessions{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}", "format": "time_series", + "instant": false, "intervalFactor": 2, - "legendFormat": "{{deployment}}" + "legendFormat": "{{deployment}}", + "refId": "Active Sessions" } ], "title": "Active sessions", @@ -535,48 +297,17 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of sessions that have expired for a deployment over time", "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" - } + "spanNulls": false }, "decimals": 0, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -588,38 +319,29 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 34 + "y": 27 }, "id": 9, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_undertow_expired_sessions_total{deployment=~\"$deployment\",job=~\"$job\", instance=~\"$instance\"}[$__interval])", + "expr": "increase(wildfly_undertow_expired_sessions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}[$__interval])", "format": "time_series", + "instant": false, "interval": "1m", "intervalFactor": 2, - "legendFormat": "{{deployment}}" + "legendFormat": "{{deployment}}", + "refId": "Expired Sessions" } ], "title": "Expired sessions", @@ -627,48 +349,17 @@ }, { "datasource": { - "uid": "${prometheus_datasource}" + "type": "datasource", + "uid": "-- Mixed --" }, "description": "Number of sessions that have been rejected from a deployment over time", "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" - } + "spanNulls": false }, "decimals": 0, - "mappings": [ ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "green", @@ -680,218 +371,131 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { "h": 8, "w": 12, "x": 12, - "y": 34 + "y": 27 }, "id": 10, - "options": { - "legend": { - "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_undertow_rejected_sessions_total{deployment=~\"$deployment\", job=~\"$job\", instance=~\"$instance\"}[$__interval])", + "expr": "increase(wildfly_undertow_rejected_sessions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}[$__interval])", "format": "time_series", + "instant": false, "interval": "1m", "intervalFactor": 2, - "legendFormat": "{{deployment}}" + "legendFormat": "{{deployment}}", + "refId": "Rejected Sessions" } ], "title": "Rejected sessions", "type": "timeseries" } ], - "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "refresh": "30s", + "schemaVersion": 39, "tags": [ - "wildfly-mixin" + "wildfly" ], "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(wildfly_batch_jberet_active_count{}, job)", "refresh": 2, - "regex": "", "sort": 1, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" }, { "allValue": ".*", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 2, "includeAll": true, "label": "Cluster", "multi": true, "name": "cluster", - "options": [ ], "query": "label_values(wildfly_batch_jberet_active_count{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": false, + "includeAll": true, "label": "Instance", - "multi": false, + "multi": true, "name": "instance", - "options": [ ], - "query": "label_values(wildfly_batch_jberet_active_count{job=~\"$job\"}, instance)", + "query": "label_values(wildfly_batch_jberet_active_count{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" }, { - "allValue": "", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, - "label": "Server", - "multi": false, + "multi": true, "name": "server", - "options": [ ], - "query": "label_values(wildfly_undertow_request_count_total{job=~\"$job\"}, server)", + "query": "label_values(wildfly_undertow_request_count_total{job=~\"$job\",cluster=~\"$cluster\"}, server)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" }, { - "allValue": "", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, - "includeAll": false, - "label": "Deployment", - "multi": false, + "multi": true, "name": "deployment", - "options": [ ], - "query": "label_values(wildfly_undertow_active_sessions{job=~\"$job\"}, deployment)", + "query": "label_values(wildfly_undertow_active_sessions{job=~\"$job\",cluster=~\"$cluster\"}, deployment)", "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" } ] }, "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": "Wildfly overview", - "uid": "wildfly-overview", - "version": 0 + "title": "Wildfly Overview", + "uid": "wildfly-overview" } \ No newline at end of file diff --git a/wildfly-mixin/g.libsonnet b/wildfly-mixin/g.libsonnet new file mode 100644 index 000000000..f89dcc064 --- /dev/null +++ b/wildfly-mixin/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' diff --git a/wildfly-mixin/jsonnetfile.json b/wildfly-mixin/jsonnetfile.json index 93f3316ec..6354d0e12 100644 --- a/wildfly-mixin/jsonnetfile.json +++ b/wildfly-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/wildfly-mixin/links.libsonnet b/wildfly-mixin/links.libsonnet new file mode 100644 index 000000000..75e1858db --- /dev/null +++ b/wildfly-mixin/links.libsonnet @@ -0,0 +1,29 @@ +local g = import './g.libsonnet'; + +{ + local link = g.dashboard.link, + new(this): + { + wildflyOverview: + link.link.new('Wildfly Overview', '/d/' + this.grafana.dashboards['wildfly-overview.json'].uid) + + link.link.options.withKeepTime(true), + + wildflyDatasource: + link.link.new('Wildfly Datasource', '/d/' + this.grafana.dashboards['wildfly-datasource.json'].uid) + + link.link.options.withKeepTime(true), + + otherDashboards: + link.dashboards.new('All dashboards', this.config.dashboardTags) + + link.dashboards.options.withIncludeVars(true) + + link.dashboards.options.withKeepTime(true) + + link.dashboards.options.withAsDropdown(true), + } + + + if this.config.enableLokiLogs then + { + logs: + link.link.new('Wildfly logs', '/d/' + this.grafana.dashboards['wildfly-logs.json'].uid) + + link.link.options.withKeepTime(true), + } + else {}, +} diff --git a/wildfly-mixin/main.libsonnet b/wildfly-mixin/main.libsonnet new file mode 100644 index 000000000..fff5650b2 --- /dev/null +++ b/wildfly-mixin/main.libsonnet @@ -0,0 +1,48 @@ +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: + { + [sig]: commonlib.signals.unmarshallJsonMulti( + this.config.signals[sig], + type=this.config.metricsSource + ) + for sig in std.objectFields(this.config.signals) + }, + + grafana: { + variables: commonlib.variables.new( + filteringSelector=this.config.filteringSelector, + groupLabels=this.config.groupLabels, + instanceLabels=this.config.instanceLabels, + varMetric='wildfly_batch_jberet_active_count', + 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/wildfly-mixin/mixin.libsonnet b/wildfly-mixin/mixin.libsonnet index 4d987cf31..2e8bd294c 100644 --- a/wildfly-mixin/mixin.libsonnet +++ b/wildfly-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/wildfly-mixin/panels.libsonnet b/wildfly-mixin/panels.libsonnet new file mode 100644 index 000000000..187c27281 --- /dev/null +++ b/wildfly-mixin/panels.libsonnet @@ -0,0 +1,166 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + new(this):: + { + local signals = this.signals, + + requestsPanel: + g.panel.timeSeries.new('Requests') + + g.panel.timeSeries.panelOptions.withDescription('Requests rate over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.requests.requestsRate.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.withUnit('reqps'), + + requestErrorsPanel: + g.panel.timeSeries.new('Request errors') + + g.panel.timeSeries.panelOptions.withDescription('Rate of requests that result in 500 over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.requests.requestErrorsRate.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.withUnit('reqps') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + networkReceivedThroughputPanel: + g.panel.timeSeries.new('Network received throughput') + + g.panel.timeSeries.panelOptions.withDescription('Throughput rate of data received over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.network.networkReceivedThroughput.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.withUnit('binBps') + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + networkSentThroughputPanel: + g.panel.timeSeries.new('Network sent throughput') + + g.panel.timeSeries.panelOptions.withDescription('Throughput rate of data sent over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.network.networkSentThroughput.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.withUnit('binBps') + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + connectionsActivePanel: + g.panel.timeSeries.new('Active connections') + + g.panel.timeSeries.panelOptions.withDescription('Connections to the datasource over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.connections.connectionsActive.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + connectionsIdlePanel: + g.panel.timeSeries.new('Idle connections') + + g.panel.timeSeries.panelOptions.withDescription('Connections to the datasource over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.connections.connectionsIdle.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + transactionsCreatedPanel: + g.panel.timeSeries.new('Created transactions') + + g.panel.timeSeries.panelOptions.withDescription('Number of transactions that were created over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.transactions.transactionsCreated.asTarget() + + g.query.prometheus.withInterval('1m') + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + transactionsInFlightPanel: + g.panel.timeSeries.new('In-flight transactions') + + g.panel.timeSeries.panelOptions.withDescription('Number of transactions that are in-flight over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.transactions.transactionsInFlight.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + transactionsAbortedPanel: + g.panel.timeSeries.new('Aborted transactions') + + g.panel.timeSeries.panelOptions.withDescription('Number of transactions that have been aborted over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.transactions.transactionsAborted.asTarget() + + g.query.prometheus.withInterval('1m') + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + sessionsActivePanel: + g.panel.timeSeries.new('Active sessions') + + g.panel.timeSeries.panelOptions.withDescription('Number of active sessions to deployment over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.sessions.activeSessions.asTarget() + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + sessionsExpiredPanel: + g.panel.timeSeries.new('Expired sessions') + + g.panel.timeSeries.panelOptions.withDescription('Number of sessions that have expired for a deployment over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.sessions.expiredSessions.asTarget() + + g.query.prometheus.withInterval('1m') + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.withDecimals(0) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + sessionsRejectedPanel: + g.panel.timeSeries.new('Rejected sessions') + + g.panel.timeSeries.panelOptions.withDescription('Number of sessions that have been rejected from a deployment over time') + + g.panel.timeSeries.queryOptions.withTargets([ + signals.sessions.rejectedSessions.asTarget() + + g.query.prometheus.withInterval('1m') + + g.query.prometheus.withIntervalFactor(2), + ]) + + g.panel.timeSeries.standardOptions.withDecimals(0) + + g.panel.timeSeries.standardOptions.thresholds.withSteps([ + { color: 'green', value: null }, + { color: 'red', value: 80 }, + ]) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + }, +} diff --git a/wildfly-mixin/prometheus_rules_out/prometheus_alerts.yaml b/wildfly-mixin/prometheus_rules_out/prometheus_alerts.yaml index 71d311c89..663860048 100644 --- a/wildfly-mixin/prometheus_rules_out/prometheus_alerts.yaml +++ b/wildfly-mixin/prometheus_rules_out/prometheus_alerts.yaml @@ -1,5 +1,5 @@ groups: - - name: wildfly + - name: WildflyAlerts rules: - alert: HighPercentageOfErrorResponses annotations: @@ -11,10 +11,10 @@ groups: for: 5m labels: severity: critical - - alert: HighNumberOfRejectedSessionsForDeployment + - alert: HighRejectedSessionsForDeployment annotations: description: | - Deployemnt {{ $labels.deployment }} on {{ $labels.instance }} is exceeding the threshold for rejected sessions {{ printf "%.0f" $value }} is higher than 20. + Deployment {{ $labels.deployment }} on {{ $labels.instance }} is exceeding the threshold for rejected sessions {{ printf "%.0f" $value }} is higher than 20. summary: Large number of sessions are being rejected for a deployment. expr: | sum by (deployment, instance, job) (increase(wildfly_undertow_rejected_sessions_total{}[5m])) > 20 diff --git a/wildfly-mixin/rows.libsonnet b/wildfly-mixin/rows.libsonnet new file mode 100644 index 000000000..ebbb6a90d --- /dev/null +++ b/wildfly-mixin/rows.libsonnet @@ -0,0 +1,43 @@ +local g = import './g.libsonnet'; + +{ + new(this): { + requestsRow: + g.panel.row.new('Requests') + + g.panel.row.withCollapsed(false) + + g.panel.row.withPanels([ + this.grafana.panels.requestsPanel { gridPos+: { w: 12 } }, + this.grafana.panels.requestErrorsPanel { gridPos+: { w: 12 } }, + ]), + networkRow: + g.panel.row.new('Network') + + g.panel.row.withCollapsed(false) + + g.panel.row.withPanels([ + this.grafana.panels.networkReceivedThroughputPanel { gridPos+: { w: 12 } }, + this.grafana.panels.networkSentThroughputPanel { gridPos+: { w: 12 } }, + ]), + connectionsRow: + g.panel.row.new('Connections') + + g.panel.row.withCollapsed(false) + + g.panel.row.withPanels([ + this.grafana.panels.connectionsActivePanel { gridPos+: { w: 12 } }, + this.grafana.panels.connectionsIdlePanel { gridPos+: { w: 12 } }, + ]), + transactionsRow: + g.panel.row.new('Transactions') + + g.panel.row.withCollapsed(false) + + g.panel.row.withPanels([ + this.grafana.panels.transactionsCreatedPanel { gridPos+: { w: 12 } }, + this.grafana.panels.transactionsInFlightPanel { gridPos+: { w: 12 } }, + this.grafana.panels.transactionsAbortedPanel { gridPos+: { w: 24 } }, + ]), + sessionsRow: + g.panel.row.new('Sessions') + + g.panel.row.withCollapsed(false) + + g.panel.row.withPanels([ + this.grafana.panels.sessionsActivePanel { gridPos+: { w: 24 } }, + this.grafana.panels.sessionsExpiredPanel { gridPos+: { w: 12 } }, + this.grafana.panels.sessionsRejectedPanel { gridPos+: { w: 12 } }, + ]), + }, +} diff --git a/wildfly-mixin/signals/connections.libsonnet b/wildfly-mixin/signals/connections.libsonnet new file mode 100644 index 000000000..f1441c784 --- /dev/null +++ b/wildfly-mixin/signals/connections.libsonnet @@ -0,0 +1,40 @@ +// for Connection related signals +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'wildfly_datasources_pool_in_use_count', + }, + signals: { + connectionsActive: { + name: 'Active Connections', + nameShort: 'Active Connections', + type: 'gauge', + description: 'Connections to the datasource over time', + sources: { + prometheus: { + expr: 'wildfly_datasources_pool_in_use_count{%(queriesSelector)s,data_source=~"$datasource"}', + legendCustomTemplate: '{{data_source}}', + }, + }, + }, + connectionsIdle: { + name: 'Idle Connections', + nameShort: 'Idle Connections', + type: 'gauge', + description: 'Idle connections to the datasource over time', + sources: { + prometheus: { + expr: 'wildfly_datasources_pool_idle_count{%(queriesSelector)s,data_source=~"$datasource"}', + legendCustomTemplate: '{{data_source}}', + }, + }, + }, + }, + } diff --git a/wildfly-mixin/signals/network.libsonnet b/wildfly-mixin/signals/network.libsonnet new file mode 100644 index 000000000..25ac2777d --- /dev/null +++ b/wildfly-mixin/signals/network.libsonnet @@ -0,0 +1,42 @@ +// for Network related signals +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'wildfly_undertow_bytes_received_total_bytes', + }, + signals: { + networkReceivedThroughput: { + name: 'Network Received Throughput', + nameShort: 'Network Received', + type: 'counter', + description: 'Throughput rate of data received over time', + unit: 'binBps', + sources: { + prometheus: { + expr: 'wildfly_undertow_bytes_received_total_bytes{%(queriesSelector)s,server=~"$server"}', + legendCustomTemplate: '{{server}} - {{http_listener}}{{https_listener}}', + }, + }, + }, + networkSentThroughput: { + name: 'Network Sent Throughput', + nameShort: 'Network Sent', + type: 'counter', + description: 'Throughput rate of data sent over time', + unit: 'binBps', + sources: { + prometheus: { + expr: 'wildfly_undertow_bytes_sent_total_bytes{%(queriesSelector)s,server=~"$server"}', + legendCustomTemplate: '{{server}} - {{http_listener}}{{https_listener}}', + }, + }, + }, + }, + } diff --git a/wildfly-mixin/signals/requests.libsonnet b/wildfly-mixin/signals/requests.libsonnet new file mode 100644 index 000000000..ae17847c5 --- /dev/null +++ b/wildfly-mixin/signals/requests.libsonnet @@ -0,0 +1,42 @@ +// for Requests related signals +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'wildfly_undertow_request_count_total', + }, + signals: { + requestsRate: { + name: 'Requests Rate', + nameShort: 'Requests', + type: 'counter', + description: 'Requests rate over time', + unit: 'reqps', + sources: { + prometheus: { + expr: 'wildfly_undertow_request_count_total{%(queriesSelector)s,server=~"$server"}', + legendCustomTemplate: '{{server}} - {{http_listener}}{{https_listener}}', + }, + }, + }, + requestErrorsRate: { + name: 'Request Errors Rate', + nameShort: 'Request Errors', + type: 'counter', + description: 'Rate of requests that result in 500 over time', + unit: 'reqps', + sources: { + prometheus: { + expr: 'wildfly_undertow_error_count_total{%(queriesSelector)s,server=~"$server"}', + legendCustomTemplate: '{{server}} - {{http_listener}}{{https_listener}}', + }, + }, + }, + }, + } diff --git a/wildfly-mixin/signals/sessions.libsonnet b/wildfly-mixin/signals/sessions.libsonnet new file mode 100644 index 000000000..ce4cc55b0 --- /dev/null +++ b/wildfly-mixin/signals/sessions.libsonnet @@ -0,0 +1,52 @@ +// for Session related signals +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'wildfly_undertow_expired_sessions_total', + }, + signals: { + activeSessions: { + name: 'Active Sessions', + nameShort: 'Active Sessions', + type: 'gauge', + description: 'Number of active sessions to deployment over time', + sources: { + prometheus: { + expr: 'wildfly_undertow_active_sessions{%(queriesSelector)s,deployment=~"$deployment"}', + legendCustomTemplate: '{{deployment}}', + }, + }, + }, + expiredSessions: { + name: 'Expired Sessions', + nameShort: 'Expired Sessions', + type: 'raw', + description: 'Number of sessions that have expired for a deployment over time', + sources: { + prometheus: { + expr: 'increase(wildfly_undertow_expired_sessions_total{%(queriesSelector)s,deployment=~"$deployment"}[$__interval])', + legendCustomTemplate: '{{deployment}}', + }, + }, + }, + rejectedSessions: { + name: 'Rejected Sessions', + nameShort: 'Rejected Sessions', + type: 'raw', + description: 'Number of sessions that have been rejected from a deployment over time', + sources: { + prometheus: { + expr: 'increase(wildfly_undertow_rejected_sessions_total{%(queriesSelector)s,deployment=~"$deployment"}[$__interval])', + legendCustomTemplate: '{{deployment}}', + }, + }, + }, + }, + } diff --git a/wildfly-mixin/signals/transactions.libsonnet b/wildfly-mixin/signals/transactions.libsonnet new file mode 100644 index 000000000..f6ab6981c --- /dev/null +++ b/wildfly-mixin/signals/transactions.libsonnet @@ -0,0 +1,52 @@ +// for Transaction related signals +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'wildfly_transactions_number_of_transactions_total', + }, + signals: { + transactionsCreated: { + name: 'Created Transactions', + nameShort: 'Created Transactions', + type: 'raw', + description: 'Number of transactions that were created over time', + sources: { + prometheus: { + expr: 'increase(wildfly_transactions_number_of_transactions_total{%(queriesSelector)s}[$__interval])', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + transactionsInFlight: { + name: 'In-flight Transactions', + nameShort: 'In-flight Transactions', + type: 'gauge', + description: 'Number of transactions that are in-flight over time', + sources: { + prometheus: { + expr: 'wildfly_transactions_number_of_inflight_transactions{%(queriesSelector)s}', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + transactionsAborted: { + name: 'Aborted Transactions', + nameShort: 'Aborted Transactions', + type: 'raw', + description: 'Number of transactions that have been aborted over time', + sources: { + prometheus: { + expr: 'increase(wildfly_transactions_number_of_aborted_transactions_total{%(queriesSelector)s}[$__interval])', + legendCustomTemplate: '{{instance}}', + }, + }, + }, + }, + } From 0f89d3d6ca5e2aff2e4201efef59e61ee2953d91 Mon Sep 17 00:00:00 2001 From: Greg Pattison Date: Tue, 11 Nov 2025 13:29:53 -0500 Subject: [PATCH 2/2] Updated links and signals to use Sentence case. Update signals to use counter type and range increase. --- wildfly-mixin/dashboards.libsonnet | 6 ++--- .../dashboards_out/wildfly-datasource.json | 14 ++++++------ .../dashboards_out/wildfly-logs.json | 6 ++--- .../dashboards_out/wildfly-overview.json | 20 ++++++++--------- wildfly-mixin/links.libsonnet | 4 ++-- wildfly-mixin/signals/connections.libsonnet | 8 +++---- wildfly-mixin/signals/network.libsonnet | 8 +++---- wildfly-mixin/signals/requests.libsonnet | 2 +- wildfly-mixin/signals/sessions.libsonnet | 22 ++++++++++--------- wildfly-mixin/signals/transactions.libsonnet | 22 ++++++++++--------- 10 files changed, 58 insertions(+), 54 deletions(-) diff --git a/wildfly-mixin/dashboards.libsonnet b/wildfly-mixin/dashboards.libsonnet index 89356160f..79124ff32 100644 --- a/wildfly-mixin/dashboards.libsonnet +++ b/wildfly-mixin/dashboards.libsonnet @@ -17,7 +17,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet'; { 'wildfly-overview.json': - g.dashboard.new(this.config.dashboardNamePrefix + ' Overview') + g.dashboard.new(this.config.dashboardNamePrefix + ' overview') + g.dashboard.withPanels( g.util.panel.resolveCollapsedFlagOnRows( g.util.grid.wrapPanels([ @@ -46,7 +46,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet'; period, ), 'wildfly-datasource.json': - g.dashboard.new(this.config.dashboardNamePrefix + ' Datasource') + g.dashboard.new(this.config.dashboardNamePrefix + ' datasource') + g.dashboard.withPanels( g.util.panel.resolveCollapsedFlagOnRows( g.util.grid.wrapPanels([ @@ -73,7 +73,7 @@ local logslib = import 'logs-lib/logs/main.libsonnet'; } + if this.config.enableLokiLogs then { 'wildfly-logs.json': logslib.new( - this.config.dashboardNamePrefix + ' Logs', + this.config.dashboardNamePrefix + ' logs', datasourceName=this.grafana.variables.datasources.loki.name, datasourceRegex=this.grafana.variables.datasources.loki.regex, filterSelector=this.config.filteringSelector, diff --git a/wildfly-mixin/dashboards_out/wildfly-datasource.json b/wildfly-mixin/dashboards_out/wildfly-datasource.json index 0ceb5da0f..43451fcb7 100644 --- a/wildfly-mixin/dashboards_out/wildfly-datasource.json +++ b/wildfly-mixin/dashboards_out/wildfly-datasource.json @@ -23,7 +23,7 @@ }, { "keepTime": true, - "title": "Wildfly Overview", + "title": "Wildfly overview", "type": "link", "url": "/d/wildfly-overview" } @@ -194,13 +194,13 @@ "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_transactions_number_of_transactions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__interval])", + "expr": "increase(wildfly_transactions_number_of_transactions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__interval:] offset -$__interval)", "format": "time_series", "instant": false, "interval": "1m", "intervalFactor": 2, "legendFormat": "{{instance}}", - "refId": "Created Transactions" + "refId": "Created transactions" } ], "title": "Created transactions", @@ -250,7 +250,7 @@ "instant": false, "intervalFactor": 2, "legendFormat": "{{instance}}", - "refId": "In-flight Transactions" + "refId": "In-flight transactions" } ], "title": "In-flight transactions", @@ -295,13 +295,13 @@ "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_transactions_number_of_aborted_transactions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__interval])", + "expr": "increase(wildfly_transactions_number_of_aborted_transactions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\"}[$__interval:] offset -$__interval)", "format": "time_series", "instant": false, "interval": "1m", "intervalFactor": 2, "legendFormat": "{{instance}}", - "refId": "Aborted Transactions" + "refId": "Aborted transactions" } ], "title": "Aborted transactions", @@ -393,6 +393,6 @@ "to": "now" }, "timezone": "default", - "title": "Wildfly Datasource", + "title": "Wildfly datasource", "uid": "wildfly-datasource" } \ No newline at end of file diff --git a/wildfly-mixin/dashboards_out/wildfly-logs.json b/wildfly-mixin/dashboards_out/wildfly-logs.json index b6ce50ed9..8ab65e082 100644 --- a/wildfly-mixin/dashboards_out/wildfly-logs.json +++ b/wildfly-mixin/dashboards_out/wildfly-logs.json @@ -17,13 +17,13 @@ }, { "keepTime": true, - "title": "Wildfly Datasource", + "title": "Wildfly datasource", "type": "link", "url": "/d/wildfly-datasource" }, { "keepTime": true, - "title": "Wildfly Overview", + "title": "Wildfly overview", "type": "link", "url": "/d/wildfly-overview" } @@ -331,6 +331,6 @@ "to": "now" }, "timezone": "default", - "title": "Wildfly Logs", + "title": "Wildfly logs", "uid": "wildfly-logs" } \ No newline at end of file diff --git a/wildfly-mixin/dashboards_out/wildfly-overview.json b/wildfly-mixin/dashboards_out/wildfly-overview.json index 98666fea7..43d2fe84d 100644 --- a/wildfly-mixin/dashboards_out/wildfly-overview.json +++ b/wildfly-mixin/dashboards_out/wildfly-overview.json @@ -23,7 +23,7 @@ }, { "keepTime": true, - "title": "Wildfly Datasource", + "title": "Wildfly datasource", "type": "link", "url": "/d/wildfly-datasource" } @@ -72,7 +72,7 @@ "instant": false, "intervalFactor": 2, "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", - "refId": "Requests Rate" + "refId": "Requests rate" } ], "title": "Requests", @@ -175,7 +175,7 @@ "instant": false, "intervalFactor": 2, "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", - "refId": "Network Received Throughput" + "refId": "Network received throughput" } ], "title": "Network received throughput", @@ -226,7 +226,7 @@ "instant": false, "intervalFactor": 2, "legendFormat": "{{server}} - {{http_listener}}{{https_listener}}", - "refId": "Network Sent Throughput" + "refId": "Network sent throughput" } ], "title": "Network sent throughput", @@ -289,7 +289,7 @@ "instant": false, "intervalFactor": 2, "legendFormat": "{{deployment}}", - "refId": "Active Sessions" + "refId": "Active sessions" } ], "title": "Active sessions", @@ -335,13 +335,13 @@ "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_undertow_expired_sessions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}[$__interval])", + "expr": "increase(wildfly_undertow_expired_sessions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}[$__interval:] offset -$__interval)", "format": "time_series", "instant": false, "interval": "1m", "intervalFactor": 2, "legendFormat": "{{deployment}}", - "refId": "Expired Sessions" + "refId": "Expired sessions" } ], "title": "Expired sessions", @@ -387,13 +387,13 @@ "type": "prometheus", "uid": "${prometheus_datasource}" }, - "expr": "increase(wildfly_undertow_rejected_sessions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}[$__interval])", + "expr": "increase(wildfly_undertow_rejected_sessions_total{job=~\"$job\",cluster=~\"$cluster\",instance=~\"$instance\",deployment=~\"$deployment\"}[$__interval:] offset -$__interval)", "format": "time_series", "instant": false, "interval": "1m", "intervalFactor": 2, "legendFormat": "{{deployment}}", - "refId": "Rejected Sessions" + "refId": "Rejected sessions" } ], "title": "Rejected sessions", @@ -496,6 +496,6 @@ "to": "now" }, "timezone": "default", - "title": "Wildfly Overview", + "title": "Wildfly overview", "uid": "wildfly-overview" } \ No newline at end of file diff --git a/wildfly-mixin/links.libsonnet b/wildfly-mixin/links.libsonnet index 75e1858db..74421c229 100644 --- a/wildfly-mixin/links.libsonnet +++ b/wildfly-mixin/links.libsonnet @@ -5,11 +5,11 @@ local g = import './g.libsonnet'; new(this): { wildflyOverview: - link.link.new('Wildfly Overview', '/d/' + this.grafana.dashboards['wildfly-overview.json'].uid) + link.link.new('Wildfly overview', '/d/' + this.grafana.dashboards['wildfly-overview.json'].uid) + link.link.options.withKeepTime(true), wildflyDatasource: - link.link.new('Wildfly Datasource', '/d/' + this.grafana.dashboards['wildfly-datasource.json'].uid) + link.link.new('Wildfly datasource', '/d/' + this.grafana.dashboards['wildfly-datasource.json'].uid) + link.link.options.withKeepTime(true), otherDashboards: diff --git a/wildfly-mixin/signals/connections.libsonnet b/wildfly-mixin/signals/connections.libsonnet index f1441c784..e87697eba 100644 --- a/wildfly-mixin/signals/connections.libsonnet +++ b/wildfly-mixin/signals/connections.libsonnet @@ -13,8 +13,8 @@ function(this) }, signals: { connectionsActive: { - name: 'Active Connections', - nameShort: 'Active Connections', + name: 'Active connections', + nameShort: 'Active connections', type: 'gauge', description: 'Connections to the datasource over time', sources: { @@ -25,8 +25,8 @@ function(this) }, }, connectionsIdle: { - name: 'Idle Connections', - nameShort: 'Idle Connections', + name: 'Idle connections', + nameShort: 'Idle connections', type: 'gauge', description: 'Idle connections to the datasource over time', sources: { diff --git a/wildfly-mixin/signals/network.libsonnet b/wildfly-mixin/signals/network.libsonnet index 25ac2777d..346802630 100644 --- a/wildfly-mixin/signals/network.libsonnet +++ b/wildfly-mixin/signals/network.libsonnet @@ -13,8 +13,8 @@ function(this) }, signals: { networkReceivedThroughput: { - name: 'Network Received Throughput', - nameShort: 'Network Received', + name: 'Network received throughput', + nameShort: 'Network received', type: 'counter', description: 'Throughput rate of data received over time', unit: 'binBps', @@ -26,8 +26,8 @@ function(this) }, }, networkSentThroughput: { - name: 'Network Sent Throughput', - nameShort: 'Network Sent', + name: 'Network sent throughput', + nameShort: 'Network sent', type: 'counter', description: 'Throughput rate of data sent over time', unit: 'binBps', diff --git a/wildfly-mixin/signals/requests.libsonnet b/wildfly-mixin/signals/requests.libsonnet index ae17847c5..e5f9927f2 100644 --- a/wildfly-mixin/signals/requests.libsonnet +++ b/wildfly-mixin/signals/requests.libsonnet @@ -13,7 +13,7 @@ function(this) }, signals: { requestsRate: { - name: 'Requests Rate', + name: 'Requests rate', nameShort: 'Requests', type: 'counter', description: 'Requests rate over time', diff --git a/wildfly-mixin/signals/sessions.libsonnet b/wildfly-mixin/signals/sessions.libsonnet index ce4cc55b0..e0850d4c8 100644 --- a/wildfly-mixin/signals/sessions.libsonnet +++ b/wildfly-mixin/signals/sessions.libsonnet @@ -13,8 +13,8 @@ function(this) }, signals: { activeSessions: { - name: 'Active Sessions', - nameShort: 'Active Sessions', + name: 'Active sessions', + nameShort: 'Active sessions', type: 'gauge', description: 'Number of active sessions to deployment over time', sources: { @@ -25,25 +25,27 @@ function(this) }, }, expiredSessions: { - name: 'Expired Sessions', - nameShort: 'Expired Sessions', - type: 'raw', + name: 'Expired sessions', + nameShort: 'Expired sessions', + type: 'counter', description: 'Number of sessions that have expired for a deployment over time', sources: { prometheus: { - expr: 'increase(wildfly_undertow_expired_sessions_total{%(queriesSelector)s,deployment=~"$deployment"}[$__interval])', + expr: 'wildfly_undertow_expired_sessions_total{%(queriesSelector)s,deployment=~"$deployment"}', + rangeFunction: 'increase', legendCustomTemplate: '{{deployment}}', }, }, }, rejectedSessions: { - name: 'Rejected Sessions', - nameShort: 'Rejected Sessions', - type: 'raw', + name: 'Rejected sessions', + nameShort: 'Rejected sessions', + type: 'counter', description: 'Number of sessions that have been rejected from a deployment over time', sources: { prometheus: { - expr: 'increase(wildfly_undertow_rejected_sessions_total{%(queriesSelector)s,deployment=~"$deployment"}[$__interval])', + expr: 'wildfly_undertow_rejected_sessions_total{%(queriesSelector)s,deployment=~"$deployment"}', + rangeFunction: 'increase', legendCustomTemplate: '{{deployment}}', }, }, diff --git a/wildfly-mixin/signals/transactions.libsonnet b/wildfly-mixin/signals/transactions.libsonnet index f6ab6981c..3ada28a6e 100644 --- a/wildfly-mixin/signals/transactions.libsonnet +++ b/wildfly-mixin/signals/transactions.libsonnet @@ -13,20 +13,21 @@ function(this) }, signals: { transactionsCreated: { - name: 'Created Transactions', - nameShort: 'Created Transactions', - type: 'raw', + name: 'Created transactions', + nameShort: 'Created transactions', + type: 'counter', description: 'Number of transactions that were created over time', sources: { prometheus: { - expr: 'increase(wildfly_transactions_number_of_transactions_total{%(queriesSelector)s}[$__interval])', + expr: 'wildfly_transactions_number_of_transactions_total{%(queriesSelector)s}', + rangeFunction: 'increase', legendCustomTemplate: '{{instance}}', }, }, }, transactionsInFlight: { - name: 'In-flight Transactions', - nameShort: 'In-flight Transactions', + name: 'In-flight transactions', + nameShort: 'In-flight transactions', type: 'gauge', description: 'Number of transactions that are in-flight over time', sources: { @@ -37,13 +38,14 @@ function(this) }, }, transactionsAborted: { - name: 'Aborted Transactions', - nameShort: 'Aborted Transactions', - type: 'raw', + name: 'Aborted transactions', + nameShort: 'Aborted transactions', + type: 'counter', description: 'Number of transactions that have been aborted over time', sources: { prometheus: { - expr: 'increase(wildfly_transactions_number_of_aborted_transactions_total{%(queriesSelector)s}[$__interval])', + expr: 'wildfly_transactions_number_of_aborted_transactions_total{%(queriesSelector)s}', + rangeFunction: 'increase', legendCustomTemplate: '{{instance}}', }, },