Grail query on Custom DB Query

Hi,

how can I query the data of custom.db.query with Grail?

For example, I would like to get the graph of this query (Data Explorer), in a Notebook:

custom.db.query:filter(and(or(eq(query_name,query1)))):splitBy(field1):sum:sort(value(sum,descending)):limit(20)

Best regards,

Carlos

Hi @cbenitezv !

Here is an example :

timeseries avg(custom.db.query), by:{field1}, filter:in(query_name,"query1") and in(column,"status"), interval:1h
| sort `avg(custom.db.query)`,direction:"descending"
| limit 20

Also please find some documentation about extension Metrics on Grail :

Does it help?

Thanks. That was exactly what I was looking for.