Hi,
I have a full stack web application (React.js in frontend).
I need to to consume one Grafana endpoint and show some charts on a react page based on some queries.
I used Insomnia (like Postman) to fetch data and it worked, but using React.js (browser) to fetch the same endpoint ended with cors and 400 errors.
The Query:
method: POST
url: https://metrics.grid.tf/api/ds/query
body: {"queries":[{"expr":"sum by(node) (irate(host_cpu_seconds_total{node=\"5C7uadAbvdHi9XWfTB5ixzdf6SzUCR6yhnCRCnnT4Hfq6ckr\", mode=\"idle\"}[$__rate_interval])) / on(node) group_left sum by (node)((irate(host_cpu_seconds_total{node=\"5C7uadAbvdHi9XWfTB5ixzdf6SzUCR6yhnCRCnnT4Hfq6ckr\"}[$__rate_interval])))","datasourceId":2}],"from":"1681917052562","to":"1682003452562"}
Respone in Insomnia:
200 OK
data: {
"results": {
"A": {
"status": 200,
"frames": [
{
"schema": {
"name": "
...
Please help me to find my way, what type of plugins I have to use? is there any trick to fetch data in backend?
Thanks.