forked from open-telemetry/opentelemetry-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yaml
248 lines (229 loc) · 10.1 KB
/
config.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
processors:
# The following example demonstrates inserting keys/values into spans.
attributes/insert:
actions:
# The following inserts a new attribute {"attribute1": 123} to spans where
# the key "attribute1" doesn't exist.
# The type of `attribute1` is inferred by the configuration.
# `123` is an integer and is stored as an integer in the attributes.
# This demonstrates how to backfill spans with an attribute that may
# not have been sent by all clients.
- key: "attribute1"
value: 123
action: insert
# The following uses the value from attribute "anotherkey" to insert a new
# attribute {"string key": <value from attribute "anotherkey">} to spans
# where the key "string key" does not exist. If the attribute "anotherkey"
# doesn't exist, no new attribute is inserted to spans.
- key: "string key"
from_attribute: "anotherkey"
action: insert
# The following demonstrates configuring the processor to only update existing
# keys in an attribute.
# Note: `action: update` must be set.
attributes/update:
actions:
# The following updates the attribute 'boo' using the value from attribute
# 'foo'. Spans without the attribute 'boo' will not change.
- key: "boo"
from_attribute: "foo"
action: update
# The following updates the attribute to { "db.secret": "redacted"}.
# This demonstrates sanitizing spans of sensitive data.
- key: db.secret
value: redacted
action: update
# The following demonstrates setting an attribute on both spans where the
# key does exist and the key doesn't exist.
attributes/upsert:
actions:
# The following demonstrates how to set an attribute on all spans.
# Any spans that already had `region` now have value `planet-earth`.
# This can be done to set properties for all traces without
# requiring an instrumentation change.
- key: region
value: "planet-earth"
action: upsert
# The following demonstrates copying a value to a new key.
# Note: If a span doesn't contain `user_key`, no new attribute `new_user_key`
# is created.
- key: new_user_key
from_attribute: user_key
action: upsert
# The following demonstrates deleting keys from an attribute.
attributes/delete:
actions:
- key: credit_card
action: delete
- key: duplicate_key
action: delete
# The following demonstrates hash existing attribute values.
attributes/hash:
actions:
- key: user.email
action: hash
# The following demonstrates excluding spans from this attributes processor.
# Ex. The following spans match the properties and won't be processed by the
# processor.
# Span1 Name: 'svcB' Attributes: {env: dev, test_request: 123, credit_card: 1234}
# Span2 Name: 'svcA' Attributes: {env: dev, test_request: false}
# The following spans do not match the properties and the processor actions
# are applied to it.
# Span3 Name: 'svcB' Attributes: {env: 1, test_request: dev, credit_card: 1234}
# Span4 Name: 'svcC' Attributes: {env: dev, test_request: false}
attributes/excludemulti:
# Specifies the spans properties that exclude a span from being processed.
exclude:
# match_type defines that "services" is an array of strings that must
# match service name strictly.
match_type: strict
# The Span service name must be equal to "svcA" or "svcB".
services: ["svcA", "svcB"]
attributes:
# This exact attribute ('env', 'dev') must exist in the span for a match.
- {key: env, value: "dev"}
# As long as there is an attribute with key 'test_request' in the span
# there is a match.
- {key: test_request}
actions:
- key: credit_card
action: delete
- key: duplicate_key
action: delete
# The following demonstrates including spans for this attributes processor.
# All other spans that do no match the properties are not processed
# by this processor.
# Ex. The following are spans match the properties and the actions are applied.
# Span1 Name: 'svcB' Attributes: {env: dev, test_request: 123, credit_card: 1234}
# Span2 Name: 'svcA' Attributes: {env: dev, test_request: false}
# Span3 Name: 'svcB' Attributes: {env: 1, test_request: dev, credit_card: 1234}
# The following span does not match the include properties and the
# processor actions are not applied.
# Span4 Name: 'svcC' Attributes: {env: dev, test_request: false}
attributes/includeservices:
# Specifies the span properties that must exist for the processor to be applied.
include:
# match_type defines that "services" is an array of regexp-es.
match_type: regexp
# The Span service name must match "auth.*" or "login.*" regexp.
services: ["auth.*", "login.*"]
actions:
- key: credit_card
action: delete
- key: duplicate_key
action: delete
# The following demonstrates specifying the set of span properties to
# indicate which spans this processor should be applied to. The `include` of
# properties say which ones should be included and the `exclude` properties
# further filter out spans that shouldn't be processed.
# Ex. The following are spans match the properties and the actions are applied.
# Note this span is processed because the value type of redact_trace is a string instead of a boolean.
# Span1 Name: 'svcB' Attributes: {env: production, test_request: 123, credit_card: 1234, redact_trace: "false"}
# Span2 Name: 'svcA' Attributes: {env: staging, test_request: false, redact_trace: true}
# The following span does not match the include properties and the
# processor actions are not applied.
# Span3 Name: 'svcB' Attributes: {env: production, test_request: true, credit_card: 1234, redact_trace: false}
# Span4 Name: 'svcC' Attributes: {env: dev, test_request: false}
attributes/selectiveprocessing:
# Specifies the span properties that must exist for the processor to be applied.
include:
# match_type defines that "services" is an array of strings that must
# match service name strictly.
match_type: strict
# The Span service name must be equal to "svcA" or "svcB".
services: ["svcA", "svcB"]
exclude:
# match_type defines that "attributes" values must match strictly. It is the
# only supported match_type for "attributes" setting.
match_type: strict
attributes:
- { key: redact_trace, value: false}
actions:
- key: credit_card
action: delete
- key: duplicate_key
action: delete
# The following demonstrates how to backfill spans missing an attribute,
# insert/update that value to a new key and deleting the old key. This guarantees
# an attribute `svc.operation` exists in spans and the attribute `operation`
# doesn't exist.
# Ex: The spans before the processor `attributes/complex`.
# Span1 Attributes: {timeout: 10, svc.operation: addition, operation: addition}
# Span2 Attributes: {operation: subtract, math_value: 123}
# Span3 Attributes: {timeout: 10, math_value: 4}
# Span4 Attributes: {svc.operation: division, timeout: 3}
attributes/complex:
# Note: There are no include and exclude settings so all spans are processed.
actions:
- key: operation
value: default
action: insert
# The spans after the first action of insert.
# Span1 Attributes: {timeout: 10, svc.operation: addition, operation: addition}
# Span2 Attributes: {operation: subtract, math_value: 123}
# Span3 Attributes: {timeout: 10, math_value: 4, operation: default}
# Span4 Attributes: {svc.operation: division, timeout: 3, operation:default}
- key: svc.operation
from_attribute: operation
action: upsert
# The spans after the second action of upsert.
# Span1 Attributes: {timeout: 10, svc.operation: addition, operation: addition}
# Span2 Attributes: {svc.operation: subtract, operation: subtract, math_value: 123}
# Span3 Attributes: {svc.operation: default, timeout: 10, math_value: 4, operation: default}
# Span4 Attributes: {svc.operation: default, timeout: 3, operation:default}
- key: operation
action: delete
# The spans after the third/final action of delete.
# Span1 Attributes: {timeout: 10, svc.operation: addition}
# Span2 Attributes: {svc.operation: subtract, math_value: 123}
# Span3 Attributes: {svc.operation: default, timeout: 10, math_value: 4}
# Span4 Attributes: {svc.operation: default, timeout: 3}
# The following is an example of various actions. The actions are applied in
# the order specified in the configuration.
attributes/example:
actions:
- key: db.table
action: delete
- key: redacted_span
value: true
action: upsert
- key: copy_key
from_attribute: key_original
action: update
- key: account_id
value: 2245
action: insert
- key: account_password
action: delete
# The following demonstrates how to process spans that have a service name and span
# name that match regexp patterns. This processor will remove "token" attribute
# and will obfuscate "password" attribute in spans where service name matches "auth.*"
# and where span name does not match "login.*".
attributes/regexp:
# Specifies the span properties that must exist for the processor to be applied.
include:
# match_type defines that "services" is an array of regexp-es.
match_type: regexp
# The span service name must match "auth.*" pattern.
services: ["auth.*"]
exclude:
# match_type defines that "services" is an array of regexp-es.
match_type: regexp
# The span name must not match "login.*" pattern.
span_names: ["login.*"]
actions:
- key: password
action: update
value: "obfuscated"
- key: token
action: delete
receivers:
examplereceiver:
exporters:
exampleexporter:
service:
pipelines:
traces:
receivers: [examplereceiver]
processors: [attributes/insert]
exporters: [exampleexporter]