Skip to content

Cost attribution

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:

config/runtimes/gke/workloads.yml
- runway_service_id: example-service-gke
labels:
gl_service: example-service
project_id: 12345678
regions:
- us-east1
groups:
- gitlab-org/example-group

labels.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.

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.

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.

.runway/runway.yml
apiVersion: runway/v1
kind: RunwayService
metadata:
name: example-service
department: eng-infra
department_group: eng-infra-scalability
owner_email_handle: example-team
product_category: scalability
gl_service: example-service
spec:
container_port: 8080

Runway uses the first of these that is set and not empty:

  1. metadata.gl_service in runway.yml New in v4.142.0
  2. The GL_SERVICE CI/CD variable, which the provisioner sets from labels.gl_service.
  3. Your Runway service ID.

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.

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.