Hello!
I am VERY new to using GCP and thus using Monitoring.
I’ve seen the possibilities of using MQL to fetch logs and turn them into graphs. I’ve read the documentation already on https://cloud.google.com/monitoring/mql/examples?_ga=2.122959883.-1251670378.1673862564&hl=en but I haven’t found a solution to my problem yet. Which is :
From these logs in Log Explorer :
That have a filter httpRequest.status = 403
I’d like to make a line chart using this component :
With an MQL query.
When asking our dear friend ChatGPT they give me this response which doesn’t work as intended :
fetch gce_instance
| metric 'logging.googleapis.com/operation'
| filter httpRequest.status = 403
| group_by [TIMESTAMP_TRUNC(timestamp, HOUR)]
| count()
Error is couldn’t find the ‘logging.googleapis.com/operation’ even though I replace the metric by something known to auto-complete.
I’d like my logs to be in a line chart given X axis is the time (grouped by hours preferably) and Y axis is the number of httpRequest that have status = 403 (which is a count if I understood correctly).
If there is any other way I can organize this information as another form of graph please let me know I’m opened for suggestions.
I hope I provided enough information and if I didn’t I’ll be sure to reply to any input.
Thank you so much in advance for your help!