From 2541b872367cd4ca3119fd71ee2c468e09e4a3d5 Mon Sep 17 00:00:00 2001 From: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:14:09 +0100 Subject: [PATCH] [chore] Move GCP attributes to the registry (#849) --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 ++ .github/ISSUE_TEMPLATE/change_proposal.yaml | 2 ++ .github/ISSUE_TEMPLATE/new-conventions.yaml | 2 ++ docs/attributes-registry/README.md | 2 ++ docs/attributes-registry/gcp-cloud-run.md | 9 +++++++ docs/attributes-registry/gcp-gce.md | 9 +++++++ docs/resource/cloud-provider/gcp/cloud-run.md | 4 +-- docs/resource/cloud-provider/gcp/gce.md | 4 +-- model/registry/gcp-cloud-run.yaml | 25 +++++++++++++++++++ model/registry/gcp-gce.yaml | 24 ++++++++++++++++++ .../cloud_provider/gcp/cloud_run.yaml | 23 +++-------------- model/resource/cloud_provider/gcp/gce.yaml | 22 +++------------- 12 files changed, 87 insertions(+), 41 deletions(-) create mode 100644 docs/attributes-registry/gcp-cloud-run.md create mode 100644 docs/attributes-registry/gcp-gce.md create mode 100644 model/registry/gcp-cloud-run.yaml create mode 100644 model/registry/gcp-gce.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 30d6a421f..42e2d38a7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -37,6 +37,8 @@ body: - area:exception - area:faas - area:feature-flag + - area:gcp-cloud-run + - area:gcp-gce - area:host - area:http - area:k8s diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index d47978fd7..b4ba2ee21 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -30,6 +30,8 @@ body: - area:exception - area:faas - area:feature-flag + - area:gcp-cloud-run + - area:gcp-gce - area:host - area:http - area:k8s diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index deef5d5aa..a289b3b6b 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -39,6 +39,8 @@ body: - area:exception - area:faas - area:feature-flag + - area:gcp-cloud-run + - area:gcp-gce - area:host - area:http - area:k8s diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index eddd116a5..8d8cd7e46 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -44,6 +44,8 @@ Currently, the following namespaces exist: * [Exception](exception.md) * [FaaS](faas.md) * [Feature Flag](feature-flag.md) +* [Google Cloud Run](gcp-cloud-run.md) +* [Google Compute Engine](gcp-gce.md) * [Host](host.md) * [HTTP](http.md) * [K8s](k8s.md) diff --git a/docs/attributes-registry/gcp-cloud-run.md b/docs/attributes-registry/gcp-cloud-run.md new file mode 100644 index 000000000..219b854eb --- /dev/null +++ b/docs/attributes-registry/gcp-cloud-run.md @@ -0,0 +1,9 @@ +# Google Cloud Run + +## Google Cloud Run Attributes + +| Attribute | Type | Description | Examples | +|---|---|---|---| +| `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` | +| `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` | + diff --git a/docs/attributes-registry/gcp-gce.md b/docs/attributes-registry/gcp-gce.md new file mode 100644 index 000000000..da3b46486 --- /dev/null +++ b/docs/attributes-registry/gcp-gce.md @@ -0,0 +1,9 @@ +# Google Compute Engine + +## Google Compute Engine Attributes + +| Attribute | Type | Description | Examples | +|---|---|---|---| +| `gcp.gce.instance.hostname` | string | The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). | `my-host1234.example.com`; `sample-vm.us-west1-b.c.my-project.internal` | +| `gcp.gce.instance.name` | string | The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). | `instance-1`; `my-vm-name` | + diff --git a/docs/resource/cloud-provider/gcp/cloud-run.md b/docs/resource/cloud-provider/gcp/cloud-run.md index d929928a9..1f7977307 100644 --- a/docs/resource/cloud-provider/gcp/cloud-run.md +++ b/docs/resource/cloud-provider/gcp/cloud-run.md @@ -11,8 +11,8 @@ These conventions are recommended for resources running on 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 | +| [`gcp.cloud_run.job.execution`](../../../attributes-registry/gcp-cloud-run.md) | 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`](../../../attributes-registry/gcp-cloud-run.md) | 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 | [DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md diff --git a/docs/resource/cloud-provider/gcp/gce.md b/docs/resource/cloud-provider/gcp/gce.md index 986ce0fbe..4e2855ed7 100644 --- a/docs/resource/cloud-provider/gcp/gce.md +++ b/docs/resource/cloud-provider/gcp/gce.md @@ -7,6 +7,6 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `gcp.gce.instance.hostname` | string | The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). | `my-host1234.example.com`; `sample-vm.us-west1-b.c.my-project.internal` | Recommended | -| `gcp.gce.instance.name` | string | The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). | `instance-1`; `my-vm-name` | Recommended | +| [`gcp.gce.instance.hostname`](../../../attributes-registry/gcp-gce.md) | string | The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). | `my-host1234.example.com`; `sample-vm.us-west1-b.c.my-project.internal` | Recommended | +| [`gcp.gce.instance.name`](../../../attributes-registry/gcp-gce.md) | string | The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). | `instance-1`; `my-vm-name` | Recommended | diff --git a/model/registry/gcp-cloud-run.yaml b/model/registry/gcp-cloud-run.yaml new file mode 100644 index 000000000..11b9481fe --- /dev/null +++ b/model/registry/gcp-cloud-run.yaml @@ -0,0 +1,25 @@ +groups: + - id: registry.gcp.cloud_run + prefix: gcp.cloud_run + type: attribute_group + brief: > + This document defines attributes for Google Cloud Run. + attributes: + - id: job.execution + type: string + stability: experimental + 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 + stability: experimental + 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/model/registry/gcp-gce.yaml b/model/registry/gcp-gce.yaml new file mode 100644 index 000000000..1ca30ee72 --- /dev/null +++ b/model/registry/gcp-gce.yaml @@ -0,0 +1,24 @@ +groups: + - id: registry.gcp.gce + prefix: gcp.gce + type: attribute_group + brief: > + This document defines attributes for Google Compute Engine (GCE). + attributes: + - id: instance.name + type: string + stability: experimental + brief: > + The instance name of a GCE instance. This is the value + provided by `host.name`, the visible name of the instance in + the Cloud Console UI, and the prefix for the default + hostname of the instance as defined by the [default internal + DNS + name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). + examples: ['instance-1', 'my-vm-name'] + - id: instance.hostname + type: string + stability: experimental + brief: > + The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). + examples: ['my-host1234.example.com', 'sample-vm.us-west1-b.c.my-project.internal'] diff --git a/model/resource/cloud_provider/gcp/cloud_run.yaml b/model/resource/cloud_provider/gcp/cloud_run.yaml index 269f4a6f8..3f0583774 100644 --- a/model/resource/cloud_provider/gcp/cloud_run.yaml +++ b/model/resource/cloud_provider/gcp/cloud_run.yaml @@ -1,25 +1,10 @@ groups: - id: gcp.cloud_run - prefix: gcp.cloud_run type: resource brief: > Resource used by Google Cloud Run. attributes: - - id: job.execution - type: string - stability: experimental - 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 - stability: experimental - 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] + - ref: gcp.cloud_run.job.execution + requirement_level: recommended + - ref: gcp.cloud_run.job.task_index + requirement_level: recommended diff --git a/model/resource/cloud_provider/gcp/gce.yaml b/model/resource/cloud_provider/gcp/gce.yaml index 22b96628d..d29684b2a 100644 --- a/model/resource/cloud_provider/gcp/gce.yaml +++ b/model/resource/cloud_provider/gcp/gce.yaml @@ -1,24 +1,10 @@ groups: - id: gcp.gce - prefix: gcp.gce type: resource brief: > Resources used by Google Compute Engine (GCE). attributes: - - id: instance.name - type: string - stability: experimental - brief: > - The instance name of a GCE instance. This is the value - provided by `host.name`, the visible name of the instance in - the Cloud Console UI, and the prefix for the default - hostname of the instance as defined by the [default internal - DNS - name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). - examples: ['instance-1', 'my-vm-name'] - - id: instance.hostname - type: string - stability: experimental - brief: > - The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). - examples: ['my-host1234.example.com', 'sample-vm.us-west1-b.c.my-project.internal'] + - ref: gcp.gce.instance.name + requirement_level: recommended + - ref: gcp.gce.instance.hostname + requirement_level: recommended