cryostatio / cryostatio/cryostat-operator

[Story] Scorecard test to verify Grafana data

Open
#793 0 comments 1 reaction 1 assignee Claimed by @tthvo View on GitHub
test
Dominant language
Go
Stars
37
Forks
22
Avg merge
21h 37m
Merged PRs (30d)
22

Description

Using an existing JFR file uploaded to Cryostat, it should be possible to verify the data presented by Grafana for that recording. It should be possible to use the Grafana API to give us repeatable JSON data for the datasource and dashboards.

We can start by querying the dashboard API for information about what information/panels will be displayed:
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/#get-dashboard-by-uid

Then we can parse that and construct datasource queries, similar to those Grafana would use itself to populate the dashboard:

`POST /api/datasources/proxy/1/query`
```json
{
"requestId": "Q106",
"range": {
"from": "2024-04-08T20:23:35.127Z",
"to": "2024-04-09T20:23:35.127Z",
"raw": {
"from": "now-24h",
"to": "now"
}
},
"interval": "15m",
"intervalMs": 900000,
"targets": [
{
"target": "jdk.PhysicalMemory.usedSize",
"refId": "A",
"type": "timeserie"
}
],
"maxDataPoints": 100,
"startTime": 1712694215127
}
```

Example response:
```json
[
{
"target": "jdk.PhysicalMemory.usedSize",
"datapoints": [
[
120377344,
1712692998158
],
[
1.1884544E+8,
1712693027960
]
],
"meta": {}
}
]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.