code: @Deprecated
    public static void createAndRegisterWithMonitoredResource(
        Duration exportInterval, MonitoredResource monitoredResource) throws IOException {
      checkNotNull(exportInterval, "exportInterval");
      checkNotNull(monitoredResource, "monitoredResource");
      checkArgument(
          !DEFAULT_PROJECT_ID.isEmpty(), "Cannot find a project ID from application default.");
      createInternal(
          null, DEFAULT_PROJECT_ID, exportInterval, monitoredResource, null, DEFAULT_CONSTANT_LABELS);
    }
docs: Creates a Stackdriver Stats exporter with a custom Monitored Resource.
  
  <p>Only one Stackdriver exporter can be created.
  
  <p>Please refer to cloud.google.com/monitoring/custom-metrics/creating-metrics#which-resource
  for a list of valid {@code MonitoredResource}s.
  
  <p>This uses the default application credentials. See {@link
  GoogleCredentials#getApplicationDefault}.
  
  <p>This uses the default project ID configured see {@link ServiceOptions#getDefaultProjectId}.
  
  @param exportInterval the interval between pushing stats to StackDriver.
  @param monitoredResource the Monitored Resource used by exporter.
  @throws IllegalStateException if a Stackdriver exporter is already created.
  @deprecated in favor of {@link #createAndRegister(StackdriverStatsConfiguration)}.
  @since 0.10