Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Story] Scorecard test to verify Grafana data #793

Open
Tracked by #794
ebaron opened this issue Apr 9, 2024 · 0 comments · May be fixed by #900
Open
Tracked by #794

[Story] Scorecard test to verify Grafana data #793

ebaron opened this issue Apr 9, 2024 · 0 comments · May be fixed by #900
Assignees
Labels

Comments

@ebaron
Copy link
Member

ebaron commented Apr 9, 2024

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": {}
  }
]
@ebaron ebaron added the test label Apr 9, 2024
@tthvo tthvo self-assigned this Apr 22, 2024
@tthvo tthvo linked a pull request Jun 25, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Status: Stretch Goals
Development

Successfully merging a pull request may close this issue.

2 participants