diff --git a/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml b/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml new file mode 100644 index 00000000000..e4da8f59296 --- /dev/null +++ b/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml @@ -0,0 +1,23 @@ +groups: + - id: gcp.cloud_run + prefix: gcp.cloud_run + type: resource + brief: > + Resource used by Google Cloud Run. + attributes: + - id: job.execution + type: string + brief: > + The name of the Cloud Run + [execution](https://cloud.google.com/run/docs/managing/job-executions) + being run for the Job, as set by the + [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) + environment variable. + examples: ['job-name-xxxx', 'sample-job-mdw84'] + - id: job.task_index + type: int + brief: > + The index for a task within an execution as provided by the + [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) + environment variable. + examples: [0, 1] diff --git a/semantic_conventions/resource/faas.yaml b/semantic_conventions/resource/faas.yaml index df1716b7d0b..8f808ce5712 100644 --- a/semantic_conventions/resource/faas.yaml +++ b/semantic_conventions/resource/faas.yaml @@ -36,7 +36,7 @@ groups: * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) (an integer represented as a decimal string). - * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) + * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., the function name plus the revision suffix). * **Google Cloud Functions:** The value of the [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). diff --git a/specification/resource/semantic_conventions/README.md b/specification/resource/semantic_conventions/README.md index cd311dbf7d8..e6aeba57e92 100644 --- a/specification/resource/semantic_conventions/README.md +++ b/specification/resource/semantic_conventions/README.md @@ -220,7 +220,7 @@ Valid cloud providers are: - [Alibaba Cloud](https://www.alibabacloud.com/) (`alibaba_cloud`) - [Amazon Web Services](https://aws.amazon.com/) ([`aws`](cloud_provider/aws/README.md)) -- [Google Cloud Platform](https://cloud.google.com/) (`gcp`) +- [Google Cloud Platform](https://cloud.google.com/) ([`gcp`](cloud_provider/gcp/README.md)) - [Microsoft Azure](https://azure.microsoft.com/) (`azure`) - [Tencent Cloud](https://www.tencentcloud.com/) (`tencent_cloud`) - [Heroku dyno](./cloud_provider/heroku.md) diff --git a/specification/resource/semantic_conventions/cloud_provider/gcp/README.md b/specification/resource/semantic_conventions/cloud_provider/gcp/README.md new file mode 100644 index 00000000000..b1d0d7ef538 --- /dev/null +++ b/specification/resource/semantic_conventions/cloud_provider/gcp/README.md @@ -0,0 +1,10 @@ +# GCP Semantic Conventions + +This directory defines standards for resource attributes that only apply to +Google Cloud Platform (GCP). If an attribute could apply to resources from more than one cloud +provider (like account ID, operating system, etc), it belongs in the parent +`semantic_conventions` directory. + +## Services + +- [Cloud Run](./cloud_run.md) diff --git a/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md b/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md new file mode 100644 index 00000000000..1888720a525 --- /dev/null +++ b/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md @@ -0,0 +1,14 @@ +# Google Cloud Run + +These conventions are recommended for resources running on Cloud Run. + +**Type:** `gcp.cloud_run` + +**Description:** Resource attributes for GCE instances. + + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `gcp.cloud_run.job.execution` | string | The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. | `job-name-xxxx`; `sample-job-mdw84` | Recommended | +| `gcp.cloud_run.job.task_index` | int | The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. | `0`; `1` | Recommended | + diff --git a/specification/resource/semantic_conventions/faas.md b/specification/resource/semantic_conventions/faas.md index e1c2c11a366..d2728663263 100644 --- a/specification/resource/semantic_conventions/faas.md +++ b/specification/resource/semantic_conventions/faas.md @@ -43,7 +43,7 @@ definition of function name MUST be used for this attribute * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) (an integer represented as a decimal string). -* **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) +* **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., the function name plus the revision suffix). * **Google Cloud Functions:** The value of the [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).