Skip to content

Commit

Permalink
Add detail for GCP Cloud Run Job execution (#3378)
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi authored May 9, 2023
1 parent b18f508 commit ccac3a2
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 3 deletions.
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)
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

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

0 comments on commit ccac3a2

Please sign in to comment.