code: public final LogMetric createLogMetric(ParentName parent, LogMetric metric) {
  
      CreateLogMetricRequest request =
          CreateLogMetricRequest.newBuilder()
              .setParent(parent == null ? null : parent.toString())
              .setMetric(metric)
              .build();
      return createLogMetric(request);
    }
docs: Creates a logs-based metric.
  
  <p>Sample code:
  
  <pre><code>
  try (MetricsClient metricsClient = MetricsClient.create()) {
  ParentName parent = ProjectName.of("[PROJECT]");
  LogMetric metric = LogMetric.newBuilder().build();
  LogMetric response = metricsClient.createLogMetric(parent, metric);
  }
  </code></pre>
  
  @param parent The resource name of the project in which to create the metric:
  <p>"projects/[PROJECT_ID]"
  <p>The new metric must be provided in the request.
  @param metric The new logs-based metric, which must not have an identifier that already exists.
  @throws com.google.api.gax.rpc.ApiException if the remote call fails