11# Config Filter Settings
22
3- The ` filter.yml ` file controls how the ` trace2receiver ` component
3+ The filter settings control how the ` trace2receiver ` component
44translates the Trace2 data stream from Git commands into OTEL data
55structures. This filtering is content- and context-aware and is
66independent of any statistical filtering performed by later stages in
77the OTEL Collector pipeline.
88
9- The filter settings pathname is set in the
9+ The filter settings are specified inline under the
1010` receivers.trace2receiver.filter `
11- parameter in the main ` config.yml ` file.
11+ parameter in the main ` config.yml ` file. Alternatively, you can use
12+ the ` ${file:PATH} ` syntax to reference an external YAML file.
1213
1314
1415
@@ -90,14 +91,15 @@ A ruleset name is essentially an alias for the underlying ruleset
9091file. Using a ruleset name avoids requiring users know how and where
9192the telemetry service is installed.
9293
93- The ` filter.yml ` file contains a dictionary to map ruleset names to
94+ The filter settings contain a dictionary to map ruleset names to
9495pathnames:
9596
9697```
97- rulesets:
98- <ruleset-name-1>: <ruleset-pathname-1>
99- <ruleset-name-2>: <ruleset-pathname-2>
100- ...
98+ filter:
99+ rulesets:
100+ <ruleset-name-1>: <ruleset-pathname-1>
101+ <ruleset-name-2>: <ruleset-pathname-2>
102+ ...
101103```
102104
103105Ruleset files will be loaded when the receiver starts up.
@@ -127,14 +129,15 @@ the ruleset "rs:bar".
127129
128130A repo nickname is a simple string without either ` dl: ` or ` rs: ` prefix.
129131
130- The ` filter.yml ` file contains a dictionary to map nicknames to detail
132+ The filter settings contain a dictionary to map nicknames to detail
131133levels or rulesets:
132134
133135```
134- nicknames:
135- <nickname-1>: <ruleset-name> | <detail-level>
136- <nickname-1>: <ruleset-name> | <detail-level>
137- ...
136+ filter:
137+ nicknames:
138+ <nickname-1>: <ruleset-name> | <detail-level>
139+ <nickname-1>: <ruleset-name> | <detail-level>
140+ ...
138141```
139142
140143
@@ -160,13 +163,14 @@ or `system` level.
160163$ git config --system trace2.configparams "otel.trace2.*"
161164```
162165
163- The ` filter.yml ` contains a dictionary to define the spelling of
166+ The filter settings contain a dictionary to define the spelling of
164167these keys:
165168
166169```
167- keynames:
168- nickname_key: "otel.trace2.nickname"
169- ruleset_key: "otel.trace2.ruleset"
170+ filter:
171+ keynames:
172+ nickname_key: "otel.trace2.nickname"
173+ ruleset_key: "otel.trace2.ruleset"
170174```
171175
172176
@@ -199,7 +203,7 @@ $ git -c otel.trace2.nickname=personal status
199203```
200204
201205If no nickname is defined or the given repo nickname is not defined in
202- the ` filter.yml ` file , the receiver will fall back to the default
206+ the filter settings , the receiver will fall back to the default
203207filter settings.
204208
205209_ In the above example, I've suggested "monorepo" and "personal" as
@@ -244,8 +248,8 @@ $ cd /path/to/my/repo4
244248$ git -c otel.trace2.ruleset="dl:summary" status
245249```
246250
247- If the named ruleset or detail level is not defined in the ` filter.yml `
248- file , the receiver will fall back to the default filter settings.
251+ If the named ruleset or detail level is not defined in the filter
252+ settings , the receiver will fall back to the default filter settings.
249253
250254If a Git command sends both a ` ruleset_key ` and ` nickname_key ` , the
251255` ruleset_key ` wins. (Both key values will be included in the OTEL
@@ -257,26 +261,27 @@ the `ruleset_key`.)
257261## Filter Settings Syntax
258262
259263Now that all of the concepts have been introduced, we can describe
260- the complete syntax of the ` filter.yml ` file . All sections and rows
264+ the complete syntax of the filter settings . All sections and rows
261265are optional.
262266
263267```
264- keynames:
265- nickname_key: <git-config-key>
266- ruleset_key: <git-config-key>
267-
268- nicknames:
269- <nickname-1>: <ruleset-name> | <detail-level>
270- <nickname-1>: <ruleset-name> | <detail-level>
271- ...
272-
273- rulesets:
274- <ruleset-name-1>: <ruleset-pathname-1>
275- <ruleset-name-2>: <ruleset-pathname-2>
276- ...
277-
278- defaults:
279- ruleset: <ruleset-name> | <detail-level>
268+ filter:
269+ keynames:
270+ nickname_key: <git-config-key>
271+ ruleset_key: <git-config-key>
272+
273+ nicknames:
274+ <nickname-1>: <ruleset-name> | <detail-level>
275+ <nickname-1>: <ruleset-name> | <detail-level>
276+ ...
277+
278+ rulesets:
279+ <ruleset-name-1>: <ruleset-pathname-1>
280+ <ruleset-name-2>: <ruleset-pathname-2>
281+ ...
282+
283+ defaults:
284+ ruleset: <ruleset-name> | <detail-level>
280285```
281286
282287The value of the ` defaults.ruleset ` parameter will be used when a Git
@@ -292,19 +297,20 @@ used.
292297In this filter:
293298
294299```
295- keynames:
296- nickname_key: "otel.trace2.nickname"
297- ruleset_key: "otel.trace2.ruleset"
300+ filter:
301+ keynames:
302+ nickname_key: "otel.trace2.nickname"
303+ ruleset_key: "otel.trace2.ruleset"
298304
299- nicknames:
300- monorepo: "dl:verbose"
301- personal: "dl:drop"
305+ nicknames:
306+ monorepo: "dl:verbose"
307+ personal: "dl:drop"
302308
303- rulesets:
304- "rs:status": "./rulesets/rs-status.yml"
309+ rulesets:
310+ "rs:status": "./rulesets/rs-status.yml"
305311
306- defaults:
307- ruleset: "dl:summary"
312+ defaults:
313+ ruleset: "dl:summary"
308314```
309315
310316The receiver will watch for the ` otel.trace2.nickname ` and
0 commit comments