Reputation: 1
I want to group the age with the span of 5 and count number of rows in each bucket. I'm using log-based counter metrics with age as label.
Does anyone have experience of using MQL in GCP monitoring and grouping output table into buckets?
MQL Query:
fetch cloud_run_revision
metric 'logging.googleapis.com/user/Age_Metric'
| align delta()
| map update[age: abs(age)]
| map [age]
Output:
|------|
| age |
|------|
| 24 |
| 7 |
|------|
Expected:
|--------|------|
| bucket count|
|--------|------|
| 20-25 | 1 |
| 6-10 | 1 |
|--------|------|
I've checked the documentation but not able to find anything useful in that.
Upvotes: 0
Views: 54