Skip to content

[Story] Scorecard test to verify Grafana data #793

@ebaron

Description

@ebaron

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

{
  "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:

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions