Application Monitoring labels and attributes

This document describes the application-specific labels and attributes that might be attached to your telemetry data and to alerting policies. These labels let Google Cloud Observability construct a hierarchy of dashboards and a topology for an application that you register with App Hub.

In this document, interpret a.b.{x,y} as a.b.x and a.b.y.

Log labels

Log data that Google Cloud infrastructure writes can store application information in the following LogEntry fields:

  • apphub
  • apphubDestination
  • apphubSource

Typically, the apphub field is populated. The other fields are populated only when the log entry records edge-like data, such as with VPC Flow Logs. Each of these fields store an AppHub object, which can list labels for an application, a service, and a workload.

The following illustrates the format of the apphub field:

apphub: {
  application: {
    container: "projects/my-project"
    id: "my-app"
    location: "my-app-location"
  }
  workload: {
    criticalityType: "MEDIUM"
    environmentType: "STAGING"
    id: "my-workload-id"
  }
}

Metric labels

Metric data from Google Cloud infrastructure includes the following metadata labels:

  • metadata.system_labels.apphub_application_{container,id,location}
  • metadata.system_labels.apphub_{workload,service}_{criticality_type,environment_type,id}

Metric data from instrumentation you added to your applications can include the following metric labels:

  • metric.labels.apphub_application_{container,id,location}
  • metric.labels.apphub_workload_{criticality_type,environment_type,id}

Trace resource attributes

Trace spans generated by instrumentation you added to your applications can include the following resource attributes:

  • gcp.apphub.application.{container,id,location}
  • gcp.apphub.{workload,service}.{criticality_type,environment_type,id}

Alerting policy labels

Service and workload labels aren't automatically attached to alerting policies. However, you can associate an alerting policy with a specific workload or service by attaching labels with the following keys to the alerting policy:

  • apphub_application_location
  • apphub_application_id
  • apphub_service_id or apphub_workload_id

When an alerting policy includes the previous keys, incidents for the policy are shown on the Application Monitoring dashboards.

For more information, see Associate an alerting policy with a service or workload.

What's next