def monitored_resource_from_local_resource_id(local_resource_id)
      return unless local_resource_id
      if @enable_metadata_agent
        @log.debug 'Calling metadata agent with local_resource_id: ' \
                  "#{local_resource_id}."
        resource = query_metadata_agent_for_monitored_resource(
          local_resource_id)
        @log.debug 'Retrieved monitored resource from metadata agent: ' \
                  "#{resource.inspect}."
        if resource
          # TODO(qingling128): Fix this temporary renaming from 'gke_container'
          # to 'container'.
          resource.type = 'container' if resource.type == 'gke_container'
          return resource
        end
      end
      # Fall back to constructing monitored resource locally.
      # TODO(qingling128): This entire else clause is temporary until we
      # implement buffering and caching.
      @log.debug('Failed to retrieve monitored resource from Metadata' \
                 " Agent with local_resource_id #{local_resource_id}.")
      construct_k8s_resource_locally(local_resource_id)
    end
def monitored_resource_from_local_resource_id(local_resource_id)
      return unless local_resource_id
      if @enable_metadata_agent
        @log.debug 'Calling metadata agent with local_resource_id: ' \
                  "#{local_resource_id}."
        resource = query_metadata_agent_for_monitored_resource(
          local_resource_id)
        @log.debug 'Retrieved monitored resource from metadata agent: ' \
                  "#{resource.inspect}."
        if resource
          # TODO(qingling128): Fix this temporary renaming from 'gke_container'
          # to 'container'.
          resource.type = 'container' if resource.type == 'gke_container'
          return resource
        end
      end
      # Fall back to constructing monitored resource locally.
      # TODO(qingling128): This entire else clause is temporary until we
      # implement buffering and caching.
      @log.debug('Failed to retrieve monitored resource from Metadata' \
                 " Agent with local_resource_id #{local_resource_id}.")
      construct_k8s_resource_locally(local_resource_id)
    end
Take a locally unique resource id and convert it to the globally unique
 monitored resource.