lib/fluent/plugin/out_google_cloud.rb
# Determine the common labels that should be added to all log entries
# processed by this logging agent.
Determine the common labels that should be added to all log entries
processed by this logging agent.
Determine the common labels that should be added to all log entries processed by this logging agent .
def determine_agent_level_common_labels(resource)
      labels = {}
      labels.merge!(@labels) if @labels
      case resource.type
      when APPENGINE_CONSTANTS[:resource_type],
           DATAFLOW_CONSTANTS[:resource_type],
           DATAPROC_CONSTANTS[:resource_type],
           ML_CONSTANTS[:resource_type]
        labels.merge!(
          "#{COMPUTE_CONSTANTS[:service]}/resource_id" => @vm_id,
          "#{COMPUTE_CONSTANTS[:service]}/resource_name" => @vm_name,
          "#{COMPUTE_CONSTANTS[:service]}/zone" => @zone
        )
      when COMPUTE_CONSTANTS[:resource_type],
           GKE_CONSTANTS[:resource_type]
        labels["#{COMPUTE_CONSTANTS[:service]}/resource_name"] = @vm_name
      when EC2_CONSTANTS[:resource_type]
        labels["#{EC2_CONSTANTS[:service]}/resource_name"] = @vm_name
      end
      labels
    end
def determine_agent_level_common_labels ( resource ) labels = { } labels . merge! ( @labels ) if @labels case resource . type when APPENGINE_CONSTANTS [ :resource_type ] , DATAFLOW_CONSTANTS [ :resource_type ] , DATAPROC_CONSTANTS [ :resource_type ] , ML_CONSTANTS [ :resource_type ] labels . merge! ( "#{COMPUTE_CONSTANTS[:service]}/resource_id" => @vm_id , "#{COMPUTE_CONSTANTS[:service]}/resource_name" => @vm_name , "#{COMPUTE_CONSTANTS[:service]}/zone" => @zone ) when COMPUTE_CONSTANTS [ :resource_type ] , GKE_CONSTANTS [ :resource_type ] labels [ "#{COMPUTE_CONSTANTS[:service]}/resource_name" ] = @vm_name when EC2_CONSTANTS [ :resource_type ] labels [ "#{EC2_CONSTANTS[:service]}/resource_name" ] = @vm_name end labels end
Determine the common labels that should be added to all log entries
processed by this logging agent.
Determine the common labels that should be added to all log entries processed by this logging agent .
# User can specify labels via config. We want to capture those as well. # GAE, Cloud Dataflow, Cloud Dataproc and Cloud ML. # GCE instance and GKE container. # EC2.
resource
<not_specific>