From c66541cba246bc01bfeecbda2d504b9acd100d1f Mon Sep 17 00:00:00 2001 From: v-zhuravlev Date: Mon, 29 Jul 2024 15:43:51 +0800 Subject: [PATCH] Add jvm observ lib (#1220) * Add process lib * Add jvm-observ-lib * Update jvm-mixin * Remove empty rules file * Update spring boot mixin * Update jvm mixin * Conditional rows inclusing * Update README * Fix otel uptime signal query * Move panels inside rows. Use resolveCollapsedFlagOnRows * Update lib * Fix commonlib(in case of stub type) * Update deps * Remove collapsed rows --- common-lib/common/signal/signal.libsonnet | 2 +- common-lib/common/signal/stub.libsonnet | 10 +- jvm-mixin/Makefile | 8 + jvm-mixin/README.md | 8 +- jvm-mixin/alerts.libsonnet | 23 - jvm-mixin/config.libsonnet | 10 + jvm-mixin/dashboards.libsonnet | 7 - jvm-mixin/jsonnetfile.json | 22 + jvm-mixin/jvm_rev1.libsonnet | 583 --- jvm-mixin/mixin.libsonnet | 11 +- jvm-observ-lib/.lint | 13 + jvm-observ-lib/README.md | 39 + jvm-observ-lib/alerts.libsonnet | 54 + jvm-observ-lib/config.libsonnet | 22 + jvm-observ-lib/dashboards.libsonnet | 40 + jvm-observ-lib/g.libsonnet | 1 + jvm-observ-lib/jsonnetfile.json | 31 + jvm-observ-lib/main.libsonnet | 59 + jvm-observ-lib/mixin.libsonnet | 1 + jvm-observ-lib/panels.libsonnet | 154 + jvm-observ-lib/rows.libsonnet | 50 + jvm-observ-lib/signals/buffers.libsonnet | 85 + jvm-observ-lib/signals/classes.libsonnet | 34 + jvm-observ-lib/signals/gc.libsonnet | 391 ++ jvm-observ-lib/signals/hikari.libsonnet | 236 + jvm-observ-lib/signals/logback.libsonnet | 63 + jvm-observ-lib/signals/memory.libsonnet | 129 + jvm-observ-lib/signals/threads.libsonnet | 108 + process-observ-lib/.lint | 0 process-observ-lib/Makefile | 34 + process-observ-lib/README.md | 18 + process-observ-lib/config.libsonnet | 27 + process-observ-lib/dashboards.libsonnet | 19 + process-observ-lib/g.libsonnet | 1 + process-observ-lib/jsonnetfile.json | 24 + process-observ-lib/main.libsonnet | 44 + process-observ-lib/mixin.libsonnet | 15 + process-observ-lib/panels.libsonnet | 34 + process-observ-lib/rows.libsonnet | 16 + process-observ-lib/signals/process.libsonnet | 175 + process-observ-lib/signals/system.libsonnet | 76 + spring-boot-mixin/.lint | 4 +- spring-boot-mixin/Makefile | 8 + spring-boot-mixin/README.md | 4 + spring-boot-mixin/config.libsonnet | 10 + .../spring-boot-statistics_rev2.json | 3897 ----------------- spring-boot-mixin/jsonnetfile.json | 22 + spring-boot-mixin/mixin.libsonnet | 11 +- 48 files changed, 2101 insertions(+), 4532 deletions(-) create mode 100644 jvm-mixin/Makefile delete mode 100644 jvm-mixin/alerts.libsonnet create mode 100644 jvm-mixin/config.libsonnet delete mode 100644 jvm-mixin/dashboards.libsonnet create mode 100644 jvm-mixin/jsonnetfile.json delete mode 100644 jvm-mixin/jvm_rev1.libsonnet create mode 100644 jvm-observ-lib/.lint create mode 100644 jvm-observ-lib/README.md create mode 100644 jvm-observ-lib/alerts.libsonnet create mode 100644 jvm-observ-lib/config.libsonnet create mode 100644 jvm-observ-lib/dashboards.libsonnet create mode 100644 jvm-observ-lib/g.libsonnet create mode 100644 jvm-observ-lib/jsonnetfile.json create mode 100644 jvm-observ-lib/main.libsonnet create mode 100644 jvm-observ-lib/mixin.libsonnet create mode 100644 jvm-observ-lib/panels.libsonnet create mode 100644 jvm-observ-lib/rows.libsonnet create mode 100644 jvm-observ-lib/signals/buffers.libsonnet create mode 100644 jvm-observ-lib/signals/classes.libsonnet create mode 100644 jvm-observ-lib/signals/gc.libsonnet create mode 100644 jvm-observ-lib/signals/hikari.libsonnet create mode 100644 jvm-observ-lib/signals/logback.libsonnet create mode 100644 jvm-observ-lib/signals/memory.libsonnet create mode 100644 jvm-observ-lib/signals/threads.libsonnet create mode 100644 process-observ-lib/.lint create mode 100644 process-observ-lib/Makefile create mode 100644 process-observ-lib/README.md create mode 100644 process-observ-lib/config.libsonnet create mode 100644 process-observ-lib/dashboards.libsonnet create mode 100644 process-observ-lib/g.libsonnet create mode 100644 process-observ-lib/jsonnetfile.json create mode 100644 process-observ-lib/main.libsonnet create mode 100644 process-observ-lib/mixin.libsonnet create mode 100644 process-observ-lib/panels.libsonnet create mode 100644 process-observ-lib/rows.libsonnet create mode 100644 process-observ-lib/signals/process.libsonnet create mode 100644 process-observ-lib/signals/system.libsonnet create mode 100644 spring-boot-mixin/Makefile create mode 100644 spring-boot-mixin/README.md create mode 100644 spring-boot-mixin/config.libsonnet delete mode 100644 spring-boot-mixin/dashboards/spring-boot-statistics_rev2.json create mode 100644 spring-boot-mixin/jsonnetfile.json diff --git a/common-lib/common/signal/signal.libsonnet b/common-lib/common/signal/signal.libsonnet index dd62b9fd2..044778028 100644 --- a/common-lib/common/signal/signal.libsonnet +++ b/common-lib/common/signal/signal.libsonnet @@ -283,7 +283,7 @@ local stub = import './stub.libsonnet'; ) else if type == 'stub' then stub.new( - name=name, + signalName=name, type=type, ), }, diff --git a/common-lib/common/signal/stub.libsonnet b/common-lib/common/signal/stub.libsonnet index 987d598ce..3b72ba1de 100644 --- a/common-lib/common/signal/stub.libsonnet +++ b/common-lib/common/signal/stub.libsonnet @@ -4,7 +4,7 @@ local signalUtils = import './utils.libsonnet'; { new( - name, + signalName, type, ): { @@ -18,21 +18,21 @@ local signalUtils = import './utils.libsonnet'; //Return query, usable in alerts/recording rules. No aggregation is applied. asRuleExpression():: {}, //Return as timeSeriesPanel - asTimeSeries(name):: + asTimeSeries(name=signalName):: g.panel.text.new('') + g.panel.text.panelOptions.withTransparent(true) + g.panel.text.panelOptions.withDescription(name + ': Signal not found.') + g.panel.text.options.withContent(''), //Return as statPanel - asStat(name):: + asStat(name=signalName):: self.asTimeSeries(), - asTable(name, format):: + asTable(name=signalName, format):: self.asTimeSeries(), //Return as timeSeriesPanel - asGauge(name):: + asGauge(name=signalName):: self.asTimeSeries(), asTableColumn(override, format):: {}, }, diff --git a/jvm-mixin/Makefile b/jvm-mixin/Makefile new file mode 100644 index 000000000..4ba658da4 --- /dev/null +++ b/jvm-mixin/Makefile @@ -0,0 +1,8 @@ +lint: + mixtool lint mixin.libsonnet + +build: + mixtool generate all mixin.libsonnet + +clean: + rm -rf dashboards_out alerts.yaml rules.yaml \ No newline at end of file diff --git a/jvm-mixin/README.md b/jvm-mixin/README.md index cf436b33e..b5a020f46 100644 --- a/jvm-mixin/README.md +++ b/jvm-mixin/README.md @@ -1,6 +1,4 @@ -# JVM Integration - -This integration works with the [Java client](https://github.com/prometheus/client_java). It requires each JVM application to export the metrics with the client. - -The dashboard is a fork of [Joel Takvorian's design](https://grafana.com/grafana/dashboards/3066). +# JVM integration +This integration works with the [Java client](https://prometheus.github.io/client_java/instrumentation/jvm/). It requires each JVM application to export the metrics with the client. +Uses [JVM observability lib](../jvm-observ-lib/). diff --git a/jvm-mixin/alerts.libsonnet b/jvm-mixin/alerts.libsonnet deleted file mode 100644 index 13de37e94..000000000 --- a/jvm-mixin/alerts.libsonnet +++ /dev/null @@ -1,23 +0,0 @@ -{ - prometheusAlerts+:: { - groups+: [{ - name: 'jvm', - rules: [ - { - alert: 'JvmMemoryFillingUp', - expr: ||| - jvm_memory_used_bytes / jvm_memory_max_bytes{area="heap"} > 0.8 - |||, - 'for': '5m', - labels: { - severity: 'warning', - }, - annotations: { - summary: 'JVM memory filling up.', - description: 'JVM memory usage is at {{ printf "%%.0f" $value }} percent over the last 5 minutes on {{$labels.instance}}, which is above the threshold of 80%.', - }, - }, - ], - }], - }, -} diff --git a/jvm-mixin/config.libsonnet b/jvm-mixin/config.libsonnet new file mode 100644 index 000000000..6521f7fe9 --- /dev/null +++ b/jvm-mixin/config.libsonnet @@ -0,0 +1,10 @@ +{ + filteringSelector: 'job!=""', + groupLabels: ['job'], + instanceLabels: ['instance'], + uid: 'jvm', + dashboardNamePrefix: '', + dashboardTags: ['java', 'jvm', 'prometheus_client'], + metricsSource: 'prometheus', + alertHeapWarning: 80, // % +} diff --git a/jvm-mixin/dashboards.libsonnet b/jvm-mixin/dashboards.libsonnet deleted file mode 100644 index e9c366708..000000000 --- a/jvm-mixin/dashboards.libsonnet +++ /dev/null @@ -1,7 +0,0 @@ -local dashboard = import 'jvm_rev1.libsonnet'; - -{ - grafanaDashboards+:: { - 'jvm-dashboard.json': dashboard, - }, -} diff --git a/jvm-mixin/jsonnetfile.json b/jvm-mixin/jsonnetfile.json new file mode 100644 index 000000000..534a29c92 --- /dev/null +++ b/jvm-mixin/jsonnetfile.json @@ -0,0 +1,22 @@ +{ + "version": 1, + "dependencies": [ + { + "source": { + "local": { + "directory": "../common-lib" + } + }, + "version": "" + }, + { + "source": { + "local": { + "directory": "../jvm-observ-lib" + } + }, + "version": "" + } + ], + "legacyImports": true +} \ No newline at end of file diff --git a/jvm-mixin/jvm_rev1.libsonnet b/jvm-mixin/jvm_rev1.libsonnet deleted file mode 100644 index 3f87ad33d..000000000 --- a/jvm-mixin/jvm_rev1.libsonnet +++ /dev/null @@ -1,583 +0,0 @@ -{ - __inputs: [ - { - name: 'datasource', - label: 'Data Source', - description: 'A prometheus datasource with JMX Exporter scraping', - type: 'datasource', - pluginId: 'prometheus', - pluginName: 'Prometheus', - }, - ], - __requires: [ - { - type: 'grafana', - id: 'grafana', - name: 'Grafana', - version: '4.5.0-pre1', - }, - { - type: 'panel', - id: 'graph', - name: 'Graph', - version: '', - }, - { - type: 'datasource', - id: 'prometheus', - name: 'Prometheus', - version: '1.0.0', - }, - ], - annotations: { - list: [], - }, - description: 'Dashboard for JVM metrics with Prometheus / JMX Exporter', - editable: true, - gnetId: 3066, - graphTooltip: 0, - hideControls: false, - id: null, - links: [], - refresh: '30s', - rows: [ - { - collapse: false, - height: 250, - panels: [ - { - aliasColors: {}, - bars: false, - dashLength: 10, - dashes: false, - datasource: '${datasource}', - fill: 1, - id: 2, - legend: { - alignAsTable: true, - avg: true, - current: true, - max: true, - min: true, - rightSide: true, - show: true, - total: false, - values: true, - }, - lines: true, - linewidth: 1, - links: [], - nullPointMode: 'null', - percentage: false, - pointradius: 5, - points: false, - renderer: 'flot', - repeat: null, - seriesOverrides: [], - spaceLength: 10, - span: 12, - stack: false, - steppedLine: false, - targets: [ - { - expr: 'jvm_memory_used_bytes{job=~"$job", instance=~"$instance"}', - format: 'time_series', - interval: '', - - legendFormat: '{{area}} memory [{{instance}}]', - metric: 'jvm_memory_used_bytes', - refId: 'A', - step: 5, - }, - ], - thresholds: [], - timeFrom: null, - timeShift: null, - title: 'Memory used', - tooltip: { - shared: true, - sort: 0, - value_type: 'individual', - }, - type: 'graph', - xaxis: { - buckets: null, - mode: 'time', - name: null, - show: true, - values: [], - }, - yaxes: [ - { - format: 'bytes', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - { - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - ], - }, - ], - repeat: null, - repeatIteration: null, - repeatRowId: null, - showTitle: false, - title: 'Dashboard Row', - titleSize: 'h6', - }, - { - collapse: false, - height: 250, - panels: [ - { - aliasColors: {}, - bars: false, - dashLength: 10, - dashes: false, - datasource: '${datasource}', - fill: 1, - id: 3, - legend: { - avg: false, - current: false, - max: false, - min: false, - show: true, - total: false, - values: false, - }, - lines: true, - linewidth: 1, - links: [], - nullPointMode: 'null', - percentage: false, - pointradius: 5, - points: false, - renderer: 'flot', - seriesOverrides: [], - spaceLength: 10, - span: 6, - stack: false, - steppedLine: false, - targets: [ - { - expr: 'jvm_threads_current{job=~"$job", instance=~"$instance"}', - format: 'time_series', - - legendFormat: 'current [{{instance}}]', - metric: 'jvm_threads_current', - refId: 'A', - step: 10, - }, - { - expr: 'jvm_threads_daemon{job=~"$job", instance=~"$instance"}', - format: 'time_series', - - legendFormat: 'daemon [{{instance}}]', - metric: 'jvm_threads_daemon', - refId: 'B', - step: 10, - }, - ], - thresholds: [], - timeFrom: null, - timeShift: null, - title: 'Threads used', - tooltip: { - shared: true, - sort: 0, - value_type: 'individual', - }, - type: 'graph', - xaxis: { - buckets: null, - mode: 'time', - name: null, - show: true, - values: [], - }, - yaxes: [ - { - decimals: 0, - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - { - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - ], - }, - { - aliasColors: {}, - bars: false, - dashLength: 10, - dashes: false, - datasource: '${datasource}', - fill: 1, - id: 4, - legend: { - avg: false, - current: false, - max: false, - min: false, - show: true, - total: false, - values: false, - }, - lines: true, - linewidth: 1, - links: [], - nullPointMode: 'null', - percentage: false, - pointradius: 5, - points: false, - renderer: 'flot', - seriesOverrides: [], - spaceLength: 10, - span: 6, - stack: false, - steppedLine: false, - targets: [ - { - expr: 'jvm_classes_loaded{job=~"$job", instance=~"$instance"}', - format: 'time_series', - interval: '', - - legendFormat: 'loaded [{{instance}}]', - metric: 'jvm_classes_loaded', - refId: 'A', - step: 10, - }, - ], - thresholds: [], - timeFrom: null, - timeShift: null, - title: 'Class loading', - tooltip: { - shared: true, - sort: 0, - value_type: 'individual', - }, - type: 'graph', - xaxis: { - buckets: null, - mode: 'time', - name: null, - show: true, - values: [], - }, - yaxes: [ - { - decimals: 0, - format: 'short', - label: '', - logBase: 1, - max: null, - min: null, - show: true, - }, - { - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - ], - }, - ], - repeat: null, - repeatIteration: null, - repeatRowId: null, - showTitle: false, - title: 'Dashboard Row', - titleSize: 'h6', - }, - { - collapse: false, - height: 250, - panels: [ - { - aliasColors: {}, - bars: false, - dashLength: 10, - dashes: false, - datasource: '${datasource}', - fill: 1, - id: 5, - legend: { - avg: false, - current: false, - max: false, - min: false, - show: true, - total: false, - values: false, - }, - lines: true, - linewidth: 1, - links: [], - nullPointMode: 'null', - percentage: false, - pointradius: 5, - points: false, - renderer: 'flot', - seriesOverrides: [], - spaceLength: 10, - span: 6, - stack: false, - steppedLine: false, - targets: [ - { - expr: 'rate(jvm_gc_collection_seconds_sum{job=~"$job", instance=~"$instance"}[$__rate_interval])', - format: 'time_series', - interval: '', - - legendFormat: '{{gc}} [{{instance}}]', - metric: 'jvm_gc_collection_seconds_sum', - refId: 'A', - step: 10, - }, - ], - thresholds: [], - timeFrom: null, - timeShift: null, - title: 'GC time rate', - tooltip: { - shared: true, - sort: 0, - value_type: 'individual', - }, - type: 'graph', - xaxis: { - buckets: null, - mode: 'time', - name: null, - show: true, - values: [], - }, - yaxes: [ - { - format: 's', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - { - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - ], - }, - { - aliasColors: {}, - bars: false, - dashLength: 10, - dashes: false, - datasource: '${datasource}', - fill: 1, - id: 6, - legend: { - avg: false, - current: false, - max: false, - min: false, - show: true, - total: false, - values: false, - }, - lines: true, - linewidth: 1, - links: [], - nullPointMode: 'null', - percentage: false, - pointradius: 5, - points: false, - renderer: 'flot', - seriesOverrides: [], - spaceLength: 10, - span: 6, - stack: false, - steppedLine: false, - targets: [ - { - expr: 'jvm_gc_collection_seconds_count{job=~"$job", instance=~"$instance"}', - format: 'time_series', - interval: '', - - legendFormat: '{{gc}} [{{instance}}]', - metric: '', - refId: 'A', - step: 10, - }, - ], - thresholds: [], - timeFrom: null, - timeShift: null, - title: 'GC count', - tooltip: { - shared: true, - sort: 0, - value_type: 'individual', - }, - type: 'graph', - xaxis: { - buckets: null, - mode: 'time', - name: null, - show: true, - values: [], - }, - yaxes: [ - { - decimals: 0, - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - { - format: 'short', - label: null, - logBase: 1, - max: null, - min: null, - show: true, - }, - ], - }, - ], - repeat: null, - repeatIteration: null, - repeatRowId: null, - showTitle: false, - title: 'Dashboard Row', - titleSize: 'h6', - }, - ], - schemaVersion: 14, - style: 'dark', - tags: [ - 'JVM', - 'prometheus', - ], - templating: { - list: [ - { - current: {}, - hide: 0, - includeAll: false, - label: 'Data Source', - multi: false, - name: 'datasource', - options: [], - query: 'prometheus', - queryValue: '', - refresh: 1, - regex: '', - skipUrlSync: false, - type: 'datasource', - }, - { - allValue: '.+', - current: {}, - datasource: '${datasource}', - hide: 0, - includeAll: true, - label: 'job', - multi: true, - name: 'job', - options: [], - query: 'label_values(jvm_memory_used_bytes,job)', - refresh: 1, - regex: '', - sort: 0, - tagValuesQuery: '', - tags: [], - tagsQuery: '', - type: 'query', - useTags: false, - }, - { - allValue: '.+', - current: {}, - datasource: '${datasource}', - hide: 0, - includeAll: true, - label: 'instance', - multi: true, - name: 'instance', - options: [], - query: 'label_values(jvm_memory_used_bytes{job=~"$job"},instance)', - refresh: 1, - regex: '', - sort: 0, - tagValuesQuery: '', - tags: [], - tagsQuery: '', - type: 'query', - useTags: false, - }, - ], - }, - time: { - 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: '', - title: 'JVM overview - Prometheus', - uid: '1602068683-1', - version: 12, -} diff --git a/jvm-mixin/mixin.libsonnet b/jvm-mixin/mixin.libsonnet index db4566876..3b99dea73 100644 --- a/jvm-mixin/mixin.libsonnet +++ b/jvm-mixin/mixin.libsonnet @@ -1,5 +1,6 @@ -(import 'dashboards.libsonnet') + -(import 'alerts.libsonnet') + -{ - grafanaDashboardFolder:: 'JVM', -} +local config = import './config.libsonnet'; +local jvmlib = import 'jvm-observ-lib/main.libsonnet'; +local jvm = + jvmlib.new() + + jvmlib.withConfigMixin(config); +jvm.asMonitoringMixin() diff --git a/jvm-observ-lib/.lint b/jvm-observ-lib/.lint new file mode 100644 index 000000000..91f57653f --- /dev/null +++ b/jvm-observ-lib/.lint @@ -0,0 +1,13 @@ +exclusions: + panel-title-description-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" + panel-units-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" + template-datasource-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" + template-instance-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" + template-job-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" + template-on-time-change-reload-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" diff --git a/jvm-observ-lib/README.md b/jvm-observ-lib/README.md new file mode 100644 index 000000000..bb552b697 --- /dev/null +++ b/jvm-observ-lib/README.md @@ -0,0 +1,39 @@ +# JVM observability lib + +This lib can be used to generate dashboards, rows, panels, and alerts for JVM monitoring. + +Supports the following sources: + +- prometheus (https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-memory-metrics) +- otel (https://github.com/open-telemetry/opentelemetry-java-contrib/blob/main/jmx-metrics/docs/target-systems/jvm.md) +- java_micrometer (springboot) (https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/JvmMemoryMetrics.java) + +## Import + +```sh +jb init +jb install https://github.com/grafana/jsonnet-libs/jvm-observ-lib +``` + +## Example: Generate monitoring-mixin + +``` +local config = import './config.libsonnet'; +local jvmlib = import 'jvm-observ-lib/main.libsonnet'; +local jvm = + jvmlib.new() + + jvmlib.withConfigMixin( + { + filteringSelector: 'job!=""', + groupLabels: ['job'], + instanceLabels: ['instance'], + uid: 'jvm-sample', + dashboardNamePrefix: 'JVM', + dashboardTags: ['java', 'jvm'], + metricsSource: 'java_micrometer', // or java_otel, prometheus, + } + ); +jvm.asMonitoringMixin() +``` + +![image](https://github.com/grafana/jsonnet-libs/assets/14870891/c5fb3763-66a1-478e-ade9-5cb3aaff81bb) \ No newline at end of file diff --git a/jvm-observ-lib/alerts.libsonnet b/jvm-observ-lib/alerts.libsonnet new file mode 100644 index 000000000..863baa23b --- /dev/null +++ b/jvm-observ-lib/alerts.libsonnet @@ -0,0 +1,54 @@ +{ + new(this): { + + groups: [ + { + name: this.config.uid, + rules: + [ + { + alert: 'JvmMemoryFillingUp', + expr: '(%s/%s) * 100 > %s' % + [ + this.signals.memory.memoryUsedHeap.asRuleExpression(), + this.signals.memory.memoryMaxHeap.asRuleExpression(), + this.config.alertHeapWarning, + ], + 'for': '5m', + keep_firing_for: '5m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'JVM heap memory filling up.', + description: 'JVM heap memory usage is at {{ printf "%%.0f" $value }}%% over the last 5 minutes on {{$labels.instance}}, which is above the threshold of %(alertHeapWarning)s%%.' + % this.config, + }, + }, + ] + + + ( + // add only this alert if signal is present for this metricsSource: + if std.length(this.signals.threads.threadsDeadlocked.asRuleExpression()) > 0 + then + [ + { + alert: 'JvmThreadsDeadlocked', + expr: '%s > 0' % this.signals.threads.threadsDeadlocked.asRuleExpression(), + 'for': '2m', + keep_firing_for: '5m', + labels: { + severity: 'critical', + }, + annotations: { + summary: 'JVM deadlock detected.', + description: 'JVM deadlock detected: Threads in the JVM application {{$labels.instance}} are in a cyclic dependency with each other. The restart is required to resolve the deadlock.' + % this.config, + }, + }, + ] else [] + ), + }, + ], + }, +} diff --git a/jvm-observ-lib/config.libsonnet b/jvm-observ-lib/config.libsonnet new file mode 100644 index 000000000..9ca5aa2fe --- /dev/null +++ b/jvm-observ-lib/config.libsonnet @@ -0,0 +1,22 @@ +{ + local this = self, + filteringSelector: 'job!=""', + groupLabels: ['job'], + instanceLabels: ['instance'], + uid: 'jvm', + dashboardNamePrefix: 'JVM', + dashboardTags: ['java', 'jvm'], + metricsSource: 'java_micrometer', + signals+: + { + memory: (import './signals/memory.libsonnet')(this), + gc: (import './signals/gc.libsonnet')(this), + threads: (import './signals/threads.libsonnet')(this), + buffers: (import './signals/buffers.libsonnet')(this), + classes: (import './signals/classes.libsonnet')(this), + logback: (import './signals/logback.libsonnet')(this), + hikari: (import './signals/hikari.libsonnet')(this), + }, + + alertHeapWarning: 80, // % +} diff --git a/jvm-observ-lib/dashboards.libsonnet b/jvm-observ-lib/dashboards.libsonnet new file mode 100644 index 000000000..7d8de492a --- /dev/null +++ b/jvm-observ-lib/dashboards.libsonnet @@ -0,0 +1,40 @@ +local g = import './g.libsonnet'; +{ + new(this): + { + 'jvm-dashboard.json': + g.dashboard.new(this.config.dashboardNamePrefix + 'JVM overview') + + g.dashboard.withVariables(this.signals.memory.getVariablesMultiChoice()) + + g.dashboard.withTags(this.config.dashboardTags) + + g.dashboard.withUid(this.config.uid + '-jvm-dashboard') + + g.dashboard.withPanels( + g.util.grid.wrapPanels( + std.flattenArrays( + [ + this.grafana.rows.overview, + this.process.grafana.rows.process, + this.grafana.rows.memory, + this.grafana.rows.gc, + this.grafana.rows.threads, + this.grafana.rows.buffers, + ] + + ( + if this.config.metricsSource == 'java_micrometer' || this.config.metricsSource == 'otel' then + [ + this.grafana.rows.hikari, + ] + else [] + ) + + ( + if this.config.metricsSource == 'java_micrometer' then + [ + this.grafana.rows.logback, + ] + else [] + ) + ) + ), + setPanelIDs=false + ), + }, +} diff --git a/jvm-observ-lib/g.libsonnet b/jvm-observ-lib/g.libsonnet new file mode 100644 index 000000000..f89dcc064 --- /dev/null +++ b/jvm-observ-lib/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' diff --git a/jvm-observ-lib/jsonnetfile.json b/jvm-observ-lib/jsonnetfile.json new file mode 100644 index 000000000..f7b411c39 --- /dev/null +++ b/jvm-observ-lib/jsonnetfile.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "dependencies": [ + { + "source": { + "local": { + "directory": "../common-lib" + } + }, + "version": "" + }, + { + "source": { + "git": { + "remote": "https://github.com/grafana/grafonnet.git", + "subdir": "gen/grafonnet-v11.0.0" + } + }, + "version": "main" + }, + { + "source": { + "local": { + "directory": "../process-observ-lib" + } + }, + "version": "" + } + ], + "legacyImports": true +} \ No newline at end of file diff --git a/jvm-observ-lib/main.libsonnet b/jvm-observ-lib/main.libsonnet new file mode 100644 index 000000000..68667fa40 --- /dev/null +++ b/jvm-observ-lib/main.libsonnet @@ -0,0 +1,59 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +local processlib = import 'process-observ-lib/main.libsonnet'; + +{ + new(): { + local this = self, + config: import './config.libsonnet', + + //include process lib + process:: + processlib.new() + + processlib.withConfigMixin( + { + filteringSelector: this.config.filteringSelector, + groupLabels: this.config.groupLabels, + instanceLabels: this.config.instanceLabels, + uid: this.config.uid, + dashboardNamePrefix: this.cofnig.dashboardNamePrefix, + dashboardTags: this.cofnig.dashboardTags, + metricsSource: + if this.config.metricsSource == 'otel' then 'java_otel' + else if this.config.metricsSource == 'prometheus' then 'prometheus' + else if this.config.metricsSource == 'java_micrometer' then 'java_micrometer' + else error 'no such metricsSource for processlib', + } + ), + signals: + { + [sig]: commonlib.signals.unmarshallJsonMulti(this.config.signals[sig], type=this.config.metricsSource) + for sig in std.objectFields(this.config.signals) + }, + grafana: { + panels: + (import './panels.libsonnet').new(this.signals) + // add panels from process lib + + this.process.grafana.panels, + rows: + (import './rows.libsonnet').new(this.grafana.panels, type=this.config.metricSource) + // add rows from process lib + + this.process.grafana.rows, + dashboards: (import './dashboards.libsonnet').new(this), + }, + prometheus: { + alerts: (import './alerts.libsonnet').new(this), + recordingRules: {}, + }, + asMonitoringMixin(): { + // _config+:: this.config, + grafanaDashboards+:: this.grafana.dashboards, + prometheusAlerts+:: this.prometheus.alerts, + prometheusRuless+:: this.prometheus.recordingRules, + }, + }, + + withConfigMixin(config): { + config+: config, + }, +} diff --git a/jvm-observ-lib/mixin.libsonnet b/jvm-observ-lib/mixin.libsonnet new file mode 100644 index 000000000..6f095a256 --- /dev/null +++ b/jvm-observ-lib/mixin.libsonnet @@ -0,0 +1 @@ +(import './main.libsonnet').new().asMonitoringMixin() diff --git a/jvm-observ-lib/panels.libsonnet b/jvm-observ-lib/panels.libsonnet new file mode 100644 index 000000000..711aa1843 --- /dev/null +++ b/jvm-observ-lib/panels.libsonnet @@ -0,0 +1,154 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +{ + new(signals):: { + + memoryUsedHeapPercent: + commonlib.panels.memory.stat.usage.new( + 'Memory used(heap)', + targets=[ + // use asTarget only for proper datasource: + signals.memory.memoryUsedHeap.asTarget() + // actually override with new expression: + + g.query.prometheus.withExpr( + '(%s/%s) * 100' % + [ + signals.memory.memoryUsedHeap.asPanelExpression(), + signals.memory.memoryMaxHeap.asPanelExpression(), + ] + ), + ] + ), + memoryUsedNonHeapPercent: + commonlib.panels.memory.stat.usage.new( + 'Memory used(nonheap)', + targets=[ + // use asTarget only for proper datasource: + signals.memory.memoryUsedNonHeap.asTarget() + // actually override with new expression: + + g.query.prometheus.withExpr( + '(%s/%s) * 100' % + [ + signals.memory.memoryUsedNonHeap.asPanelExpression(), + signals.memory.memoryMaxNonHeap.asPanelExpression(), + ] + ), + ] + ), + + memoryUsedHeap: + signals.memory.memoryUsedHeap.asTimeSeries() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='/.*max.*/') + + signals.memory.memoryMaxHeap.asPanelMixin() + + signals.memory.memoryCommittedHeap.asPanelMixin(), + memoryUsedNonHeap: + signals.memory.memoryUsedNonHeap.asTimeSeries() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='/.*max.*/') + + signals.memory.memoryMaxNonHeap.asPanelMixin() + + signals.memory.memoryCommittedNonHeap.asPanelMixin(), + + // GCmem + memoryUsedEden: + signals.gc.memoryUsedEden.asTimeSeries() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='/.*max.*/') + + signals.gc.memoryMaxEden.asPanelMixin() + + signals.gc.memoryCommittedEden.asPanelMixin(), + memoryUsedSurvival: + signals.gc.memoryUsedSurvival.asTimeSeries() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='/.*max.*/') + + signals.gc.memoryMaxSurvival.asPanelMixin() + + signals.gc.memoryCommittedSurvival.asPanelMixin(), + memoryUsedTenured: + signals.gc.memoryUsedTenured.asTimeSeries() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='/.*max.*/') + + signals.gc.memoryMaxTenured.asPanelMixin() + + signals.gc.memoryCommittedTenured.asPanelMixin(), + + // GC + gc: + signals.gc.collections.asTimeSeries() + + commonlib.panels.generic.timeSeries.base.stylize(), + + gcDuration: + g.panel.timeSeries.new('GC duration') + + commonlib.panels.generic.timeSeries.base.stylize() + + g.panel.timeSeries.fieldConfig.defaults.custom.withFillOpacity(0) + + signals.gc.collectionsTimeAvg.asPanelMixin() + + signals.gc.collectionsTimeMax.asPanelMixin() + + signals.gc.collectionsTimeP95.asPanelMixin(), + + promotedAllocated: + g.panel.timeSeries.new('Allocated/promoted') + + commonlib.panels.memory.timeSeries.usageBytes.stylize() + + signals.gc.memAllocatedBytes.asPanelMixin() + + signals.gc.memAllocated.asPanelMixin() + + signals.gc.memPromotedBytes.asPanelMixin(), + + // threads + threadsOverviewStat: + signals.threads.threads.asStat() + + commonlib.panels.generic.stat.base.stylize(), + + threadsOverviewTS: + signals.threads.threads.asTimeSeries() + + signals.threads.threadsDaemon.asPanelMixin() + + signals.threads.threadsPeak.asPanelMixin() + + commonlib.panels.generic.timeSeries.threshold.stylizeByRegexp('.*peak.*') + + signals.threads.threadsDeadlocked.asPanelMixin() + + commonlib.panels.generic.timeSeries.base.stylize(), + + threadStates: + signals.threads.threadStates.asTimeSeries() + + commonlib.panels.generic.timeSeries.base.stylize(), + + + // classes + classesLoaded: + signals.classes.classesLoaded.asStat() + + commonlib.panels.generic.stat.base.stylize(), + + // buffers + directBuffer: + signals.buffers.directBufferUsed.asTimeSeries() + + signals.buffers.directBufferCapacity.asPanelMixin() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='.*capacity.*'), + + mappedBuffer: + signals.buffers.mappedBufferUsed.asTimeSeries() + + signals.buffers.mappedBufferCapacity.asPanelMixin() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(totalRegexp='.*capacity.*'), + + // logback + logs: + signals.logback.events.asTimeSeries() + + commonlib.panels.generic.timeSeries.base.stylize(), + + // hikari + hikariConnections: + signals.hikari.connections.asStat() + + commonlib.panels.generic.stat.base.stylize(), + hikariTimeouts: + signals.hikari.timeouts.asStat() + + commonlib.panels.generic.stat.base.stylize(), + hikariConnectionsStates: + signals.hikari.connectionsActive.asTimeSeries() + + signals.hikari.connectionsIdle.asPanelMixin() + + signals.hikari.connectionsPending.asPanelMixin() + + commonlib.panels.generic.timeSeries.base.stylize(), + hikariConnectionsCreate: + g.panel.timeSeries.new('Connection create duration') + + signals.hikari.connectionsCreationDurationP95.asPanelMixin() + + signals.hikari.connectionsCreationDurationAvg.asPanelMixin() + + commonlib.panels.requests.timeSeries.duration.stylize(), + hikariConnectionsUsage: + g.panel.timeSeries.new('Connection create duration') + + signals.hikari.connectionsUsageDurationP95.asPanelMixin() + + signals.hikari.connectionsUsageDurationAvg.asPanelMixin() + + commonlib.panels.requests.timeSeries.duration.stylize(), + hikariConnectionsAcquire: + g.panel.timeSeries.new('Connection acquire duration') + + signals.hikari.connectionsAcquireDurationP95.asPanelMixin() + + signals.hikari.connectionsAcquireDurationAvg.asPanelMixin() + + commonlib.panels.requests.timeSeries.duration.stylize(), + }, +} diff --git a/jvm-observ-lib/rows.libsonnet b/jvm-observ-lib/rows.libsonnet new file mode 100644 index 000000000..e8b195540 --- /dev/null +++ b/jvm-observ-lib/rows.libsonnet @@ -0,0 +1,50 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +{ + new(panels, type):: { + overview: [ + g.panel.row.new('JVM overview'), + panels.memoryUsedHeapPercent { gridPos+: { w: 4, h: 4 } }, + panels.memoryUsedNonHeapPercent { gridPos+: { w: 4, h: 4 } }, + panels.threadsOverviewStat { gridPos+: { w: 4, h: 4 } }, + panels.classesLoaded { gridPos+: { w: 4, h: 4 } }, + ], + gc: [ + g.panel.row.new('JVM garbage collection'), + panels.memoryUsedEden, + panels.memoryUsedSurvival, + panels.memoryUsedTenured, + panels.gc, + panels.gcDuration, + panels.promotedAllocated, + ], + memory: [ + g.panel.row.new('JVM memory'), + panels.memoryUsedHeap { w: 12, h: 6 }, + panels.memoryUsedNonHeap { w: 12, h: 6 }, + ], + threads: [ + g.panel.row.new('JVM threads'), + panels.threadsOverviewTS, + panels.threadStates, + ], + buffers: [ + g.panel.row.new('JVM buffers'), + panels.directBuffer, + panels.mappedBuffer, + ], + hikari: [ + g.panel.row.new('Hikari pools'), + panels.hikariConnections { gridPos+: { w: 4, h: 6 } }, + panels.hikariTimeouts { gridPos+: { w: 4, h: 6 } }, + panels.hikariConnectionsStates { gridPos+: { w: 16, h: 6 } }, + panels.hikariConnectionsCreate { gridPos+: { w: 8, h: 6 } }, + panels.hikariConnectionsUsage { gridPos+: { w: 8, h: 6 } }, + panels.hikariConnectionsAcquire { gridPos+: { w: 8, h: 6 } }, + ], + logback: [ + g.panel.row.new('Logback'), + panels.logs { gridPos+: { w: 24, h: 6 } }, + ], + }, +} diff --git a/jvm-observ-lib/signals/buffers.libsonnet b/jvm-observ-lib/signals/buffers.libsonnet new file mode 100644 index 000000000..eb6fff6b9 --- /dev/null +++ b/jvm-observ-lib/signals/buffers.libsonnet @@ -0,0 +1,85 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'avg', + discoveryMetric: { + java_micrometer: 'jvm_buffer_memory_used_bytes', // https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/JvmMemoryMetrics.java + prometheus: 'jvm_buffer_pool_used_bytes', // https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-buffer-pool-metrics + otel: 'process_runtime_jvm_buffer_usage', + }, + signals: { + directBufferUsed: { + name: 'Direct buffer used bytes', + description: "Direct buffer is allocated outside the Java heap and represents the OS native memory used by the JVM process. It is generally used for I/O operations. Note that direct buffers aren't freed up by GC.", + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_buffer_memory_used_bytes{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_buffer_pool_used_bytes{pool="direct", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_buffer_usage{pool="direct", %(queriesSelector)s}', + }, + }, + }, + directBufferCapacity: { + name: 'Direct buffer capacity', + description: "Direct buffer is allocated outside the Java heap and represents the OS native memory used by the JVM process. It is generally used for I/O operations. Note that direct buffers aren't freed up by GC.", + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_buffer_total_capacity_bytes{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_buffer_pool_capacity_bytes{pool="direct", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_buffer_limit{pool="direct", %(queriesSelector)s}', + }, + }, + }, + mappedBufferUsed: { + name: 'Mapped buffer used', + description: 'The mapped buffer pool is used for its FileChannel instances.', + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_buffer_memory_used_bytes{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_buffer_pool_used_bytes{pool="mapped", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_buffer_usage{pool="mapped", %(queriesSelector)s}', + }, + }, + }, + mappedBufferCapacity: { + name: 'Mapped buffer capacity', + description: 'The mapped buffer pool is used for its FileChannel instances.', + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_buffer_total_capacity_bytes{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_buffer_pool_capacity_bytes{pool="mapped", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_buffer_limit{pool="mapped", %(queriesSelector)s}', + }, + }, + }, + }, + } diff --git a/jvm-observ-lib/signals/classes.libsonnet b/jvm-observ-lib/signals/classes.libsonnet new file mode 100644 index 000000000..2f74f50e6 --- /dev/null +++ b/jvm-observ-lib/signals/classes.libsonnet @@ -0,0 +1,34 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'avg', + discoveryMetric: { + java_micrometer: 'jvm_classes_loaded_classes', // https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/ClassLoaderMetrics.java + prometheus: 'jvm_classes_loaded', // https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-class-loading-metrics + otel: 'process_runtime_jvm_classes_loaded', + }, + signals: { + classesLoaded: { + name: 'Classes loaded', + description: 'The number of classes that are currently loaded in the JVM.', + type: 'gauge', + unit: 'short', + sources: { + java_micrometer: { + expr: 'jvm_classes_loaded_classes{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_classes_loaded{%(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_classes_loaded{%(queriesSelector)s}', + }, + }, + }, + }, + } diff --git a/jvm-observ-lib/signals/gc.libsonnet b/jvm-observ-lib/signals/gc.libsonnet new file mode 100644 index 000000000..69a536761 --- /dev/null +++ b/jvm-observ-lib/signals/gc.libsonnet @@ -0,0 +1,391 @@ +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'avg', + discoveryMetric: { + java_micrometer: 'jvm_memory_used_bytes', + prometheus: 'jvm_memory_used_bytes', // https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-memory-metrics + otel: 'process_runtime_jvm_memory_usage', //https://opentelemetry.io/docs/specs/semconv/runtime/jvm-metrics/ + }, + signals: { + + local actionLabelPrettify = [ + 'label_replace(', + ', "action", "$1", "action", "end of (.+)")', + ], + + //gc + collections: { + name: 'Garbage collections', + description: 'Major and minor garbage collection', + type: 'counter', + unit: 'ops', + sources: { + java_micrometer: { + expr: 'jvm_gc_pause_seconds_count{%(queriesSelector)s}', + aggKeepLabels: ['action', 'cause'], + legendCustomTemplate: '%(aggLegend)s', + exprWrappers: [ + actionLabelPrettify, + ], + }, + prometheus: { + expr: 'jvm_gc_collection_seconds_count{%(queriesSelector)s}', + aggKeepLabels: ['gc'], + legendCustomTemplate: '%(aggLegend)s', + }, + otel: { + expr: 'process_runtime_jvm_gc_duration_count{%(queriesSelector)s}', + legendCustomTemplate: '%(aggLegend)s', + aggKeepLabels: ['gc', 'action'], + exprWrappers: [ + actionLabelPrettify, + ], + }, + }, + }, + //gc + collectionsTimeMax: { + name: 'GC time (max)', + description: 'Garbage collection time (max).', + type: 'raw', + unit: 's', + optional: true, + sources: { + java_micrometer: { + expr: 'avg by (action,cause, %(agg)s) (rate(jvm_gc_pause_seconds_max{%(queriesSelector)s}[$__rate_interval]))', + legendCustomTemplate: '{{ %(agg)s }}: {{ action }} ({{ cause }}) (max)', + exprWrappers: [ + actionLabelPrettify, + ], + }, + // prometheus: { + // expr: '', + // }, + // otel: { + // expr: '', + // }, + }, + }, + collectionsTimeAvg: { + name: 'GC time (avg)', + description: 'Garbage collection time (max).', + type: 'raw', + unit: 's', + optional: true, + sources: { + java_micrometer: { + expr: ||| + avg by (%(agg)s, action, cause) ( + rate(jvm_gc_pause_seconds_sum{%(queriesSelector)s}[$__rate_interval]) + / + rate(jvm_gc_pause_seconds_count{%(queriesSelector)s}[$__rate_interval]) + ) + |||, + legendCustomTemplate: '{{ %(agg)s }}: {{ action }} ({{ cause }}) (avg)', + exprWrappers: [ + actionLabelPrettify, + ], + }, + prometheus: { + expr: ||| + avg by (%(agg)s, gc) ( + rate(jvm_gc_collection_seconds_sum{%(queriesSelector)s}[$__rate_interval]) + / + rate(jvm_gc_collection_seconds_count{%(queriesSelector)s}[$__rate_interval]) + ) + |||, + legendCustomTemplate: '{{ %(agg)s }}: {{ gc }} (avg)', + + }, + // otel: { + // expr: '', + // }, + }, + }, + collectionsTimeP95: { + name: 'GC time (p95)', + description: 'Garbage collection time (p95).', + type: 'raw', + unit: 'ms', + optional: true, + sources: { + otel: { + expr: ||| + histogram_quantile(0.95, sum(rate(process_runtime_jvm_gc_duration_bucket{%(queriesSelector)s}[$__rate_interval])) by (le,%(agg)s,action,gc)) + |||, + legendCustomTemplate: '{{ %(agg)s }}: {{ action }} ({{ gc }}) (p95)', + exprWrappers: [ + actionLabelPrettify, + ], + }, + }, + }, + + memPromotedBytes: { + name: 'Promoted', + description: 'Memory promoted to Tenured Space.', + type: 'counter', + rangeFunction: 'increase', + unit: 'bytes', + optional: true, + sources: { + java_micrometer: { + expr: 'jvm_gc_memory_promoted_bytes_total{%(queriesSelector)s}', + }, + }, + }, + memAllocatedBytes: { + name: 'Allocated', + description: 'Memory allocated to Eden Space.', + type: 'counter', + rangeFunction: 'increase', + unit: 'bytes', + optional: true, + sources: { + java_micrometer: { + expr: 'jvm_gc_memory_allocated_bytes_total{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_allocated_bytes_total{pool="PS Eden Space",%(queriesSelector)s}', + }, + }, + }, + memAllocated: { + name: 'Allocated', + description: 'Memory allocated to Eden Space.', + type: 'raw', + rangeFunction: 'increase', + unit: 'allocs', + optional: true, + sources: { + otel: { + expr: ||| + topk(10, + avg by (%(agg)s, arena, thread_name) (rate(process_runtime_jvm_memory_allocation_count{%(queriesSelector)s}[$__rate_interval])) + ) + |||, + legendCustomTemplate: '{{ %(agg)s }}: Allocated ({{ thread_name }}, {{ arena }})', + }, + }, + }, + + + //G1 Eden + memoryUsedEden: { + name: 'Eden Space (used)', + description: 'Memory used for G1 Eden Space Collection.', + type: 'gauge', + unit: 'bytes', + sources: { + //spring + java_micrometer: { + expr: 'jvm_memory_used_bytes{id=~"(G1 )?Eden Space", area="heap", %(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_collection_used_bytes{pool="PS Eden Space", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_usage{type="heap", pool=~"(G1 )?Eden Space", %(queriesSelector)s}', + }, + }, + }, + memoryMaxEden: { + name: 'Eden Space (max)', + description: ||| + The max heap size is the size specified via the -Xmx flag. + Returns -1 if the maximum memory size is undefined. + + This amount of memory is not guaranteed to be available for memory management + if it is greater than the amount of committed memory. + The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size. + + See also: https://docs.oracle.com/javase/10/docs/api/java/lang/management/MemoryUsage.html + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_memory_max_bytes{id=~"(G1 )?Eden Space", area="heap", %(queriesSelector)s}', + exprWrappers: [ + ['', ' != -1'], + ], + }, + prometheus: { + expr: 'jvm_memory_pool_collection_used_bytes{pool="PS Eden Space", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_limit{pool=~"(G1 )?Eden Space", type="heap", %(queriesSelector)s}', + exprWrappers: [ + ['', ' != -1'], + ], + }, + }, + }, + memoryCommittedEden: { + name: 'Eden Space (committed)', + description: ||| + The committed size is the amount of memory guaranteed to be available for use by the Java virtual machine. + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_memory_committed_bytes{id=~"(G1 )?Eden Space", area="heap", %(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_committed_bytes{pool="PS Eden Space", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_committed{pool=~"(G1 )?Eden Space", type="heap", %(queriesSelector)s}', + }, + }, + }, + + + // Survival + memoryUsedSurvival: { + name: 'Survival space (used)', + description: 'Memory used for Survival collection.', + type: 'gauge', + unit: 'bytes', + sources: { + //spring + java_micrometer: { + expr: 'jvm_memory_used_bytes{id="Survivor Space", area="heap", %(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_collection_used_bytes{pool="PS Survivor Space", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_usage{type="heap", pool=~"(G1 )?Survivor Space", %(queriesSelector)s}', + }, + }, + }, + memoryMaxSurvival: { + name: 'Survival space (max)', + description: ||| + The max heap size is the size specified via the -Xmx flag. + Returns -1 if the maximum memory size is undefined. + + This amount of memory is not guaranteed to be available for memory management + if it is greater than the amount of committed memory. + The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size. + + See also: https://docs.oracle.com/javase/10/docs/api/java/lang/management/MemoryUsage.html + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_memory_max_bytes{id="Survivor Space", area="heap", %(queriesSelector)s}', + exprWrappers: [ + ['', ' != -1'], + ], + }, + prometheus: { + expr: 'jvm_memory_pool_collection_used_bytes{pool="PS Survivor Space", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_limit{pool=~"(G1 )?Survivor Space", type="heap", %(queriesSelector)s}', + exprWrappers: [ + ['', ' != -1'], + ], + }, + }, + }, + memoryCommittedSurvival: { + name: 'Survival space (committed)', + description: ||| + The committed size is the amount of memory guaranteed to be available for use by the Java virtual machine. + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_memory_committed_bytes{id="Survivor Space", area="heap", %(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_committed_bytes{pool="PS Survivor Space", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_committed{pool=~"(G1 )?Survivor Space", type="heap", %(queriesSelector)s}', + }, + }, + }, + + // Tenured + memoryUsedTenured: { + name: 'Tenured space (used)', + description: 'Memory used for Tenured(Old Gen) collection.', + type: 'gauge', + unit: 'bytes', + sources: { + //spring + java_micrometer: { + expr: 'jvm_memory_used_bytes{id="Tenured Gen", area="heap", %(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_collection_used_bytes{pool="PS Old Gen", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_usage{type="heap", pool=~"G1 Old Gen|Tenured Gen", %(queriesSelector)s}', + }, + }, + }, + memoryMaxTenured: { + name: 'Tenured space (max)', + description: ||| + The max heap size is the size specified via the -Xmx flag. + Returns -1 if the maximum memory size is undefined. + + This amount of memory is not guaranteed to be available for memory management + if it is greater than the amount of committed memory. + The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size. + + See also: https://docs.oracle.com/javase/10/docs/api/java/lang/management/MemoryUsage.html + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_memory_max_bytes{id="Tenured Gen", area="heap", %(queriesSelector)s}', + exprWrappers: [ + ['', ' != -1'], + ], + }, + prometheus: { + expr: 'jvm_memory_pool_collection_used_bytes{pool="PS Old Gen", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_limit{pool=~"G1 Old Gen|Tenured Gen", type="heap", %(queriesSelector)s}', + exprWrappers: [ + ['', ' != -1'], + ], + }, + }, + }, + memoryCommittedTenured: { + name: 'Tenured space (committed)', + description: ||| + The committed size is the amount of memory guaranteed to be available for use by the Java virtual machine. + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'jvm_memory_committed_bytes{id="Tenured Gen", area="heap", %(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_memory_pool_committed_bytes{pool="PS Old Gen", %(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_memory_committed{pool=~"G1 Old Gen|Tenured Gen", type="heap", %(queriesSelector)s}', + }, + }, + }, + }, + } diff --git a/jvm-observ-lib/signals/hikari.libsonnet b/jvm-observ-lib/signals/hikari.libsonnet new file mode 100644 index 000000000..69604ec5b --- /dev/null +++ b/jvm-observ-lib/signals/hikari.libsonnet @@ -0,0 +1,236 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'avg', + discoveryMetric: { + java_micrometer: 'hikaricp_connections', // https://github.com/brettwooldridge/HikariCP/blob/dev/src/main/java/com/zaxxer/hikari/metrics/micrometer/MicrometerMetricsTracker.java + prometheus: '?', + otel: 'hikaricp_connections', + }, + signals: { + connections: { + name: 'Connections', + description: 'Hikari pool connections', + type: 'gauge', + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'hikaricp_connections{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + timeouts: { + name: 'Connections timeouts', + description: 'Hikari pool timeouts', + type: 'counter', + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'hikaricp_connections_timeout_total{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + }, + }, + connectionsActive: { + name: 'Connections (active) ', + description: 'Hikari pool active connections.', + type: 'gauge', + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'hikaricp_connections_active{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections_active{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + connectionsIdle: { + name: 'Connections (idle) ', + description: 'Hikari pool idle connections.', + type: 'gauge', + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'hikaricp_connections_idle{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections_idle{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + connectionsPending: { + name: 'Connections (pending) ', + description: 'Hikari pool pending connections.', + type: 'gauge', + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'hikaricp_connections_pending{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections_pending{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + connectionsCreationDurationAvg: { + name: 'Connections creation time (avg)', + description: 'Hikari pool connection creation time.', + type: 'raw', + unit: 's', + optional: true, + sources: { + java_micrometer: { + expr: ||| + rate(hikaricp_connections_creation_seconds_sum{%(queriesSelector)s}[$__rate_interval]) + /rate(hikaricp_connections_creation_seconds_count{%(queriesSelector)s}[$__rate_interval]) + |||, + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // }, + }, + }, + connectionsUsageDurationAvg: { + name: 'Connections usage time (avg)', + description: 'Hikari pool connection usage time.', + type: 'raw', + unit: 's', + optional: true, + sources: { + java_micrometer: { + expr: ||| + rate(hikaricp_connections_usage_seconds_sum{%(queriesSelector)s}[$__rate_interval]) + /rate(hikaricp_connections_usage_seconds_count{%(queriesSelector)s}[$__rate_interval]) + |||, + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // }, + }, + }, + connectionsAcquireDurationAvg: { + name: 'Connections acquire time (avg)', + description: 'Hikari pool connection acquire time.', + type: 'raw', + unit: 's', + optional: true, + sources: { + java_micrometer: { + expr: ||| + rate(hikaricp_connections_acquire_seconds_sum{%(queriesSelector)s}[$__rate_interval]) + /rate(hikaricp_connections_acquire_seconds_count{%(queriesSelector)s}[$__rate_interval]) + |||, + aggKeepLabels: ['pool'], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // }, + }, + }, + connectionsCreationDurationP95: { + name: 'Connections creation time (p95)', + description: 'Hikari pool connection creation time.', + type: 'histogram', + unit: 's', + optional: true, + sources: { + // java_micrometer: { + // expr: '?{%(queriesSelector)s}', + // }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections_creation_bucket{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + connectionsUsageDurationP95: { + name: 'Connections usage time (p95)', + description: 'Hikari pool connection usage time.', + type: 'histogram', + unit: 's', + optional: true, + sources: { + // java_micrometer: { + + // }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections_usage_bucket{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + connectionsAcquireDurationP95: { + name: 'Connections acquire time (p95)', + description: 'Hikari pool connection acquire time.', + type: 'histogram', + unit: 's', + optional: true, + sources: { + // java_micrometer: { + + // }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + otel: { + expr: 'hikaricp_connections_acquire_bucket{%(queriesSelector)s}', + aggKeepLabels: ['pool'], + }, + }, + }, + }, + } diff --git a/jvm-observ-lib/signals/logback.libsonnet b/jvm-observ-lib/signals/logback.libsonnet new file mode 100644 index 000000000..c9c959364 --- /dev/null +++ b/jvm-observ-lib/signals/logback.libsonnet @@ -0,0 +1,63 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'sum', + aggKeepLabels: ['level'], + discoveryMetric: { + java_micrometer: 'logback_events_total', + prometheus: '?', + otel: '?', + }, + signals: { + events: { + name: 'Logback events', + description: 'Logback events.', + type: 'counter', // counter + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: ||| + logback_events_total{%(queriesSelector)s} + |||, + exprWrappers: [ + ['topk(10,', ')'], + ], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + }, + }, + errors: { + name: 'Logback events (errors)', + description: 'Logback events with error level.', + type: 'counter', // counter + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'logback_events_total{level="error", %(queriesSelector)s}', + exprWrappers: [ + ['topk(10,', ')'], + ], + }, + // prometheus: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + }, + }, + + }, + } diff --git a/jvm-observ-lib/signals/memory.libsonnet b/jvm-observ-lib/signals/memory.libsonnet new file mode 100644 index 000000000..1586221be --- /dev/null +++ b/jvm-observ-lib/signals/memory.libsonnet @@ -0,0 +1,129 @@ +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'avg', + discoveryMetric: { + java_micrometer: 'jvm_memory_used_bytes', + prometheus: 'jvm_memory_used_bytes', // https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-memory-metrics + otel: 'process_runtime_jvm_memory_usage', + }, + signals: { + //memory + memoryUsedHeap: { + name: 'JVM memory used(heap)', + description: 'The used space is the amount of memory that is currently occupied by Java objects.', + type: 'gauge', + unit: 'bytes', + sources: { + //spring + java_micrometer: { + expr: 'sum without (id) (jvm_memory_used_bytes{area="heap", %(queriesSelector)s})', + }, + prometheus: { + expr: 'sum without (id) (jvm_memory_used_bytes{area="heap", %(queriesSelector)s})', + }, + otel: { + expr: 'sum without (pool) (process_runtime_jvm_memory_usage{type="heap", %(queriesSelector)s})', + }, + }, + }, + memoryMaxHeap: { + name: 'JVM memory max(heap)', + description: ||| + The max heap size is the size specified via the -Xmx flag. + Returns -1 if the maximum memory size is undefined. + + This amount of memory is not guaranteed to be available for memory management + if it is greater than the amount of committed memory. + The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size. + + See also: https://docs.oracle.com/javase/10/docs/api/java/lang/management/MemoryUsage.html + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'sum without (id) (jvm_memory_max_bytes{area="heap", %(queriesSelector)s})', + exprWrappers: [ + ['', ' != -1'], + ], + }, + prometheus: self.java_micrometer, + otel: { + expr: 'sum without (pool) (process_runtime_jvm_memory_limit{type="heap", %(queriesSelector)s})', + exprWrappers: [ + ['', ' != -1'], + ], + }, + }, + }, + memoryUsedNonHeap: { + name: 'JVM memory used(nonheap)', + description: 'The amount of memory that is currently in non-heap.', + type: 'gauge', + unit: 'bytes', + sources: { + //spring + java_micrometer: { + expr: 'sum without (id) (jvm_memory_used_bytes{area="nonheap", %(queriesSelector)s})', + }, + prometheus: self.java_micrometer, + otel: { + expr: 'sum without (pool) (process_runtime_jvm_memory_usage{type="non_heap", %(queriesSelector)s})', + }, + }, + }, + memoryMaxNonHeap: { + name: 'JVM memory max(nonheap)', + description: 'Measure of memory max possible (non-heap).', + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'sum without (id) (jvm_memory_max_bytes{area="nonheap", %(queriesSelector)s})', + }, + prometheus: self.java_micrometer, + otel: { + expr: 'sum without (pool) (process_runtime_jvm_memory_limit{type="non_heap", %(queriesSelector)s})', + }, + }, + }, + memoryCommittedHeap: { + name: 'JVM memory committed(heap)', + description: ||| + The committed size is the amount of memory guaranteed to be available for use by the Java virtual machine. + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'sum without (id) (jvm_memory_committed_bytes{area="heap", %(queriesSelector)s})', + }, + prometheus: self.java_micrometer, + otel: { + expr: 'sum without (pool) (process_runtime_jvm_memory_committed{type="heap", %(queriesSelector)s})', + }, + }, + }, + memoryCommittedNonHeap: { + name: 'JVM memory committed(nonheap)', + description: ||| + The committed size is the amount of memory guaranteed to be available for use by the Java virtual machine(non-heap). + |||, + type: 'gauge', + unit: 'bytes', + sources: { + java_micrometer: { + expr: 'sum without (id) (jvm_memory_committed_bytes{area="nonheap", %(queriesSelector)s})', + }, + prometheus: self.java_micrometer, + otel: { + expr: 'sum without (pool) (process_runtime_jvm_memory_committed{type="non_heap", %(queriesSelector)s})', + }, + }, + }, + }, + } diff --git a/jvm-observ-lib/signals/threads.libsonnet b/jvm-observ-lib/signals/threads.libsonnet new file mode 100644 index 000000000..379c8f3e7 --- /dev/null +++ b/jvm-observ-lib/signals/threads.libsonnet @@ -0,0 +1,108 @@ +local commonlib = import 'common-lib/common/main.libsonnet'; + +function(this) + { + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'group', + aggFunction: 'avg', + discoveryMetric: { + java_micrometer: 'jvm_threads_live_threads', // https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/binder/jvm/JvmThreadMetrics.java + prometheus: 'jvm_threads_current', // https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-memory-metrics + otel: 'process_runtime_jvm_threads_count', + }, + signals: { + threads: { + name: 'Threads', + description: 'The current number of live threads including both daemon and non-daemon threads.', + type: 'gauge', + unit: 'short', + sources: { + java_micrometer: { + expr: 'jvm_threads_live_threads{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_threads_current{%(queriesSelector)s}', + }, + otel: { + expr: 'sum without (daemon) (process_runtime_jvm_threads_count{%(queriesSelector)s})', + }, + }, + }, + threadsDaemon: { + name: 'Threads (daemon)', + description: 'Daemon thread count of a JVM.', + type: 'gauge', + unit: 'short', + sources: { + java_micrometer: { + expr: 'jvm_threads_daemon_threads{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_threads_daemon{%(queriesSelector)s}', + }, + otel: { + expr: 'process_runtime_jvm_threads_count{daemon="true", %(queriesSelector)s}', + }, + }, + }, + threadsPeak: { + name: 'Threads (peak)', + description: 'Peak thread count of a JVM.', + type: 'gauge', + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'jvm_threads_peak_threads{%(queriesSelector)s}', + }, + prometheus: { + expr: 'jvm_threads_peak{%(queriesSelector)s}', + }, + // otel: { + // expr: '?{daemon="true", %(queriesSelector)s}', + // }, + }, + }, + threadsDeadlocked: { + name: 'Threads (deadlocked)', + description: 'Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers.', + type: 'gauge', + unit: 'short', + optional: true, + sources: { + // java_micrometer: { + // expr: '?{%(queriesSelector)s}', + // }, + prometheus: { + expr: 'jvm_threads_deadlocked{%(queriesSelector)s}', + }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + }, + }, + threadStates: { + name: 'Threads states', + description: 'Threads by current state.', + type: 'raw', // gauge + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'sum by (state, %(agg)s) (jvm_threads_states_threads{%(queriesSelector)s})', + legendCustomTemplate: '{{ state }}', + }, + //https://prometheus.github.io/client_java/instrumentation/jvm/#jvm-thread-metrics + prometheus: { + expr: 'sum by (state, %(agg)s) (jvm_threads_state{%(queriesSelector)s})', + legendCustomTemplate: '{{ state }}', + }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + }, + }, + }, + } diff --git a/process-observ-lib/.lint b/process-observ-lib/.lint new file mode 100644 index 000000000..e69de29bb diff --git a/process-observ-lib/Makefile b/process-observ-lib/Makefile new file mode 100644 index 000000000..e55ac169e --- /dev/null +++ b/process-observ-lib/Makefile @@ -0,0 +1,34 @@ +JSONNET_FMT := jsonnetfmt -n 2 --max-blank-lines 1 --string-style s --comment-style s + +.PHONY: all +all: build dashboards_out prometheus_alerts.yaml + +vendor: jsonnetfile.json + jb install + +.PHONY: build +build: vendor + +.PHONY: fmt +fmt: + find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ + xargs -n 1 -- $(JSONNET_FMT) -i + +.PHONY: lint +lint: build + find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ + while read f; do \ + $(JSONNET_FMT) "$$f" | diff -u "$$f" -; \ + done + mixtool lint mixin.libsonnet + +dashboards_out: mixin.libsonnet config.libsonnet $(wildcard dashboards/*) + @mkdir -p dashboards_out + jsonnet -J vendor -m dashboards_out lib/dashboards.jsonnet + +prometheus_alerts.yaml: mixin.libsonnet lib/alerts.jsonnet alerts/*.libsonnet + jsonnet -J vendor -S lib/alerts.jsonnet > $@ + +.PHONY: clean +clean: + rm -rf dashboards_out prometheus_alerts.yaml diff --git a/process-observ-lib/README.md b/process-observ-lib/README.md new file mode 100644 index 000000000..3d7cf2b34 --- /dev/null +++ b/process-observ-lib/README.md @@ -0,0 +1,18 @@ +# OS process observability lib + +This lib can be used to generate dashboards, rows, panels for generic OS process monitoring. + +Supports the following sources: + +- prometheus +- otel +- java_otel +- java_micrometer (springboot) + +## Import + +```sh +jb init +jb install https://github.com/grafana/jsonnet-libs/process-observ-lib +``` + diff --git a/process-observ-lib/config.libsonnet b/process-observ-lib/config.libsonnet new file mode 100644 index 000000000..998e7976f --- /dev/null +++ b/process-observ-lib/config.libsonnet @@ -0,0 +1,27 @@ +{ + // any modular library should include as inputs: + // 'dashboardNamePrefix' - Use as prefix for all Dashboards and (optional) rule groups + // 'filteringSelector' - Static selector to apply to ALL dashboard variables of type query, panel queries, alerts and recording rules. + // 'groupLabels' - one or more labels that can be used to identify 'group' of instances. In simple cases, can be 'job' or 'cluster'. + // 'instanceLabels' - one or more labels that can be used to identify single entity of instances. In simple cases, can be 'instance' or 'pod'. + // 'uid' - UID to prefix all dashboards original uids + local this = self, + filteringSelector: 'job!=""', + groupLabels: ['job'], + instanceLabels: ['instance'], + dashboardTags: [self.uid], + uid: 'proc', + dashboardNamePrefix: '', + + // additional params can be added if needed + dashboardPeriod: 'now-1h', + dashboardTimezone: 'default', + dashboardRefresh: '1m', + + metricsSource: 'prometheus', // or: otel, java_otel, java_micrometer + signals+: + { + system: (import './signals/system.libsonnet')(this), + process: (import './signals/process.libsonnet')(this), + }, +} diff --git a/process-observ-lib/dashboards.libsonnet b/process-observ-lib/dashboards.libsonnet new file mode 100644 index 000000000..5b8693e3e --- /dev/null +++ b/process-observ-lib/dashboards.libsonnet @@ -0,0 +1,19 @@ +local g = import './g.libsonnet'; +{ + new(this): + { + 'process-dashboard.json': + g.dashboard.new(this.config.dashboardNamePrefix + 'process overview') + + g.dashboard.withVariables(this.signals.process.getVariablesMultiChoice()) + + g.dashboard.withTags(this.config.dashboardTags) + + g.dashboard.withUid(this.config.uid + '-process') + + g.dashboard.withPanels( + g.util.grid.wrapPanels( + std.flattenArrays([ + this.grafana.rows.process, + ]) + ), + setPanelIDs=false + ), + }, +} diff --git a/process-observ-lib/g.libsonnet b/process-observ-lib/g.libsonnet new file mode 100644 index 000000000..f89dcc064 --- /dev/null +++ b/process-observ-lib/g.libsonnet @@ -0,0 +1 @@ +import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet' diff --git a/process-observ-lib/jsonnetfile.json b/process-observ-lib/jsonnetfile.json new file mode 100644 index 000000000..a581f6461 --- /dev/null +++ b/process-observ-lib/jsonnetfile.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "dependencies": [ + { + "source": { + "git": { + "remote": "https://github.com/grafana/jsonnet-libs.git", + "subdir": "common-lib" + } + }, + "version": "master" + }, + { + "source": { + "git": { + "remote": "https://github.com/jsonnet-libs/xtd.git", + "subdir": "" + } + }, + "version": "master" + } + ], + "legacyImports": true +} \ No newline at end of file diff --git a/process-observ-lib/main.libsonnet b/process-observ-lib/main.libsonnet new file mode 100644 index 000000000..872e0f667 --- /dev/null +++ b/process-observ-lib/main.libsonnet @@ -0,0 +1,44 @@ +local config = import './config.libsonnet'; +local dashboards = import './dashboards.libsonnet'; +local g = import './g.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: { + annotations: {}, + links: {}, + panels: panels.new(this.signals), + dashboards: dashboards.new(this), + rows: rows.new(this.grafana.panels, type=this.config.metricsSource), + }, + + prometheus: { + alerts: {}, + recordingRules: {}, + }, + + asMonitoringMixin(): { + // _config+:: this.config, + grafanaDashboards+:: this.grafana.dashboards, + prometheusAlerts+:: this.prometheus.alerts, + prometheusRuless+:: this.prometheus.recordingRules, + }, + + }, +} diff --git a/process-observ-lib/mixin.libsonnet b/process-observ-lib/mixin.libsonnet new file mode 100644 index 000000000..bc849d76d --- /dev/null +++ b/process-observ-lib/mixin.libsonnet @@ -0,0 +1,15 @@ +// this file is provided for the reference. Import main.libsonnet instead into your mixin like below: + +local proclib = import './main.libsonnet'; + +local proc = + proclib.new() + + proclib.withConfigMixin( + { + filteringSelector: 'job!=""', + metricsSource: 'java_otel', + } + ); + +// populate monitoring-mixin: +proc.asMonitoringMixin() diff --git a/process-observ-lib/panels.libsonnet b/process-observ-lib/panels.libsonnet new file mode 100644 index 000000000..0a83db50e --- /dev/null +++ b/process-observ-lib/panels.libsonnet @@ -0,0 +1,34 @@ +local g = import './g.libsonnet'; +local commonlib = import 'common-lib/common/main.libsonnet'; +{ + new(signals): + { + uptime: + signals.process.uptime.asStat() + + commonlib.panels.system.stat.uptime.stylize(), + startTime: + signals.process.startTime.asStat() + + commonlib.panels.generic.stat.info.stylize(), + + loadAverage: + signals.system.loadAverage1m.asTimeSeries() + + signals.system.systemCPUCount.asPanelMixin() + + commonlib.panels.system.timeSeries.loadAverage.stylize(cpuCountName='.*CPU count.*'), + + cpuUsage: + signals.process.processCPUUsage.asTimeSeries() + + signals.system.systemCPUUsage.asPanelMixin() + + commonlib.panels.cpu.timeSeries.utilization.stylize(), + + memoryUsage: + signals.process.memoryUsedResident.asTimeSeries() + + signals.process.memoryUsedVirtual.asPanelMixin() + + commonlib.panels.memory.timeSeries.usageBytes.stylize(), + + filesUsed: + g.panel.timeSeries.new('Process files open') + + signals.process.filesMax.asPanelMixin() + + signals.process.filesOpen.asPanelMixin() + + commonlib.panels.generic.timeSeries.base.stylize(), + }, +} diff --git a/process-observ-lib/rows.libsonnet b/process-observ-lib/rows.libsonnet new file mode 100644 index 000000000..4406f964c --- /dev/null +++ b/process-observ-lib/rows.libsonnet @@ -0,0 +1,16 @@ +local g = import './g.libsonnet'; + +{ + new(panels, type): { + + process: [ + g.panel.row.new('Process'), + panels.uptime { gridPos: { w: 4, h: 4 } }, + panels.startTime { gridPos: { w: 4, h: 4 } }, + panels.loadAverage { gridPos: { w: 16, h: 4 } }, + panels.cpuUsage { gridPos: { w: 8, h: 6 } }, + panels.filesUsed { gridPos: { w: 8, h: 6 } }, + panels.memoryUsage { gridPos: { w: 8, h: 6 } }, + ], + }, +} diff --git a/process-observ-lib/signals/process.libsonnet b/process-observ-lib/signals/process.libsonnet new file mode 100644 index 000000000..c6449899b --- /dev/null +++ b/process-observ-lib/signals/process.libsonnet @@ -0,0 +1,175 @@ +function(this) + { + discoveryMetric: { + // https://opentelemetry.io/docs/specs/semconv/system/process-metrics/ + + otel: 'runtime_uptime', + java_otel: self.otel, // some system metrics are calculated differently for java. (see system.libsonnet) + java_micrometer: 'process_uptime_seconds', // https://docs.spring.io/spring-boot/docs/1.3.3.RELEASE/reference/html/production-ready-metrics.html + + // https://prometheus.github.io/client_java/instrumentation/jvm/#process-metrics + // https://github.com/prometheus/client_golang + prometheus: 'process_start_time_seconds', + + // acceptable if container has single process running + cadvisor: 'container_cpu_usage_seconds_total', + }, + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', // group, instance, or none. + alertsInterval: '5m', + signals: { + uptime: { + name: 'Uptime', + type: 'raw', + description: 'Process uptime.', + unit: 'dtdurations', //duration in seconds + optional: true, + sources: { + prometheus: + { + expr: 'time()-process_start_time_seconds{%(queriesSelector)s}', + }, + otel: { + expr: 'process_uptime{%(queriesSelector)s}', + }, + java_otel: self.otel, + java_micrometer: { + expr: 'process_uptime_seconds{%(queriesSelector)s}', + }, + }, + }, + startTime: { + name: 'Process start time', + type: 'gauge', + description: 'Process start time.', + unit: 'dateTimeAsIso', + sources: { + java_micrometer: { + expr: 'process_start_time_seconds{%(queriesSelector)s} * 1000', + }, + prometheus: + { + expr: 'process_start_time_seconds{%(queriesSelector)s} * 1000', + }, + otel: { + expr: 'process_start_time{%(queriesSelector)s} * 1000', + }, + java_otel: self.otel, + cadvisor: { + cadvisor: 'container_start_time_seconds{%(queriesSelector)s}', + }, + }, + }, + // cpuUsage + processCPUUsage: { + name: 'CPU usage (process)', + type: 'gauge', + description: 'Process CPU usage.', + unit: 'percent', // 0-100 + optional: true, + sources: { + java_micrometer: { + expr: 'process_cpu_usage{%(queriesSelector)s} * 100', + }, + // otel: { + // // expr: 'process_runtime_jvm_cpu_utilization{%(queriesSelector)s}', + // expr: '?', + // }, + java_otel: { + expr: 'process_runtime_jvm_cpu_utilization{%(queriesSelector)s} * 100', + }, + prometheus: { + // convert to gauge from counter to match others here. + expr: 'rate(process_cpu_seconds_total{%(queriesSelector)s}[%(interval)s]) * 100', + }, + cadvisor: { + expr: 'rate(container_cpu_usage_seconds_total{cpu="total", %(queriesSelector)s}[%(interval)s]) * 100', + }, + }, + }, + + memoryUsedResident: { + name: 'Process memory used (rss)', + description: 'Process resident memory size in bytes.', + type: 'gauge', + unit: 'bytes', + optional: true, + sources: { + // java_micrometer: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + prometheus: { + expr: 'process_resident_memory_bytes{%(queriesSelector)s}', + }, + cadvisor: { + expr: 'container_memory_rss{%(queriesSelector)s}', + }, + }, + }, + memoryUsedVirtual: { + name: 'Process memory used (virtual)', + description: 'Process virtual memory size in bytes.', + type: 'gauge', + unit: 'bytes', + optional: true, + sources: { + // java_micrometer: { + // expr: '?{%(queriesSelector)s}', + // }, + // otel: { + // expr: '?{%(queriesSelector)s}', + // }, + prometheus: { + expr: 'process_virtual_memory_bytes{%(queriesSelector)s}', + }, + }, + }, + + // files open + // process_files_open_files + filesOpen: { + name: 'Process files open', + type: 'gauge', + description: 'Process files opened.', + optional: true, + sources: { + otel: { + expr: 'process_files_open{%(queriesSelector)s}', + }, + java_otel: self.otel, + java_micrometer: { + expr: 'process_files_open_files{%(queriesSelector)s}', + }, + prometheus: { + expr: 'process_open_fds{%(queriesSelector)s}', + }, + }, + }, + filesMax: { + name: 'Process files max', + type: 'gauge', + description: 'Process files opened limit.', + optional: true, + sources: { + otel: { + expr: 'process_files_max{%(queriesSelector)s}', + }, + java_otel: self.otel, + java_micrometer: { + expr: 'process_files_max_files{%(queriesSelector)s}', + }, + prometheus: { + expr: 'process_max_fds{%(queriesSelector)s}', + }, + cadvisor: { + expr: 'container_ulimits_soft{%(queriesSelector)s}', + }, + }, + }, + }, + } diff --git a/process-observ-lib/signals/system.libsonnet b/process-observ-lib/signals/system.libsonnet new file mode 100644 index 000000000..3890acf0e --- /dev/null +++ b/process-observ-lib/signals/system.libsonnet @@ -0,0 +1,76 @@ +function(this) + { + discoveryMetric: { + // https://opentelemetry.io/docs/specs/semconv/system/process-metrics/ + otel: 'runtime_uptime', + java_otel: self.otel, // some system metrics are calculated differently for java + java_micrometer: 'process_uptime_seconds', + // https://prometheus.github.io/client_java/instrumentation/jvm/#process-metrics + // https://github.com/prometheus/client_golang + prometheus: 'process_start_time_seconds', + + // acceptable if container has single process running + cadvisor: 'container_cpu_usage_seconds_total', + }, + filteringSelector: this.filteringSelector, + groupLabels: this.groupLabels, + instanceLabels: this.instanceLabels, + aggLevel: 'instance', // group, instance, or none. + alertsInterval: '5m', + signals: { + loadAverage1m: { + name: 'Load average', + type: 'gauge', //show as is. + description: "System's load average.", + unit: 'short', + optional: true, + sources: { + // prometheus: + // { + // expr: '?{%(queriesSelector)s}', + // }, + java_otel: { + expr: 'process_runtime_jvm_system_cpu_load_1m{%(queriesSelector)s}', + }, + // otel: { + // expr: ? + // }, + java_micrometer: { + expr: 'system_load_average_1m{%(queriesSelector)s}', + }, + }, + }, + systemCPUUsage: { + name: 'CPU usage (system)', + description: 'CPU Usage of host system.', + type: 'gauge', + unit: 'percent', // 0-100 + optional: true, + sources: { + java_micrometer: { + expr: 'system_cpu_usage{%(queriesSelector)s} * 100', + }, + java_otel: { + expr: 'process_runtime_jvm_system_cpu_utilization{%(queriesSelector)s}', + }, + // otel: { + // ? + // } + }, + + }, + + systemCPUCount: { + name: 'CPU count', + type: 'gauge', + description: "System's CPU count available to the process observed.", + unit: 'short', + optional: true, + sources: { + java_micrometer: { + expr: 'system_cpu_count{%(queriesSelector)s}', + }, + }, + }, + }, + } diff --git a/spring-boot-mixin/.lint b/spring-boot-mixin/.lint index 601c2f5e5..91f57653f 100644 --- a/spring-boot-mixin/.lint +++ b/spring-boot-mixin/.lint @@ -1,11 +1,13 @@ exclusions: panel-title-description-rule: reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" + panel-units-rule: + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" template-datasource-rule: reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" template-instance-rule: reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" template-job-rule: - reason: "allValue '.+' cannot be used as queries such as 'process_uptime_seconds{job=~\".+\"}' will return timeseries unrelated to Spring boot applications." + reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" template-on-time-change-reload-rule: reason: "mixtool upgrade made this rule stricter. TODO: Fix errors and remove the warning exclusion" diff --git a/spring-boot-mixin/Makefile b/spring-boot-mixin/Makefile new file mode 100644 index 000000000..4ba658da4 --- /dev/null +++ b/spring-boot-mixin/Makefile @@ -0,0 +1,8 @@ +lint: + mixtool lint mixin.libsonnet + +build: + mixtool generate all mixin.libsonnet + +clean: + rm -rf dashboards_out alerts.yaml rules.yaml \ No newline at end of file diff --git a/spring-boot-mixin/README.md b/spring-boot-mixin/README.md new file mode 100644 index 000000000..99daf027b --- /dev/null +++ b/spring-boot-mixin/README.md @@ -0,0 +1,4 @@ +# Spring boot (micrometer) mixin + +This integration works with the [Micrometer (prometheus)](https://docs.micrometer.io/micrometer/reference/implementations/prometheus.html/). It requires each JVM application to export the metrics with this method. +Uses [JVM observability lib](../jvm-observ-lib/). diff --git a/spring-boot-mixin/config.libsonnet b/spring-boot-mixin/config.libsonnet new file mode 100644 index 000000000..7454c57c0 --- /dev/null +++ b/spring-boot-mixin/config.libsonnet @@ -0,0 +1,10 @@ +{ + filteringSelector: 'job!=""', + groupLabels: ['job'], + instanceLabels: ['instance'], + uid: 'jvm-micrometer', + dashboardNamePrefix: 'Springboot ', + dashboardTags: ['java', 'jvm', 'springboot', 'micrometer'], + metricsSource: 'java_micrometer', + alertHeapWarning: 80, // % +} diff --git a/spring-boot-mixin/dashboards/spring-boot-statistics_rev2.json b/spring-boot-mixin/dashboards/spring-boot-statistics_rev2.json deleted file mode 100644 index 16e29aa4c..000000000 --- a/spring-boot-mixin/dashboards/spring-boot-statistics_rev2.json +++ /dev/null @@ -1,3897 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Dashboard for Spring Boot2 Statistics(by micrometer-prometheus).", - "editable": true, - "fiscalYearStartMonth": 0, - "gnetId": 6756, - "graphTooltip": 0, - "id": 2, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 54, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "Basic Statistics", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 0, - "y": 1 - }, - "id": 52, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "process_uptime_seconds{application=~\"$application\", instance=~\"$instance\", job=~\"$job\"}", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "metric": "", - "refId": "A", - "step": 14400 - } - ], - "title": "Uptime", - "type": "stat" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(50, 172, 45, 0.97)", - "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 70 - }, - { - "color": "rgba(245, 54, 54, 0.9)", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 5, - "x": 6, - "y": 1 - }, - "id": 58, - "links": [], - "maxDataPoints": 100, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "sum(jvm_memory_used_bytes{application=~\"$application\", instance=~\"$instance\", job=~\"$job\", area=\"heap\"})*100/sum(jvm_memory_max_bytes{application=~\"$application\",instance=~\"$instance\", job=~\"$job\", area=\"heap\"})", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A", - "step": 14400 - } - ], - "title": "Heap Used", - "type": "gauge" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 1, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - }, - { - "options": { - "from": -1e32, - "result": { - "text": "N/A" - }, - "to": 0 - }, - "type": "range" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(50, 172, 45, 0.97)", - "value": null - }, - { - "color": "rgba(237, 129, 40, 0.89)", - "value": 70 - }, - { - "color": "rgba(245, 54, 54, 0.9)", - "value": 90 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 5, - "x": 11, - "y": 1 - }, - "id": 60, - "links": [], - "maxDataPoints": 100, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "sum(jvm_memory_used_bytes{application=~\"$application\", instance=~\"$instance\", job=~\"$job\", area=\"nonheap\"})*100/sum(jvm_memory_max_bytes{application=~\"$application\",instance=~\"$instance\", job=~\"$job\", area=\"nonheap\"})", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "refId": "A", - "step": 14400 - } - ], - "title": "Non-Heap Used", - "type": "gauge" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "locale" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 8, - "x": 16, - "y": 1 - }, - "id": 66, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "process_files_open_files{application=~\"$application\", instance=~\"$instance\", job=~\"$job\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Open Files", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "process_files_max_files{application=~\"$application\", instance=~\"$instance\", job=~\"$job\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Max Files", - "refId": "B" - } - ], - "title": "Process Open Files", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "dateTimeAsIso" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 6, - "x": 0, - "y": 4 - }, - "id": 56, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "process_start_time_seconds{application=~\"$application\", instance=~\"$instance\", job=~\"$job\"}*1000", - "format": "time_series", - "intervalFactor": 2, - "legendFormat": "", - "metric": "", - "refId": "A", - "step": 14400 - } - ], - "title": "Start time", - "type": "stat" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 7 - }, - "id": 95, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "system_cpu_usage{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "System CPU Usage", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "process_cpu_usage{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Process CPU Usage", - "refId": "B" - } - ], - "title": "CPU Usage", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 7 - }, - "id": 96, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "system_load_average_1m{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Load Average [1m]", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "system_cpu_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "CPU Core Size", - "refId": "B" - } - ], - "title": "Load Average", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 14 - }, - "id": 48, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "JVM Statistics - Memory", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 15 - }, - "id": 85, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "repeat": "memory_pool_heap", - "repeatDirection": "h", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_memory_used_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=~\"$memory_pool_heap\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Used", - "refId": "C" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_memory_committed_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=~\"$memory_pool_heap\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Commited", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_memory_max_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=~\"$memory_pool_heap\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Max", - "refId": "B" - } - ], - "title": "$memory_pool_heap (heap)", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 0, - "y": 23 - }, - "id": 88, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "repeat": "memory_pool_nonheap", - "repeatDirection": "h", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_memory_used_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=~\"$memory_pool_nonheap\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Used", - "refId": "C" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_memory_committed_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=~\"$memory_pool_nonheap\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Commited", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_memory_max_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=~\"$memory_pool_nonheap\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Max", - "refId": "B" - } - ], - "title": "$memory_pool_nonheap (non-heap)", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "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 - } - ] - }, - "unit": "locale" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 31 - }, - "id": 50, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_classes_loaded_classes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Classes Loaded", - "refId": "A" - } - ], - "title": "Classes Loaded", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 31 - }, - "id": 80, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(jvm_classes_unloaded_classes_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Classes Unloaded", - "refId": "A" - } - ], - "title": "Classes Unloaded", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 39 - }, - "id": 82, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_buffer_memory_used_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=\"direct\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Used Bytes", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_buffer_total_capacity_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=\"direct\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Capacity Bytes", - "refId": "B" - } - ], - "title": "Direct Buffers", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 39 - }, - "id": 83, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_buffer_memory_used_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=\"mapped\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Used Bytes", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_buffer_total_capacity_bytes{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", id=\"mapped\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Capacity Bytes", - "refId": "B" - } - ], - "title": "Mapped Buffers", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 46 - }, - "id": 68, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_threads_daemon_threads{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Daemon", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_threads_live_threads{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Live", - "refId": "B" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "jvm_threads_peak_threads{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Peak", - "refId": "C" - } - ], - "title": "Threads", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 46 - }, - "id": 78, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(jvm_gc_memory_allocated_bytes_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "allocated", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(jvm_gc_memory_promoted_bytes_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "promoted", - "refId": "B" - } - ], - "title": "Memory Allocate/Promote", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 54 - }, - "id": 72, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "JVM Statistics - GC", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "locale" - }, - "overrides": [ - { - "matcher": { - "id": "byValue", - "options": { - "op": "gte", - "reducer": "allIsZero", - "value": 0 - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": false - } - } - ] - }, - { - "matcher": { - "id": "byValue", - "options": { - "op": "gte", - "reducer": "allIsNull", - "value": 0 - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": false - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 55 - }, - "id": 74, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(jvm_gc_pause_seconds_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{action}} [{{cause}}]", - "refId": "A" - } - ], - "title": "GC Count", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [ - { - "matcher": { - "id": "byValue", - "options": { - "op": "gte", - "reducer": "allIsZero", - "value": 0 - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": false - } - } - ] - }, - { - "matcher": { - "id": "byValue", - "options": { - "op": "gte", - "reducer": "allIsNull", - "value": 0 - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": false - } - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 55 - }, - "id": 76, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(jvm_gc_pause_seconds_sum{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{action}} [{{cause}}]", - "refId": "A" - } - ], - "title": "GC Stop the World Duration", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 65 - }, - "id": 34, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "HikariCP Statistics", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 66 - }, - "id": 44, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Connections Size", - "type": "stat" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byValue", - "options": { - "op": "gte", - "reducer": "allIsNull", - "value": 0 - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": false - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 20, - "x": 4, - "y": 66 - }, - "id": 36, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_active{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Active", - "refId": "B" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_idle{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Idle", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_pending{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Pending", - "refId": "C" - } - ], - "title": "Connections", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 70 - }, - "id": 46, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_timeout_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Connection Timeout Count", - "type": "stat" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 8, - "x": 0, - "y": 74 - }, - "id": 38, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_creation_seconds_sum{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"} / hikaricp_connections_creation_seconds_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Creation Time", - "refId": "A" - } - ], - "title": "Connection Creation Time", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 8, - "x": 8, - "y": 74 - }, - "id": 42, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_usage_seconds_sum{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"} / hikaricp_connections_usage_seconds_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Usage Time", - "refId": "A" - } - ], - "title": "Connection Usage Time", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 6, - "w": 8, - "x": 16, - "y": 74 - }, - "id": 40, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "hikaricp_connections_acquire_seconds_sum{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"} / hikaricp_connections_acquire_seconds_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", pool=\"$hikaricp\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Acquire Time", - "refId": "A" - } - ], - "title": "Connection Acquire Time", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 80 - }, - "id": 18, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "HTTP Statistics", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 81 - }, - "id": 4, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(http_server_requests_seconds_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", uri!~\".*actuator.*\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{method}} [{{status}}] - {{uri}}", - "refId": "A" - } - ], - "title": "Request Count", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 88 - }, - "id": 2, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "max", "min"], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(http_server_requests_seconds_sum{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", exception=~\"[n|N]one\", uri!~\".*actuator.*\"}[$__rate_interval]) / irate(http_server_requests_seconds_count{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", exception=~\"[n|N]one\", uri!~\".*actuator.*\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{method}} [{{status}}] - {{uri}}", - "refId": "A" - } - ], - "title": "Response Time", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 95 - }, - "id": 22, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "Tomcat Statistics", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "locale" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 0, - "y": 96 - }, - "id": 28, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "tomcat_global_error_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Total Error Count", - "type": "stat" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 9, - "x": 4, - "y": 96 - }, - "id": 24, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "tomcat_sessions_active_current_sessions{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "active sessions", - "refId": "A" - } - ], - "title": "Active Sessions", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 11, - "x": 13, - "y": 96 - }, - "id": 26, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(tomcat_global_sent_bytes_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Sent Bytes", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(tomcat_global_received_bytes_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Recieved Bytes", - "refId": "B" - } - ], - "title": "Sent & Recieved Bytes", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "locale" - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 100 - }, - "id": 32, - "links": [], - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "tomcat_threads_config_max_threads{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "", - "refId": "A" - } - ], - "title": "Thread Config Max", - "type": "stat" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 103 - }, - "id": 30, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "expr": "tomcat_threads_current_threads{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Current thread", - "refId": "A" - }, - { - "datasource": { - "uid": "$datasource" - }, - "expr": "tomcat_threads_busy{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "Current thread busy", - "refId": "B" - } - ], - "title": "Threads", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 110 - }, - "id": 8, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "grafanacloud-prom" - }, - "refId": "A" - } - ], - "title": "Logback Statistics", - "type": "row" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 111 - }, - "id": 6, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "alias": "", - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(logback_events_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", level=\"info\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "info", - "rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n", - "refId": "A" - } - ], - "title": "INFO logs", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 111 - }, - "id": 10, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "alias": "", - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(logback_events_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", level=\"error\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "error", - "rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n", - "refId": "A" - } - ], - "title": "ERROR logs", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 8, - "x": 0, - "y": 118 - }, - "id": 14, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "alias": "", - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(logback_events_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", level=\"warn\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "warn", - "rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n", - "refId": "A" - } - ], - "title": "WARN logs", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 8, - "x": 8, - "y": 118 - }, - "id": 16, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "alias": "", - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(logback_events_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", level=\"debug\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "debug", - "rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n", - "refId": "A" - } - ], - "title": "DEBUG logs", - "type": "timeseries" - }, - { - "datasource": { - "uid": "$datasource" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 8, - "x": 16, - "y": 118 - }, - "id": 20, - "links": [], - "options": { - "legend": { - "calcs": ["mean", "lastNotNull", "max", "min", "sum"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.2.2", - "targets": [ - { - "alias": "", - "datasource": { - "uid": "$datasource" - }, - "expr": "irate(logback_events_total{instance=~\"$instance\", job=~\"$job\", application=~\"$application\", level=\"trace\"}[$__rate_interval])", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "trace", - "rawSql": "SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n", - "refId": "A" - } - ], - "title": "TRACE logs", - "type": "timeseries" - } - ], - "refresh": "30s", - "schemaVersion": 38, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "default", - "value": "default" - }, - "hide": 0, - "includeAll": false, - "label": "Data source", - "multi": false, - "name": "datasource", - "options": [], - "query": "prometheus", - "refresh": 1, - "regex": "(?!grafanacloud-usage|grafanacloud-ml-metrics).+", - "skipUrlSync": false, - "type": "datasource" - }, - { - "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "uid": "$datasource" - }, - "definition": "label_values(jvm_classes_loaded_classes, job)", - "hide": 0, - "includeAll": true, - "label": "Job", - "multi": true, - "name": "job", - "options": [], - "query": { - "query": "label_values(jvm_classes_loaded_classes, job)", - "refId": "StandardVariableQuery" - }, - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "uid": "$datasource" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "label": "Instance", - "multi": true, - "name": "instance", - "options": [], - "query": "label_values(jvm_classes_loaded_classes{job=~\"$job\"}, instance)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "uid": "$datasource" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "label": "Application", - "multi": true, - "name": "application", - "options": [], - "query": "label_values(jvm_classes_loaded_classes{instance=~\"$instance\", job=~\"$job\"}, application)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "uid": "$datasource" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "label": "HikariCP-Pool", - "multi": true, - "name": "hikaricp", - "options": [], - "query": "label_values(hikaricp_connections{instance=~\"$instance\", job=~\"$job\", application=~\"$application\"}, pool)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "uid": "$datasource" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "label": "Memory Pool (heap)", - "multi": true, - "name": "memory_pool_heap", - "options": [], - "query": "label_values(jvm_memory_used_bytes{application=~\"$application\", instance=~\"$instance\", job=~\"$job\", area=\"heap\"},id)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, - "datasource": { - "uid": "$datasource" - }, - "definition": "", - "hide": 0, - "includeAll": true, - "label": "Memory Pool (nonheap)", - "multi": true, - "name": "memory_pool_nonheap", - "options": [], - "query": "label_values(jvm_memory_used_bytes{application=~\"$application\", instance=~\"$instance\", job=~\"$job\", area=\"nonheap\"},id)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "tagValuesQuery": "", - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "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": "", - "title": "Spring Boot Statistics", - "uid": "20201230-spring", - "version": 3, - "weekStart": "" -} diff --git a/spring-boot-mixin/jsonnetfile.json b/spring-boot-mixin/jsonnetfile.json new file mode 100644 index 000000000..534a29c92 --- /dev/null +++ b/spring-boot-mixin/jsonnetfile.json @@ -0,0 +1,22 @@ +{ + "version": 1, + "dependencies": [ + { + "source": { + "local": { + "directory": "../common-lib" + } + }, + "version": "" + }, + { + "source": { + "local": { + "directory": "../jvm-observ-lib" + } + }, + "version": "" + } + ], + "legacyImports": true +} \ No newline at end of file diff --git a/spring-boot-mixin/mixin.libsonnet b/spring-boot-mixin/mixin.libsonnet index 133cd7533..3b99dea73 100644 --- a/spring-boot-mixin/mixin.libsonnet +++ b/spring-boot-mixin/mixin.libsonnet @@ -1,5 +1,6 @@ -{ - grafanaDashboards: { - 'spring-boot-dashboard.json': (import 'dashboards/spring-boot-statistics_rev2.json'), - }, -} +local config = import './config.libsonnet'; +local jvmlib = import 'jvm-observ-lib/main.libsonnet'; +local jvm = + jvmlib.new() + + jvmlib.withConfigMixin(config); +jvm.asMonitoringMixin()