Add generic labels, which are added to all objects
Summary
Labels are utilized heavily in Prometheus and a fantastic method for keeping track of various components and generating queries to help with alerting. In various forms, our GitLab chart allows us to place labels on a variety of components, but we should consider extending this further.
Example today, we utilize the podLabels
and the serviceLabels
configuration items to add additional labels to the Pod Spec for deployments. For GitLab.com, we use these additional labels to help us classify components into various tiers. This helps us categorize our various components allowing us to build queries that better match with our existing metrics platform.
Expected behavior
Additional labels that are added to Pods should be added to additional components of our helm chart that are metrics worry. Consider adding these same labels to the following objects:
- Deployments
- Horizontal Pod Autoscalers
- Services
Note that these are not intended to be selector labels, but rather labels that we can leverage for queries in Prometheus that help us link various objects together in our metrics systems.
Proposal
Add a generic label set which would be applied to all objects generated by these charts (those within this repository). These would be akin to the gitlab.standardLabels
template, but in a configurable manner. These should behave as existing per-object labeling does, in that: local is used if present, otherwise taken from global (if present) via merge
.
global:
common:
labels:
gitlab.com/stage: "canary"
gitlab.com/type: "xyz"
gitlab.com/something: "else"
gitlab:
sidekiq:
common:
labels:
sidekiq.gitlab.com/shard: "abc"
webservice:
common:
labels:
http.gitlab.com/region: "def"
deployments:
web:
common:
labels:
http.gitlab.com/fleet: "web"
ws:
common:
labels:
http.gitlab.com/fleet: "websocket"