code: public Metric getMetric(String metricName) {
      // [START getMetric]
      Metric metric = logging.getMetric(metricName);
      if (metric == null) {
        // metric was not found
      }
      // [END getMetric]
      return metric;
    }
docs: [VARIABLE "my_metric_name"]