I want to execute MQL (metric query language) to get sum of all values from "metric.size" column which have the same "metric.id".
It should be grouped by id, and size column to be the sum of all the size values for matching id, and this within a certain time range.
In SQL it would look something like below: select id, sum(size) from "metric" group by id where ts is bigger X & less than Y
I have tried many variation of the below command; using within, every, window with no luck.
fetch k8s_container | metric 'logging.googleapis.com/user/ingestion-info' | group_by [metric.tenantId], sum(metric.size) | every 13h
Any help would be greatly appreciated. Thank you.
Also i have tried solutions in the below links: Unable to collect data from metric query language MQL - GCP GCP MQL query: getting metrics/minute
I think you need to turn the column you want to aggregate into a
valuecolumn.metricandresourcecolumns are used in the first argument ofgroup_byoperation.BTW, looks like there is no value exported in your table. If the
metric.sizeis the info you want to monitor, I recommend you define it as the value of the metric.logging.googleapis.com/user/ingestion_sizeorlogging.googleapis.com/user/ingestion-info/sizemight be more readable as a metric name.