Infinity API - Data retention

Hi,

I would like to visualize the REST API’s response over a time (like 6hrs, 24hrs…). But this API response isn’t being saved as it is being saved in the Prometheus TSDB.

How can I retain the history of this API response?

Additionally, since the API sometimes returns an empty response ([ ]), how do I display a custom message when this happens? I have already tried value mappings.

Thanks.

you can create an pi job in prometheus that will scrape the endpoint based on your scrape interval: