Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kube-prometheus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
prometheus-operator
kube-prometheus
Commits
9c93c7ae
Unverified
Commit
9c93c7ae
authored
4 years ago
by
paulfantom
Browse files
Options
Downloads
Patches
Plain Diff
docs: regenerate
parent
ab3dff20
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/developing-prometheus-rules-and-grafana-dashboards.md
+45
-42
45 additions, 42 deletions
docs/developing-prometheus-rules-and-grafana-dashboards.md
with
45 additions
and
42 deletions
docs/developing-prometheus-rules-and-grafana-dashboards.md
+
45
−
42
View file @
9c93c7ae
...
@@ -274,34 +274,36 @@ local template = grafana.template;
...
@@ -274,34 +274,36 @@ local template = grafana.template;
local
graphPanel
=
grafana
.
graphPanel
;
local
graphPanel
=
grafana
.
graphPanel
;
local
kp
=
(
import
'kube-prometheus/main.libsonnet'
)
+
{
local
kp
=
(
import
'kube-prometheus/main.libsonnet'
)
+
{
_config
+::
{
values
+::
{
namespace
:
'monitoring'
,
common
+::
{
},
namespace
:
'monitoring'
,
grafana
+::
{
},
dashboards
+::
{
grafana
+:
{
'my-dashboard.json'
:
dashboards
+::
{
dashboard
.
new
(
'My Dashboard'
)
'my-dashboard.json'
:
.
addTemplate
(
dashboard
.
new
(
'My Dashboard'
)
{
.
addTemplate
(
current
:
{
{
text
:
'Prometheus'
,
current
:
{
value
:
'Prometheus'
,
text
:
'Prometheus'
,
value
:
'Prometheus'
,
},
hide
:
0
,
label
:
null
,
name
:
'datasource'
,
options
:
[],
query
:
'prometheus'
,
refresh
:
1
,
regex
:
''
,
type
:
'datasource'
,
},
},
hide
:
0
,
)
label
:
null
,
.
addRow
(
name
:
'datasource'
,
row
.
new
()
options
:
[],
.
addPanel
(
graphPanel
.
new
(
'My Panel'
,
span
=
6
,
datasource
=
'$datasource'
)
query
:
'prometheus'
,
.
addTarget
(
prometheus
.
target
(
'vector(1)'
)))
refresh
:
1
,
),
regex
:
''
,
},
type
:
'datasource'
,
},
)
.
addRow
(
row
.
new
()
.
addPanel
(
graphPanel
.
new
(
'My Panel'
,
span
=
6
,
datasource
=
'$datasource'
)
.
addTarget
(
prometheus
.
target
(
'vector(1)'
)))
),
},
},
},
},
};
};
...
@@ -322,15 +324,14 @@ As jsonnet is a superset of json, the jsonnet `import` function can be used to i
...
@@ -322,15 +324,14 @@ As jsonnet is a superset of json, the jsonnet `import` function can be used to i
[
embedmd
]:
#
(../examples/grafana-additional-rendered-dashboard-example.jsonnet)
[
embedmd
]:
#
(../examples/grafana-additional-rendered-dashboard-example.jsonnet)
```
jsonnet
```
jsonnet
local
kp
=
(
import
'kube-prometheus/main.libsonnet'
)
+
{
local
kp
=
(
import
'kube-prometheus/main.libsonnet'
)
+
{
_config
+::
{
values
+::
{
namespace
:
'monitoring'
,
common
+::
{
},
namespace
:
'monitoring'
,
grafanaDashboards
+::
{
// monitoring-mixin compatibility
},
'my-dashboard.json'
:
(
import
'example-grafana-dashboard.json'
),
grafana
+:
{
},
dashboards
+::
{
// use this method to import your dashboards to Grafana
grafana
+::
{
'my-dashboard.json'
:
(
import
'example-grafana-dashboard.json'
),
dashboards
+::
{
// use this method to import your dashboards to Grafana
},
'my-dashboard.json'
:
(
import
'example-grafana-dashboard.json'
),
},
},
},
},
};
};
...
@@ -348,12 +349,14 @@ In case you have lots of json dashboard exported out from grafana UI the above a
...
@@ -348,12 +349,14 @@ In case you have lots of json dashboard exported out from grafana UI the above a
[
embedmd
]:
#
(../examples/grafana-additional-rendered-dashboard-example-2.jsonnet)
[
embedmd
]:
#
(../examples/grafana-additional-rendered-dashboard-example-2.jsonnet)
```
jsonnet
```
jsonnet
local
kp
=
(
import
'kube-prometheus/main.libsonnet'
)
+
{
local
kp
=
(
import
'kube-prometheus/main.libsonnet'
)
+
{
_config
+::
{
values
+::
{
namespace
:
'monitoring'
,
common
+::
{
},
namespace
:
'monitoring'
,
grafana
+::
{
},
rawDashboards
+::
{
grafana
+:
{
'my-dashboard.json'
:
(
importstr
'example-grafana-dashboard.json'
),
rawDashboards
+::
{
'my-dashboard.json'
:
(
importstr
'example-grafana-dashboard.json'
),
},
},
},
},
},
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment