Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9774ec0a
Commit
9774ec0a
authored
Sep 24, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenv: adds script for creating many dashboards with alerts
parent
bdea8d24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
199 additions
and
3 deletions
+199
-3
.gitignore
+1
-0
devenv/bulk_alerting_dashboards/bulk_alerting_dashboards.yaml
+9
-0
devenv/bulk_alerting_dashboards/bulkdash_alerting.jsonnet
+169
-0
devenv/setup.sh
+20
-3
No files found.
.gitignore
View file @
9774ec0a
...
...
@@ -72,3 +72,4 @@ debug.test
*.orig
/devenv/bulk-dashboards/*.json
/devenv/bulk_alerting_dashboards/*.json
devenv/bulk_alerting_dashboards/bulk_alerting_dashboards.yaml
0 → 100644
View file @
9774ec0a
apiVersion
:
1
providers
:
-
name
:
'
Bulk
alerting
dashboards'
folder
:
'
Bulk
alerting
dashboards'
type
:
file
options
:
path
:
devenv/bulk_alerting_dashboards
devenv/bulk_alerting_dashboards/bulkdash_alerting.jsonnet
0 → 100644
View file @
9774ec0a
{
"editable"
:
true
,
"gnetId"
:
null
,
"graphTooltip"
:
0
,
"id"
:
null
,
"links"
:
[],
"panels"
:
[
{
"alert"
:
{
"conditions"
:
[
{
"evaluator"
:
{
"params"
:
[
65
],
"type"
:
"gt"
},
"operator"
:
{
"type"
:
"and"
},
"query"
:
{
"params"
:
[
"A"
,
"5m"
,
"now"
]
},
"reducer"
:
{
"params"
:
[],
"type"
:
"avg"
},
"type"
:
"query"
}
],
"executionErrorState"
:
"alerting"
,
"frequency"
:
"10s"
,
"handler"
:
1
,
"name"
:
"bulk alerting"
,
"noDataState"
:
"no_data"
,
"notifications"
:
[]
},
"aliasColors"
:
{},
"bars"
:
false
,
"dashLength"
:
10
,
"dashes"
:
false
,
"datasource"
:
"Prometheus"
,
"fill"
:
1
,
"gridPos"
:
{
"h"
:
9
,
"w"
:
12
,
"x"
:
0
,
"y"
:
0
},
"id"
:
2
,
"legend"
:
{
"avg"
:
false
,
"current"
:
false
,
"max"
:
false
,
"min"
:
false
,
"show"
:
true
,
"total"
:
false
,
"values"
:
false
},
"lines"
:
true
,
"linewidth"
:
1
,
"nullPointMode"
:
"null"
,
"percentage"
:
false
,
"pointradius"
:
5
,
"points"
:
false
,
"renderer"
:
"flot"
,
"seriesOverrides"
:
[],
"spaceLength"
:
10
,
"stack"
:
false
,
"steppedLine"
:
false
,
"targets"
:
[
{
"$$hashKey"
:
"object:117"
,
"expr"
:
"go_goroutines"
,
"format"
:
"time_series"
,
"intervalFactor"
:
1
,
"refId"
:
"A"
}
],
"thresholds"
:
[
{
"colorMode"
:
"critical"
,
"fill"
:
true
,
"line"
:
true
,
"op"
:
"gt"
,
"value"
:
50
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"Panel Title"
,
"tooltip"
:
{
"shared"
:
true
,
"sort"
:
0
,
"value_type"
:
"individual"
},
"type"
:
"graph"
,
"xaxis"
:
{
"buckets"
:
null
,
"mode"
:
"time"
,
"name"
:
null
,
"show"
:
true
,
"values"
:
[]
},
"yaxes"
:
[
{
"format"
:
"short"
,
"label"
:
null
,
"logBase"
:
1
,
"max"
:
null
,
"min"
:
null
,
"show"
:
true
},
{
"format"
:
"short"
,
"label"
:
null
,
"logBase"
:
1
,
"max"
:
null
,
"min"
:
null
,
"show"
:
true
}
]
}
],
"schemaVersion"
:
16
,
"style"
:
"dark"
,
"tags"
:
[],
"templating"
:
{
"list"
:
[]
},
"time"
:
{
"from"
:
"now-6h"
,
"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"
:
"New dashboard"
,
"uid"
:
null
,
"version"
:
0
}
\ No newline at end of file
devenv/setup.sh
View file @
9774ec0a
...
...
@@ -14,6 +14,20 @@ bulkDashboard() {
ln
-s
-f
-r
./bulk-dashboards/bulk-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
}
bulkAlertingDashboard
()
{
requiresJsonnet
COUNTER
=
0
MAX
=
100
while
[
$COUNTER
-lt
$MAX
]
;
do
jsonnet
-o
"bulk_alerting_dashboards/alerting_dashboard
${
COUNTER
}
.json"
-e
"local bulkDash = import 'bulk_alerting_dashboards/bulkdash_alerting.jsonnet'; bulkDash + { uid: 'uid-
${
COUNTER
}
', title: 'alerting-title-
${
COUNTER
}
' }"
let
COUNTER
=
COUNTER+1
done
ln
-s
-f
-r
./bulk_alerting_dashboards/bulk_alerting_dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
}
requiresJsonnet
()
{
if
!
type
"jsonnet"
>
/dev/null
;
then
echo
"you need you install jsonnet to run this script"
...
...
@@ -36,8 +50,9 @@ devDatasources() {
usage
()
{
echo
-e
"
\n
"
echo
"Usage:"
echo
" bulk-dashboards - create and provisioning 400 dashboards"
echo
" no args - provisiong core datasources and dev dashboards"
echo
" bulk-dashboards - create and provisioning 400 dashboards"
echo
" bulk-alerting-dashboards - create and provisioning 400 dashboards with alerts"
echo
" no args - provisiong core datasources and dev dashboards"
}
main
()
{
...
...
@@ -48,7 +63,9 @@ main() {
local
cmd
=
$1
if
[[
$cmd
==
"bulk-dashboards"
]]
;
then
if
[[
$cmd
==
"bulk-alerting-dashboards"
]]
;
then
bulkAlertingDashboard
elif
[[
$cmd
==
"bulk-dashboards"
]]
;
then
bulkDashboard
else
devDashboards
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment