I have a log-based metric and an alert that is configured to trigger on Cloud Function error logs. This is the filter for our metric:
resource.type="cloud_function" and severity >= ERROR
Our team uses GitHub Action to deploy the function via gcloud functions deploy
command, and we have noticed that every time we deploy the function for the first time to our production environment, the alert is triggered.
However, when I go to Logs Explorer, I don’t see any logs for the same filter. Moreover, it seems that this issue happens only in this specific environment/Google cloud project, and when I deploy to any other environment (e.g. staging) the metric stays at 0.
What could be causing this log-based metric to count 1 when there are no logs for that filter?