Create a column in the table that counts the duration

Greetings to all! I recently use grafana and have a problem.

I created a table using the Prometheus Alertmanager datasource. It also indicates the time when the alert appears.
My goal is to create a column in this table where the duration of the alert would be indicated or how long ago it appeared.
I tried to make two requests and combine them into one, setting one column to the time unit: from now
But when you combine the two queries, the time columns become common. I was unable to fix it
I also tried to set the unit on one request and merge after, but they were merged into one column again

I thought to make a request that will subtract the alert time from the current time in order to determine the duration. But I didn’t succeed.

I would be very glad if someone would tell me how to do this or tell me in which direction it would be better for me to look.
Many thanks!!

what my table looks like now

Hi @andreyperov

Can you share more screenshots? This is a little difficult to understand. Or the raw unformatted data.

I would also recommend familiarizing yourself with the Proemtheus data model.

This topic was automatically closed after 365 days. New replies are no longer allowed.