Querying list of failed jobs using Infinity Data source

Hi everyone,

I use infinity data source to query a list of failed jobs. But regardless of the timeline I put in such as “last 12 hours” it will always returns all the failed jobs going back to the very beginning many months ago. Is this a bug or am I doing something wrong? Same for list of skipped jobs. But the list of commits works fine. Below is what I have:

Thanks,

what does the rest api look like and does it use the timeline you choose in the rest api query?

what do you see when you run the same query outside of grafana?

Hi Yosiasz, appreciate your response. I am pretty new to the CICD, Grafana and Gitlab so I really don’t know how to answer your question about rest api. I am trying to read the stats from Gitlab using the command I saw in Gitlab. I tried to run the command outside Grafana using GET command:

GET -C username:password https://gitlab-us-ltd.xxx.com/api/v4/projects/1134/jobs?scope[]=failed

But it returns:

GET: No match

Not sure why the command doesn’t work. Maybe it needs some kind of an access key. In Grafana I setup PROVATE-TOKEN key to a value that I get from Gitlab as shown below.

So if that call to gitlab returns nothing outside of grafana, then the issue is not grafana.

So you have to figure out a way to maybe have an empty csv file instead of no file which causes the error

I don’t think the command line works. I am investigating why. But Grafana does return the list of failed jobs but it returns all of them regardless of the time frame I choose on the top right corner of the panel such as last 12 hours or last 30 minutes. It always returns all of the failed jobs dating back to months ago.

Your REST api command does not have any time parameters. If you wanted last 12 hours, 2 weeks, etc then there would be a place in the URL for the start and end. This is covered in the official documentation for Infinity.

Here is a URL with date parameters that works in Infinity.

https://api.marketdata.app/v1/stocks/candles/D/AAPL/?from=${__from:date:YYYY-MM-DD}&to=${__to:date:YYYY-MM-DD}

1 Like