-
Notifications
You must be signed in to change notification settings - Fork 0
/
collector-values.yaml
160 lines (157 loc) · 7.02 KB
/
collector-values.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
mode: deployment
image:
repository: ghcr.io/dynatrace/dynatrace-otel-collector/dynatrace-otel-collector
tag: latest
command:
name: dynatrace-otel-collector
extraEnvs:
- name: DT_API_TOKEN
valueFrom:
secretKeyRef:
name: dt-details
key: DYNATRACE_API_TOKEN
- name: DT_ENDPOINT
valueFrom:
secretKeyRef:
name: dt-details
key: DYNATRACE_ENV_URL
resources:
limits:
memory: 512Mi
config:
receivers:
jaeger: null
prometheus: null
zipkin: null
otlp: null
filelog: null
prometheus:
config:
# Scape any pods with prometheus.io/scrape: true annotation
scrape_configs:
- job_name: 'kubernetes_pods'
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: "true"
# - source_labels: [__meta_kubernetes_pod_annotations_prometheus_io_port]
# target_label: '__port__'
# replacement: $1:8080
processors:
cumulativetodelta:
# k8sattributes:
# extract:
# metadata:
# - k8s.pod.name
# - k8s.pod.uid
# - k8s.deployment.name
# - k8s.statefulset.name
# - k8s.daemonset.name
# - k8s.cronjob.name
# - k8s.namespace.name
# - k8s.node.name
# - k8s.cluster.uid
# annotations:
# # Extracts the value of a pod annotation with key `ownedBy` and inserts it as a resource attribute with key `dt.owner`
# # see otel-demo-values.yaml for where `ownedBy` is set as a custom annotation only on the `cartservice` pods
# - tag_name: dt.owner
# key: ownedBy
# from: pod
# # Extracts the value of a pod annotation with key `product` and inserts it as a resource attribute with key `dt.cost.product`
# # see otel-demo-values.yaml for where `product` is set as a custom annotation only on the `cartservice` pods
# - tag_name: dt.cost.product
# key: product
# from: pod
# # Extracts the value of a pod annotation with key `costCentre` and inserts it as a resource attribute with key `dt.cost.costcenter`
# # Notice the deliberate English / US spelling differences to emphasis that `costCentre` is a custom annotation
# # set in otel-demo-values.yaml
# - tag_name: dt.cost.costcenter
# key: costCentre
# from: pod
# - tag_name: supportInfo
# key: supportInfo
# from: pod
# - tag_name: deployment.release_product
# key: product
# from: pod
# - tag_name: deployment.release_stage
# key: environment
# from: pod
# # How to associate the data to a pod (order matters)
# pod_association:
# - sources:
# - from: resource_attribute
# name: k8s.pod.name
# - from: resource_attribute
# name: k8s.namespace.name
# - sources:
# - from: resource_attribute
# name: k8s.pod.ip
# - sources:
# - from: resource_attribute
# name: k8s.pod.uid
# - sources:
# - from: connection
# transform:
# error_mode: ignore
# trace_statements:
# - context: resource
# statements:
# - set(attributes["dt.kubernetes.workload.kind"], "statefulset") where IsString(attributes["k8s.statefulset.name"])
# - set(attributes["dt.kubernetes.workload.name"], attributes["k8s.statefulset.name"]) where IsString(attributes["k8s.statefulset.name"])
# - set(attributes["dt.kubernetes.workload.kind"], "deployment") where IsString(attributes["k8s.deployment.name"])
# - set(attributes["dt.kubernetes.workload.name"], attributes["k8s.deployment.name"]) where IsString(attributes["k8s.deployment.name"])
# - set(attributes["dt.kubernetes.workload.kind"], "daemonset") where IsString(attributes["k8s.daemonset.name"])
# - set(attributes["dt.kubernetes.workload.name"], attributes["k8s.daemonset.name"]) where IsString(attributes["k8s.daemonset.name"])
# - set(attributes["dt.kubernetes.cluster.id"], attributes["k8s.cluster.uid"]) where IsString(attributes["k8s.cluster.uid"])
# log_statements:
# - context: resource
# statements:
# - set(attributes["dt.kubernetes.workload.kind"], "statefulset") where IsString(attributes["k8s.statefulset.name"])
# - set(attributes["dt.kubernetes.workload.name"], attributes["k8s.statefulset.name"]) where IsString(attributes["k8s.statefulset.name"])
# - set(attributes["dt.kubernetes.workload.kind"], "deployment") where IsString(attributes["k8s.deployment.name"])
# - set(attributes["dt.kubernetes.workload.name"], attributes["k8s.deployment.name"]) where IsString(attributes["k8s.deployment.name"])
# - set(attributes["dt.kubernetes.workload.kind"], "daemonset") where IsString(attributes["k8s.daemonset.name"])
# - set(attributes["dt.kubernetes.workload.name"], attributes["k8s.daemonset.name"]) where IsString(attributes["k8s.daemonset.name"])
# - set(attributes["dt.kubernetes.cluster.id"], attributes["k8s.cluster.uid"]) where IsString(attributes["k8s.cluster.uid"])
# - context: log
# # statements:
# # - set(attributes["alertlevel"], "p4") where attributes["service.name"] == "cartservice"
# statements:
# # Use string "true" here
# # not boolean as it is more flexible in the future
# # Case insensitive match
# # - set(attributes["alertme"], "true")
# # where resource.attributes["service.name"] == "cartservice"
# # and IsMatch(body, "(?i)getcartasync.*")
# - set(attributes["alertmessage"], "Critical Redis connection error!")
# where resource.attributes["service.name"] == "cartservice"
# and resource.attributes["deployment.release_stage"] == "production"
# and IsMatch(body, "(?i)wasn't able to connect to redis.*")
# - set(attributes["priority"], "1")
# where resource.attributes["service.name"] == "cartservice"
# and resource.attributes["deployment.release_stage"] == "production"
# and IsMatch(body, "(?i)wasn't able to connect to redis.*")
exporters:
debug:
verbosity: detailed
otlphttp:
endpoint: "${env:DT_ENDPOINT}"
headers:
Authorization: "Api-Token ${env:DT_API_TOKEN}"
service:
pipelines:
metrics:
receivers: [prometheus]
processors: [cumulativetodelta]
exporters: [otlphttp]
traces: null
# receivers: [otlp]
# processors: [k8sattributes, transform]
# exporters: [otlphttp]
logs: null
# receivers: [otlp]
# processors: [k8sattributes, transform]
# exporters: [debug, otlphttp]