I am trying to create an alert on Google Cloud, to be notified about Pub/Sub messages which cannot be forwarded to a dead-letter topic, using Google Monitoring Query Language.
On Google documentation, it is said:
To verify that Pub/Sub is forwarding undeliverable messages, you can compare the subscription/dead_letter_message_count metric with the topic/send_message_operation_count metric from the topic that Pub/Sub forwards these messages to.
However, when trying to create an alert condition with the Query Editor, I get the following error:
Metric 'pubsub.googleapis.com/topic/send_message_operation_count' is not compatible with resource 'pubsub_subscription'. Consider using the following resource(s): 'pubsub_topic'.
I am wondering then if it is possible to fetch topic and subscription metrics with the Google Monitoring Query Language, and if yes, how?