Reference documentation and code samples for the Cloud Logging V2 API class Google::Api::MonitoredResourceDescriptor.
An object that describes the schema of a
MonitoredResource object using a type name
and a set of labels. For example, the monitored resource descriptor for
Google Compute Engine VM instances has a type of
"gce_instance" and specifies the use of the labels "instance_id" and
"zone" to identify particular VM instances.
Different APIs can support different monitored resource types. APIs generally
provide a list method that returns the monitored resource descriptors used
by the API.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#description
defdescription()->::String
Returns
(::String) — Optional. A detailed description of the monitored resource type that might
be used in documentation.
#description=
defdescription=(value)->::String
Parameter
value (::String) — Optional. A detailed description of the monitored resource type that might
be used in documentation.
Returns
(::String) — Optional. A detailed description of the monitored resource type that might
be used in documentation.
#display_name
defdisplay_name()->::String
Returns
(::String) — Optional. A concise name for the monitored resource type that might be
displayed in user interfaces. It should be a Title Cased Noun Phrase,
without any article or other determiners. For example,
"Google Cloud SQL Database".
#display_name=
defdisplay_name=(value)->::String
Parameter
value (::String) — Optional. A concise name for the monitored resource type that might be
displayed in user interfaces. It should be a Title Cased Noun Phrase,
without any article or other determiners. For example,
"Google Cloud SQL Database".
Returns
(::String) — Optional. A concise name for the monitored resource type that might be
displayed in user interfaces. It should be a Title Cased Noun Phrase,
without any article or other determiners. For example,
"Google Cloud SQL Database".
(::Array<::Google::Api::LabelDescriptor>) — Required. A set of labels used to describe instances of this monitored
resource type. For example, an individual Google Cloud SQL database is
identified by values for the labels "database_id" and "zone".
value (::Array<::Google::Api::LabelDescriptor>) — Required. A set of labels used to describe instances of this monitored
resource type. For example, an individual Google Cloud SQL database is
identified by values for the labels "database_id" and "zone".
Returns
(::Array<::Google::Api::LabelDescriptor>) — Required. A set of labels used to describe instances of this monitored
resource type. For example, an individual Google Cloud SQL database is
identified by values for the labels "database_id" and "zone".
(::String) — Optional. The resource name of the monitored resource descriptor:
"projects/{project_id}/monitoredResourceDescriptors/{type}" where
{type} is the value of the type field in this object and
{project_id} is a project ID that provides API-specific context for
accessing the type. APIs that do not use project information can use the
resource name format "monitoredResourceDescriptors/{type}".
#name=
defname=(value)->::String
Parameter
value (::String) — Optional. The resource name of the monitored resource descriptor:
"projects/{project_id}/monitoredResourceDescriptors/{type}" where
{type} is the value of the type field in this object and
{project_id} is a project ID that provides API-specific context for
accessing the type. APIs that do not use project information can use the
resource name format "monitoredResourceDescriptors/{type}".
Returns
(::String) — Optional. The resource name of the monitored resource descriptor:
"projects/{project_id}/monitoredResourceDescriptors/{type}" where
{type} is the value of the type field in this object and
{project_id} is a project ID that provides API-specific context for
accessing the type. APIs that do not use project information can use the
resource name format "monitoredResourceDescriptors/{type}".
#type
deftype()->::String
Returns
(::String) — Required. The monitored resource type. For example, the type
"cloudsql_database" represents databases in Google Cloud SQL.
For a list of types, see Monitored resource
types
and Logging resource
types.
#type=
deftype=(value)->::String
Parameter
value (::String) — Required. The monitored resource type. For example, the type
"cloudsql_database" represents databases in Google Cloud SQL.
For a list of types, see Monitored resource
types
and Logging resource
types.
Returns
(::String) — Required. The monitored resource type. For example, the type
"cloudsql_database" represents databases in Google Cloud SQL.
For a list of types, see Monitored resource
types
and Logging resource
types.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Logging V2 API - Class Google::Api::MonitoredResourceDescriptor (v1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/ruby/docs/reference/google-cloud-logging-v2/latest/Google-Api-MonitoredResourceDescriptor)\n- [1.2.1](/ruby/docs/reference/google-cloud-logging-v2/1.2.1/Google-Api-MonitoredResourceDescriptor)\n- [1.1.0](/ruby/docs/reference/google-cloud-logging-v2/1.1.0/Google-Api-MonitoredResourceDescriptor)\n- [1.0.1](/ruby/docs/reference/google-cloud-logging-v2/1.0.1/Google-Api-MonitoredResourceDescriptor)\n- [0.13.0](/ruby/docs/reference/google-cloud-logging-v2/0.13.0/Google-Api-MonitoredResourceDescriptor)\n- [0.12.2](/ruby/docs/reference/google-cloud-logging-v2/0.12.2/Google-Api-MonitoredResourceDescriptor)\n- [0.11.0](/ruby/docs/reference/google-cloud-logging-v2/0.11.0/Google-Api-MonitoredResourceDescriptor)\n- [0.10.1](/ruby/docs/reference/google-cloud-logging-v2/0.10.1/Google-Api-MonitoredResourceDescriptor)\n- [0.9.0](/ruby/docs/reference/google-cloud-logging-v2/0.9.0/Google-Api-MonitoredResourceDescriptor)\n- [0.8.1](/ruby/docs/reference/google-cloud-logging-v2/0.8.1/Google-Api-MonitoredResourceDescriptor)\n- [0.7.0](/ruby/docs/reference/google-cloud-logging-v2/0.7.0/Google-Api-MonitoredResourceDescriptor)\n- [0.6.0](/ruby/docs/reference/google-cloud-logging-v2/0.6.0/Google-Api-MonitoredResourceDescriptor)\n- [0.5.6](/ruby/docs/reference/google-cloud-logging-v2/0.5.6/Google-Api-MonitoredResourceDescriptor) \nReference documentation and code samples for the Cloud Logging V2 API class Google::Api::MonitoredResourceDescriptor.\n\nAn object that describes the schema of a\n[MonitoredResource](/ruby/docs/reference/google-cloud-logging-v2/latest/Google-Api-MonitoredResource \"Google::Api::MonitoredResource (class)\") object using a type name\nand a set of labels. For example, the monitored resource descriptor for\nGoogle Compute Engine VM instances has a type of\n`\"gce_instance\"` and specifies the use of the labels `\"instance_id\"` and\n`\"zone\"` to identify particular VM instances.\n\n\n\u003cbr /\u003e\n\nDifferent APIs can support different monitored resource types. APIs generally\nprovide a `list` method that returns the monitored resource descriptors used\nby the API. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. A detailed description of the monitored resource type that might be used in documentation.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. A detailed description of the monitored resource type that might be used in documentation. \n**Returns**\n\n- (::String) --- Optional. A detailed description of the monitored resource type that might be used in documentation.\n\n### #display_name\n\n def display_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, `\"Google Cloud SQL Database\"`.\n\n### #display_name=\n\n def display_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, `\"Google Cloud SQL Database\"`. \n**Returns**\n\n- (::String) --- Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, `\"Google Cloud SQL Database\"`.\n\n### #labels\n\n def labels() -\u003e ::Array\u003c::Google::Api::LabelDescriptor\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Api::LabelDescriptor](./Google-Api-LabelDescriptor)\\\u003e) --- Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels `\"database_id\"` and `\"zone\"`.\n\n### #labels=\n\n def labels=(value) -\u003e ::Array\u003c::Google::Api::LabelDescriptor\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Api::LabelDescriptor](./Google-Api-LabelDescriptor)\\\u003e) --- Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels `\"database_id\"` and `\"zone\"`. \n**Returns**\n\n- (::Array\\\u003c[::Google::Api::LabelDescriptor](./Google-Api-LabelDescriptor)\\\u003e) --- Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels `\"database_id\"` and `\"zone\"`.\n\n### #launch_stage\n\n def launch_stage() -\u003e ::Google::Api::LaunchStage\n\n**Returns**\n\n- ([::Google::Api::LaunchStage](./Google-Api-LaunchStage)) --- Optional. The launch stage of the monitored resource definition.\n\n### #launch_stage=\n\n def launch_stage=(value) -\u003e ::Google::Api::LaunchStage\n\n**Parameter**\n\n- **value** ([::Google::Api::LaunchStage](./Google-Api-LaunchStage)) --- Optional. The launch stage of the monitored resource definition. \n**Returns**\n\n- ([::Google::Api::LaunchStage](./Google-Api-LaunchStage)) --- Optional. The launch stage of the monitored resource definition.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. The resource name of the monitored resource descriptor: `\"projects/{project_id}/monitoredResourceDescriptors/{type}\"` where {type} is the value of the `type` field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format `\"monitoredResourceDescriptors/{type}\"`.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. The resource name of the monitored resource descriptor: `\"projects/{project_id}/monitoredResourceDescriptors/{type}\"` where {type} is the value of the `type` field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format `\"monitoredResourceDescriptors/{type}\"`. \n**Returns**\n\n- (::String) --- Optional. The resource name of the monitored resource descriptor: `\"projects/{project_id}/monitoredResourceDescriptors/{type}\"` where {type} is the value of the `type` field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format `\"monitoredResourceDescriptors/{type}\"`.\n\n### #type\n\n def type() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The monitored resource type. For example, the type `\"cloudsql_database\"` represents databases in Google Cloud SQL. For a list of types, see [Monitored resource\n types](https://cloud.google.com/monitoring/api/resources) and [Logging resource\n types](https://cloud.google.com/logging/docs/api/v2/resource-list).\n\n### #type=\n\n def type=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The monitored resource type. For example, the type `\"cloudsql_database\"` represents databases in Google Cloud SQL. For a list of types, see [Monitored resource\n types](https://cloud.google.com/monitoring/api/resources) and [Logging resource\ntypes](https://cloud.google.com/logging/docs/api/v2/resource-list). \n**Returns**\n\n- (::String) --- Required. The monitored resource type. For example, the type `\"cloudsql_database\"` represents databases in Google Cloud SQL. For a list of types, see [Monitored resource\n types](https://cloud.google.com/monitoring/api/resources) and [Logging resource\n types](https://cloud.google.com/logging/docs/api/v2/resource-list)."]]