@@ -44,7 +44,7 @@ grafana-wtf - grep through all Grafana entities in the spirit of `git-wtf`_.
44
44
Synopsis
45
45
********
46
46
47
- Search Grafana API for string "weatherbase".
47
+ Search Grafana (dashboards and datasources) for string "weatherbase".
48
48
::
49
49
50
50
grafana-wtf find weatherbase
@@ -54,13 +54,24 @@ Display 50 most recent changes across all dashboards.
54
54
55
55
grafana-wtf log --number=50
56
56
57
+ Explore dashboards and datasources in more detail.
58
+ ::
59
+
60
+ grafana-wtf explore dashboards
61
+ grafana-wtf explore datasources
62
+
57
63
Run with Docker::
58
64
59
65
# Access Grafana instance on localhost, without authentication.
60
- docker run --rm -it --env GRAFANA_URL="http://host.docker.internal:3000" ghcr.io/panodata/grafana-wtf grafana-wtf info
66
+ docker run --rm -it \
67
+ --env GRAFANA_URL="http://host.docker.internal:3000" \
68
+ ghcr.io/panodata/grafana-wtf grafana-wtf info
61
69
62
70
# Access Grafana instance with authentication.
63
- docker run --rm -it --env GRAFANA_URL="https://daq.grafana.org/grafana" --env GRAFANA_TOKEN="eyJrIjoiWHg...dGJpZCI6MX0=" ghcr.io/panodata/grafana-wtf grafana-wtf info
71
+ docker run --rm -it \
72
+ --env GRAFANA_URL="https://grafana.example.org/grafana" \
73
+ --env GRAFANA_TOKEN="eyJrIjoiWHg...dGJpZCI6MX0=" \
74
+ ghcr.io/panodata/grafana-wtf grafana-wtf info
64
75
65
76
66
77
***********
@@ -102,20 +113,42 @@ Please take these steps to create an API key with your Grafana instance:
102
113
please take note of the Bearer token. This is your Grafana API key.
103
114
104
115
105
- *****
106
- Usage
107
- *****
116
+ *************
117
+ Configuration
118
+ *************
108
119
109
- Before running ``grafana-wtf ``, define URL and access token of your Grafana instance::
120
+ Grafana connection
121
+ ==================
122
+
123
+ To configure to which Grafana instance to connect to, and how to authenticate, use
124
+ the ``--grafana-url `` and ``--grafana-token `` command line options.
125
+
126
+ Alternatively, before running ``grafana-wtf ``, you can define URL and access token
127
+ of your Grafana instance by using environment variables::
110
128
111
129
export GRAFANA_URL=https://daq.example.org/grafana/
112
130
export GRAFANA_TOKEN=eyJrIjoiWHg...dGJpZCI6MX0=
113
131
114
- In order to ignore untrusted SSL certificates, append the ``?verify=no `` query string
132
+ In order to accept untrusted SSL certificates, append the ``?verify=no `` query string
115
133
to the ``GRAFANA_URL ``::
116
134
117
135
export GRAFANA_URL=https://daq.example.org/grafana/?verify=no
118
136
137
+ Caching
138
+ =======
139
+
140
+ ``grafana-wtf `` will cache HTTP responses for 300 seconds by default, in order to save
141
+ resources, by not hitting the server each server. You can configure that setting by using
142
+ the ``--cache-ttl `` option, or the ``CACHE_TTL `` environment variable.
143
+
144
+ When invoking the program with the ``--drop-cache `` option, it will drop its cache upfront.
145
+
146
+
147
+
148
+ *****
149
+ Usage
150
+ *****
151
+
119
152
120
153
General information
121
154
===================
@@ -152,7 +185,8 @@ How to find dashboards which use non-existing data sources?
152
185
grafana-wtf explore dashboards --format=yaml
153
186
154
187
# Display only dashboards which have missing data sources, along with their names.
155
- grafana-wtf explore dashboards --format=json | jq '.[] | select( .datasources_missing ) | .dashboard + {ds_missing: .datasources_missing[] | [.name]}'
188
+ grafana-wtf explore dashboards --format=json | \
189
+ jq '.[] | select( .datasources_missing ) | .dashboard + {ds_missing: .datasources_missing[] | [.name]}'
156
190
157
191
How to list all queries used in all dashboards?
158
192
::
@@ -168,12 +202,6 @@ Find the string ``weatherbase`` throughout all dashboards and data sources::
168
202
169
203
grafana-wtf find weatherbase
170
204
171
- .. note ::
172
-
173
- ``grafana-wtf `` will cache HTTP responses for 300 seconds by default.
174
- When running it with the ``--drop-cache `` option, it will drop its cache upfront.
175
-
176
-
177
205
Replacing strings
178
206
=================
179
207
0 commit comments