Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions DEVELOPMENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ yarn dev
1. Build the back-end, inject it into a docker image, and run it alongside a Haxall server:

```bash
mage -v && docker compose -f docker-compose_dev.yaml up
mage -v && docker compose up
```

## Usage

Create a new data source and select "Haystack". If no Docker configuration has been edited, the Haystack API is available at
`http://haxall:8080/api/`, with the username `su` and password `su`. Click "Save and Test" and make sure that it is
working.
An example datasource and dashboard are created by the provisioning system.

Create a new dashboard and panel, and use this axon query to test the connection:
If you'd like to create a new dashboard and panel, you use this axon query to test the connection:

```
[{ts: now()-1hr, v0: 0}, {ts: now(), v0: 10}].toGrid
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ services:
extends:
file: .config/docker-compose-base.yaml
service: grafana
haxall:
image: "needleinajaystack/haxall:latest"
environment:
- SU_USER=su
- SU_PASS=su
ports:
- 8080:8080/tcp
volumes:
- ~/haxall/proj:/opt/haxall/proj
27 changes: 0 additions & 27 deletions docker-compose_dev.yaml

This file was deleted.

1 change: 1 addition & 0 deletions provisioning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For more information see [Provision dashboards and data sources](https://grafana.com/tutorials/provision-dashboards-and-data-sources/)
10 changes: 10 additions & 0 deletions provisioning/dashboards/dashboards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1

providers:
- name: 'provisioning'
disableDeletion: true
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /etc/grafana/provisioning/dashboards
foldersFromFilesStructure: true
51 changes: 51 additions & 0 deletions provisioning/dashboards/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"uid": "haystack-example",
"title": "Haystack Example",
"schemaVersion": 39,
"version": 1,
"editable": true,
"tags": [],
"time": { "from": "now-6h", "to": "now" },
"timepicker": {},
"refresh": "",
"panels": [
{
"id": 1,
"type": "timeseries",
"title": "Time Series",
"gridPos": { "x": 0, "y": 0, "w": 12, "h": 8 },
"datasource": { "type": "needleinajaystack-haystack-datasource", "uid": "Haystack" },
"targets": [
{
"refId": "A",
"datasource": { "type": "needleinajaystack-haystack-datasource", "uid": "Haystack" },
"type": "eval",
"eval": "[{ts: now()-1hr, v0: 0}, {ts: now(), v0: 10}].toGrid"
}
]
},
{
"id": 2,
"type": "table",
"title": "Table",
"gridPos": { "x": 12, "y": 0, "w": 12, "h": 8 },
"datasource": { "type": "needleinajaystack-haystack-datasource", "uid": "Haystack" },
"targets": [
{
"refId": "A",
"datasource": { "type": "needleinajaystack-haystack-datasource", "uid": "Haystack" },
"type": "eval",
"eval": "[{name: \"a\", value: 75, temp}, {name: \"b\", value: 5, pressure}].toGrid"
}
]
}
],
"__requires": [
{
"type": "datasource",
"id": "needleinajaystack-haystack-datasource",
"name": "Haystack",
"version": "1.0.0"
}
]
}
Empty file.
15 changes: 15 additions & 0 deletions provisioning/datasources/datasources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: 1

datasources:
- name: 'Haystack'
type: 'needleinajaystack-haystack-datasource'
access: proxy
isDefault: true
orgId: 1
version: 1
editable: true
jsonData:
url: 'http://haxall:8080/api/'
username: 'su'
secureJsonData:
password: 'su'
Loading