From 38bf5aed50e731598b3d1032391cebb8c78c2472 Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Mon, 10 Apr 2023 17:56:45 +0000 Subject: [PATCH 1/3] Add detail for GCP Cloud Run Job version --- semantic_conventions/resource/faas.yaml | 11 +++++++++-- specification/resource/semantic_conventions/faas.md | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/semantic_conventions/resource/faas.yaml b/semantic_conventions/resource/faas.yaml index df1716b7d0b..a9fa3e3ce43 100644 --- a/semantic_conventions/resource/faas.yaml +++ b/semantic_conventions/resource/faas.yaml @@ -36,8 +36,15 @@ 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) - (i.e., the function name plus the revision suffix). + * **Google Cloud Run:** + * **Services:** The + [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., + the function name plus the revision suffix). + * **Jobs:** The + [execution](https://cloud.google.com/run/docs/managing/job-executions) and + [task + index](https://cloud.google.com/run/docs/container-contract#jobs-env-vars), + eg `execution/0`. * **Google Cloud Functions:** The value of the [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). * **Azure Functions:** Not applicable. Do not set this attribute. diff --git a/specification/resource/semantic_conventions/faas.md b/specification/resource/semantic_conventions/faas.md index e1c2c11a366..edb0e6222bc 100644 --- a/specification/resource/semantic_conventions/faas.md +++ b/specification/resource/semantic_conventions/faas.md @@ -43,8 +43,15 @@ 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) - (i.e., the function name plus the revision suffix). +* **Google Cloud Run:** + * **Services:** The + [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., + the function name plus the revision suffix). + * **Jobs:** The + [execution](https://cloud.google.com/run/docs/managing/job-executions) and + [task + index](https://cloud.google.com/run/docs/container-contract#jobs-env-vars), + eg `execution/0`. * **Google Cloud Functions:** The value of the [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). * **Azure Functions:** Not applicable. Do not set this attribute. From 5b589465ffa095203ac27aa75140d8a5475cc706 Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Tue, 25 Apr 2023 14:31:11 +0000 Subject: [PATCH 2/3] Revert Job version def + create resource attrs for Cloud Run --- .../cloud_provider/gcp/cloud_run.yaml | 21 +++++++++++++++++++ semantic_conventions/resource/faas.yaml | 11 ++-------- .../resource/semantic_conventions/README.md | 2 +- .../cloud_provider/gcp/README.md | 10 +++++++++ .../cloud_provider/gcp/cloud_run.md | 12 +++++++++++ .../resource/semantic_conventions/faas.md | 11 ++-------- 6 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml create mode 100644 specification/resource/semantic_conventions/cloud_provider/gcp/README.md create mode 100644 specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md 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..e7bf308daff --- /dev/null +++ b/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml @@ -0,0 +1,21 @@ +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 + [execution](https://cloud.google.com/run/docs/managing/job-executions) + of the job. + 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 a9fa3e3ce43..8f808ce5712 100644 --- a/semantic_conventions/resource/faas.yaml +++ b/semantic_conventions/resource/faas.yaml @@ -36,15 +36,8 @@ 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:** - * **Services:** The - [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., - the function name plus the revision suffix). - * **Jobs:** The - [execution](https://cloud.google.com/run/docs/managing/job-executions) and - [task - index](https://cloud.google.com/run/docs/container-contract#jobs-env-vars), - eg `execution/0`. + * **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). * **Azure Functions:** Not applicable. Do not set this attribute. diff --git a/specification/resource/semantic_conventions/README.md b/specification/resource/semantic_conventions/README.md index 7d4fe1e99fd..d1eff3ef66f 100644 --- a/specification/resource/semantic_conventions/README.md +++ b/specification/resource/semantic_conventions/README.md @@ -219,7 +219,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..6ab9e9f594b --- /dev/null +++ b/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md @@ -0,0 +1,12 @@ +# Google 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 [execution](https://cloud.google.com/run/docs/managing/job-executions) of the job. | `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 edb0e6222bc..d2728663263 100644 --- a/specification/resource/semantic_conventions/faas.md +++ b/specification/resource/semantic_conventions/faas.md @@ -43,15 +43,8 @@ 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:** - * **Services:** The - [revision](https://cloud.google.com/run/docs/managing/revisions) (i.e., - the function name plus the revision suffix). - * **Jobs:** The - [execution](https://cloud.google.com/run/docs/managing/job-executions) and - [task - index](https://cloud.google.com/run/docs/container-contract#jobs-env-vars), - eg `execution/0`. +* **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). * **Azure Functions:** Not applicable. Do not set this attribute. From 92070cc1638833daf7d9f90f28a1a65aa1c103ef Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Tue, 2 May 2023 18:57:46 +0000 Subject: [PATCH 3/3] feedback --- .../resource/cloud_provider/gcp/cloud_run.yaml | 6 ++++-- .../semantic_conventions/cloud_provider/gcp/cloud_run.md | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml b/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml index e7bf308daff..e4da8f59296 100644 --- a/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml +++ b/semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml @@ -8,9 +8,11 @@ groups: - id: job.execution type: string brief: > - The + The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) - of the job. + 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 diff --git a/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md b/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md index 6ab9e9f594b..1888720a525 100644 --- a/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md +++ b/specification/resource/semantic_conventions/cloud_provider/gcp/cloud_run.md @@ -1,5 +1,7 @@ # Google Cloud Run +These conventions are recommended for resources running on Cloud Run. + **Type:** `gcp.cloud_run` **Description:** Resource attributes for GCE instances. @@ -7,6 +9,6 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `gcp.cloud_run.job.execution` | string | The [execution](https://cloud.google.com/run/docs/managing/job-executions) of the job. | `job-name-xxxx`; `sample-job-mdw84` | Recommended | +| `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 |