Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detail for GCP Cloud Run Job execution #3378

Merged
merged 6 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions semantic_conventions/resource/cloud_provider/gcp/cloud_run.yaml
Original file line number Diff line number Diff line change
@@ -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)
damemi marked this conversation as resolved.
Show resolved Hide resolved
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]
2 changes: 1 addition & 1 deletion semantic_conventions/resource/faas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Google Cloud Run
damemi marked this conversation as resolved.
Show resolved Hide resolved

These conventions are recommended for resources running on Cloud Run.

**Type:** `gcp.cloud_run`

**Description:** Resource attributes for GCE instances.

<!-- semconv gcp.cloud_run -->
| 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 |
<!-- endsemconv -->
2 changes: 1 addition & 1 deletion specification/resource/semantic_conventions/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down