0

I have a dashboard created from stackdriver custom log metrics. My question is how can I show only one split stack bar for 1 day. This is the query in query editor:

fetch gae_app 
| metric 'some-custom-metric' 
| filter (metric.log == 'appengiene-log') 
| group_by 1d, 
    [value_new_aggregate: 
       aggregate(value.new)] 
| every 1d 
| group_by [label1:metric.label1a, label2:ascii_to_upper(metric.label2a)],
    [value_new_aggregate_aggregate: aggregate(value_new_aggregate)]

this displays the dashboard chart as below for a day: enter image description here

but I want to display it like this: enter image description here

Jose Luis Delgadillo
  • 2,348
  • 1
  • 6
  • 16

1 Answers1

0

For my kubernetes cluster CPU allocatable utilization below MQL gives me the stacked bar like thisenter image description here which I believe similar like yours

fetch k8s_node
| metric 'kubernetes.io/node/cpu/allocatable_utilization'
| filter resource.project_id == 'xxxxxxxxxx'
| group_by 1d,
    [value_allocatable_utilization_aggregate:
       aggregate(value.allocatable_utilization)]
| every 1d
| group_by [resource.cluster_name],
    [value_allocatable_utilization_aggregate_aggregate:
       aggregate(value_allocatable_utilization_aggregate)]
Mahboob
  • 1,877
  • 5
  • 19
  • not sure why its not working in my case. The main reason for using Query editor is to use ascii_to_upper(), which is not supported in basic/advanced metric. – sharmila sundaresan Jan 27 '21 at 22:28
  • Was the answer useful to solve your issue? If so, can you accept it – Elba Lazo Jan 28 '21 at 17:48
  • Regarding the 1st image (Green/orange query), are you showing the visualization period per week instead of per day? that's not visible and in the 2nd image the time frame was selected per 1D or by 1W? I cannot see it neither, finally and as 3rd option what if you add in addition to ```ever 1d``` + ```align rate``` too also checkout [how to configure dashboard widgets](https://cloud.google.com/monitoring/charts#configure-widget) – Elba Lazo Feb 05 '21 at 23:28
  • ```| align rate(1d)``` ```| every 1d``` note that there is a line break between both fields, not sure 100% if this will solve your issue but let me know – Elba Lazo Feb 09 '21 at 18:38