-
Notifications
You must be signed in to change notification settings - Fork 10
/
agent-collector.yaml
331 lines (331 loc) · 10.6 KB
/
agent-collector.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: openobserve-collector-agent
namespace: openobserve
spec:
config:
exporters:
otlphttp/openobserve:
endpoint: http://openobserve-openobserve-standalone.openobserve.svc.local.kronform.pius.dev:5080/api/default/
headers:
Authorization: ENC[AES256_GCM,data:ONypvFw8ENxJrCJ1zvGQrp14k1uInkll5DtyYeJjZMLVsvZggAy8GFG24+1tRttFkReB483oRPISpg==,iv:JE5TAdoYBd1MeNM5gzlgfMB/Am7RpATkkLo3D5A5ASA=,tag:jWC1DRrbque+SIqTYvOz3g==,type:str]
otlphttp/openobserve_k8s_events:
endpoint: http://openobserve-openobserve-standalone.openobserve.svc.local.kronform.pius.dev:5080/api/default/
headers:
Authorization: ENC[AES256_GCM,data:vU5Q+Xj2mgQVe4vRz9fLCW2SE0D5FGUhUGdkHePv4H2ZRqtkfplozpKa8sdQjhrZZwVPrWscXOMKVg==,iv:sG4zM5TugXjNyMdt5pWx2MIVx5jWrHZkCsnbSZyCYgM=,tag:q+Tk+y1MiDNvTT+vhD5Dcw==,type:str]
stream-name: k8s_events
processors:
batch:
send_batch_size: 10000
timeout: 10s
k8sattributes:
auth_type: serviceAccount
extract:
labels:
- from: pod
key: app.kubernetes.io/name
tag_name: service.name
- from: pod
key: k8s-app
tag_name: service.name
- from: pod
key: app.kubernetes.io/instance
tag_name: k8s.app.instance
- from: pod
key: app.kubernetes.io/version
tag_name: service.version
- from: pod
key: app.kubernetes.io/component
tag_name: k8s.app.component
metadata:
- k8s.pod.name
- k8s.pod.uid
- k8s.deployment.name
- k8s.namespace.name
- k8s.node.name
- k8s.pod.start_time
filter:
node_from_env_var: K8S_NODE_NAME
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: resource_attribute
name: k8s.pod.name
- from: resource_attribute
name: k8s.namespace.name
- from: resource_attribute
name: k8s.node.name
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.name
- from: resource_attribute
name: k8s.namespace.name
- sources:
- from: connection
resourcedetection:
detectors:
- system
- env
- k8snode
override: true
system:
hostname_sources:
- os
- dns
receivers:
filelog/std:
exclude:
- /var/log/pods/default_daemonset-collector*_*/opentelemetry-collector/*.log
include:
- /var/log/pods/*/*/*.log
include_file_name: false
include_file_path: true
operators:
- id: get-format
routes:
- expr: body matches "^\\{"
output: parser-docker
- expr: body matches "^[^ Z]+ "
output: parser-crio
- expr: body matches "^[^ Z]+Z"
output: parser-containerd
type: router
- id: parser-crio
output: extract_metadata_from_filepath
regex: ^(?P<time>[^ Z]+) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) ?(?P<log>.*)$
timestamp:
layout: 2006-01-02T15:04:05.999999999Z07:00
layout_type: gotime
parse_from: attributes.time
type: regex_parser
- id: parser-containerd
output: extract_metadata_from_filepath
regex: ^(?P<time>[^ ^Z]+Z) (?P<stream>stdout|stderr) (?P<logtag>[^ ]*) ?(?P<log>.*)$
timestamp:
layout: "%Y-%m-%dT%H:%M:%S.%LZ"
parse_from: attributes.time
type: regex_parser
- id: parser-docker
output: extract_metadata_from_filepath
timestamp:
layout: "%Y-%m-%dT%H:%M:%S.%LZ"
parse_from: attributes.time
type: json_parser
- cache:
size: 128
id: extract_metadata_from_filepath
parse_from: attributes["log.file.path"]
regex: ^.*\/(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]{36})\/(?P<container_name>[^\._]+)\/(?P<restart_count>\d+)\.log$
type: regex_parser
- from: attributes.log
to: body
type: move
- from: attributes.stream
to: attributes["log.iostream"]
type: move
- from: attributes.container_name
to: resource["k8s.container.name"]
type: move
- from: attributes.namespace
to: resource["k8s.namespace.name"]
type: move
- from: attributes.pod_name
to: resource["k8s.pod.name"]
type: move
- from: attributes.restart_count
to: resource["k8s.container.restart_count"]
type: move
- from: attributes.uid
to: resource["k8s.pod.uid"]
type: move
start_at: end
hostmetrics:
collection_interval: 15s
root_path: /hostfs
scrapers:
cpu: {}
disk: {}
filesystem:
exclude_fs_types:
fs_types:
- autofs
- binfmt_misc
- bpf
- cgroup2
- configfs
- debugfs
- devpts
- devtmpfs
- fusectl
- hugetlbfs
- iso9660
- mqueue
- nsfs
- overlay
- proc
- procfs
- pstore
- rpc_pipefs
- securityfs
- selinuxfs
- squashfs
- sysfs
- tracefs
match_type: strict
exclude_mount_points:
match_type: regexp
mount_points:
- /dev/.*
- /proc/.*
- /sys/.*
- /run/k3s/containerd/.*
- /var/lib/docker/.*
- /var/lib/kubelet/.*
- /snap/.*
load: {}
network: {}
process: {}
kubeletstats:
auth_type: serviceAccount
collection_interval: 15s
endpoint: https://${env:K8S_NODE_IP}:10250
extra_metadata_labels:
- container.id
- k8s.volume.type
insecure_skip_verify: true
metric_groups:
- node
- pod
- container
- volume
metrics:
k8s.pod.cpu_limit_utilization:
enabled: true
k8s.pod.cpu_request_utilization:
enabled: true
k8s.pod.memory_limit_utilization:
enabled: true
k8s.pod.memory_request_utilization:
enabled: true
otlp:
protocols:
grpc: {}
http: {}
prometheus:
config:
scrape_configs:
- job_name: otel-collector
scrape_interval: 5s
static_configs:
- targets:
- 0.0.0.0:8888
service:
pipelines:
logs:
exporters:
- otlphttp/openobserve
processors:
- batch
- k8sattributes
receivers:
- filelog/std
metrics:
exporters:
- otlphttp/openobserve
processors:
- batch
- k8sattributes
receivers:
- kubeletstats
traces:
exporters:
- otlphttp/openobserve
processors:
- batch
- k8sattributes
receivers:
- otlp
env:
- name: K8S_NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.115.1
ingress:
route: {}
managementState: managed
mode: daemonset
observability:
metrics: {}
podDisruptionBudget:
maxUnavailable: 1
replicas: 1
resources: {}
securityContext:
runAsUser: 0
runAsGroup: 0
serviceAccount: openobserve-collector
targetAllocator:
allocationStrategy: consistent-hashing
filterStrategy: relabel-config
observability:
metrics: {}
prometheusCR:
podMonitorSelector: {}
scrapeInterval: 30s
serviceMonitorSelector: {}
resources: {}
upgradeStrategy: automatic
volumeMounts:
- mountPath: /hostfs
name: hostfs
- mountPath: /var/log/pods
name: varlogpods
readOnly: true
volumes:
- hostPath:
path: /
name: hostfs
- hostPath:
path: /var/log/pods
name: varlogpods
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age10v5jyc5ylreyltm32kfj57fmqle0aumxqvg9lp67r50cl8ynlsmq9kx7ez
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBaNSswL09QZ09vUTZ1YndO
dDFJZ3EwdGdCdFNmMThOOUMxT29LTXFwRFE0CnBQWkZqV0YrMHBpZUo5RUQyNkxh
Q0xkUTVGM2JwQTNPMnRjaE5WZU5EL3cKLS0tIG94TXFmWmpuRlRMd0orcGxxUG5Z
OHpNMFFvbFFLMWlWcGx1N0Q1cDd6Nk0K4R9T7rLNlYeP8HA6lGMJhipYhSqoMLoq
iYbaffl1UXPLeZb4tlNkBikuikdxjRzp/qWG5vAdEPJEoIl2qd/9hA==
-----END AGE ENCRYPTED FILE-----
- recipient: age1c8rjkuv9px2gfyrlqn75ajhv26l8fdmeugcdegt237c20l8uc4wq6y9h6d
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNYlJyUXFjSjJQcktyb1Ey
Nmh0S2oxZVZ2RUNtTklEZ0pWTTA5eTY0NTJnCldEUXpwWlZPWnB1OFRyRmpWS3Vp
WEErZGZFUUZseXp5SUQ3ZEpKY2U4cFUKLS0tIEpES3pvNEYxZkIvc1lqM0NFcnps
aVRXWDNsYWN3MWxJRkhVOUdGVXltM0EKNeuqoRevd5pjPB5w3OdbSfVvoOj+Gda+
Ab/lNFX1PU1k9umMbg7VEkUz2QDJncoTbVLWIGSFvt9njPDq7Zdnzw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-23T06:55:28Z"
mac: ENC[AES256_GCM,data:TwU/8RJG5a9oZoFIuW4O+vaoHVcd0xBeJgfAgufITMkWFSbEGidb6RWOCsZZGkWBI1M19EFK4FuVsgQ4q9fKjjSQ1ijGoiRxxq1ueL0nHQFJsZpltMMnPEy1K92+H1Ub7NLTih0lHojkZBilbeFphdUhlj4MjIOk6LC7RsfMqQw=,iv:OWvFBDaPn9WvsrLraidUCKmBDwOnqoeXjp+U4EUEeas=,tag:hPSY//NZ9w4bk9986R+mcg==,type:str]
pgp: []
encrypted_regex: ^(data|stringData|Authorization)$
version: 3.8.1