docs: static MonitoredResource getDefaultResource() {
      MonitoredResource.Builder builder = MonitoredResource.newBuilder();
      // Populate internal resource label for defaulting project_id label.
      // This allows stats from other projects (e.g from GAE running in another project) to be
      // collected.
      if (MetadataConfig.getProjectId() != null) {
        builder.putLabels(STACKDRIVER_PROJECT_ID_KEY, MetadataConfig.getProjectId());
      }
  
      Resource autoDetectedResource = ResourceUtils.detectResource();
      if (autoDetectedResource == null || autoDetectedResource.getType() == null) {
        builder.setType(GLOBAL);
        return builder.build();
      }
  
      setResourceForBuilder(builder, autoDetectedResource);
      return builder.build();
    }