docs: static Metric toMetricProto(
        io.opencensus.metrics.export.Metric metric,
        @Nullable io.opencensus.resource.Resource resource) {
      Metric.Builder builder = Metric.newBuilder();
      builder.setMetricDescriptor(toMetricDescriptorProto(metric.getMetricDescriptor()));
      for (io.opencensus.metrics.export.TimeSeries timeSeries : metric.getTimeSeriesList()) {
        builder.addTimeseries(toTimeSeriesProto(timeSeries));
      }
      if (resource != null) {
        builder.setResource(toResourceProto(resource));
      }
      return builder.build();
    }