Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit 0f6302a

Browse files
committed
Added tag-keys and tag-values api
1 parent bb9a077 commit 0f6302a

File tree

6 files changed

+198
-2
lines changed

6 files changed

+198
-2
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Your backend needs to implement 4 urls:
1010
* `/search` used by the find metric options on the query tab in panels.
1111
* `/query` should return metrics based on input.
1212
* `/annotations` should return annotations.
13+
* `/tag-keys` should return tag keys for ad hoc filters.
14+
* `/tag-values` should return tag values for ad hoc filters.
1315

1416
## Installation
1517

@@ -49,6 +51,11 @@ Example `timeserie` request
4951
{ "target": "upper_50", "refId": "A", "type": "timeserie" },
5052
{ "target": "upper_75", "refId": "B", "type": "timeserie" }
5153
],
54+
"adhocFilters": [
55+
"key": "City"
56+
"operator": "=",
57+
"value": "Berlin"
58+
]
5259
"format": "json",
5360
"maxDataPoints": 550
5461
}
@@ -161,6 +168,37 @@ Example map response
161168
[ { "text" :"upper_25", "value": 1}, { "text" :"upper_75", "value": 2} ]
162169
```
163170

171+
### Tag Keys API
172+
173+
Example request
174+
``` javascript
175+
{ }
176+
```
177+
178+
The tag keys api returns:
179+
```javascript
180+
[
181+
{"type":"string","text":"City"},
182+
{"type":"string","text":"Country"}
183+
]
184+
```
185+
186+
### Tag Values API
187+
188+
Example request
189+
``` javascript
190+
{"key": "City"}
191+
```
192+
193+
The tag values api returns:
194+
```javascript
195+
[
196+
{'text': 'Eins!'},
197+
{'text': 'Zwei'},
198+
{'text': 'Drei!'}
199+
]
200+
```
201+
164202
### Dev setup
165203

166204
This plugin requires node 6.10.0
@@ -171,6 +209,10 @@ This plugin requires node 6.10.0
171209

172210
### Changelog
173211

212+
dev
213+
- added tag-keys + tag-values api
214+
- added adHocFilters parameter to query body
215+
174216
1.3.5
175217
- Fix for dropdowns in query editor to allow writing template variables (broke due to change in Grafana).
176218

dist/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Your backend needs to implement 4 urls:
1010
* `/search` used by the find metric options on the query tab in panels.
1111
* `/query` should return metrics based on input.
1212
* `/annotations` should return annotations.
13+
* `/tag-keys` should return tag keys for ad hoc filters.
14+
* `/tag-values` should return tag values for ad hoc filters.
1315

1416
## Installation
1517

@@ -48,6 +50,11 @@ Example `timeserie` request
4850
{ "target": "upper_50", "refId": "A", "type": "timeserie" },
4951
{ "target": "upper_75", "refId": "B", "type": "timeserie" }
5052
],
53+
"adhocFilters": [
54+
"key": "City"
55+
"operator": "=",
56+
"value": "Berlin"
57+
]
5158
"format": "json",
5259
"maxDataPoints": 550
5360
}
@@ -160,6 +167,37 @@ Example map response
160167
[ { "text" :"upper_25", "value": 1}, { "text" :"upper_75", "value": 2} ]
161168
```
162169

170+
### Tag Keys API
171+
172+
Example request
173+
``` javascript
174+
{ }
175+
```
176+
177+
The tag keys api returns:
178+
```javascript
179+
[
180+
{"type":"string","text":"City"},
181+
{"type":"string","text":"Country"}
182+
]
183+
```
184+
185+
### Tag Values API
186+
187+
Example request
188+
``` javascript
189+
{"key": "City"}
190+
```
191+
192+
The tag values api returns:
193+
```javascript
194+
[
195+
{'text': 'Eins!'},
196+
{'text': 'Zwei'},
197+
{'text': 'Drei!'}
198+
]
199+
```
200+
163201
### Dev setup
164202

165203
This plugin requires node 6.10.0
@@ -170,6 +208,10 @@ This plugin requires node 6.10.0
170208

171209
### Changelog
172210

211+
dev
212+
- added tag-keys + tag-values api
213+
- added adHocFilters parameter to query body
214+
173215
1.3.5
174216
- Fix for dropdowns in query editor to allow writing template variables (broke due to change in Grafana).
175217

dist/datasource.js

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/datasource.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)