-
Notifications
You must be signed in to change notification settings - Fork 184
Expand file tree
/
Copy pathk8sobjects-events.output.yaml
More file actions
112 lines (112 loc) · 3.23 KB
/
k8sobjects-events.output.yaml
File metadata and controls
112 lines (112 loc) · 3.23 KB
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
---
# Source: sumologic/templates/events/otelcol/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: RELEASE-NAME-sumologic-otelcol-events
namespace: sumologic
labels:
app: RELEASE-NAME-sumologic-otelcol-events
chart: "sumologic-%CURRENT_CHART_VERSION%"
release: "RELEASE-NAME"
heritage: "Helm"
data:
config.yaml: |
exporters:
sumologic:
client: k8s_%CURRENT_CHART_VERSION%
endpoint: ${SUMO_ENDPOINT_DEFAULT_OTLP_EVENTS_SOURCE}
log_format: otlp
sending_queue:
enabled: true
storage: file_storage
extensions:
file_storage:
directory: /var/lib/storage/events
timeout: 10s
health_check:
endpoint: ${env:MY_POD_IP}:13133
pprof: {}
processors:
batch:
send_batch_max_size: 2048
send_batch_size: 1024
timeout: 1s
filter/watch_types:
logs:
log_record:
- attributes["type"] != "ADDED" and attributes["type"] != "MODIFIED"
resource/add_cluster:
attributes:
- action: upsert
key: cluster
value: kubernetes
source:
collector: kubernetes
source_category: kubernetes/events
source_category_prefix: ""
source_category_replace_dash: /
source_name: events
sumologic:
add_cloud_namespace: false
transform/add_timestamp:
log_statements:
- context: log
statements:
- set(time, Now()) where time_unix_nano == 0
- set(attributes["timestamp"], Int(time_unix_nano / 1000000))
transform/reformat_body:
log_statements:
- context: log
statements:
- set(attributes["object"], body["object"])
- set(attributes["type"], body["type"])
- set(body, attributes["object"]["message"])
transform/set_severity:
log_statements:
- context: log
statements:
- set(severity_text, "Warning") where attributes["object"]["type"] == "Warning"
- set(severity_number, 13) where attributes["object"]["type"] == "Warning"
- set(severity_text, "Normal") where attributes["object"]["type"] == "Normal"
- set(severity_number, 9) where attributes["object"]["type"] == "Normal"
receivers:
k8sobjects/events:
auth_type: serviceAccount
objects:
- mode: watch
name: events
service:
extensions:
- health_check
- file_storage
- pprof
pipelines:
logs/events:
exporters:
- sumologic
processors:
- transform/reformat_body
- filter/watch_types
- transform/set_severity
- resource/add_cluster
- source
- sumologic
- transform/add_timestamp
- batch
receivers:
- k8sobjects/events
telemetry:
logs:
level: info
metrics:
level: normal
readers:
- pull:
exporter:
prometheus:
host: ${env:MY_POD_IP}
port: 8888
without_scope_info: true
without_type_suffix: true
without_units: true