Labels are used to send tags based upon a Deployment or a Pod.
Pod Labels
Pod labels will show up as log attributes in DataSet. Below is where they are configured within a deployment YAML.
YAML
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
deployment_label: ui_server_attribute
annotations:
a: hidden_from_ui
b: hidden_from_ui
c: hidden_from_ui
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
annotations:
log.config.scalyr.com/attributes.parser: accessLog
log.config.scalyr.com/attributes.attribute_tag: ui_log_attribute
labels:
app: nginx
**pod_label: ui_log_attribute**
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
You can check your deployment labels with the following command
kubectl get deployments --show-labels NAME READY UP-TO-DATE AVAILABLE AGE LABELS nginx-deployment 3/3 3 3 23h app=nginx,deployment_label=ui_server_attribute

Comments
0 comments
Please sign in to leave a comment.