github.com/zchee/zap-cloudlogging@v0.0.0-20220819025602-19b026d3900e/pkg/monitoredresource/monitoredresource.go (about) 1 // Copyright 2022 The zap-cloudlogging Authors 2 // SPDX-License-Identifier: BSD-3-Clause 3 4 package monitoredresource 5 6 import ( 7 "strings" 8 "sync" 9 10 "go.uber.org/zap/zapcore" 11 mrpb "google.golang.org/genproto/googleapis/api/monitoredres" 12 13 "github.com/zchee/zap-cloudlogging/pkg/detector" 14 ) 15 16 type Type string 17 18 type Label map[string]string 19 20 // List of Monitored resource types. 21 // 22 // https://cloud.google.com/logging/docs/api/v2/resource-list 23 const ( 24 // aiplatform.googleapis.com/Endpoint 25 // Vertex AI Endpoint 26 // A Vertex AI API Endpoint where Models are deployed into it. 27 // 28 // resource_container: The identifier of the GCP Project owning the Endpoint. 29 // location: The region in which the service is running. 30 // endpoint_id: The ID of the Endpoint. 31 32 // aiplatform.googleapis.com/Featurestore 33 // Vertex AI Feature Store A Vertex AI Feature Store. 34 // 35 // resource_container: The identifier of the GCP Project owning the Featurestore. 36 // location: The region in which the service is running. 37 // featurestore_id: The ID of the Featurestore. 38 39 // aiplatform.googleapis.com/IndexEndpoint 40 // Matching Engine Index Endpoint An Endpoint to which Matching Engine Indexes are deployed. 41 // 42 // resource_container: The identifier of the GCP Project owning the Index. 43 // location: The region in which the service is running. 44 // index_endpoint_id: The ID of the index endpoint. 45 46 // aiplatform.googleapis.com/PipelineJob 47 // Vertex Pipelines Job A Vertex Pipelines Job. 48 // 49 // resource_container: The identifier of the GCP project associated with this resource, such as "my-project". 50 // location: The region in which the service is running. 51 // pipeline_job_id: The ID of the PipelineJob. 52 53 // alloydb.googleapis.com/Instance 54 // AlloyDB instance Monitored resource representing an AlloyDB instance. 55 // 56 // resource_container: The identifier of the GCP project associated with this resource. 57 // location: The Google Cloud region in which the AlloyDB instance is running. 58 // cluster_id: AlloyDB cluster identifier. 59 // instance_id: AlloyDB instance identifier. 60 61 // api 62 // Produced API An API provided by the producer. 63 // 64 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 65 // service: The API service name, such as "cloudsql.googleapis.com". 66 // method: The API method, such as "disks.list". 67 // version: The API version, such as "v1". 68 // location: The service specific notion of location. This can be the name of a zone, region, or "global". 69 70 // apigateway.googleapis.com/Gateway 71 // API Gateway Fully managed API Gateway. 72 // 73 // resource_container: The identifier of the GCP Project owning the Gateway. 74 // location: The region in which the Gateway is running. 75 // gateway_id: The ID of the Gateway. 76 77 // apigee.googleapis.com/Environment 78 // Apigee environment Monitored resource for Apigee environment. 79 // 80 // resource_container: The GCP project ID that writes to this monitored resource. 81 // org: An organization is a container for all the objects in an Apigee account. 82 // env: An environment is a runtime execution context for the proxies in an organization. 83 // location: Location where the Apigee infrastructure is provisioned. 84 85 // app_script_function 86 // Apps Script Function An Apps Script function. 87 // 88 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 89 // invocation_type: The invocation type. 90 // function_name: The function name. 91 92 // assistant_action 93 // Google Assistant Action An Action in a Google Assistant App. 94 // 95 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 96 // version_id: Stringified version ID of the assistant agent. 97 // action_id: Action ID of the assistant agent. 98 99 // audited_resource 100 // Audited Resource A Google Cloud resource that produces an audit log. 101 // 102 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 103 // service: The name of the API service generating the audit log. 104 // method: The name of the API method generating the audit log. 105 106 // autoscaler 107 // Autoscaler An autoscaler for a single managed instance group. 108 // 109 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 110 // location: The zone or region for the autoscaler. 111 // autoscaler_id: The identifier for the autoscaler. 112 // autoscaler_name: The name of the autoscaler. 113 // instance_group_manager_id: The identifier for the managed instance group scaled by the given autoscaler. 114 // instance_group_manager_name: The name of the managed instance group scaled by the givenautoscaler. 115 116 // aws_alb_load_balancer 117 // Amazon ALB Load Balancer A load balancer in Amazon ALB. 118 // 119 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 120 // name: The name of the load balancer. 121 // region: The AWS region for the load balancer. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 122 // aws_account: The AWS account number for the load balancer. 123 124 // aws_cloudfront_distribution 125 // Amazon CloudFront CDN A CloudFront content distribution network. 126 // 127 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 128 // distribution_id: The CloudFront distribution identifier assigned by AWS. 129 // region: The AWS region for the CloudFront distribution. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 130 // aws_account: The AWS account number for the CDN. 131 132 // aws_dynamodb_table 133 // Amazon DynamoDB Table A table in Amazon DynamoDB. 134 // 135 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 136 // table: The table name. 137 // region: The AWS region for the table. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 138 // aws_account: The AWS account number for the table. 139 140 // aws_ebs_volume 141 // Amazon EBS Volume An Amazon EC2 Elastic Block Storage volume. 142 // 143 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 144 // volume_id: The EBS volume identifier assigned by AWS. 145 // region: The AWS region for the volume. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 146 // aws_account: The AWS account number for the volume. 147 148 // aws_ec2_instance 149 // Amazon EC2 Instance A VM instance in Amazon EC2. 150 // 151 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 152 // instance_id: The VM instance identifier assigned by AWS. 153 // aws_account: The AWS account number under which the VM is running. 154 // region: The AWS region in which the VM is running. Supported AWS region values are listed by service at http://docs.aws.amazon.com/general/latest/gr/rande.html. The value supplied for this label must be prefixed with 'aws:' (for example, 'aws:us-east-1' is a valid value while 'us-east-1' is not). 155 156 // aws_elasticache_cluster 157 // Amazon Elasticache Cluster A cache cluster in Amazon Elasticache. 158 // 159 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 160 // cluster_id: The cluster identifier. 161 // region: The AWS region for the cluster. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 162 // aws_account: The AWS account number for the cluster. 163 164 // aws_elb_load_balancer 165 // Amazon Elastic Load Balancer A load balancer in Amazon Elastic Load Balancer. 166 // 167 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 168 // region: The AWS region for the load balancer. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 169 // name: The name of the load balancer. 170 // aws_account: The AWS account number for the load balancer. 171 172 // aws_emr_cluster 173 // Amazon EMR Cluster A cluster in Amazon Elastic MapReduce. 174 // 175 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 176 // cluster_id: The cluster identifier. 177 // region: The AWS region for the cluster. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 178 // aws_account: The AWS account number for the cluster. 179 180 // aws_kinesis_stream 181 // Amazon Kinesis Stream A stream in Amazon Kinesis. 182 // 183 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 184 // stream_name: The stream name. 185 // region: The AWS region for the stream. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 186 // aws_account: The AWS account number for the stream. 187 188 // aws_lambda_function 189 // Amazon Lambda Function A function in Amazon Lambda. 190 // 191 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 192 // function_name: The function name. 193 // region: The AWS region for the function. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 194 // aws_account: The AWS account number for the function. 195 196 // aws_rds_database 197 // Amazon RDS Database A database in Amazon Relational Database Service. 198 // 199 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 200 // name: The database name. 201 // region: The AWS region for the database. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 202 // aws_account: The AWS account number for the database. 203 204 // aws_redshift_cluster 205 // Amazon Redshift Cluster A cluster in Amazon Redshift. 206 // 207 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 208 // cluster_identifier: The cluster name. 209 // region: The AWS region for the cluster. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 210 // aws_account: The AWS account number for the cluster. 211 212 // aws_s3_bucket 213 // Amazon S3 Bucket A bucket in Amazon S3. 214 // 215 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 216 // bucket_name: The bucket name. 217 // region: The AWS region for the bucket. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 218 // aws_account: The AWS account number for the bucket. 219 220 // aws_ses 221 // Amazon SES Region An Amazon region with Amazon Simple Email Service enabled. 222 // 223 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 224 // region: The AWS region. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 225 // aws_account: The AWS account number for the SES region. 226 227 // aws_sns_topic 228 // Amazon SNS Topic A topic in Amazon SNS. 229 // 230 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 231 // topic: The topic name. 232 // region: The AWS region for the topic. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 233 // aws_account: The AWS account number for the topic. 234 235 // aws_sqs_queue 236 // Amazon SQS Queue A queue in Amazon Simple Queue Service. 237 // 238 // project_id: The identifier of the GCP project under which data is stored for the AWS account specified in the aws_account label, such as "my-project". 239 // queue: The queue name. 240 // region: The AWS region for the queue. The format of this field is "aws:{region}", where supported values for {region} are listed at http://docs.aws.amazon.com/general/latest/gr/rande.html. 241 // aws_account: The AWS account number for the queue. 242 243 // bigquery_biengine_model 244 // BigQuery BI Engine Model BigQuery BI Engine Model. 245 // 246 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 247 // location: The Google Cloud location of the resource. 248 // model_id: The identifier of the BI model. 249 250 // bigquery_dataset 251 // BigQuery Dataset A dataset in BigQuery. 252 // 253 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 254 // dataset_id: The name of the BigQuery dataset. 255 256 // bigquery_dts_config 257 // BigQuery DTS Config A BigQuery Data Transfer Service configuration. 258 // 259 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 260 // location: The Google Cloud location of the resource 261 // config_id: The id of the DTS configuration. 262 263 // bigquery_dts_run 264 // BigQuery DTS Run A BigQuery Data Transfer Service Run. 265 // 266 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 267 // location: The Google Cloud location of the resource 268 // config_id: The name of the DTS config that created the run. 269 // run_id: The unique resource name of the BigQuery DTS run. 270 271 // bigquery_project 272 // BigQuery Project BigQuery Project. 273 // 274 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 275 // location: Location of the resource. 276 277 // bigquery_resource 278 // BigQuery A BigQuery resource. 279 // 280 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 281 282 // bigquery_table 283 // BigQuery Table An individual BigQuery table. 284 // 285 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 286 // dataset_id: The name of the BigQuery dataset. 287 // table_id: The name of the BigQuery table. 288 289 // billing_account 290 // Cloud Billing Account A Cloud Billing Account. 291 // 292 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 293 // account_id: The unique id of the billing account. 294 295 // build 296 // Cloud Build A build in Cloud Build. 297 // 298 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 299 // build_id: The unique id of the build. 300 // build_trigger_id: The unique id of the build trigger. 301 // certificatemanager.googleapis.com/Project 302 // Certificate Manager project Certificate Manager project. 303 // resource_container: The GCP container associated with the resource. 304 // location: GCP location. 305 306 // client_auth_config_brand 307 // OAuth2 Brand Consent screen data shown to users during three-legged OAuth2 flows. 308 // 309 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 310 // brand_id: The unique id of the brand. 311 // client_auth_config_client 312 // OAuth2 Client A client used in OAuth2 flows. 313 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 314 // client_id: The unique id of the client. 315 316 // cloud_composer_environment 317 // Cloud Composer Environment A Composer environment runs the managed Apache Airflow service. 318 // 319 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 320 // location: The Cloud Composer location in which the environment is running. 321 // environment_name: The user-specified environment name. 322 323 // cloud_dataproc_batch 324 // Cloud Dataproc Batch A Dataproc batch execution. 325 // 326 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 327 // location: The Cloud Dataproc region to which the batch was submitted. 328 // batch_id: The user-specified batch id. 329 330 // cloud_dataproc_cluster 331 // Cloud Dataproc Cluster A Dataproc cluster with separate cluster name and id labels. 332 // 333 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 334 // cluster_name: The user-specified cluster name. 335 // cluster_uuid: The generated cluster id. 336 // region: The Cloud Dataproc region in which the cluster is running. 337 // cloud_dataproc_job 338 // Cloud Dataproc Job A Dataproc job execution. 339 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 340 // region: The Cloud Dataproc region to which the job was submitted. 341 // job_id: The user-specified job id. 342 // job_uuid: The generated job uuid. 343 344 // cloud_debugger_resource 345 // Cloud Debugger A Google Cloud Debugger resource. 346 // 347 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 348 // app: The application to which the debugger is attached. 349 350 // CloudFunction is a function in Google Cloud Functions. 351 // 352 // project_id 353 // The identifier of the GCP project associated with this resource, such as "my-project". 354 // 355 // function_name 356 // The short function name. 357 // 358 // region 359 // The region in which the function is running. 360 CloudFunction Type = "cloud_function" 361 362 // CloudRunJob is a job in Cloud Run. 363 // 364 // project_id 365 // The identifier of the GCP project associated with this resource, such as "my-project". 366 // 367 // job_name 368 // Name of the monitored job. 369 // 370 // location 371 // Region where the job exists. 372 CloudRunJob Type = "cloud_run_job" 373 374 // CloudRunRevision is a revision in Cloud Run. 375 // 376 // project_id 377 // The identifier of the GCP project associated with this resource, such as "my-project". 378 // 379 // service_name 380 // Name of the service. 381 // 382 // revision_name 383 // Name of the monitored revision. 384 // 385 // location 386 // Region where the service is running. 387 // 388 // configuration_name 389 // Name of the configuration which created the monitored revision. 390 CloudRunRevision Type = "cloud_run_revision" 391 392 // cloud_scheduler_job 393 // Cloud Scheduler Job A Cloud Scheduler Job. 394 // 395 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 396 // location: The region of the job. 397 // job_id: Identifier of the job. 398 399 // cloud_tasks_queue 400 // Cloud Tasks Queue A queue in Cloud Tasks. 401 // 402 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 403 // queue_id: The name of the queue. 404 // target_type: The target type the queue is dispatching to. 405 // location: The zone or region where the application is running. 406 // clouddeploy.googleapis.com/DeliveryPipeline 407 // Cloud Deploy Delivery Pipeline A Cloud Deploy Delivery Pipeline. 408 // resource_container: The identifier of the Google Cloud project associated with this resource. 409 // location: The Google Cloud location where the resource resides. 410 // pipeline_id: ID of the delivery pipeline resource. 411 412 // cloudiot_device 413 // Cloud IoT Device A Device in Google Cloud IoT. 414 // 415 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 416 // device_num_id: The unique numeric identifier of the device. 417 // device_registry_id: The user-defined string identifier of the device registry. 418 // location: The cloud region of the device registry. 419 420 // cloudiot_device_registry 421 // Cloud IoT Registry A Device Registry in Google Cloud IoT. 422 // 423 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 424 // device_registry_id: The user-defined string identifier of the device registry. 425 // location: The cloud region of the device registry. 426 427 // cloudkms_cryptokey 428 // Cloud KMS CryptoKey Cryptographic key in the KMS. 429 // 430 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 431 // location: The region Crypto Key belongs to. 432 // key_ring_id: Key Ring the Crypto Key belongs to. 433 // crypto_key_id: Crypto Key Identifier. 434 435 // cloudkms_cryptokeyversion 436 // Cloud KMS CryptoKeyVersion Version of a cryptographic key. 437 // 438 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 439 // location: The region Crypto Key Version belongs to. 440 // key_ring_id: Key Ring the Crypto Key Version belongs to. 441 // crypto_key_id: Crypto Key the Crypto Key Version belongs to. 442 // crypto_key_version_id: Crypto Key Version Identifier. 443 444 // cloudkms_keyring 445 // Cloud KMS Key Ring Collection of cryptographic keys. 446 // 447 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 448 // location: The region Key Ring belongs to. 449 // key_ring_id: Key Ring Identifier. 450 451 // cloudml_model_version 452 // Cloud ML Model Version A Google Cloud ML model version. 453 // 454 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 455 // model_id: An immutable identifier for a model. 456 // version_id: An immutable identifier for a version. 457 // region: Cloud ML region. 458 459 // cloudsql_database 460 // Cloud SQL Database A database hosted in Google Cloud SQL. 461 // 462 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 463 // database_id: The ID of the database. 464 // region: The Google Cloud SQL region in which the database is running. 465 // cloudvolumesgcp-api.netapp.com/CloudVolume 466 // Monitored Resource for NetApp CVS Monitored Resource for NetApp CVS. 467 // resource_container: Project information. 468 // location: Region/Zone information. 469 // volume_id: ID of the volume. 470 // service_type: Service type of the volume or replication relationship. 471 // name: Name of the volume or replication relationship. 472 473 // consumed_api 474 // Consumed API An API used by customers. 475 // 476 // project_id: The identifier of the GCP project associated with this resource, such as 'my-project'. 477 // service: The API service name, such as 'cloudsql.googleapis.com'. 478 // method: The API method name, such as 'disks.list'. 479 // version: The API version, such as 'v1'. 480 // location: The service specific notion of location. This can be a name of a zone or region. If a service does not have any notion of zones then 'global' can be used. 481 // credential_id: The client credential ID, such as an API key ID or the OAuth client ID. 482 483 // container 484 // GKE Container A Google Kubernetes Engine (GKE) container instance. 485 // 486 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 487 // cluster_name: An immutable name for the cluster the container is running in. 488 // namespace_id: Immutable ID of the cluster namespace the container is running in. 489 // instance_id: Immutable ID of the GCE instance the container is running in. 490 // pod_id: Immutable ID of the pod the container is running in. 491 // container_name: Immutable name of the container. 492 // zone: The GCE zone in which the instance is running. 493 494 // csr_repository 495 // Cloud Source Repository A repository in Google Cloud Source Repositories. 496 // 497 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 498 // name: The name of the repository. 499 500 // dataflow_step 501 // Dataflow Step A step in a Dataflow job. 502 // 503 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 504 // job_id: The ID of the job. 505 // step_id: The ID of the step. 506 // job_name: The name of the job. 507 // region: The region in which the job is running. 508 // datamigration.googleapis.com/MigrationJob 509 // Database migration service migration job Database migration service migration job. 510 // resource_container: The resource container (project ID). 511 // location: The location. 512 // migration_job_id: The migration job ID. 513 514 // dataplex.googleapis.com/Environment 515 // Cloud Dataplex Environment An Environment within a Cloud Dataplex Lake. 516 // 517 // resource_container: The identifier of GCP project associated with this resource. 518 // location: The GCP region associated with this resource. 519 // lake_id: The identifier of the Lake resource containing this resource. 520 // environment_id: The identifier of this Environment resource. 521 522 // dataplex.googleapis.com/Lake 523 // Cloud Dataplex Lake A Cloud Dataplex Lake. 524 // 525 // resource_container: The identifier of GCP project associated with this resource. 526 // location: The GCP region associated with this resource. 527 // lake_id: The identifier of this Lake resource. 528 529 // dataplex.googleapis.com/Task 530 // Cloud Dataplex Task A Task within a Cloud Dataplex Lake. 531 // 532 // resource_container: The identifier of GCP project associated with this resource. 533 // location: The GCP region associated with this resource. 534 // lake_id: The identifier of the Lake resource containing this resource. 535 // task_id: The identifier of this Task resource. 536 537 // dataplex.googleapis.com/Zone 538 // Cloud Dataplex Zone A Zone within a Cloud Dataplex Lake. 539 // 540 // resource_container: The identifier of GCP project associated with this resource. 541 // location: The GCP region associated with this resource. 542 // lake_id: The identifier of the Lake resource containing this resource. 543 // zone_id: The identifier of this Zone resource. 544 545 // dataproc_cluster 546 // Dataproc Cluster A Dataproc cluster. 547 // 548 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 549 // cluster_id: The cluster ID, concatenated from the cluster name and uuid 550 // zone: The GCE zone in which the instance is running. 551 552 // datastore_database 553 // Cloud Datastore Database A Cloud Datastore database. 554 // 555 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 556 // database_id: The unique id of the database. 557 558 // datastore_index 559 // Cloud Datastore Index A Cloud Datastore index. 560 // 561 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 562 // database_id: The database the index belongs to. 563 // index_id: The unique id of the index. 564 565 // datastream.googleapis.com/Stream 566 // Datastream Stream A Datastream stream. 567 // 568 // resource_container: The resource container (project ID). 569 // location: The location. 570 // stream_id: The stream ID. 571 572 // deployment 573 // Deployment A Deployment Manager deployment. 574 // 575 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 576 // name: Name that uniquely identifies the deployment within a project. 577 578 // deployment_manager_manifest 579 // Deployment Manager Manifest A Deployment Manager manifest which is used to specify the contents of a deployment. 580 // 581 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 582 // manifest_name: Name that uniquely identifies the manifest within a project. 583 // deployment_name: Name of the deployment. 584 585 // deployment_manager_operation 586 // Deployment Manager Operation A Deployment Manager operation. 587 // 588 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 589 // operation_name: Name that uniquely identifies the operation within a project. 590 591 // deployment_manager_resource 592 // Deployment Manager Resource Deployment Manager's record of Google Cloud Platform resources in a Deployment, such as a VM or a bucket. 593 // 594 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 595 // resource_name: Name of the resource, unique within a deployment. 596 // deployment_name: Name of the deployment. 597 598 // deployment_manager_type 599 // Deployment Manager Type A Deployment Manager type. 600 // 601 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 602 // name: Name that uniquely identifies the type within a project. 603 604 // dns_managed_zone 605 // Managed DNS Zone A ManagedZone in the Google Cloud DNS service. 606 // 607 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 608 // zone_name: The name of the ManagedZone. 609 // location: The location field is provided for compatibility with other GCP services. Its value is always set to 'global' 610 611 // dns_policy 612 // Cloud DNS Policy A Policy in the Google Cloud DNS service. 613 // 614 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 615 // policy_name: The name of the Policy. 616 // location: The location field is provided for compatibility with other GCP services. Its value is always set to 'global' 617 618 // dns_query 619 // Cloud DNS Query A DNS query to a private DNS handled by the Google Cloud DNS service. 620 // 621 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 622 // target_name: The DNS name managed by Cloud DNS to be resolved (e.g. the zone name, policy name, internal domain name). External names will have the value "external" 623 // location: The GCP zone where the DNS request was received (e.g. us-east1, us-west1). 624 // target_type: The target of the resolution of the DNS query (e.g. public-zone, private-zone, external). 625 // source_type: Source of the query (e.g. gce-vm, internet). 626 627 // firebase_domain 628 // Firebase Hosting Site Domain A domain from which a Firebase Hosting site is serving traffic. 629 // 630 // project_id: The identifier of the GCP project associated with this resource, such as 'my-project'. 631 // site_name: The name of a Firebase Hosting site, that is the subdomain in .web.app. 632 // domain_name: The default subdomain (on web.app or firebaseapp.com) or custom domain from which content was served. 633 634 // firebase_namespace 635 // Firebase Realtime Database A Firebase Realtime Database. 636 // 637 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 638 // table_name: The name of the database. 639 // location: The location of the database. 640 // fleetengine.googleapis.com/Fleet 641 // Fleet Engine On Demand Rides and Deliveries A top-level resource for Fleet Engine On Demand Rides and Deliveries metrics and logs. 642 // resource_container: The identifier of the GCP container associated with Fleet. 643 // location: The region in which the Fleet Engine instance is running. 644 645 // folder 646 // Google Folder A Google Cloud Platform folder. 647 // 648 // folder_id: Numeric id of the folder. 649 650 // GAEApp is an application running in Google App Engine (GAE). 651 // 652 // project_id 653 // The identifier of the GCP project associated with this resource, such as "my-project". 654 // 655 // module_id 656 // The service/module name. 657 // 658 // version_id 659 // The version name. 660 // 661 // zone 662 // The GAE zone where the application is running. 663 GAEApp Type = "gae_app" 664 665 // gateway_scope 666 // Gateway Scope GatewayScope represents a set of Gateways with the same merged configs. 667 // 668 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 669 // location: The location of the control plane 670 // scope: The name of the gateway_scope 671 672 // gce_autoscaler 673 // GCE Autoscaler A Google Compute Engine (GCE) autoscaler. 674 // 675 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 676 // autoscaler_id: Unique identifier of the autoscaler. 677 // location: GCE zone or region where the autoscaler is running. 678 679 // gce_backend_bucket 680 // GCE Backend Bucket A Google Compute Engine (GCE) backend bucket. 681 // 682 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 683 // backend_bucket_id: Unique identifier of the backend bucket. 684 685 // gce_backend_service 686 // Compute Engine Backend Service A Compute Engine backend service. 687 // 688 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 689 // backend_service_id: Unique identifier of the backend service. 690 // location: Global or Compute Engine region containing the backend service 691 692 // gce_client_ssl_policy 693 // GCE Client SSL Policy A Google Compute Engine (GCE) client SSL policy. 694 // 695 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 696 // client_ssl_policy_id: Unique identifier of the client SSL policy. 697 698 // gce_commitment 699 // GCE Committed Use Discount A Google Compute Engine (GCE) committed use discount. 700 // 701 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 702 // commitment_id: Unique identifier of the committed use discount. 703 // location: GCE region where the committed use discount is active. 704 705 // gce_disk 706 // Disk A disk belonging to a Compute Engine instance. 707 // 708 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 709 // disk_id: Unique identifier of the disk. 710 // zone: The Compute Engine zone where the disk resides. 711 712 // gce_firewall_rule 713 // GCE Firewall Rule A Google Compute Engine (GCE) firewall rule. 714 // 715 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 716 // firewall_rule_id: Unique identifier of the firewall rule. 717 718 // gce_forwarding_rule 719 // GCE Forwarding Rule A Google Compute Engine (GCE) Forwarding Rule. 720 // 721 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 722 // forwarding_rule_id: Unique identifier of the forewarding rule. 723 // region: GCE region where the forwarding rule resides. 724 725 // gce_health_check 726 // GCE Health Check A Google Compute Engine (GCE) health check. 727 // 728 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 729 // health_check_id: Unique identifier of the health check. 730 731 // gce_image 732 // GCE Image A Google Compute Engine (GCE) image resource. 733 // 734 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 735 // image_id: Unique numerical identifier of the image. 736 737 // gce_instance 738 // VM Instance A virtual machine instance hosted in Compute Engine. 739 // 740 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 741 // instance_id: The numeric VM instance identifier assigned by Compute Engine. 742 // zone: The Compute Engine zone in which the VM is running. 743 744 // gce_instance_group 745 // GCE Instance Group A Google Compute Engine (GCE) instance group resource. 746 // 747 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 748 // instance_group_id: The unique numerical identifier of the instance group. 749 // instance_group_name: The unique user provided name of the instance group. 750 // location: GCE zone containing the instance group. 751 752 // gce_instance_group_manager 753 // GCE Instance Group Manager A Google Compute Engine (GCE) instance group manager resource. 754 // 755 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 756 // instance_group_manager_id: The unique numerical identifier of the instance group manager. 757 // instance_group_manager_name: The unique user provided name of the instance group manager. 758 // location: GCE zone or region where the instance group manager is located. 759 760 // gce_instance_template 761 // GCE Instance Template A Google Compute Engine (GCE) instance template resource. 762 // 763 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 764 // instance_template_id: The unique numerical identifier of the instance template. 765 // instance_template_name: The unique user provided name of the instance template. 766 767 // gce_license 768 // GCE License A Google Compute Engine (GCE) license. 769 // 770 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 771 // license_id: Unique identifier of the license. 772 773 // gce_network 774 // GCE Network A Google Compute Engine (GCE) network. 775 // 776 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 777 // network_id: Unique identifier of the network. 778 779 // gce_network_endpoint_group 780 // Network Endpoint Group A Compute Engine network endpoint group resource. 781 // 782 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 783 // zone: The name of the zone where the network endpoint group is located. 784 // network_endpoint_group_id: The ID of the network endpoint group. 785 786 // gce_network_region 787 // Network Region A region of a Compute Engine network. 788 // 789 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 790 // network_id: The ID of the Compute Engine network. 791 // region: The name of the network region. 792 // gce_node_group 793 // Node Group A Compute Engine node group. 794 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 795 // node_group_id: Unique identifier of the node group. 796 // zone: Zone of the node group. 797 798 // gce_node_template 799 // Node Template A Compute Engine node template. 800 // 801 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 802 // node_template_id: Unique identifier of the node template. 803 // region: Region of the node template. 804 805 // gce_operation 806 // GCE Operation A Google Compute Engine (GCE) operation resource. 807 // 808 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 809 // operation_name: The unique user provided name of the operation. 810 // location: Location of the resource. 811 812 // gce_packet_mirroring 813 // GCE Packet Mirroring A Google Compute Engine (GCE) packet mirroring. 814 // 815 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 816 // packet_mirroring_id: Unique identifier of the packet mirroring. 817 // region: Region of the packet mirroring. 818 // gce_project 819 // GCE Project A Google Compute Engine (GCE) project resource. 820 // project_id: GCE specific numeric identifier of the GCE project resource. 821 822 // gce_reserved_address 823 // GCE Reserved Address A Google Compute Engine reserved address. 824 // 825 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 826 // reserved_address_id: Unique identifier of the reserved address. 827 // location: Global or GCE region containing the reserved address 828 829 // gce_resource_policy 830 // Resource Policy A Compute Engine resource policy. 831 // 832 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 833 // resource_policy_id: Unique identifier of the resource policy. 834 // region: Region of the resource policy. 835 836 // gce_route 837 // GCE Route A Google Compute Engine (GCE) route. 838 // 839 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 840 // route_id: Unique identifier of the route. 841 842 // gce_router 843 // GCE Router A Google Compute Engine (GCE) router. 844 // 845 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 846 // router_id: Unique identifier of the router. 847 // region: Region of the router. 848 849 // gce_snapshot 850 // GCE Snapshot A Google Compute Engine (GCE) snapshot. 851 // 852 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 853 // snapshot_id: Unique identifier of the snapshot. 854 855 // gce_ssl_certificate 856 // GCE SSL Certificate A Google Compute Engine (GCE) SSL certificate. 857 // 858 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 859 // ssl_certificate_id: The unique numerical identifier of the SSL certificate. 860 // ssl_certificate_name: The unique user provided name of the SSL Certificate. 861 862 // gce_subnetwork 863 // Subnetwork A Compute Engine subnetwork. 864 // 865 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 866 // subnetwork_id: The unique numerical identifier of the subnetwork. 867 // subnetwork_name: The unique user provided name of the subnetwork. 868 // location: Location of the resource. 869 870 // gce_target_http_instance 871 // GCE Target HTTP Instance A Google Compute Engine (GCE) target http instance. 872 // 873 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 874 // target_http_instance_id: Unique identifier of the target http instance. 875 // zone: GCE zone where the target http instance resides. 876 877 // gce_target_http_proxy 878 // GCE Target HTTP Proxy A Google Compute Engine (GCE) target http proxy. 879 // 880 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 881 // target_http_proxy_id: Unique identifier of the target http proxy. 882 883 // gce_target_https_proxy 884 // GCE Target HTTPS Proxy A Google Compute Engine (GCE) target https proxy. 885 // 886 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 887 // target_https_proxy_id: Unique identifier of the target https proxy. 888 889 // gce_target_pool 890 // GCE Target Pool A Google Compute Engine (GCE) target pool. 891 // 892 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 893 // target_pool_id: Unique identifier of the target pool. 894 // zone: GCE zone where the pool resides. 895 896 // gce_target_ssl_proxy 897 // GCE Target SSL Proxy A Google Compute Engine (GCE) target SSL proxy. 898 // 899 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 900 // target_ssl_proxy_id: Unique identifier of the target ssl proxy. 901 902 // gce_url_map 903 // GCE URL Map A Google Compute Engine (GCE) URL map. 904 // 905 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 906 // url_map_id: Unique identifier of the url map. 907 908 // gcs_bucket 909 // GCS Bucket A Google Cloud Storage (GCS) bucket. 910 // 911 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 912 // bucket_name: An immutable name of the bucket. 913 // location: Location of the bucket. 914 915 // generic_node 916 // Generic Node A generic node identifies a machine or other computational resource for which no more specific resource type is applicable. The label values must uniquely identify the node. 917 // 918 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 919 // location: The GCP or AWS region in which data about the resource is stored. For example, "us-east1-a" (GCP) or "aws:us-east-1a" (AWS). 920 // namespace: A namespace identifier, such as a cluster name. 921 // node_id: A unique identifier for the node within the namespace, such as a hostname or IP address. 922 923 // generic_task 924 // Generic Task A generic task identifies an application process for which no more specific resource is applicable, such as a process scheduled by a custom orchestration system. The label values must uniquely identify the task. 925 // 926 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 927 // location: The GCP or AWS region in which data about the resource is stored. For example, "us-east1-a" (GCP) or "aws:us-east-1a" (AWS). 928 // namespace: A namespace identifier, such as a cluster name. 929 // job: An identifier for a grouping of related tasks, such as the name of a microservice or distributed batch job. 930 // task_id: A unique identifier for the task within the namespace and job, such as a replica index identifying the task within the job. 931 932 // genomics_dataset 933 // Genomics Dataset A dataset in the Google Genomics service. 934 // 935 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 936 // dataset_id: Unique identifier of the dataset. 937 938 // genomics_operation 939 // Genomics Operation A long running operation in the Google Genomics service. 940 // 941 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 942 // operation_id: Unique identifier of the long running operation. 943 944 // gke_cluster 945 // GKE Cluster Operations A Google Kubernetes Engine (GKE) Cluster. It contains events and audit logs about cluster operations. 946 // 947 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 948 // cluster_name: The name of the GKE Cluster. 949 // location: The location in which the GKE Cluster is running. 950 951 // gke_nodepool 952 // GKE Node Pool Operations A Google Kubernetes Engine (GKE) Node Pool. It contains audit logs about Node Pool operations. 953 // 954 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 955 // nodepool_name: The name of the GKE Node Pool. 956 // location: The location in which the GKE Cluster is running. 957 // cluster_name: The name of the GKE Cluster to which this Node Pool belongs. 958 959 // gkebackup.googleapis.com/BackupPlan 960 // GKE Backup Plan A backup plan provides configuration, location, and management functions for a sequence of backups. 961 // 962 // resource_container: The identifier of the Google Cloud container associated with the resource. 963 // location: The Google Cloud location where this backupPlan resides. 964 // backup_plan_id: The name of the backupPlan. 965 966 // gkebackup.googleapis.com/RestorePlan 967 // GKE Restore Plan A restore plan defines the configuration of a series of restore operations to be performed against backups which belong to the specified backup plan. 968 // 969 // resource_container: The identifier of the Google Cloud container associated with the resource. 970 // location: The Google Cloud location where this restorePlan resides. 971 // restore_plan_id: The name of the restorePlan. 972 973 // global 974 // Global A resource type used to indicate that a log is not associated with any specific resource. 975 // 976 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 977 978 // healthcare_annotation_store 979 // Healthcare Annotation Store A Cloud Healthcare Annotation store containing Annotation records. 980 // 981 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 982 // location: The Google Cloud location of the dataset that contains the Annotation store. 983 984 // dataset_id: The ID of the dataset. 985 // 986 // annotation_store_id: The ID of the Annotation store. 987 988 // healthcare_consent_store 989 // Healthcare Consent Store A Cloud Healthcare Consent store containing consent records. 990 // 991 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 992 // location: The Google Cloud location of the dataset that contains the Consent store. 993 // dataset_id: The ID of the dataset. 994 // consent_store_id: The ID of the Consent store. 995 996 // healthcare_dataset 997 // Healthcare Dataset A Cloud Healthcare dataset. 998 // 999 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1000 // location: The Google Cloud location of the dataset. 1001 // dataset_id: The ID of the dataset. 1002 1003 // healthcare_dicom_store 1004 // Healthcare DICOM Store A Cloud Healthcare DICOM store containing DICOM instances. 1005 // 1006 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1007 // location: The Google Cloud location of the dataset that contains the DICOM store. 1008 // dataset_id: The ID of the dataset. 1009 // dicom_store_id: The ID of the DICOM store. 1010 1011 // healthcare_fhir_store 1012 // Healthcare FHIR Store A Cloud Healthcare FHIR store containing FHIR resources representing electronic medical information. 1013 // 1014 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1015 // location: The Google Cloud location of the dataset that contains the FHIR store. 1016 // dataset_id: The ID of the dataset. 1017 // fhir_store_id: The ID of the FHIR store. 1018 1019 // healthcare_hl7v2_store 1020 // Healthcare HL7v2 Store A Cloud Healthcare HL7v2 store containing clinical messages. 1021 // 1022 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1023 // location: The Google Cloud location of the dataset that contains the HL7v2 store. 1024 // dataset_id: The ID of the dataset. 1025 // hl7v2_store_id: The ID of the HL7v2 store. 1026 1027 // http_external_regional_lb_rule 1028 // HTTP/S External Regional Load Balancing Rule A resource descriptor for HTTP/S External Regional load balancing behavior. 1029 // 1030 // project_id: The identifier of the Google Cloud project associated with this resource, such as 'my-project'. 1031 // network_name: The name of the customer network in which the Load Balancer resides. 1032 // region: The region under which the Load Balancer is defined. 1033 // url_map_name: The name of the urlmap. 1034 // forwarding_rule_name: The name of the forwarding rule. 1035 // target_proxy_name: The name of the target HTTP/S proxy. 1036 // matched_url_path_rule: The prefix of URL defined in urlmap tree. 'UNMATCHED' for the sink default rule. 1037 // backend_target_name: The name of the backend target or service. 1038 // backend_target_type: The type of the backend target. Can be 'BACKEND_SERVICE', or 'UNKNOWN' if the backend wasn't assigned. 1039 // backend_name: The name of the backend group. Can be '' if the backend wasn't assigned. 1040 // backend_type: The type of the backend group. Can be 'INSTANCE_GROUP', 'NETWORK_ENDPOINT_GROUP', or 'UNKNOWN' if the backend wasn't assigned. 1041 // backend_scope: The scope of the backend group. Can be 'UNKNOWN' if the backend wasn't assigned. 1042 // backend_scope_type: The type of the scope of the backend group. Can be 'ZONE', 'REGION', or 'UNKNOWN' in case the backend wasn't assigned. 1043 1044 // http_load_balancer 1045 // Cloud HTTP Load Balancer A Cloud HTTP Load Balancer Instance. 1046 // 1047 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1048 // forwarding_rule_name: The name of the forwarding rule. 1049 // url_map_name: The name of the urlmap. 1050 // target_proxy_name: The name of the target proxy. 1051 // backend_service_name: The name of the backend service. 1052 // zone: The zone in which the load balancer is running. 1053 1054 // iam_role 1055 // IAM Role An IAM role. 1056 // 1057 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1058 // role_name: The name of the IAM custom role; this labelappears only on custom roles.(e.g., roles/[CUSTOM_ROLE],organizations/123456/roles/[CUSTOM_ROLE],projects/myproject/roles/[CUSTOM_ROLE]). 1059 1060 // identitytoolkit_project 1061 // Project An Identity Toolkit project. 1062 // 1063 // project_id: The identifier of the GCP project associated with this resource. 1064 1065 // identitytoolkit_tenant 1066 // Identity Toolkit Tenant An Identity Toolkit tenant. 1067 // 1068 // project_id: The identifier of the GCP project associated with this resource. 1069 // tenant_name: The name of the tenant. 1070 1071 // ids.googleapis.com/Endpoint 1072 // IDS Endpoint A Cloud IDS Endpoint. 1073 // 1074 // resource_container: The identifier of the GCP project owning the Endpoint. 1075 // location: The zone of the IDS Endpoint. 1076 // id: The ID of the Endpoint. 1077 1078 // istio_control_plane 1079 // Istio Control Plane An Istio Control Plane is an instance of a service that provides xDS and related functionality to a set of managed Istio proxies. 1080 // 1081 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1082 // mesh_uid: Unique identifier for an Istio service mesh. 1083 // location: The physical location in which the workload for the Control Plane is located. 1084 // revision: Immutable revision of Istio managed by the Control Plane. 1085 // build_id: Immutable build tag for the instance of the Control Plane. 1086 // owner: Immutable name of the owner of the Control Plane. 1087 1088 // k8s_cluster 1089 // Kubernetes Cluster A Kubernetes cluster. It contains Kubernetes audit logs from the cluster. 1090 // 1091 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1092 // location: The physical location of the cluster. 1093 // cluster_name: The name of the cluster. 1094 1095 // k8s_container 1096 // Kubernetes Container A Kubernetes container instance. 1097 // 1098 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1099 // location: The physical location of the cluster that contains the container. 1100 // cluster_name: The name of the cluster that the container is running in. 1101 // namespace_name: The name of the namespace that the container is running in. 1102 // pod_name: The name of the pod that the container is running in. 1103 // container_name: The name of the container. 1104 1105 // k8s_control_plane_component 1106 // Kubernetes Control Plane Component A Kubernetes Control Plane component. 1107 // 1108 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1109 // location: The physical location of the cluster that contains the control plane component. 1110 // cluster_name: The name of the cluster that the control plane component is running in. 1111 // component_name: The name of the control plane component. 1112 // component_location: The physical location where the control plane component is running. 1113 1114 // k8s_node 1115 // Kubernetes Node A Kubernetes node instance. 1116 // 1117 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1118 // location: The physical location of the cluster that contains the node. 1119 // cluster_name: The name of the cluster that the node is a part of. 1120 // node_name: The name of the node. 1121 1122 // k8s_pod 1123 // Kubernetes Pod A Kubernetes pod instance. 1124 // 1125 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1126 // location: The physical location of the cluster that contains the pod. 1127 // cluster_name: The name of the cluster that the pod is running in. 1128 // namespace_name: The name of the namespace that the pod is running in. 1129 // pod_name: The name of the pod. 1130 1131 // k8s_service 1132 // Kubernetes Service A Kubernetes Service instance. 1133 // 1134 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1135 // location: The physical location of the cluster that contains the service. 1136 // cluster_name: The name of the cluster that the service is running in. 1137 // namespace_name: The name of the namespace that the service is running in. 1138 // service_name: The name of the service. 1139 1140 // l4_proxy_rule 1141 // Layer 4 Proxying Rule for TCP/UDP/SSL Traffic A resource descriptor for TCP/SSL/UDP Internal Regional load balancing behavior. 1142 // 1143 // project_id: The identifier of the Google Cloud project associated with this resource, such as 'my-project'. 1144 // network_name: The name of the customer network in which the Load Balancer resides. 1145 // region: The region under which the Load Balancer is defined. 1146 // load_balancing_scheme: The load balancing scheme associated with the forwarding rule, one of [INTERNAL_MANAGED, EXTERNAL_MANAGED]. 1147 // protocol: The protocol associated with the traffic processed by the proxy, one of [TCP, UDP, SSL, UNKNOWN]. 1148 // forwarding_rule_name: The name of the forwarding rule. 1149 // target_proxy_name: The name of the target proxy. 1150 // backend_target_name: The name of the backend target or service. 1151 // backend_target_type: The type of the backend target, one of ['BACKEND_SERVICE'; 'UNKNOWN' - if the backend wasn't assigned]. 1152 // backend_name: The name of the backend group. Can be '' if the backend wasn't assigned. 1153 // backend_type: The type of the backend group, one of ['INSTANCE_GROUP'; 'NETWORK_ENDPOINT_GROUP'; 'UNKNOWN' - if the backend wasn't assigned]. 1154 // backend_scope: The scope of the backend group. Can be 'UNKNOWN' if the backend wasn't assigned. 1155 // backend_scope_type: The type of the scope of the backend group, one of ['ZONE'; 'REGION'; 'UNKNOWN' - in case the backend wasn't assigned]. 1156 1157 // livestream.googleapis.com/Channel 1158 // Live Stream API Channel A Live Stream API Channel. 1159 // 1160 // resource_container: The identifier of the GCP project associated with this channel resource. 1161 // location: The GCP location where the channel resource resides. 1162 // channel_id: ID of the channel resource. 1163 1164 // loadbalancing.googleapis.com/ExternalNetworkLoadBalancerRule 1165 // Google Cloud External Network Load Balancer Rule A set of definitions for multi protocol network load balancing behavior. 1166 // 1167 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1168 // region: The Google Cloud Platform region of the backend instance that connected to network load balancing forwarding rule. 1169 // backend_network_name: The network name of the NIC of the instance that received the Net LB flow. 1170 // backend_target_type: The type of the backend target that handled the connection. 1171 // backend_service_name: The name of the backend service that handled the connection. 1172 // primary_target_pool: The name of the primary target pool. 1173 // target_pool: The name of the target pool. 1174 // forwarding_rule_name: The name of the forwarding rule. 1175 // backend_group_name: The name of the backend group that handled the connection. 1176 // backend_group_type: The type of the backend group that handled the connection. 1177 // backend_group_scope: The scope (zone or region) of the backend group that handled the connection. 1178 // backend_subnetwork_name: The name of the subnetwork of the instance that handled the connection. 1179 // backend_zone: The zone of the endpoint (VM instance) that handled the connection. 1180 1181 // loadbalancing.googleapis.com/InternalNetworkLoadBalancerRule 1182 // Google Cloud Internal Network Load Balancer Rule A set of definitions for multi protocol internal load balancing behavior. 1183 // 1184 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1185 // region: The Google Cloud Platform region of the backend instance that connected to network load balancing forwarding rule. 1186 // backend_network_name: The network name of the NIC of the instance that received the Net LB flow. 1187 // backend_service_name: The name of the backend service that handled the connection. 1188 // forwarding_rule_name: The name of the forwarding rule. 1189 // backend_group_name: The name of the backend group that handled the connection. 1190 // backend_group_type: The type of the backend group that handled the connection. 1191 // backend_group_scope: The scope (zone or region) of the backend group that handled the connection. 1192 // backend_subnetwork_name: The name of the subnetwork of the instance that handled the connection. 1193 1194 // logging_bucket 1195 // Logging Bucket An export bucket in Cloud Logging. 1196 // 1197 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1198 // bucket_id: The name of the log bucket. 1199 // location: The location of the log bucket. 1200 // source_resource_container: The source resource container (e.g. project, folder, organization) of the log entry that is destined for the log bucket. The format is "projects/project_id" 1201 // monitored_resource_type: The type field of the monitored resource in the log entry that is destined for the log bucket. 1202 1203 // logging_exclusion 1204 // Log Exclusion An exclusion in Cloud Logging. 1205 // 1206 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1207 // name: The unique name of the exclusion. 1208 // logging_log 1209 // Log stream A Google Cloud Logging log. 1210 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1211 // name: Unique identifier of the log. 1212 1213 // logging_sink 1214 // Logging export sink An export sink in Cloud Logging. 1215 // 1216 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1217 // name: The unique name of the sink. 1218 // destination: The destination of the sink. 1219 1220 // managed_service 1221 // Managed Service A service managed by Google Service Management. 1222 // 1223 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1224 // service_name: The name of the service. 1225 // producer_project_id: The id of the project which produces and owns this service. 1226 1227 // mesh 1228 // Mesh A mesh serves as the "key" to deliver configuration to data plane proxy instances. 1229 // 1230 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1231 // location: The location of the control plane 1232 // mesh: The name of the mesh 1233 1234 // metastore.googleapis.com/Service 1235 // Dataproc Metastore Service A Dataproc Metastore Service. 1236 // 1237 // resource_container: The ID of the customer project. 1238 // location: The region that the service is hosted in. 1239 // service_id: The service ID. 1240 1241 // metric 1242 // Metric Type A Stackdriver Monitoring metric type. 1243 // 1244 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1245 // name: The name of the metric type, such as "logging.googleapis.com/my-metric-name". 1246 1247 // ml_job 1248 // Cloud ML Job A Cloud Machine Learning job. 1249 // 1250 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1251 // job_id: The job identifier. 1252 // task_name: The task name. 1253 1254 // nat_gateway 1255 // Cloud NAT Gateway A Cloud NAT Gateway. 1256 // 1257 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1258 // region: The region where the NAT gateway is located. 1259 // router_id: Identifier of the router under which the NAT gateway is defined. 1260 // gateway_name: The name of the NAT gateway. 1261 1262 // network_security_policy 1263 // Network Security Policy A network security policy. 1264 // 1265 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1266 // policy_name: The unique user provided name of the security policy. 1267 // networking.googleapis.com/Location 1268 // GCP Location A GCP location: a specific zone or region, or "global". 1269 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1270 // location: Name of a GCP zone/region, or "global". 1271 1272 // organization 1273 // Google Organization A Google Cloud Platform organization. 1274 // 1275 // organization_id: Numeric id of the organization. 1276 1277 // project 1278 // Google Project A Google project. 1279 // 1280 // project_id: The identifier of the GCP project associated with this resource (e.g., my-project). 1281 1282 // pubsub_snapshot 1283 // Cloud Pub/Sub Snapshot A snapshot in Google Cloud Pub/Sub. 1284 // 1285 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1286 // snapshot_id: The identifier of the snapshot, such as "my-snapshot". 1287 1288 // pubsub_subscription 1289 // Cloud Pub/Sub Subscription A subscription in Google Cloud Pub/Sub. 1290 // 1291 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1292 // subscription_id: The identifier of the subscription, such as "my-subscription". 1293 1294 // pubsub_topic 1295 // Cloud Pub/Sub Topic A topic in Google Cloud Pub/Sub. 1296 // 1297 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1298 // topic_id: The identifier of the topic, such as "my-topic". 1299 // recaptchaenterprise.googleapis.com/Key 1300 // reCAPTCHA Key Monitoring resource for reCAPTCHA Key. 1301 // resource_container: The ID of the GCP project associated with this reCAPTCHA Key. 1302 // location: Location where the reCAPTCHA Key is provisioned. 1303 // key_id: The ID for this Key. 1304 1305 // recommender 1306 // Recommender A Recommender represents a grouping of similar recommendations. 1307 // 1308 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1309 // recommender_id: The name of the recommender. 1310 // location: The location of the recommendation. 1311 1312 // recommender_insight_type 1313 // InsightType An InsightType represents a grouping of similar insights. 1314 // 1315 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1316 // insight_type_id: The resource ID of the insight type. 1317 // location: The location of the insight. 1318 1319 // redis_instance 1320 // Cloud Memorystore Redis Instance A Redis instance hosted on Google Cloud Memorystore. 1321 // 1322 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1323 // region: The Google Cloud region in which the managed instance is running. 1324 // instance_id: The ID of the managed instance. 1325 // node_id: The ID of a Redis node within the managed instance. 1326 1327 // reported_errors 1328 // Reported Errors Error data and metadata managed by Stackdriver Error Reporting 1329 // 1330 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1331 1332 // secretmanager.googleapis.com/Secret 1333 // Secret Manager Secret A logical secret whose value and versions can be accessed. 1334 // 1335 // resource_container: The identifier of the GCP project associated with this resource. 1336 // location: Location of secret metadata. Always global. 1337 // secret_id: The name given to this secret. 1338 1339 // service_account 1340 // Service Account A service account. 1341 // 1342 // project_id: The identifier of the GCP project associated with this resource (e.g., my-project). 1343 // email_id: The service account email id, e.g. "account123@proj123.iam.gserviceaccount.com". 1344 // unique_id: The unique id of the service account, e.g. "113948692397867021414". 1345 1346 // service_config 1347 // Service Configuration A specific service configuration. 1348 // 1349 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1350 // service_name: The name of the service. 1351 // service_config_id: The id of the service configuration. 1352 1353 // service_rollout 1354 // Service Rollout A resource type used to describe how a service configuration is deployed to backend systems. 1355 // 1356 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1357 // service_name: The name of the service. 1358 // rollout_id: The id of the service rollout. 1359 1360 // servicedirectory_namespace 1361 // Service Directory Namespace A namespace in the Service Directory service. 1362 // 1363 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1364 // location: The cloud region of the Service Directory namespace. 1365 // namespace_name: The name of the Service Directory namespace. 1366 1367 // serviceusage_service 1368 // Service A service activated or deactivated by a consumer project. 1369 // 1370 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1371 // service_name: The name of the service. 1372 1373 // serviceuser_service 1374 // Service A service activated or deactivated by a consumer project. 1375 // 1376 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1377 // service_name: The name of the service. 1378 1379 // spanner_instance 1380 // Cloud Spanner Instance A Cloud Spanner instance. 1381 // 1382 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1383 // instance_id: An immutable identifier for an instance. 1384 // location: Cloud Spanner region. 1385 // instance_config: Instance config for the instance. 1386 1387 // storage_transfer_job 1388 // Cloud Storage Transfer Job A Google Cloud storage transfer job. 1389 // 1390 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1391 // job_id: A unique name of the storage transfer job. 1392 1393 // tcp_ssl_proxy_rule 1394 // Google Cloud TCP/SSL Proxy Rule A set of definitions for TCP/SSL proxy behavior. 1395 // 1396 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1397 // region: The region on which TCP/SSL proxy is applied, such as 'global' or 'us-central1'. Various other objects are defined per that locality. 1398 // backend_target_name: The name of the backend target ('backend service', equivalent to 'proxy name'). 1399 // backend_target_type: The type of the backend target. Can only be 'BACKEND_SERVICE' currently. 1400 // forwarding_rule_name: The name of the forwarding rule. 1401 // target_proxy_name: The name of the target TCP/SSL proxy. 1402 // backend_name: The name of the backend group. 1403 // backend_type: The type of the backend group. Can be 'INSTANCE_GROUP' or 'NETWORK_ENDPOINT_GROUP'. 1404 // backend_scope: The scope (zone or region) of the backend group. 1405 // backend_scope_type: The type of the scope of the backend group. Can be either 'ZONE' or 'REGION'. 1406 1407 // testservice_matrix 1408 // Test Matrix A Test Matrix in the Google Cloud Test Lab service. 1409 // 1410 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1411 // matrix_id: Unique identifier of the matrix. 1412 1413 // threat_detector 1414 // Threat Detector A detector in the Threat Detection service. 1415 // 1416 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1417 // detector_name: The specific detector that triggered the alert. 1418 1419 // uptime_url 1420 // Uptime Check URL An Uptime Monitoring check against a custom URL. 1421 // 1422 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1423 // host: The hostname or IP address of the check. 1424 1425 // vmmigration.googleapis.com/MigratingVM 1426 // Migrate to Virtual Machines Migrating VM A Migrate to Virtual Machines Migrating VM. 1427 // 1428 // resource_container: The identifier of the GCP project associated with this VM resource. 1429 // location: The GCP location where the VM resource resides. 1430 // source: The source where the VM resource resides. 1431 // vm: The VM ID. 1432 1433 // vmmigration.googleapis.com/Source 1434 // Migrate to Virtual Machines Source A Migrate to Virtual Machines Source. 1435 // 1436 // resource_container: The identifier of the GCP project associated with this source resource. 1437 // location: The GCP location where the source resource resides. 1438 // source: The source ID. 1439 1440 // vpc_access_connector 1441 // VPC Access Connector A connector that can communicate with devices within a VPC. 1442 // 1443 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1444 // location: The region the connector is located in. 1445 // connector_name: The name of the connector. 1446 1447 // vpn_gateway 1448 // Cloud VPN Gateway A Cloud VPN gateway. 1449 // 1450 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1451 // gateway_id: The VPN Gateway ID. 1452 // region: The region in which the VPN Gateway is running. 1453 1454 // vpn_tunnel 1455 // Cloud VPN Tunnel A Cloud VPN tunnel. 1456 // 1457 // project_id: The identifier of the GCP project associated with this resource, such as "my-project". 1458 // tunnel_id: The unique numerical identifier of the VPN tunnel. 1459 // tunnel_name: The unique user provided name of the VPN tunnel. 1460 // location: Location of the Cloud VPN Tunnel. 1461 1462 // workflows.googleapis.com/Workflow 1463 // Workflow A Workflows specification of steps to execute. 1464 // 1465 // resource_container: The identifier of the GCP container associated with the resource. 1466 // location: The region in which the workflow is deployed. 1467 // workflow_id: The ID of the workflow. 1468 ) 1469 1470 type MonitoredResource struct { 1471 *mrpb.MonitoredResource 1472 1473 LogID string 1474 } 1475 1476 // MarshalLogObject implements zapcore.ObjectMarshaler. 1477 func (mr *MonitoredResource) MarshalLogObject(enc zapcore.ObjectEncoder) error { 1478 for key, val := range mr.Labels { 1479 enc.AddString(key, val) 1480 } 1481 1482 return nil 1483 } 1484 1485 type resource struct { 1486 pb *mrpb.MonitoredResource 1487 attrs detector.ResourceAttributesFetcher 1488 once *sync.Once 1489 } 1490 1491 func (r *resource) metadataProjectID() string { 1492 return r.attrs.Metadata("project/project-id") 1493 } 1494 1495 func (r *resource) metadataZone() string { 1496 zone := r.attrs.Metadata("instance/zone") 1497 if zone != "" { 1498 return zone[strings.LastIndex(zone, "/")+1:] 1499 } 1500 1501 return "" 1502 } 1503 1504 func (r *resource) metadataRegion() string { 1505 region := r.attrs.Metadata("instance/region") 1506 if region != "" { 1507 return region[strings.LastIndex(region, "/")+1:] 1508 } 1509 1510 return "" 1511 } 1512 1513 // isMetadataActive queries valid response on "/computeMetadata/v1/" URL. 1514 func (r *resource) isMetadataActive() bool { 1515 data := r.attrs.Metadata("") 1516 1517 return data != "" 1518 } 1519 1520 var resourceDetector = &resource{ 1521 attrs: detector.ResourceAttributes(), 1522 once: new(sync.Once), 1523 } 1524 1525 // Detect returns new platform specific MonitoredResource. 1526 func Detect() *MonitoredResource { 1527 d := detector.NewDetector(resourceDetector.attrs) 1528 1529 switch d.CloudPlatform() { 1530 case detector.CloudRun: 1531 return detectCloudRunResource() 1532 1533 case detector.CloudRunJobs: 1534 return detectCloudRunJobsResource() 1535 1536 case detector.CloudFunctions: 1537 return detectCloudFunctionsResource() 1538 } 1539 1540 panic("unreachable") 1541 } 1542 1543 func detectCloudRunResource() *MonitoredResource { 1544 projectID := resourceDetector.metadataProjectID() 1545 if projectID == "" { 1546 return nil 1547 } 1548 1549 region := resourceDetector.metadataRegion() 1550 config := resourceDetector.attrs.EnvVar(detector.EnvCloudRunConfig) 1551 service := resourceDetector.attrs.EnvVar(detector.EnvCloudRunService) 1552 revision := resourceDetector.attrs.EnvVar(detector.EnvCloudRunRevision) 1553 1554 return &MonitoredResource{ 1555 LogID: "run.googleapis.com%2Fstdout", 1556 MonitoredResource: &mrpb.MonitoredResource{ 1557 Type: string(CloudRunRevision), 1558 Labels: Label{ 1559 "project_id": projectID, 1560 "service_name": service, 1561 "revision_name": revision, 1562 "location": region, 1563 "configuration_name": config, 1564 }, 1565 }, 1566 } 1567 } 1568 1569 func detectCloudRunJobsResource() *MonitoredResource { 1570 projectID := resourceDetector.metadataProjectID() 1571 if projectID == "" { 1572 return nil 1573 } 1574 1575 region := resourceDetector.metadataRegion() 1576 jobname := resourceDetector.attrs.EnvVar(detector.EnvCloudRunJobsService) 1577 1578 return &MonitoredResource{ 1579 LogID: "run.googleapis.com%2Fstdout", 1580 MonitoredResource: &mrpb.MonitoredResource{ 1581 Type: string(CloudRunJob), 1582 Labels: Label{ 1583 "project_id": projectID, 1584 "job_name": jobname, 1585 "location": region, 1586 }, 1587 }, 1588 } 1589 } 1590 1591 func detectCloudFunctionsResource() *MonitoredResource { 1592 projectID := resourceDetector.metadataProjectID() 1593 if projectID == "" { 1594 return nil 1595 } 1596 1597 funcname := resourceDetector.attrs.EnvVar(detector.EnvCloudFunctionsKService) 1598 revision := resourceDetector.attrs.EnvVar(detector.EnvCloudRunRevision) 1599 1600 return &MonitoredResource{ 1601 LogID: "cloudfunctions.googleapis.com%2Fcloud-functions", 1602 MonitoredResource: &mrpb.MonitoredResource{ 1603 Type: string(CloudFunction), 1604 Labels: Label{ 1605 "project_id": projectID, 1606 "function_name": funcname, 1607 "region": revision, 1608 }, 1609 }, 1610 } 1611 }