Cost attribution
Overview
Section titled “Overview”FinOps attributes cloud costs to services using the gl_service label, as described in the labeling strategy.
A cost only counts as attributed when its label names an entry in the GitLab Service Catalog.
On every runtime, you set the label in one place: labels.gl_service on your workload in the provisioner.
Runway applies it to your service’s resources, as the gl_service label on GCP resources, the gl_service tag on AWS resources, and the gitlab.com/gl_service label on Kubernetes resources.
Configuration New in v4.143.0
Section titled “Configuration ”Set gl_service under labels in your workload’s entry in the provisioner’s workloads.yml for your runtime:
- Cloud Run:
config/runtimes/cloud-run/workloads.yml - GKE:
config/runtimes/gke/workloads.yml - EKS:
config/runtimes/eks/workloads.yml - GitLab Dedicated:
config/runtimes/dedicated/workloads.yml
- runway_service_id: example-service-gke labels: gl_service: example-service project_id: 12345678 regions: - us-east1 groups: - gitlab-org/example-grouplabels.gl_service is required.
The provisioner applies it to the resources it manages for your workload, and sets it as the GL_SERVICE CI/CD variable in your deployment project.
Runway reads GL_SERVICE when it deploys your service, from runwayctl v4.143.0.
Choosing the value
Section titled “Choosing the value”Use the name of your service’s entry in the Service Catalog.
Runway does not check that the entry exists.
The value may contain lowercase letters, digits and hyphens, must start and end with a letter or digit, and can be at most 63 characters long.
If your service has no entry yet, add one by following the setup for Kubernetes or Cloud Run services in the observability reference. The same entry is a prerequisite for alerts and capacity planning.
Several Runway workloads can share one entry. For example, the Cloud Run, GKE and EKS deployments of a service, or its separate components, can all use the service’s name.
Overriding the value
Section titled “Overriding the value”Each Runway manifest has a field that overrides labels.gl_service for the resources Runway deploys.
Leave it unset unless your service needs a different value, so that the provisioner’s configuration stays the single source of the value.
Set metadata.gl_service in your runway.yml.
Jobs set it the same way.
apiVersion: runway/v1kind: RunwayServicemetadata: name: example-service department: eng-infra department_group: eng-infra-scalability owner_email_handle: example-team product_category: scalability gl_service: example-servicespec: container_port: 8080Runway uses the first of these that is set and not empty:
metadata.gl_serviceinrunway.ymlNew in v4.142.0- The
GL_SERVICECI/CD variable, which the provisioner sets fromlabels.gl_service. - Your Runway service ID.
Set spec.serviceLabel in your runway/v2 deployment manifest.
apiVersion: runway/v2kind: RunwayManifestmetadata: name: example-service-gkespec: chartRef: "oci://registry.gitlab.com/my-group/example-service/chart/example-service:{% .ChartVersion %}" serviceLabel: example-serviceRunway uses the first of these that is set and not empty:
spec.serviceLabelindeployment.yamlNew in v4.56.0- The
GL_SERVICECI/CD variable, which the provisioner sets fromlabels.gl_service. - Your Runway service ID.
Set spec.glService in your module manifest.
apiVersion: runway/v3kind: RunwayManifestmetadata: name: example-service-dedicatedspec: glService: example-serviceWhen you release the module, runwayctl catalog create records the value in the Module Catalog entry.
It uses the first of these that is set and not empty:
spec.glServicein the module manifest.- The
GL_SERVICECI/CD variable, which the provisioner sets fromlabels.gl_service. - The module name,
metadata.name.
Tenants deploy the value recorded in the module version.
A change to labels.gl_service therefore takes effect with your next release.
How Runway applies the label
Section titled “How Runway applies the label”Runway adds gl_service to the labels of the GCP resources it deploys for your service, including:
- the Cloud Run service and its revisions, or the Cloud Run job and its executions,
- the load balancers’ forwarding rules and IP addresses, and the internal load balancer’s certificate,
- the Cloud Armor security policy,
- the Secret Manager secrets that hold your service’s secrets,
- the mTLS trust configuration and TLS policies, if you use mTLS.
Cloud Run shares revision labels with Cloud Billing, so your service’s compute costs carry the gl_service label and are attributed to its Service Catalog entry.
On both GKE and EKS, Runway adds gitlab.com/gl_service to:
- the Kubernetes resources it generates for your service,
common.labelsin your Helm values, so the resources your chart renders carry it too, including your Pods.
On GKE, cost allocation exports Pod labels into the Cloud Billing data, which lets FinOps split node costs by service.
Runway applies the value recorded in the module version:
- as the
gl_servicetag on every AWS resource it provisions for the module in the tenant’s AWS account, - as the
gitlab.com/gl_servicelabel on the Kubernetes resources it applies, - in
common.labelsin your Helm values, so the resources your chart renders carry it too, including your Pods.
Resources managed by the provisioner
Section titled “Resources managed by the provisioner”Some resources, such as Cloud SQL and Memorystore instances and Artifact Registry repositories, are managed by the provisioner rather than deployed from your service repository. They take their labels from the provisioner’s configuration, not from the Runway manifest, so a manifest override does not change them.