File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -127,3 +127,7 @@ docker-swarm.box
127
127
* .tfvars
128
128
join.sh
129
129
output-virtualbox-iso
130
+
131
+ # Ignore grafanalib output
132
+ /graphs /__pycache__ /
133
+ /graphs /* .json
Original file line number Diff line number Diff line change
1
+ FROM python:3.4-alpine
2
+
3
+ MAINTAINER Container Solutions
[email protected]
4
+
5
+ # Install basic dependencies
6
+ RUN apk add -U curl git parallel
7
+
8
+ # Silence parallel citation notice
9
+ RUN mkdir /root/.parallel && \
10
+ touch /root/.parallel/will-cite
11
+
12
+ # Install pip
13
+ RUN curl https://bootstrap.pypa.io/get-pip.py | python
14
+
15
+ # Install grafanalib
16
+ RUN pip install git+https://github.com/weaveworks/grafanalib@82556ddfbbd6134837d280a7999d35c45cc3c87e
17
+
18
+ WORKDIR /opt/code
19
+
20
+ CMD ["/bin/sh" , "-c" ]
Original file line number Diff line number Diff line change
1
+ # Grafana Dashboards
2
+ We have included a set of dashboards for Grafana in this demo application.
3
+ Most of the source of these dashboards look exactly the same. For the sake of
4
+ keeping our code DRY, we have decided to generate our dashboards using [ grafanalib] ( https://github.com/weaveworks/grafanalib ) .
5
+
6
+
7
+ # Requirements
8
+ If you don't have Python installed on your computer but do have Docker, then Docker and Make will
9
+ make your life easier today:
10
+
11
+ | what | version |
12
+ | ------ | --------- |
13
+ | make | ` >= 4.1 ` |
14
+ | docker | ` >= 17 ` |
15
+
16
+ # Getting Started
17
+
18
+ ## The Base Image
19
+ All the tooling required to generate the dashboards is inside a container. Build it with like this:
20
+
21
+ ```
22
+ docker build -t weaveworks/grafanalib .
23
+ ```
24
+
25
+ ## Generating Dashboards
26
+ Make sure that you run the following commands from within the ` graphs/ ` directory:
27
+
28
+ ```
29
+ docker run --rm -it -v ${PWD}:/opt/code weaveworks/grafanalib /bin/sh -c 'ls /opt/code/*.dashboard.py | parallel generate-dashboard -o {.}.json {}'
30
+ ```
You can’t perform that action at this time.
0 commit comments