Skip to content

Commit

Permalink
Merge pull request #57 from axiomhq/provide-provisioning
Browse files Browse the repository at this point in the history
provide a datasource & dashboard for quick testing
  • Loading branch information
SollyzDev authored Apr 24, 2024
2 parents 9eded99 + 6056dd5 commit 1fd5027
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ e2e-results/
# Editor
.idea

.eslintcache
.eslintcache
.envrc
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axiom-datasource",
"version": "0.2.0",
"version": "0.3.0",
"description": "Query Axiom through Grafana",
"scripts": {
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
Expand Down
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/)
136 changes: 136 additions & 0 deletions provisioning/dashboards/axiom-play.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "axiomhq-axiom-datasource",
"uid": "P59D466820D86172A"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"apl": "['hn']\n| summarize count() by bin_auto(_time)",
"datasource": {
"type": "axiomhq-axiom-datasource",
"uid": "P59D466820D86172A"
},
"refId": "A"
}
],
"title": "hn posts",
"type": "timeseries"
}
],
"schemaVersion": 37,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Axiom Grafana plugin test",
"uid": "S6cOVNBSz",
"version": 2,
"weekStart": ""
}
24 changes: 24 additions & 0 deletions provisioning/dashboards/dashboards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: 1

providers:
# <string> an unique provider name. Required
- name: 'axiom-datasource'
# <int> Org id. Default to 1
orgId: 1
# <string> name of the dashboard folder.
folder: ''
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string> provider type. Default to 'file'
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: false
options:
# <string, required> path to dashboard files on disk. Required when using the 'file' type
path: /etc/grafana/provisioning/dashboards
# <bool> use folder names from filesystem to create folders in Grafana
foldersFromFilesStructure: true
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: 'Axiom'
type: 'axiomhq-axiom-datasource'
access: proxy
isDefault: false
orgId: 1
version: 1
editable: true
jsonData:
path: '/resources'
orgID: 'axiom-play-qf1k'
secureJsonData:
accessToken: 'set-your-access-token'

0 comments on commit 1fd5027

Please sign in to comment.