title: How to use Google Monitoring Query Language to fetch metrics from different resource types?
body: <p>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.</p>
  <p>On <a href="https://cloud.google.com/pubsub/docs/monitoring#monitoring_forwarded_undeliverable_messages" rel="nofollow noreferrer">Google documentation</a>, it is said:</p>
  <blockquote>
  <p>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.</p>
  </blockquote>
  <p>However, when trying to create an alert condition with the Query Editor, I get the following error:</p>
  <blockquote>
  <p>Metric 'pubsub.googleapis.com/topic/send_message_operation_count' is not compatible with resource 'pubsub_subscription'. Consider using the following resource(s): 'pubsub_topic'.</p>
  </blockquote>
  <p>I am wondering then if it is possible to fetch topic and subscription metrics with the Google Monitoring Query Language, and if yes, how?</p>