Module: Fluent::GoogleCloudOutput::ServiceConstants

Defined in:
lib/fluent/plugin/out_google_cloud.rb

Overview

Constants for service names, resource types and etc.

Constant Summary collapse

APPENGINE_CONSTANTS =
{
  service: 'appengine.googleapis.com',
  resource_type: 'gae_app',
  metadata_attributes: %w(gae_backend_name gae_backend_version)
}
CLOUDFUNCTIONS_CONSTANTS =
{
  service: 'cloudfunctions.googleapis.com',
  resource_type: 'cloud_function'
}
COMPUTE_CONSTANTS =
{
  service: 'compute.googleapis.com',
  resource_type: 'gce_instance'
}
GKE_CONSTANTS =
{
  service: 'container.googleapis.com',
  resource_type: 'container',
  extra_resource_labels: %w(namespace_id pod_id container_name),
  extra_common_labels: %w(namespace_name pod_name),
  metadata_attributes: %w(kube-env)
}
DOCKER_CONSTANTS =
{
  service: 'docker.googleapis.com',
  resource_type: 'docker_container'
}
DATAFLOW_CONSTANTS =
{
  service: 'dataflow.googleapis.com',
  resource_type: 'dataflow_step',
  extra_common_labels: %w(region job_name job_id step_id)
}
DATAPROC_CONSTANTS =
{
  service: 'cluster.dataproc.googleapis.com',
  resource_type: 'cloud_dataproc_cluster',
  metadata_attributes: %w(dataproc-cluster-uuid dataproc-cluster-name)
}
EC2_CONSTANTS =
{
  service: 'ec2.amazonaws.com',
  resource_type: 'aws_ec2_instance'
}
ML_CONSTANTS =
{
  service: 'ml.googleapis.com',
  resource_type: 'ml_job',
  extra_common_labels: %w(job_id task_name)
}
SUBSERVICE_MAP =

The map between a subservice name and a resource type.

[APPENGINE_CONSTANTS, GKE_CONSTANTS, DATAFLOW_CONSTANTS,
 DATAPROC_CONSTANTS, ML_CONSTANTS]
.map { |consts| [consts[:service], consts[:resource_type]] }.to_h
SUBSERVICE_METADATA_ATTRIBUTES =

The map between a resource type and expected subservice attributes.

[APPENGINE_CONSTANTS, GKE_CONSTANTS, DATAPROC_CONSTANTS].map do |consts|
  [consts[:resource_type], consts[:metadata_attributes].to_set]
end.to_h