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 semantic conventions for GCP resources #3384

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ release.

### Resource

- Add GCP-specific resource attributes for Compute Engine under `gcp.gce` ([#3384](https://github.com/open-telemetry/opentelemetry-specification/pull/3384))

### Semantic Conventions

- Clarify the scope of the HTTP client span.
Expand Down
22 changes: 22 additions & 0 deletions semantic_conventions/resource/cloud_provider/gcp/gce.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
groups:
- id: gcp.gce
prefix: gcp.gce
type: resource
brief: >
Resources used by Google Compute Engine (GCE).
attributes:
- id: instance.name
type: string
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just ref: host.name instead of define a new field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that sounds good, but gcp.gce.instance.name would actually be the new field that should ref: host.name (currently host.name is set to the instance name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming what we discussed, we use the instance name to set host.name (also for GKE). We don't currently set the actual hostname anywhere.

type: string
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']
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

- [Google Compute Engine](./gce.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Google Compute Engine

**Type:** `gcp.gce`

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

<!-- semconv gcp.gce -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `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` | 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 |
<!-- endsemconv -->