Skip to content

Commit

Permalink
docs(plugins): update readme to link to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bergquist committed Mar 4, 2016
1 parent 09c29cd commit d86cb92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 68 deletions.
69 changes: 3 additions & 66 deletions examples/datasource-plugin-genericdatasource/README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,12 @@
#Generic backend datasource#

This is a very minimalistic datasource that forwards http requests in a defined format. The idea is that anybody should be able to build an api and retrieve data from any datasource without built-in support in grafana.
More documentation about datasource plugins can be found in the [Docs](https://github.com/grafana/grafana/blob/master/docs/sources/plugins/datasources.md)

Its also serves as an living example implementation of a datasource.

A guide for installing plugins can be found at [placeholder for links].

Your backend need implement 3 urls
Your backend need implement 4 urls
* "/" Should return 200 ok. Used for "Test connection" on the datasource config page.
* "/search" Used by the find metric options on the query tab in panels
* "/query" Should return metrics based on input
* "/annotations" should return annotations

## Metric discovery ##

### Request ###
```
{ refId: 'F', target: 'select metric' }
```
### Expected Response ###

An array of options based on the target input

####Example####
```
["upper_25","upper_50","upper_75","upper_90","upper_95"]
```

## Metric query ##

### Request ###
```
{
range: { from: '2015-12-22T03:06:13.851Z',to: '2015-12-22T06:48:24.137Z' },
interval: '5s',
targets:
[ { refId: 'B', target: 'upper_75' },
{ refId: 'A', target: 'upper_90' } ],
format: 'json',
maxDataPoints: 2495 //decided by the panel
}
```
### Expected response ###

An array of
```
{
"target":"target_name",
"datapoints":[
[intvalue, timestamp in epoch],
[intvalue, timestamp in epoch]
]
}
```
###Example###
```
[
{
"target":"upper_75",
"datapoints":[
[622,1450754160000],
[365,1450754220000]
]
},
{
"target":"upper_90",
"datapoints":[
[861,1450754160000],
[767,1450754220000]
]
}
]
```
## Example backend implementation ##
https://gist.github.com/bergquist/bc4aa5baface3cffa109
2 changes: 0 additions & 2 deletions examples/datasource-plugin-genericdatasource/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"id": "datasource-plugin-genericdatasource",
"type": "datasource",

"module": "plugins/genericdatasource/datasource",

"staticRoot": ".",

"metrics": true,
Expand Down

0 comments on commit d86cb92

Please sign in to comment.