mirror of https://github.com/grafana/grafana
Aggregator: Add README and example query (#93351)
parent
3df62c28bb
commit
80795fcfd5
@ -0,0 +1,30 @@ |
||||
## Data Plane Aggregator |
||||
|
||||
### Testing queries |
||||
|
||||
1. `custom.ini` changes: |
||||
```ini |
||||
[feature_toggles] |
||||
kubernetesAggregator = true |
||||
dataplaneAggregator = true |
||||
grafanaAPIServerEnsureKubectlAccess = true |
||||
``` |
||||
|
||||
2. start grafana: |
||||
```bash |
||||
make run |
||||
``` |
||||
|
||||
3. enable aggregation for prometheus data source: |
||||
```bash |
||||
export KUBECONFIG=./data/grafana-apiserver/grafana.kubeconfig |
||||
kubectl apply -f pkg/aggregator/examples/datasource.yml --validate=false |
||||
dataplaneservice.aggregation.grafana.app/v0alpha1.prometheus.grafana.app created |
||||
``` |
||||
|
||||
4. edit `pkg/aggregator/examples/datasource-query.json` and update the datasource UID to match the UID of a prometheus data source. |
||||
|
||||
5. execute query (replace `example` with the UID of a prometheus data source): |
||||
```bash |
||||
curl 'http://admin:admin@localhost:3000/apis/prometheus.grafana.app/v0alpha1/namespaces/default/connections/example/query' -X POST -d '@pkg/aggregator/examples/datasource-query.json' |
||||
``` |
@ -0,0 +1,26 @@ |
||||
{ |
||||
"queries": [ |
||||
{ |
||||
"refId": "A", |
||||
"expr": "grafana_environment_info{}", |
||||
"range": true, |
||||
"datasource": { |
||||
"type": "prometheus", |
||||
"uid": "example" |
||||
}, |
||||
"editorMode": "code", |
||||
"legendFormat": "__auto", |
||||
"instant": false, |
||||
"exemplar": false, |
||||
"utcOffsetSec": 0, |
||||
"scopes": [], |
||||
"adhocFilters": [], |
||||
"interval": "", |
||||
"datasourceId": 2, |
||||
"intervalMs": 15000, |
||||
"maxDataPoints": 969 |
||||
} |
||||
], |
||||
"from": "now-1m", |
||||
"to": "now" |
||||
} |
Loading…
Reference in new issue