Documentation

GCP Tags and Labels

Background

The GCP billing data export shows Labels through three columns:

  1. labels
  2. system_labels
  3. project.labels

As of October 2022, the billing data export also supports attribution based on Tags, exposed as key-value pairs in a new table column.

At Ternary, these label sources are merged into a single coherent namespace. The dimensions which are available as input for defining custom labels or for defining groupings and filters in the Reporting Engine are produced from a combination including labels, system_labels, project.labels and tags.

Conflict Resolution

On rare occasions, there can be conflicts between the abovementioned label sources. For example, within GCP a project may be labeled team: A and the same project may be Tagged team: B. Ternary resolves such conflicts by respecting the following order of precedence:

Tags > Labels > System Labels > Project Labels

Rationale:

  1. Tags are centralized managed (at the organization level) and will therefore tend to be better standardized than ordinary GCP labels, which can be applied on a more ad hoc basis; labels can be noisier or less reliable than tags. To that point, tags are often relied upon in use cases that demand correctness and reliability, such as GCP IAM policies.
  2. Among the three label sources (project.labels, system_labels, labels), precedence is established based on specificity and intentionality.
    • Project labels are the least specific, applying to all contained resources, and so they are superseded by resource labels and system labels.
    • System labels are specific (describing resource-specific information), but they are system-generated and therefore less intentional than ordinary resource labels.
    • Ordinary resource labels are both resource-specific and human-generated; hence they are given the highest precedence among labels.