google-cloud-logging - Class Google::Cloud::Logging::ResourceDescriptor::LabelDescriptor (v2.2.2)

Stay organized with collections Save and categorize content based on your preferences.

Reference documentation and code samples for the google-cloud-logging class Google::Cloud::Logging::ResourceDescriptor::LabelDescriptor.


A definition of a label that can be used to describe instances of a Google::Cloud::Logging::Resource. For example, Cloud SQL databases must be labeled with their database_id. See #labels.


  • Object


require "google/cloud/logging"

logging =
resource_descriptor = logging.resource_descriptors.first
label_descriptor = resource_descriptor.labels.first
label_descriptor.key #=> "database_id"
label_descriptor.description #=> "The ID of the database."



def description()

A human-readable description for the label.


def key()

The key (name) of the label.


def type() -> Symbol, nil

The type of data that can be assigned to the label.

  • (Symbol, nil) — Returns :string, :boolean, :integer, or nil if there is no type.