Commit 245a7364 authored by Owais Razi Uddin's avatar Owais Razi Uddin

updating JVM jsonnet

parent befe36c6
Pipeline #4138 passed with stages
in 12 seconds
......@@ -9,6 +9,7 @@ local tablePanel = grafana.tablePanel;
local tablePanel = grafana.tablePanel;
local singleStat = grafana.singlestat;
local gaugePanel = grafana.gaugePanel;
local graphPanel = grafana.graphPanel;
......@@ -28,14 +29,14 @@ local steps_1 = [
local steps_2 = [
{color: 'green', value: 10, text: 'High'},
{color: 'orange', value: 10, text: 'Low', },
{color: 'green', value: 20, text: 'Low', },
];
grafana.dashboard.new(
'JVM New DB',
uid='ABCXYZ123',
'SpringBoot App Dashboard',
uid='ABCJVM123',
refresh='1m',
time_from='now-1h',
time_from='now-6h',
editable=true,
tags=['java']
)
......@@ -63,28 +64,142 @@ grafana.dashboard.new(
label='Job',
refresh='time',
)
).addTemplate(
template.new(
'env',
'Prometheus',
'label_values(jvm_threads_current, env)',
label='Environment',
refresh='time',
)
).addRow(
row.new(
'Performance Stats',
)
.addPanel(
graphPanel.new(
'CPU Usage',
span=6,
fill=1,
min=0,
format='',
decimals=2,
legend_values=true,
legend_min=true,
legend_max=true,
legend_current=true,
legend_total=false,
legend_avg=true,
legend_alignAsTable=true,
)
.addTarget(
prometheus.target(
'system_cpu_usage',
legendFormat='CPU Usage',
datasource='Prometheus',
)
),
gridPos = { h: 5, w: 30, x: 0, y: 0}
).addPanel(
graphPanel.new(
'System Load',
span=6,
fill=1,
min=0,
format='',
decimals=2,
legend_values=true,
legend_min=true,
legend_max=true,
legend_current=true,
legend_total=false,
legend_avg=true,
legend_alignAsTable=true,
)
.addTarget(
prometheus.target(
'system_load_average_1m',
legendFormat='System Load',
datasource='Prometheus',
)
),
gridPos = { h: 5, w: 30, x: 0, y: 0}
)
).addRow(
row.new(
'Thread Information',
).addPanel(
grafana.statPanel.new('Stat Panel representation of Jvm Threads state',
datasource='Prometheus',
allValues=false,
colorMode='background',
reducerFunction='lastNotNull',
graphMode='none'
).addThresholds(steps_2)
.addTarget(
prometheus.target(
hide=false,
expr='jvm_threads_states_threads{job="$job",instance="$instance"}',
legendFormat='{{state}}',
)
),
gridPos={ h: 5, w: 30, x: 0, y: 20 }
).addPanel(
grafana.statPanel.new('JVM Memory Max Bytes',
datasource='Prometheus',
allValues=false,
colorMode='background',
graphMode='none',
unit='bytes'
).addThresholds(steps_2)
.addTarget(
prometheus.target(
hide=false,
expr='jvm_memory_max_bytes{job="$job",instance="$instance"}',
legendFormat='{{id}}',
)
),
gridPos={ h: 5, w: 30, x: 0, y: 20 }
).addPanel(
grafana.statPanel.new('Server Requests Count',
datasource='Prometheus',
allValues=false,
colorMode='background',
graphMode='none',
unit=''
).addThresholds(steps_2)
.addTarget(
prometheus.target(
hide=false,
expr='sum(http_server_requests_seconds_count) by (outcome)',
legendFormat='{{outcome}}',
)
),
gridPos={ h: 5, w: 30, x: 0, y: 20 }
)
).addRow(
row.new(
'Basic Stats',
)
.addPanel(
singleStat.new(
'Jvm GC Memory allocation(in GegaBytes)',
'Application Up time',
span=4,
prefix='',
format='s',
postfix='',
colorBackground=true,
colorValue=true,
colorValue=false,
thresholds="10,25",
colors=[
'rgba(237, 129, 40, 0.89)',
'rgba(255, 255, 0, 1)',
'#d44a3a',
'#00FF00',
'green',
]
)
)
.addTarget(
prometheus.target(
'((jvm_gc_memory_allocated_bytes_total{job="$job",instance="$instance"}) / (1024 * 1024 * 1024))',
'time()-process_start_time_seconds{env="$env",job="$job",instance="$instance"}',
datasource='Prometheus',
)
)
......@@ -104,7 +219,7 @@ grafana.dashboard.new(
legendFormat='buffer capacity'
)
),
gridPos={ h: 15, w: 30, x: 0, y: 0 }
gridPos={ h: 5, w: 30, x: 0, y: 0 }
).addPanel(gaugePanel.new('Jvm Memory Max Bytes',
datasource='Prometheus',
min=0,
......@@ -123,63 +238,5 @@ grafana.dashboard.new(
),
gridPos={ h: 15, w: 30, x: 0, y: 0 }
)
).addRow(
row.new(
'Graph Stats',
).addPanel(
grafana.graphPanel.new('Graph representation of Jvm GC pause',
datasource='Prometheus',
legend_show=true,
shared_tooltip=true,
show_xaxis=true,
x_axis_mode="Time",
format='short',
span=12,
labelY1='Short',
fill=0,
bars = { // add the 'bars' object here
mode: 'stackedPercent',
width: 1.5 // increase bar width
}
)
.addTarget(
prometheus.target(
hide=false,
expr='jvm_gc_pause_seconds_sum{job="$job",instance="$instance"}',
legendFormat='Jvm GC pause second sum',
)
),
gridPos={ h: 8, w: 6, x: 6, y: 0 }
).addPanel(
grafana.statPanel.new('Stat Panel representation of Jvm Threads state',
datasource='Prometheus',
allValues=false,
colorMode='background',
graphMode='none'
).addThresholds(steps_2)
.addTarget(
prometheus.target(
hide=false,
expr='jvm_threads_states_threads{job="$job",instance="$instance"}',
legendFormat='{{state}}',
)
),
gridPos={ h: 10, w: 20, x: 0, y: 20 }
).addPanel(
barGaugePanel.new(
title='Jvm GC Allocated memory in Bytes',
datasource='Prometheus',
thresholds=steps,
)
.addTarget(
grafana.prometheus.target(
expr='sum(jvm_classes_loaded_classes{job="$job",instance="$instance"})',
)
) + {
options: {
displayMode:'lcd'
},
},
gridPos = { h: 8, w: 8, x: 8, y: 10 }
)
)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment