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
059e74d1
Commit
059e74d1
authored
5 years ago
by
Deepak Jain
Committed by
Deepak Jain
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Docs for rawGrafanaDashboards filed
Propose in this
https://github.com/brancz/kubernetes-grafana/pull/78
parent
03b36af5
No related branches found
No related tags found
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
+20
-0
20 additions, 0 deletions
docs/developing-prometheus-rules-and-grafana-dashboards.md
with
20 additions
and
0 deletions
docs/developing-prometheus-rules-and-grafana-dashboards.md
+
20
−
0
View file @
059e74d1
...
...
@@ -310,3 +310,23 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
{
[
'prometheus-'
+
name
]:
kp
.
prometheus
[
name
]
for
name
in
std
.
objectFields
(
kp
.
prometheus
)
}
+
{
[
'grafana-'
+
name
]:
kp
.
grafana
[
name
]
for
name
in
std
.
objectFields
(
kp
.
grafana
)
}
```
Incase you have lots of json dashboard exported out from grafan UI the above approch is going to take lots of time. to improve performance we can use
`rawGrafanaDashboards`
field and provide it's value as json string by using importstr
```
jsonnet
local
kp
=
(
import
'kube-prometheus/kube-prometheus.libsonnet'
)
+
{
_config
+::
{
namespace
:
'monitoring'
,
},
rawGrafanaDashboards
+::
{
'my-dashboard.json'
:
(
importstr
'example-grafana-dashboard.json'
),
},
};
{
[
'00namespace-'
+
name
]:
kp
.
kubePrometheus
[
name
]
for
name
in
std
.
objectFields
(
kp
.
kubePrometheus
)
}
+
{
[
'0prometheus-operator-'
+
name
]:
kp
.
prometheusOperator
[
name
]
for
name
in
std
.
objectFields
(
kp
.
prometheusOperator
)
}
+
{
[
'node-exporter-'
+
name
]:
kp
.
nodeExporter
[
name
]
for
name
in
std
.
objectFields
(
kp
.
nodeExporter
)
}
+
{
[
'kube-state-metrics-'
+
name
]:
kp
.
kubeStateMetrics
[
name
]
for
name
in
std
.
objectFields
(
kp
.
kubeStateMetrics
)
}
+
{
[
'alertmanager-'
+
name
]:
kp
.
alertmanager
[
name
]
for
name
in
std
.
objectFields
(
kp
.
alertmanager
)
}
+
{
[
'prometheus-'
+
name
]:
kp
.
prometheus
[
name
]
for
name
in
std
.
objectFields
(
kp
.
prometheus
)
}
+
{
[
'grafana-'
+
name
]:
kp
.
grafana
[
name
]
for
name
in
std
.
objectFields
(
kp
.
grafana
)
}
```
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