Skip to content

Commit

Permalink
Revert Job version def + create resource attrs for Cloud Run
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed Apr 25, 2023
1 parent 38bf5ae commit 5b58946
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 19 deletions.
21 changes: 21 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,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]
11 changes: 2 additions & 9 deletions semantic_conventions/resource/faas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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 @@ -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)
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,12 @@
# Google 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 [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 |
<!-- endsemconv -->
11 changes: 2 additions & 9 deletions specification/resource/semantic_conventions/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5b58946

Please sign in to comment.