Skip to content
Open
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
4 changes: 4 additions & 0 deletions .chloggen/gcp_apphub_destination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: gcp
note: Document `gcp.apphub_destination.*` attributes
issues: [2649]
61 changes: 61 additions & 0 deletions docs/registry/attributes/gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# GCP

- [GCP - AppHub Attributes](#gcp---apphub-attributes)
- [GCP - AppHub Destination Attributes](#gcp---apphub-destination-attributes)
- [GCP Client Attributes](#gcp-client-attributes)
- [GCP - Google Cloud Run Attributes](#gcp---google-cloud-run-attributes)
- [GCP - Google Compute Engine (GCE) Attributes](#gcp---google-compute-engine-gce-attributes)
Expand Down Expand Up @@ -76,6 +77,66 @@ This document defines attributes AppHub will apply to resources in GCP. See [App
| `STAGING` | Staging environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `TEST` | Test environment. | ![Development](https://img.shields.io/badge/-development-blue) |

## GCP - AppHub Destination Attributes

This document defines attributes AppHub will apply to destination resources in GCP. See [AppHub overview](https://cloud.google.com/app-hub/docs/overview).

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="gcp-apphub-destination-application-container" href="#gcp-apphub-destination-application-container">`gcp.apphub_destination.application.container`</a> | string | The container within GCP where the AppHub destination application is defined. | `projects/my-container-project` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-application-id" href="#gcp-apphub-destination-application-id">`gcp.apphub_destination.application.id`</a> | string | The name of the destination application as configured in AppHub. | `my-application` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-application-location" href="#gcp-apphub-destination-application-location">`gcp.apphub_destination.application.location`</a> | string | The GCP zone or region where the destination application is defined. | `us-central1` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-service-criticality-type" href="#gcp-apphub-destination-service-criticality-type">`gcp.apphub_destination.service.criticality_type`</a> | string | Criticality of a destination workload indicates its importance to the business as specified in [AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type) | `MISSION_CRITICAL`; `HIGH`; `MEDIUM` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-service-environment-type" href="#gcp-apphub-destination-service-environment-type">`gcp.apphub_destination.service.environment_type`</a> | string | Software lifecycle stage of a destination service as defined [AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1) | `PRODUCTION`; `STAGING`; `TEST` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-service-id" href="#gcp-apphub-destination-service-id">`gcp.apphub_destination.service.id`</a> | string | The name of the destination service as configured in AppHub. | `my-service` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-workload-criticality-type" href="#gcp-apphub-destination-workload-criticality-type">`gcp.apphub_destination.workload.criticality_type`</a> | string | Criticality of a destination workload indicates its importance to the business as specified in [AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type) | `MISSION_CRITICAL`; `HIGH`; `MEDIUM` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-workload-environment-type" href="#gcp-apphub-destination-workload-environment-type">`gcp.apphub_destination.workload.environment_type`</a> | string | Environment of a destination workload is the stage of a software lifecycle as provided in the [AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1) | `PRODUCTION`; `STAGING`; `TEST` | ![Development](https://img.shields.io/badge/-development-blue) |
| <a id="gcp-apphub-destination-workload-id" href="#gcp-apphub-destination-workload-id">`gcp.apphub_destination.workload.id`</a> | string | The name of the destination workload as configured in AppHub. | `my-workload` | ![Development](https://img.shields.io/badge/-development-blue) |

---

`gcp.apphub_destination.service.criticality_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `HIGH` | High impact. | ![Development](https://img.shields.io/badge/-development-blue) |
| `LOW` | Low impact. | ![Development](https://img.shields.io/badge/-development-blue) |
| `MEDIUM` | Medium impact. | ![Development](https://img.shields.io/badge/-development-blue) |
| `MISSION_CRITICAL` | Mission critical service. | ![Development](https://img.shields.io/badge/-development-blue) |

---

`gcp.apphub_destination.service.environment_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `DEVELOPMENT` | Development environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `PRODUCTION` | Production environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `STAGING` | Staging environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `TEST` | Test environment. | ![Development](https://img.shields.io/badge/-development-blue) |

---

`gcp.apphub_destination.workload.criticality_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `HIGH` | High impact. | ![Development](https://img.shields.io/badge/-development-blue) |
| `LOW` | Low impact. | ![Development](https://img.shields.io/badge/-development-blue) |
| `MEDIUM` | Medium impact. | ![Development](https://img.shields.io/badge/-development-blue) |
| `MISSION_CRITICAL` | Mission critical service. | ![Development](https://img.shields.io/badge/-development-blue) |

---

`gcp.apphub_destination.workload.environment_type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `DEVELOPMENT` | Development environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `PRODUCTION` | Production environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `STAGING` | Staging environment. | ![Development](https://img.shields.io/badge/-development-blue) |
| `TEST` | Test environment. | ![Development](https://img.shields.io/badge/-development-blue) |

## GCP Client Attributes

Attributes for Google Cloud client libraries.
Expand Down
5 changes: 5 additions & 0 deletions docs/resource/cloud-provider/gcp/apphub.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on the source of telemetry. For example, metrics coming from a Google Cloud
service will be annotated with the appropriate `gcp.apphub.application` and
`gcp.apphub.service` as configured in AppHub.

Note that each `gcp.apphub.*` attribute has a corresponding `gcp.apphub_destination.*` attribute, describing the
destination/dependency application/service/workload for telemetry which can reference more than one AppHub component.
For example, `CLIENT` spans may contain both `gcp.apphub.*` attributes describing the application where the client
operation was running as well as `gcp.apphub_destination.*` attributes describing the application that it is talking to.

See [Supported Resources](https://cloud.google.com/app-hub/docs/supported-resources) for what data will be annotated by Google Cloud.

## Application
Expand Down
126 changes: 126 additions & 0 deletions model/gcp/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,132 @@ groups:
Criticality of a workload indicates its importance to the business.
note: >
[See AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type)
- id: registry.gcp.apphub_destination
type: attribute_group
display_name: GCP - AppHub Destination Attributes
brief: >
This document defines attributes AppHub will apply to destination resources in GCP.
See [AppHub overview](https://cloud.google.com/app-hub/docs/overview).
attributes:
- id: gcp.apphub_destination.application.container
type: string
stability: development
brief: >
The container within GCP where the AppHub destination application is defined.
examples: ['projects/my-container-project']
- id: gcp.apphub_destination.application.location
type: string
stability: development
brief: >
The GCP zone or region where the destination application is defined.
examples: ['us-central1']
- id: gcp.apphub_destination.application.id
type: string
stability: development
brief: >
The name of the destination application as configured in AppHub.
examples: ['my-application']
- id: gcp.apphub_destination.service.id
type: string
stability: development
brief: >
The name of the destination service as configured in AppHub.
examples: ['my-service']
- id: gcp.apphub_destination.service.environment_type
Copy link
Member

Choose a reason for hiding this comment

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

the rule of thumb is to use . whenever it makes sense. It seems type is a property of env and (in theory) there could be multiple other properties, thus . makes sense

Suggested change
- id: gcp.apphub_destination.service.environment_type
- id: gcp.apphub_destination.service.environment.type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While this would be a reasonable suggestion in the initial design (when gcp.apphub.service.environment_type was defined), renaming here would break the rule that "for every attribute gcp.apphub.* there is an equivalent gcp.apphub_destination.* field corresponding to the destination application".

Given that gcp.apphub.service.environment_type already exists, I would like to push back on this request.

type:
members:
- id: production
value: "PRODUCTION"
brief: Production environment.
stability: development
- id: staging
value: "STAGING"
brief: Staging environment.
stability: development
- id: test
value: "TEST"
brief: Test environment.
stability: development
- id: development
value: "DEVELOPMENT"
brief: Development environment.
stability: development
stability: development
brief: >
Software lifecycle stage of a destination service as defined [AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1)
- id: gcp.apphub_destination.service.criticality_type
type:
members:
- id: mission_critical
value: "MISSION_CRITICAL"
brief: Mission critical service.
stability: development
- id: high
value: "HIGH"
brief: High impact.
stability: development
- id: medium
value: "MEDIUM"
brief: Medium impact.
stability: development
- id: low
value: "LOW"
brief: Low impact.
stability: development
stability: development
brief: >
Criticality of a destination workload indicates its importance to the business as specified in [AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type)
- id: gcp.apphub_destination.workload.id
type: string
stability: development
brief: >
The name of the destination workload as configured in AppHub.
examples: ['my-workload']
- id: gcp.apphub_destination.workload.environment_type
Copy link
Member

@lmolkova lmolkova Aug 28, 2025

Choose a reason for hiding this comment

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

let's not define multiple attributes for the same thing.
According to docs the same enum is shared

Environment of the Application, Service, or Workload

so, can we define one and call it gcp.apphub?destination.environment.type or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For similar reasons as the other comments, I need to push back.

I concur that there is a lot of overlap between the "service" and "workload" concepts in AppHub. Were I in charge, I would have made a single definition with "SERVICE" and "WORKLOAD" as enum types that are independent of the overall structure.

While it would have been ideal to have:

     message AppHub {
        AppHubApplication application
        ApplicationComponentType component_type  // WORKLOAD or SERVICE
        string id
        CriticalityType criticality_type
        EnvironmentType environment_type
     } 

What actually exists in AppHub is:

   message AppHub {
       AppHubApplication application
       oneof component_type {
         AppHubService service
         AppHubWorkload workload
       }
    }

... with AppHubService and AppHubWorkload having substantially similar fields. This organizational structure is carried through to the currently defined AppHub attributes (perhaps under the assumption that these fields may take on divergent meaning or values in the two contexts in the future).

The desired rule "for every gcp.apphub.* attribute, there is an equivalent gcp.apphub_destination.* attribute corresponding to the destination application" ties my hands a bit in terms of improving this organization.

type:
members:
- id: production
value: "PRODUCTION"
brief: Production environment.
stability: development
- id: staging
value: "STAGING"
brief: Staging environment.
stability: development
- id: test
value: "TEST"
brief: Test environment.
stability: development
- id: development
value: "DEVELOPMENT"
brief: Development environment.
stability: development
stability: development
brief: >
Environment of a destination workload is the stage of a software lifecycle as provided in the
[AppHub environment type](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type_1)
- id: gcp.apphub_destination.workload.criticality_type
type:
members:
- id: mission_critical
value: "MISSION_CRITICAL"
brief: Mission critical service.
stability: development
- id: high
value: "HIGH"
brief: High impact.
stability: development
- id: medium
value: "MEDIUM"
brief: Medium impact.
stability: development
- id: low
value: "LOW"
brief: Low impact.
stability: development
stability: development
brief: >
Criticality of a destination workload indicates its importance to the business as specified in [AppHub type enum](https://cloud.google.com/app-hub/docs/reference/rest/v1/Attributes#type)
- id: registry.gcp.gce
type: attribute_group
display_name: GCP - Google Compute Engine (GCE) Attributes
Expand Down
Loading