Skip to content

Commit 0c6f262

Browse files
docs: Moves usage info into plugin readme
1 parent 9304cf4 commit 0c6f262

2 files changed

Lines changed: 54 additions & 42 deletions

File tree

README.md

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Grafana Datasource Plugin for Project Haystack
1+
# Grafana Data Source Plugin for Project Haystack
22

33
This is a [Grafana](https://grafana.com/grafana/) plugin that supports direct communication with a
44
[Project Haystack API Server](https://project-haystack.org/doc/docHaystack/HttpApi). It handles authentication
@@ -10,48 +10,14 @@ and supports standard Haystack API operations as well as custom Axon execution,
1010
To use this package, you should already have a working Grafana server. For instructions on how to install and configure
1111
Grafana, see [here](https://grafana.com/docs/grafana/latest/)
1212

13-
### Installation
13+
For more usage information, see the [plugin readme](./src/README.md)
1414

15-
TODO
15+
## Contributing
1616

17-
### Create a Data Source
17+
Contributions are very welcome! For details on how to develop this plugin, see the
18+
[development guide](./DEVELOPMENT_GUIDE.md).
1819

19-
To create a new data source, select `Data Sources` from the Configuration menu represented by the gear icon on the left
20-
panel. Click `Add Data Source`, and then select `Haystack` from the list. Next, fill in the name of the data source,
21-
the API URL, and the credentials to use to access the data. It is typically a good idea to create a dedicated user
22-
to access the data. Once complete, select `Save & Test`. If you get a green check mark, the connection was successful!
23-
24-
### Query Data
25-
26-
To query data from the data source, create a new panel in a dashboard. If you do not have any dashboards yet, create
27-
one by selecting `+ New Dashboard` from the Dashboard menu in the left panel.
28-
29-
Once within the panel editor, select your Haystack data source in the Data Sources menu. Next, select the type of
30-
Haystack query that should be performed. The supported queries are:
31-
32-
- Eval: Evaluate a free-form Axon expression. Grafana variables may be injected into the query, with the supported
33-
variables listed below. *Note: Not all Haystack servers support this functionality*
34-
- HisRead: Display the history of a single point over the selected time range.
35-
- Read: Display the records matching a filter. Since this is not timeseries data, it can only be viewed in Grafana's
36-
"Table" view.
37-
38-
#### Variables
39-
40-
Some queries support injecting values from the Grafana UI. The following variables are supported:
41-
42-
- `$__timeRange_start`: DateTime start of the selected Grafana time range
43-
- `$__timeRange_end`: DateTime end of the selected Grafana time range
44-
- `$__maxDataPoints`: Number representing the pixel width of Grafana's display panel.
45-
- `$__interval`: Number representing Grafana's recommended data interval. This is the duration of the time range,
46-
divided by the number of pixels, delivered in units of minutes.
47-
48-
To use them, simply use the value in the input string like this:
49-
50-
```
51-
[{ts: $__timeRange_start, v0: 0}, {ts: $__timeRange_end, v0: 10}].toGrid
52-
```
53-
54-
# Continuing Work
20+
## Continuing Work
5521

5622
* [ ] Publish plugin
5723
* [ ] Consider enabling multi-point hisRead (through filters)

src/README.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
<!-- This README file is going to be the one displayed on the Grafana.com website for your plugin -->
22

3-
# Haystack
3+
# Haystack Data Source Plugin
44

5-
A Grafana data source for Haystack tagged data
5+
This is a [Grafana](https://grafana.com/grafana/) data source plugin that supports direct communication with a
6+
[Project Haystack API Server](https://project-haystack.org/doc/docHaystack/HttpApi). It handles authentication
7+
and supports standard Haystack API operations as well as custom Axon execution, which is supported by
8+
[SkySpark](https://skyfoundry.com/product) and [Haxall](https://haxall.io/).
9+
10+
## Usage
11+
12+
### Installation
13+
14+
TODO
15+
16+
### Create a Data Source
17+
18+
To create a new data source, select `Data Sources` from the Configuration menu represented by the gear icon on the left
19+
panel. Click `Add Data Source`, and then select `Haystack` from the list. Next, fill in the name of the data source,
20+
the API URL, and the credentials to use to access the data. It is typically a good idea to create a dedicated user
21+
to access the data. Once complete, select `Save & Test`. If you get a green check mark, the connection was successful!
22+
23+
### Query Data
24+
25+
To query data from the data source, create a new panel in a dashboard. If you do not have any dashboards yet, create
26+
one by selecting `+ New Dashboard` from the Dashboard menu in the left panel.
27+
28+
Once within the panel editor, select your Haystack data source in the Data Sources menu. Next, select the type of
29+
Haystack query that should be performed. The supported queries are:
30+
31+
- Eval: Evaluate a free-form Axon expression. Grafana variables may be injected into the query, with the supported
32+
variables listed below. *Note: Not all Haystack servers support this functionality*
33+
- HisRead: Display the history of a single point over the selected time range.
34+
- Read: Display the records matching a filter. Since this is not timeseries data, it can only be viewed in Grafana's
35+
"Table" view.
36+
37+
#### Variables
38+
39+
Some queries support injecting values from the Grafana UI. The following variables are supported:
40+
41+
- `$__timeRange_start`: DateTime start of the selected Grafana time range
42+
- `$__timeRange_end`: DateTime end of the selected Grafana time range
43+
- `$__maxDataPoints`: Number representing the pixel width of Grafana's display panel.
44+
- `$__interval`: Number representing Grafana's recommended data interval. This is the duration of the time range,
45+
divided by the number of pixels, delivered in units of minutes.
46+
47+
To use them, simply use the value in the input string. Below is an example of using the variables in an Eval query:
48+
49+
```
50+
> [{ts: $__timeRange_start, v0: 0}, {ts: $__timeRange_end, v0: 10}].toGrid
51+
```

0 commit comments

Comments
 (0)