diff --git a/oracledb-mixin/README.md b/oracledb-mixin/README.md index d2abedf5b..e62c56de0 100644 --- a/oracledb-mixin/README.md +++ b/oracledb-mixin/README.md @@ -9,16 +9,14 @@ OracleDB mixin is a set of configurable alerts and dashboards that use the third | OracledbReachingSessionLimit | number of processess being utilized exceeded a theshold. | 85% | | OracledbReachingProcessLimit | The number of processess being utilized exceeded the threshold. | 85% | | OracledbTablespaceReachingCapacity | A Tablespace is exceeded its threshold of its maximum allotted space. | 85% | -| OracledbFileDescriptorLimit | File descriptors usage is reaching its threshold. | 85% | Default thresholds can be configured in `config.libsonnet`. ```js { _config+:: { - alertsFileDescriptorThreshold: '85', // % - alertsProcessThreshold: '85', // % alertsSessionThreshold: '85', // % + alertsProcessThreshold: '85', // % alertsTablespaceThreshold: '85', // % }, } diff --git a/oracledb-mixin/alerts/alerts.libsonnet b/oracledb-mixin/alerts.libsonnet similarity index 83% rename from oracledb-mixin/alerts/alerts.libsonnet rename to oracledb-mixin/alerts.libsonnet index 29bb9c43d..13dc14a9f 100644 --- a/oracledb-mixin/alerts/alerts.libsonnet +++ b/oracledb-mixin/alerts.libsonnet @@ -1,5 +1,5 @@ { - prometheusAlerts+:: { + new(this): { groups+: [ { name: 'OracleDBAlerts', @@ -8,49 +8,49 @@ alert: 'OracledbReachingSessionLimit', expr: ||| oracledb_resource_current_utilization{resource_name="sessions"} / oracledb_resource_limit_value{resource_name="sessions"} * 100 > %(alertsSessionThreshold)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', }, annotations: { - summary: 'The number of sessions being utilized exceeded %(alertsSessionThreshold)s%%.' % $._config, + summary: 'The number of sessions being utilized exceeded %(alertsSessionThreshold)s%%.' % this.config, description: ('{{ printf "%%.2f" $value }}%% of sessions are being utilized which is above the ' + - 'threshold %(alertsSessionThreshold)s%%. This could mean that {{$labels.instance}} is being overutilized.') % $._config, + 'threshold %(alertsSessionThreshold)s%%. This could mean that {{$labels.instance}} is being overutilized.') % this.config, }, }, { alert: 'OracledbReachingProcessLimit', expr: ||| oracledb_resource_current_utilization{resource_name="processes"} / oracledb_resource_limit_value{resource_name="processes"} * 100 > %(alertsProcessThreshold)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', }, annotations: { - summary: 'The number of processess being utilized exceeded the threshold of %(alertsProcessThreshold)s%%.' % $._config, + summary: 'The number of processess being utilized exceeded the threshold of %(alertsProcessThreshold)s%%.' % this.config, description: ('{{ printf "%%.2f" $value }} of processes are being utilized which is above the' + 'threshold %(alertsProcessThreshold)s%%. This could potentially mean that ' + - '{{$labels.instance}} runs out of processes it can spin up.') % $._config, + '{{$labels.instance}} runs out of processes it can spin up.') % this.config, }, }, { alert: 'OracledbTablespaceReachingCapacity', expr: ||| oracledb_tablespace_bytes / oracledb_tablespace_max_bytes * 100 > %(alertsTablespaceThreshold)s - ||| % $._config, + ||| % this.config, 'for': '5m', labels: { severity: 'critical', }, annotations: { - summary: 'A tablespace is exceeding more than %(alertsTablespaceThreshold)s%% of its maximum allotted space.' % $._config, + summary: 'A tablespace is exceeding more than %(alertsTablespaceThreshold)s%% of its maximum allotted space.' % this.config, description: ('{{ printf "%%.2f" $value }}%% of bytes are being utilized by the tablespace {{$labels.tablespace}} on the instance {{$labels.instance}}, ' + - 'which is above the threshold %(alertsTablespaceThreshold)s%%.') % $._config, + 'which is above the threshold %(alertsTablespaceThreshold)s%%.') % this.config, }, }, ], diff --git a/oracledb-mixin/config.libsonnet b/oracledb-mixin/config.libsonnet index d77528744..ddf26c6b2 100644 --- a/oracledb-mixin/config.libsonnet +++ b/oracledb-mixin/config.libsonnet @@ -1,18 +1,36 @@ { - _config+:: { - enableMultiCluster: false, - oracledbSelector: if self.enableMultiCluster then 'job=~"$job", cluster=~"$cluster"' else 'job=~"$job"', - dashboardTags: ['oracledb-mixin'], - dashboardPeriod: 'now-1h', - dashboardTimezone: 'default', - dashboardRefresh: '1m', + local this = self, + filteringSelector: 'job=~"integrations/oracledb"', + enableMultiCluster: false, + groupLabels: if self.enableMultiCluster then ['cluster', 'job'] else ['job'], + instanceLabels: ['instance'], + tablespaceLabels: ['tablespace'], + uid: 'oracledb', - alertsFileDescriptorThreshold: '85', // % - alertsProcessThreshold: '85', // % - alertsSessionThreshold: '85', // % - alertsTablespaceThreshold: '85', // % + dashboardNamePrefix: 'Oracle Database', + dashboardTags: ['oracledb-mixin'], + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + dashboardRefresh: '1m', - // enable Loki logs - enableLokiLogs: true, + // Data source configuration + metricsSource: 'prometheus', + enableLokiLogs: true, + logLabels: this.groupLabels + this.instanceLabels, + extraLogLabels: [], + logsVolumeGroupBy: 'level', + showLogsVolume: true, + + // Alerting thresholds + alertsFileDescriptorThreshold: 85, // % + alertsProcessThreshold: 85, // % + alertsSessionThreshold: 85, // % + alertsTablespaceThreshold: 85, // % + + // Signals configuration + signals+: { + sessions: (import './signals/sessions.libsonnet')(this), + waittimes: (import './signals/waittimes.libsonnet')(this), + tablespace: (import './signals/tablespace.libsonnet')(this), }, } diff --git a/oracledb-mixin/dashboards.libsonnet b/oracledb-mixin/dashboards.libsonnet new file mode 100644 index 000000000..3884f66f0 --- /dev/null +++ b/oracledb-mixin/dashboards.libsonnet @@ -0,0 +1,88 @@ +local g = import './g.libsonnet'; +local logslib = import 'logs-lib/logs/main.libsonnet'; + +{ + local root = self, + + 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)), + + + new(this):: + local prefix = this.config.dashboardNamePrefix; + local links = this.grafana.links; + local tags = this.config.dashboardTags; + local uid = g.util.string.slugify(this.config.uid); + local vars = this.grafana.variables; + local annotations = this.grafana.annotations; + local refresh = this.config.dashboardRefresh; + local period = this.config.dashboardPeriod; + local timezone = this.config.dashboardTimezone; + + { + 'oracledb-overview.json': + g.dashboard.new(prefix + ' overview') + + g.dashboard.withPanels( + g.util.panel.resolveCollapsedFlagOnRows( + g.util.grid.wrapPanels( + [ + this.grafana.rows.overview + g.panel.row.withCollapsed(false), + this.grafana.rows.waittimes + g.panel.row.withCollapsed(false), + this.grafana.rows.tablespace + g.panel.row.withCollapsed(false), + ], + ), + ) + ) + + root.applyCommon( + vars.multiInstance, + uid + '_oracledb_overview', + tags, + links { oracledbOverview+:: {} }, + annotations, + timezone, + refresh, + period + ), + } + + + + if this.config.enableLokiLogs then { + 'logs.json': + logslib.new( + prefix + ' 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 {}, +} diff --git a/oracledb-mixin/dashboards/dashboards.libsonnet b/oracledb-mixin/dashboards/dashboards.libsonnet deleted file mode 100644 index 800feec12..000000000 --- a/oracledb-mixin/dashboards/dashboards.libsonnet +++ /dev/null @@ -1 +0,0 @@ -(import 'overview.libsonnet') diff --git a/oracledb-mixin/dashboards/overview.libsonnet b/oracledb-mixin/dashboards/overview.libsonnet deleted file mode 100644 index f5291cef1..000000000 --- a/oracledb-mixin/dashboards/overview.libsonnet +++ /dev/null @@ -1,1174 +0,0 @@ -local grafana = (import 'grafonnet/grafana.libsonnet'); -local dashboard = grafana.dashboard; -local template = grafana.template; -local dashboardUid = 'oracledb-overview'; - -local prometheus = grafana.prometheus; -local promDatasourceName = 'prometheus_datasource'; -local getMatcher(cfg) = '%(oracledbSelector)s, instance=~"$instance"' % cfg; - -local promDatasource = { - uid: '${%s}' % promDatasourceName, -}; - -local lokiDatasource = { - uid: '$loki_datasource', -}; - -local databaseStatusPanel(matcher) = { - description: 'Database status either Up or Down. Colored to be green when Up or red when Down', - fieldConfig: { - defaults: { - color: { - mode: 'thresholds', - }, - mappings: [ - { - options: { - '0': { - index: 0, - text: 'Down', - }, - '1': { - index: 1, - text: 'OK', - }, - }, - type: 'value', - }, - ], - thresholds: { - mode: 'absolute', - steps: [ - { - color: 'red', - }, - { - color: 'green', - value: 1, - }, - ], - }, - }, - overrides: [], - }, - options: { - colorMode: 'value', - graphMode: 'none', - justifyMode: 'auto', - orientation: 'auto', - reduceOptions: { - calcs: [ - 'lastNotNull', - ], - fields: '', - values: false, - }, - textMode: 'auto', - }, - pluginVersion: '9.1.8', - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_up{' + matcher + '}', - legendFormat: '__auto', - range: true, - refId: 'A', - }, - ], - title: 'Database status', - type: 'stat', -}; - -local sessionsPanel(matcher) = { - datasource: promDatasource, - description: 'Number of sessions and the limit overtime.', - 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', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_resource_current_utilization{' + matcher + ',resource_name="sessions"}', - legendFormat: '{{instance}} - open', - range: true, - refId: 'Open', - }, - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_resource_limit_value{' + matcher + ',resource_name="sessions"}', - hide: false, - legendFormat: '{{instance}} - limit', - range: true, - refId: 'Limit', - }, - ], - title: 'Sessions', - type: 'timeseries', -}; - -local processPanel(matcher) = { - datasource: promDatasource, - description: 'Number of processes and the limit overtime.', - 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', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_resource_current_utilization{' + matcher + ',resource_name="processes"}', - legendFormat: '{{instance}} - current', - range: true, - refId: 'Current', - }, - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_resource_limit_value{' + matcher + ',resource_name="processes"}', - hide: false, - legendFormat: '{{instance}} - limit', - range: true, - refId: 'Limit', - }, - ], - title: 'Processes', - type: 'timeseries', -}; - -local alertLogPanel(matcher) = { - datasource: lokiDatasource, - description: 'Recent logs from alert log file', - options: { - dedupStrategy: 'none', - enableLogDetails: true, - prettifyLogMessage: false, - showCommonLabels: false, - showLabels: false, - showTime: false, - sortOrder: 'Descending', - wrapLogMessage: false, - }, - pluginVersion: '9.1.8', - targets: [ - { - datasource: lokiDatasource, - editorMode: 'builder', - expr: '{' + matcher + '} |= `` | (filename=~"/.*/.*/diag/rdbms/.*/.*/trace/alert_.*log" or log_type="oracledb")', - queryType: 'range', - refId: 'A', - }, - ], - title: 'Alert logs', - type: 'logs', -}; - -local waitTimerow = { - collapsed: false, - title: 'Wait time', - type: 'row', -}; - -local applicationWaitTimePanel(matcher) = { - datasource: promDatasource, - description: 'Application wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_application{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'Application wait time', - type: 'timeseries', -}; - -local commitTimePanel(matcher) = { - datasource: promDatasource, - description: 'Commit wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_commit{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'Commit wait time', - type: 'timeseries', -}; - -local concurrencyWaitTime(matcher) = { - datasource: promDatasource, - description: 'Concurrency wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_concurrency{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'Concurrency wait time', - type: 'timeseries', -}; - -local configurationWaitTime(matcher) = { - datasource: promDatasource, - description: 'Configuration wait time, in seconds waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_configuration{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'Configuration wait time', - type: 'timeseries', -}; - -local networkWaitTime(matcher) = { - datasource: promDatasource, - description: 'Network wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_network{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'Network wait time', - type: 'timeseries', -}; - -local schedulerWaitTime(matcher) = { - datasource: promDatasource, - description: 'Scheduler wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_scheduler{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'Scheduler wait time', - type: 'timeseries', -}; - -local systemIOWaitTime(matcher) = { - datasource: promDatasource, - description: 'System I/O wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_system_io{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'System I/O wait time', - type: 'timeseries', -}; - -local userIOWaitTime(matcher) = { - datasource: promDatasource, - description: 'User I/O wait time, in seconds, waiting for wait events.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 's', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_wait_time_user_io{' + matcher + '}', - legendFormat: '{{instance}}', - range: true, - refId: 'A', - }, - ], - title: 'User I/O wait time', - type: 'timeseries', -}; - -local tablespaceRow = { - collapsed: false, - title: 'Tablespace', - type: 'row', -}; - -local tablespaceSizePanel(matcher) = { - datasource: promDatasource, - description: 'Shows the size overtime for the tablespace.', - 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', - }, - { - color: 'red', - value: 80, - }, - ], - }, - unit: 'bytes', - }, - overrides: [], - }, - options: { - legend: { - calcs: [], - displayMode: 'list', - placement: 'bottom', - showLegend: true, - }, - tooltip: { - mode: 'single', - sort: 'none', - }, - }, - targets: [ - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_tablespace_bytes{' + matcher + ',tablespace=~"$tablespace"}', - legendFormat: '{{instance}} - {{tablespace}} - used', - range: true, - refId: 'Used Bytes', - }, - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_tablespace_free{' + matcher + ',tablespace=~"$tablespace"}', - hide: false, - legendFormat: '{{instance}} - {{tablespace}} - free', - range: true, - refId: 'Free', - }, - { - datasource: promDatasource, - editorMode: 'code', - expr: 'oracledb_tablespace_max_bytes{' + matcher + ',tablespace=~"$tablespace"}', - hide: false, - legendFormat: '{{instance}} - {{tablespace}} - max', - range: true, - refId: 'Max', - }, - ], - title: 'Tablespace size', - type: 'timeseries', -}; - -{ - grafanaDashboards+:: { - 'oracledb-overview.json': - dashboard.new( - 'OracleDB overview', - time_from='%s' % $._config.dashboardPeriod, - editable=false, - tags=($._config.dashboardTags), - timezone='%s' % $._config.dashboardTimezone, - refresh='%s' % $._config.dashboardRefresh, - graphTooltip='shared_crosshair', - uid=dashboardUid, - ) - .addTemplates( - std.flattenArrays( - [ - [ - { - hide: 0, - label: 'Data source', - name: promDatasourceName, - query: 'prometheus', - refresh: 1, - regex: '', - type: 'datasource', - }, - ], - if $._config.enableLokiLogs then - [ - { - hide: 0, - label: 'Loki datasource', - name: 'loki_datasource', - query: 'loki', - refresh: 1, - regex: '', - type: 'datasource', - }, - ] else [], - [ - template.new( - 'job', - promDatasource, - query='label_values(oracledb_up, job)', - label='Job', - refresh='time', - includeAll=true, - multi=true, - allValues='.+', - sort=1 - ), - template.new( - 'cluster', - promDatasource, - 'label_values(oracledb_up, cluster)' % $._config, - label='Cluster', - refresh=2, - includeAll=true, - multi=true, - allValues='.*', - hide=if $._config.enableMultiCluster then '' else 'variable', - sort=0 - ), - template.new( - name='instance', - label='Instance', - datasource='$prometheus_datasource', - query='label_values(oracledb_up, instance)', - current='', - refresh=2, - includeAll=true, - multi=true, - allValues='.+', - sort=1 - ), - template.new( - 'tablespace', - promDatasource, - query='label_values(oracledb_tablespace_bytes{%(oracledbSelector)s, instance=~"$instance"}, tablespace)' % $._config, - label='Tablespace', - refresh='time', - includeAll=true, - multi=true, - allValues='.+', - sort=1 - ), - ], - ], - ) - ) - .addPanels( - std.flattenArrays([ - [ - databaseStatusPanel(getMatcher($._config)) { gridPos: { h: 6, w: 4, x: 0, y: 0 } }, - sessionsPanel(getMatcher($._config)) { gridPos: { h: 6, w: 10, x: 4, y: 0 } }, - processPanel(getMatcher($._config)) { gridPos: { h: 6, w: 10, x: 14, y: 0 } }, - ], - if $._config.enableLokiLogs then [ - alertLogPanel(getMatcher($._config)) { gridPos: { h: 7, w: 24, x: 0, y: 6 } }, - ] else [], - [ - waitTimerow { gridPos: { h: 1, w: 24, x: 0, y: 13 } }, - ], - [ - applicationWaitTimePanel(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 0, y: 14 } }, - commitTimePanel(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 6, y: 14 } }, - concurrencyWaitTime(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 12, y: 14 } }, - configurationWaitTime(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 18, y: 14 } }, - ], - [ - networkWaitTime(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 0, y: 20 } }, - schedulerWaitTime(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 6, y: 20 } }, - systemIOWaitTime(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 12, y: 20 } }, - userIOWaitTime(getMatcher($._config)) { gridPos: { h: 6, w: 6, x: 18, y: 20 } }, - ], - [ - tablespaceRow { gridPos: { h: 1, w: 24, x: 0, y: 26 } }, - ], - [ - tablespaceSizePanel(getMatcher($._config)) { gridPos: { h: 6, w: 24, x: 0, y: 27 } }, - ], - ]) - ), - }, -} diff --git a/oracledb-mixin/dashboards_out/logs.json b/oracledb-mixin/dashboards_out/logs.json new file mode 100644 index 000000000..f21d899e3 --- /dev/null +++ b/oracledb-mixin/dashboards_out/logs.json @@ -0,0 +1,273 @@ +{ + "annotations": { + "list": [ ] + }, + "links": [ + { + "keepTime": true, + "title": "OracleDB overview", + "type": "link", + "url": "/d/oracledb_oracledb_overview" + } + ], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "description": "Logs volume grouped by \"level\" label.", + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "bars", + "fillOpacity": 50, + "stacking": { + "mode": "normal" + } + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)merg|(F|f)atal|(A|a)lert|(C|c)rit.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(E|e)(rr.*|RR.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(W|w)(arn.*|ARN.*|rn|RN)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(N|n)(otice|ote)|(I|i)(nf.*|NF.*)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "dbg.*|DBG.*|(D|d)(EBUG|ebug)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "(T|t)(race|RACE)" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "logs" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "text", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "maxDataPoints": 100, + "options": { + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "sum by (level) (count_over_time({job=~\"integrations/oracledb\",job=~\"$job\"}\n|~ \"$regex_search\"\n\n[$__auto]))\n", + "legendFormat": "{{ level }}" + } + ], + "title": "Logs volume", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "Value", + "renamePattern": "logs" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "gridPos": { + "h": 18, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 2, + "options": { + "dedupStrategy": "exact", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showTime": false, + "wrapLogMessage": false + }, + "pluginVersion": "v11.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "expr": "{job=~\"integrations/oracledb\",job=~\"$job\"} \n|~ \"$regex_search\"\n\n\n" + } + ], + "title": "Logs", + "type": "logs" + } + ], + "refresh": "1m", + "schemaVersion": 39, + "tags": [ + "oracledb-mixin" + ], + "templating": { + "list": [ + { + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "", + "type": "datasource" + }, + { + "allValue": ".*", + "datasource": { + "type": "loki", + "uid": "${loki_datasource}" + }, + "includeAll": true, + "label": "Job", + "multi": true, + "name": "job", + "query": "label_values({job=~\"integrations/oracledb\"}, job)", + "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": "", + "type": "datasource" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timezone": "default", + "title": "Oracle Database logs", + "uid": "oracledb-logs" + } \ No newline at end of file diff --git a/oracledb-mixin/dashboards_out/oracledb-overview.json b/oracledb-mixin/dashboards_out/oracledb-overview.json index 0536a15ff..ca358a43c 100644 --- a/oracledb-mixin/dashboards_out/oracledb-overview.json +++ b/oracledb-mixin/dashboards_out/oracledb-overview.json @@ -1,23 +1,37 @@ { - "__inputs": [ ], - "__requires": [ ], "annotations": { "list": [ ] }, - "editable": false, - "gnetId": null, - "graphTooltip": 1, - "hideControls": false, - "id": null, - "links": [ ], + "links": [ + { + "keepTime": true, + "title": "Logs", + "type": "link", + "url": "/d/oracledb-logs" + } + ], "panels": [ { - "description": "Database status either Up or Down. Colored to be green when Up or red when Down", + "collapsed": false, + "gridPos": { + "h": 1, + "w": 0, + "x": 0, + "y": 0 + }, + "id": 1, + "panels": [ ], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "type": "datasource", + "uid": "-- Mixed --" + }, + "description": "Database status either Up or Down. Colored to be green when Up or red when Down.", "fieldConfig": { "defaults": { - "color": { - "mode": "thresholds" - }, "mappings": [ { "options": { @@ -34,7 +48,6 @@ } ], "thresholds": { - "mode": "absolute", "steps": [ { "color": "red" @@ -45,41 +58,31 @@ } ] } - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 4, "x": 0, - "y": 0 + "y": 1 }, "id": 2, "options": { "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" + "graphMode": "none" }, - "pluginVersion": "9.1.8", + "pluginVersion": "v11.4.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_up{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "__auto", - "range": true, - "refId": "A" + "expr": "oracledb_up{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{ instance }}", + "refId": "Database status" } ], "title": "Database status", @@ -87,101 +90,63 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Number of sessions and the limit overtime.", + "description": "Number of sessions.", "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" - } + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { - "h": 6, + "h": 8, "w": 10, "x": 4, - "y": 0 + "y": 1 }, "id": 3, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_resource_current_utilization{job=~\"$job\", instance=~\"$instance\",resource_name=\"sessions\"}", - "legendFormat": "{{instance}} - open", - "range": true, - "refId": "Open" + "expr": "oracledb_resource_current_utilization{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\", resource_name=\"sessions\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{ instance }} - open", + "refId": "Sessions" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_resource_limit_value{job=~\"$job\", instance=~\"$instance\",resource_name=\"sessions\"}", - "hide": false, - "legendFormat": "{{instance}} - limit", - "range": true, - "refId": "Limit" + "expr": "oracledb_resource_limit_value{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\", resource_name=\"sessions\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{ instance }} - limit", + "refId": "Sessions limit" } ], "title": "Sessions", @@ -189,241 +154,132 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Number of processes and the limit overtime.", + "description": "Number of processes.", "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" - } + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, - "mappings": [ ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ ] + "unit": "short" + } }, "gridPos": { - "h": 6, + "h": 8, "w": 10, "x": 14, - "y": 0 + "y": 1 }, "id": 4, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_resource_current_utilization{job=~\"$job\", instance=~\"$instance\",resource_name=\"processes\"}", - "legendFormat": "{{instance}} - current", - "range": true, - "refId": "Current" + "expr": "oracledb_resource_current_utilization{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\", resource_name=\"processes\"}", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }} - current", + "refId": "Processes" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_resource_limit_value{job=~\"$job\", instance=~\"$instance\",resource_name=\"processes\"}", - "hide": false, - "legendFormat": "{{instance}} - limit", - "range": true, - "refId": "Limit" + "expr": "oracledb_resource_limit_value{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\", resource_name=\"processes\"}", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }} - limit", + "refId": "Processes limit" } ], "title": "Processes", "type": "timeseries" }, - { - "datasource": { - "uid": "$loki_datasource" - }, - "description": "Recent logs from alert log file", - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 6 - }, - "id": 5, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": false, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "pluginVersion": "9.1.8", - "targets": [ - { - "datasource": { - "uid": "$loki_datasource" - }, - "editorMode": "builder", - "expr": "{job=~\"$job\", instance=~\"$instance\"} |= `` | (filename=~\"/.*/.*/diag/rdbms/.*/.*/trace/alert_.*log\" or log_type=\"oracledb\")", - "queryType": "range", - "refId": "A" - } - ], - "title": "Alert logs", - "type": "logs" - }, { "collapsed": false, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, - "y": 13 + "y": 9 }, - "id": 6, + "id": 5, + "panels": [ ], "title": "Wait time", "type": "row" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Application wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 0, - "y": 14 + "y": 10 }, - "id": 7, + "id": 6, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_application{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_application{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "Application wait time" } ], "title": "Application wait time", @@ -431,90 +287,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Commit wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 6, - "y": 14 + "y": 10 }, - "id": 8, + "id": 7, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_commit{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_commit{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "Commit wait time" } ], "title": "Commit wait time", @@ -522,90 +341,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Concurrency wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 12, - "y": 14 + "y": 10 }, - "id": 9, + "id": 8, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_concurrency{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_concurrency{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "Concurrency wait time" } ], "title": "Concurrency wait time", @@ -613,90 +395,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Configuration wait time, in seconds waiting for wait events.", + "description": "Configuration wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 18, - "y": 14 + "y": 10 }, - "id": 10, + "id": 9, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_configuration{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_configuration{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "Configuration wait time" } ], "title": "Configuration wait time", @@ -704,90 +449,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Network wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 0, - "y": 20 + "y": 18 }, - "id": 11, + "id": 10, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_network{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_network{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "Network wait time" } ], "title": "Network wait time", @@ -795,90 +503,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "Scheduler wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 6, - "y": 20 + "y": 18 }, - "id": 12, + "id": 11, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_scheduler{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_scheduler{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "Scheduler wait time" } ], "title": "Scheduler wait time", @@ -886,90 +557,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "System I/O wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 12, - "y": 20 + "y": 18 }, - "id": 13, + "id": 12, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_system_io{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_system_io{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "System I/O wait time" } ], "title": "System I/O wait time", @@ -977,90 +611,53 @@ }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, "description": "User I/O wait time, in seconds, waiting for wait events.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "s" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 6, "x": 18, - "y": 20 + "y": 18 }, - "id": 14, + "id": 13, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_wait_time_user_io{job=~\"$job\", instance=~\"$instance\"}", - "legendFormat": "{{instance}}", - "range": true, - "refId": "A" + "expr": "rate(oracledb_wait_time_user_io{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "1m", + "legendFormat": "{{ instance }}", + "refId": "User I/O wait time" } ], "title": "User I/O wait time", @@ -1070,122 +667,85 @@ "collapsed": false, "gridPos": { "h": 1, - "w": 24, + "w": 0, "x": 0, "y": 26 }, - "id": 15, + "id": 14, + "panels": [ ], "title": "Tablespace", "type": "row" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "description": "Shows the size overtime for the tablespace.", + "description": "Shows the size over time for the tablespace.", "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" - }, - { - "color": "red", - "value": 80 - } - ] + "gradientMode": "opacity", + "lineInterpolation": "smooth", + "lineWidth": 2, + "showPoints": "never", + "spanNulls": false }, "unit": "bytes" - }, - "overrides": [ ] + } }, "gridPos": { - "h": 6, + "h": 8, "w": 24, "x": 0, "y": 27 }, - "id": 16, + "id": 15, "options": { "legend": { "calcs": [ ], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "displayMode": "list" }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, + "pluginVersion": "v11.0.0", "targets": [ { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_tablespace_bytes{job=~\"$job\", instance=~\"$instance\",tablespace=~\"$tablespace\"}", - "legendFormat": "{{instance}} - {{tablespace}} - used", - "range": true, - "refId": "Used Bytes" + "expr": "oracledb_tablespace_bytes{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\",tablespace=~\"$tablespace\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{ instance }} - {{ tablespace }} - used", + "refId": "Tablespace used bytes" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_tablespace_free{job=~\"$job\", instance=~\"$instance\",tablespace=~\"$tablespace\"}", - "hide": false, - "legendFormat": "{{instance}} - {{tablespace}} - free", - "range": true, - "refId": "Free" + "expr": "oracledb_tablespace_free{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\",tablespace=~\"$tablespace\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{ instance }} - {{ tablespace }} - free", + "refId": "Tablespace free bytes" }, { "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "editorMode": "code", - "expr": "oracledb_tablespace_max_bytes{job=~\"$job\", instance=~\"$instance\",tablespace=~\"$tablespace\"}", - "hide": false, - "legendFormat": "{{instance}} - {{tablespace}} - max", - "range": true, - "refId": "Max" + "expr": "oracledb_tablespace_max_bytes{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\",tablespace=~\"$tablespace\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{ instance }} - {{ tablespace }} - max", + "refId": "Tablespace max bytes" } ], "title": "Tablespace size", @@ -1193,120 +753,71 @@ } ], "refresh": "1m", - "rows": [ ], - "schemaVersion": 14, - "style": "dark", + "schemaVersion": 39, "tags": [ "oracledb-mixin" ], "templating": { "list": [ { - "hide": 0, - "label": "Data source", + "label": "Prometheus data source", "name": "prometheus_datasource", "query": "prometheus", - "refresh": 1, - "regex": "", - "type": "datasource" - }, - { - "hide": 0, - "label": "Loki datasource", - "name": "loki_datasource", - "query": "loki", - "refresh": 1, "regex": "", "type": "datasource" }, { "allValue": ".+", - "current": { }, "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "Job", "multi": true, "name": "job", - "options": [ ], - "query": "label_values(oracledb_up, job)", + "query": "label_values(oracledb_up{job=~\"integrations/oracledb\"}, job)", "refresh": 2, - "regex": "", "sort": 1, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" }, { - "allValue": ".*", - "current": { }, + "allValue": ".+", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 2, - "includeAll": true, - "label": "Cluster", - "multi": true, - "name": "cluster", - "options": [ ], - "query": "label_values(oracledb_up, cluster)", - "refresh": 2, - "regex": "", - "sort": 0, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".+", - "current": { - "text": "", - "value": "" - }, - "datasource": "$prometheus_datasource", - "hide": 0, "includeAll": true, "label": "Instance", "multi": true, "name": "instance", - "options": [ ], - "query": "label_values(oracledb_up, instance)", + "query": "label_values(oracledb_up{job=~\"integrations/oracledb\",job=~\"$job\"}, instance)", "refresh": 2, - "regex": "", "sort": 1, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" }, { - "allValue": ".+", - "current": { }, + "allValue": ".*", "datasource": { + "type": "prometheus", "uid": "${prometheus_datasource}" }, - "hide": 0, "includeAll": true, "label": "Tablespace", "multi": true, "name": "tablespace", - "options": [ ], - "query": "label_values(oracledb_tablespace_bytes{job=~\"$job\", instance=~\"$instance\"}, tablespace)", + "query": "label_values(oracledb_up{job=~\"integrations/oracledb\",job=~\"$job\",instance=~\"$instance\"}, tablespace)", "refresh": 2, - "regex": "", "sort": 1, - "tagValuesQuery": "", - "tags": [ ], - "tagsQuery": "", - "type": "query", - "useTags": false + "type": "query" + }, + { + "hide": 2, + "label": "Loki data source", + "name": "loki_datasource", + "query": "loki", + "regex": "", + "type": "datasource" } ] }, @@ -1314,33 +825,7 @@ "from": "now-1h", "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": "OracleDB overview", - "uid": "oracledb-overview", - "version": 0 + "title": "Oracle Database overview", + "uid": "oracledb_oracledb_overview" } \ No newline at end of file diff --git a/oracledb-mixin/g.libsonnet b/oracledb-mixin/g.libsonnet new file mode 100644 index 000000000..e6a2060ee --- /dev/null +++ b/oracledb-mixin/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/main.libsonnet' diff --git a/oracledb-mixin/jsonnetfile.json b/oracledb-mixin/jsonnetfile.json index 65cebf84b..d74ae4e33 100644 --- a/oracledb-mixin/jsonnetfile.json +++ b/oracledb-mixin/jsonnetfile.json @@ -1,15 +1,42 @@ { "version": 1, "dependencies": [ - { - "source": { - "git": { - "remote": "https://github.com/grafana/grafonnet-lib.git", - "subdir": "grafonnet" - } - }, - "version": "master" - } + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "common-lib" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet.git", + "subdir": "gen/grafonnet-v11.4.0" + } + }, + "version": "main" + }, + { + "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 -} + } \ No newline at end of file diff --git a/oracledb-mixin/links.libsonnet b/oracledb-mixin/links.libsonnet new file mode 100644 index 000000000..185bfa70b --- /dev/null +++ b/oracledb-mixin/links.libsonnet @@ -0,0 +1,17 @@ +local g = import './g.libsonnet'; + +{ + local link = g.dashboard.link, + new(this):: + { + oracledbOverview: + link.link.new('OracleDB overview', '/d/' + this.grafana.dashboards['oracledb-overview.json'].uid) + + link.link.options.withKeepTime(true), + + } + + if this.config.enableLokiLogs then { + logs: + g.dashboard.link.link.new('Logs', '/d/' + this.grafana.dashboards['logs.json'].uid) + + g.dashboard.link.link.options.withKeepTime(true), + } else {}, +} diff --git a/oracledb-mixin/main.libsonnet b/oracledb-mixin/main.libsonnet new file mode 100644 index 000000000..a4b0feb5a --- /dev/null +++ b/oracledb-mixin/main.libsonnet @@ -0,0 +1,49 @@ +local alerts = import './alerts.libsonnet'; +local config = import './config.libsonnet'; +local dashboards = import './dashboards.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 + this.config.tablespaceLabels, + varMetric='oracledb_up', + 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/oracledb-mixin/mixin.libsonnet b/oracledb-mixin/mixin.libsonnet index 119d2cdde..3d5b27f9b 100644 --- a/oracledb-mixin/mixin.libsonnet +++ b/oracledb-mixin/mixin.libsonnet @@ -1,3 +1,35 @@ -(import 'alerts/alerts.libsonnet') + -(import 'dashboards/dashboards.libsonnet') + -(import 'config.libsonnet') +local oracledblib = import './main.libsonnet'; +local util = import 'grafana-cloud-integration-utils/util.libsonnet'; + +local oracledb = + oracledblib.new() + + oracledblib.withConfigMixin( + { + filteringSelector: 'job=~"integrations/oracledb"', + uid: 'oracledb', + enableLokiLogs: true, + } + ); + +local optional_labels = { + cluster+: { + allValue: '.*', + }, + tablespace+: { + label: 'Tablespace', + allValue: '.*', + }, +}; + +{ + grafanaDashboards+:: { + [fname]: + local dashboard = oracledb.grafana.dashboards[fname]; + dashboard + util.patch_variables(dashboard, optional_labels) + + for fname in std.objectFields(oracledb.grafana.dashboards) + }, + + prometheusAlerts+:: oracledb.prometheus.alerts, + prometheusRules+:: oracledb.prometheus.recordingRules, +} diff --git a/oracledb-mixin/panels.libsonnet b/oracledb-mixin/panels.libsonnet new file mode 100644 index 000000000..547072d15 --- /dev/null +++ b/oracledb-mixin/panels.libsonnet @@ -0,0 +1,157 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; + +{ + new(this):: + { + local signals = this.signals, + + databaseStatusPanel: + g.panel.stat.new(title='Database status') + + g.panel.stat.queryOptions.withTargets([ + signals.sessions.databaseStatus.asTarget(), + ]) + + g.panel.stat.panelOptions.withDescription('Database status either Up or Down. Colored to be green when Up or red when Down.') + + g.panel.stat.standardOptions.withMappings([ + { + options: { + '0': { + index: 0, + text: 'Down', + }, + '1': { + index: 1, + text: 'OK', + }, + }, + type: 'value', + }, + ]) + + g.panel.stat.standardOptions.thresholds.withSteps([ + g.panel.stat.thresholdStep.withColor('red'), + g.panel.stat.thresholdStep.withColor('green') + g.panel.stat.thresholdStep.withValue(1), + ]) + + g.panel.stat.options.withColorMode('value') + + g.panel.stat.options.withGraphMode('none'), + + sessionsPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Sessions', + targets=[ + signals.sessions.sessions.asTarget(), + signals.sessions.sessionsLimit.asTarget(), + ], + description='Number of sessions.' + ) + + g.panel.timeSeries.standardOptions.withUnit('short') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + processesPanel: + commonlib.panels.generic.timeSeries.base.new( + 'Processes', + targets=[ + signals.sessions.processes.asTarget() { interval: '1m' }, + signals.sessions.processesLimit.asTarget() { interval: '1m' }, + ], + description='Number of processes.' + ) + + g.panel.timeSeries.standardOptions.withUnit('short') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + applicationWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Application wait time', + targets=[signals.waittimes.applicationWaitTime.asTarget() { interval: '1m' }], + description='Application wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + commitWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Commit wait time', + targets=[signals.waittimes.commitWaitTime.asTarget() { interval: '1m' }], + description='Commit wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + concurrencyWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Concurrency wait time', + targets=[signals.waittimes.concurrencyWaitTime.asTarget() { interval: '1m' }], + description='Concurrency wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + configurationWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Configuration wait time', + targets=[signals.waittimes.configurationWaitTime.asTarget() { interval: '1m' }], + description='Configuration wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + networkWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Network wait time', + targets=[signals.waittimes.networkWaitTime.asTarget() { interval: '1m' }], + description='Network wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + schedulerWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Scheduler wait time', + targets=[signals.waittimes.schedulerWaitTime.asTarget() { interval: '1m' }], + description='Scheduler wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + systemIOWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'System I/O wait time', + targets=[signals.waittimes.systemIOWaitTime.asTarget() { interval: '1m' }], + description='System I/O wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + userIOWaitTimePanel: + commonlib.panels.generic.timeSeries.base.new( + 'User I/O wait time', + targets=[signals.waittimes.userIOWaitTime.asTarget() { interval: '1m' }], + description='User I/O wait time, in seconds, waiting for wait events.' + ) + + g.panel.timeSeries.standardOptions.withUnit('s') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + + tablespaceSizePanel: + commonlib.panels.generic.timeSeries.base.new( + 'Tablespace size', + targets=[ + signals.tablespace.tablespaceUsed.asTarget(), + signals.tablespace.tablespaceFree.asTarget(), + signals.tablespace.tablespaceMax.asTarget(), + ], + description='Shows the size over time for the tablespace.' + ) + + g.panel.timeSeries.standardOptions.withUnit('bytes') + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + g.panel.timeSeries.fieldConfig.defaults.custom.withSpanNulls(false), + }, +} diff --git a/oracledb-mixin/rows.libsonnet b/oracledb-mixin/rows.libsonnet new file mode 100644 index 000000000..fd3f69ee2 --- /dev/null +++ b/oracledb-mixin/rows.libsonnet @@ -0,0 +1,41 @@ +local g = import './g.libsonnet'; + +{ + new(this): { + // Database status and connection metrics + overview: + g.panel.row.new('Overview') + + g.panel.row.withPanels( + [ + this.grafana.panels.databaseStatusPanel + g.panel.stat.gridPos.withW(4), + this.grafana.panels.sessionsPanel + g.panel.timeSeries.gridPos.withW(10), + this.grafana.panels.processesPanel + g.panel.timeSeries.gridPos.withW(10), + ] + ), + + // Wait time metrics + waittimes: + g.panel.row.new('Wait time') + + g.panel.row.withPanels( + [ + this.grafana.panels.applicationWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.commitWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.concurrencyWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.configurationWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.networkWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.schedulerWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.systemIOWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + this.grafana.panels.userIOWaitTimePanel + g.panel.timeSeries.gridPos.withW(6), + ] + ), + + // Tablespace metrics + tablespace: + g.panel.row.new('Tablespace') + + g.panel.row.withPanels( + [ + this.grafana.panels.tablespaceSizePanel + g.panel.timeSeries.gridPos.withW(24), + ] + ), + }, +} diff --git a/oracledb-mixin/signals/sessions.libsonnet b/oracledb-mixin/signals/sessions.libsonnet new file mode 100644 index 000000000..6b02a0407 --- /dev/null +++ b/oracledb-mixin/signals/sessions.libsonnet @@ -0,0 +1,80 @@ +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'oracledb_up', + }, + signals: { + databaseStatus: { + name: 'Database status', + nameShort: 'Status', + type: 'gauge', + description: 'Database status indicator - 1 for up, 0 for down.', + unit: 'short', + sources: { + prometheus: { + expr: 'oracledb_up{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + sessions: { + name: 'Sessions', + nameShort: 'Sessions', + type: 'gauge', + description: 'Current number of sessions.', + unit: 'short', + sources: { + prometheus: { + expr: 'oracledb_resource_current_utilization{%(queriesSelector)s, resource_name="sessions"}', + legendCustomTemplate: '{{ instance }} - open', + }, + }, + }, + sessionsLimit: { + name: 'Sessions limit', + nameShort: 'Sessions limit', + type: 'gauge', + description: 'Maximum number of sessions allowed.', + unit: 'short', + sources: { + prometheus: { + expr: 'oracledb_resource_limit_value{%(queriesSelector)s, resource_name="sessions"}', + legendCustomTemplate: '{{ instance }} - limit', + }, + }, + }, + processes: { + name: 'Processes', + nameShort: 'Processes', + type: 'gauge', + description: 'Current number of processes.', + unit: 'short', + sources: { + prometheus: { + expr: 'oracledb_resource_current_utilization{%(queriesSelector)s, resource_name="processes"}', + legendCustomTemplate: '{{ instance }} - current', + }, + }, + }, + processesLimit: { + name: 'Processes limit', + nameShort: 'Processes limit', + type: 'gauge', + description: 'Maximum number of processes allowed.', + unit: 'short', + sources: { + prometheus: { + expr: 'oracledb_resource_limit_value{%(queriesSelector)s, resource_name="processes"}', + legendCustomTemplate: '{{ instance }} - limit', + }, + }, + }, + }, + } diff --git a/oracledb-mixin/signals/tablespace.libsonnet b/oracledb-mixin/signals/tablespace.libsonnet new file mode 100644 index 000000000..70b2228e5 --- /dev/null +++ b/oracledb-mixin/signals/tablespace.libsonnet @@ -0,0 +1,54 @@ +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels + this.tablespaceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'sum', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'oracledb_tablespace_bytes', + }, + signals: { + tablespaceUsed: { + name: 'Tablespace used bytes', + nameShort: 'Used bytes', + type: 'gauge', + description: 'Tablespace used bytes.', + unit: 'bytes', + sources: { + prometheus: { + expr: 'oracledb_tablespace_bytes{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }} - {{ tablespace }} - used', + }, + }, + }, + tablespaceFree: { + name: 'Tablespace free bytes', + nameShort: 'Free bytes', + type: 'gauge', + description: 'Tablespace free bytes.', + unit: 'bytes', + sources: { + prometheus: { + expr: 'oracledb_tablespace_free{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }} - {{ tablespace }} - free', + }, + }, + }, + tablespaceMax: { + name: 'Tablespace max bytes', + nameShort: 'Max bytes', + type: 'gauge', + description: 'Tablespace maximum bytes.', + unit: 'bytes', + sources: { + prometheus: { + expr: 'oracledb_tablespace_max_bytes{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }} - {{ tablespace }} - max', + }, + }, + }, + }, + } diff --git a/oracledb-mixin/signals/waittimes.libsonnet b/oracledb-mixin/signals/waittimes.libsonnet new file mode 100644 index 000000000..17a2e3b9e --- /dev/null +++ b/oracledb-mixin/signals/waittimes.libsonnet @@ -0,0 +1,119 @@ +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + enableLokiLogs: this.enableLokiLogs, + aggLevel: 'none', + aggFunction: 'avg', + alertsInterval: '5m', + discoveryMetric: { + prometheus: 'oracledb_wait_time_application', + }, + signals: { + applicationWaitTime: { + name: 'Application wait time', + nameShort: 'Application wait', + type: 'counter', + description: 'Application wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_application{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + commitWaitTime: { + name: 'Commit wait time', + nameShort: 'Commit wait', + type: 'counter', + description: 'Commit wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_commit{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + concurrencyWaitTime: { + name: 'Concurrency wait time', + nameShort: 'Concurrency wait', + type: 'counter', + description: 'Concurrency wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_concurrency{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + configurationWaitTime: { + name: 'Configuration wait time', + nameShort: 'Configuration wait', + type: 'counter', + description: 'Configuration wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_configuration{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + networkWaitTime: { + name: 'Network wait time', + nameShort: 'Network wait', + type: 'counter', + description: 'Network wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_network{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + schedulerWaitTime: { + name: 'Scheduler wait time', + nameShort: 'Scheduler wait', + type: 'counter', + description: 'Scheduler wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_scheduler{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + systemIOWaitTime: { + name: 'System I/O wait time', + nameShort: 'System I/O wait', + type: 'counter', + description: 'System I/O wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_system_io{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + userIOWaitTime: { + name: 'User I/O wait time', + nameShort: 'User I/O wait', + type: 'counter', + description: 'User I/O wait time in seconds waiting for wait events.', + unit: 'seconds', + sources: { + prometheus: { + expr: 'oracledb_wait_time_user_io{%(queriesSelector)s}', + legendCustomTemplate: '{{ instance }}', + }, + }, + }, + }, + }