def determine_agent_level_monitored_resource_via_legacy
      resource = Google::Apis::LoggingV2::MonitoredResource.new(
        labels: {})
      resource.type = determine_agent_level_monitored_resource_type
      resource.labels = determine_agent_level_monitored_resource_labels(
        resource.type)
      resource
    end
def determine_agent_level_monitored_resource_via_legacy
      resource = Google::Apis::LoggingV2::MonitoredResource.new(
        labels: {})
      resource.type = determine_agent_level_monitored_resource_type
      resource.labels = determine_agent_level_monitored_resource_labels(
        resource.type)
      resource
    end
Retrieve monitored resource via the legacy way.

 Note: This is just a failover plan if we fail to get metadata from
 Metadata Agent. Thus it should be equivalent to what Metadata Agent
 returns.