Skip to content

Commit a20bd4d

Browse files
mjcheethamclaude
andcommitted
docs: update config documentation for inline settings
Update documentation and example configs to reflect the switch from file-path-based to inline configuration for pii, filter, and summary settings. Example configs now show inline YAML structs instead of file paths, and mention the ${file:PATH} syntax as an alternative for users who prefer separate files. The filter and PII settings docs are updated to describe the settings as inline config blocks rather than separate .yml files. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
1 parent cf63adf commit a20bd4d

5 files changed

Lines changed: 114 additions & 73 deletions

File tree

Docs/Examples/DebugDump/config.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,24 @@
1212
# THIS WILL GENERATE A LOT OF DATA, so use it with care.
1313
#
1414
# If you want to enable filtering and/or PII data, uncomment the
15-
# correpsonding lines and create the additional .yml files.
15+
# corresponding lines below.
16+
#
17+
# You can also use ${file:PATH} to reference an external YAML file,
18+
# e.g.: filter: "${file:/path/to/filter.yml}"
1619

1720
receivers:
1821
trace2receiver:
1922
socket: "/usr/local/<my-install-dir>/trace2.socket"
2023
pipe: "//./pipe/<my-pipe-name>"
2124

22-
# filter: "/usr/local/<my-install-dir>/filter.yml"
23-
# pii: "/usr/local/<my-install-dir>/pii.yml"
25+
# pii:
26+
# include:
27+
# hostname: true
28+
# username: false
2429

25-
# filter: "C:/ProgramData/<my-data-dir>/filter.yml"
26-
# pii: "C:/ProgramData/<my-data-dir>/pii.yml"
30+
# filter:
31+
# defaults:
32+
# ruleset: "dl:verbose"
2733

2834
processors:
2935

Docs/Examples/ExportToAzureMonitor/config.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,24 @@
1111
# THIS WILL GENERATE A LOT OF DATA, so use it with care.
1212
#
1313
# If you want to enable filtering and/or PII data, uncomment the
14-
# correpsonding lines and create the additional .yml files.
14+
# corresponding lines below.
15+
#
16+
# You can also use ${file:PATH} to reference an external YAML file,
17+
# e.g.: filter: "${file:/path/to/filter.yml}"
1518

1619
receivers:
1720
trace2receiver:
1821
socket: "/usr/local/<my-install-dir>/trace2.socket"
1922
pipe: "//./pipe/<my-pipe-name>"
2023

21-
# filter: "/usr/local/<my-install-dir>/filter.yml"
22-
# pii: "/usr/local/<my-install-dir>/pii.yml"
24+
# pii:
25+
# include:
26+
# hostname: true
27+
# username: false
2328

24-
# filter: "C:/ProgramData/<my-data-dir>/filter.yml"
25-
# pii: "C:/ProgramData/<my-data-dir>/pii.yml"
29+
# filter:
30+
# defaults:
31+
# ruleset: "dl:verbose"
2632

2733
processors:
2834

Docs/config-filter-settings.md

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Config Filter Settings
22

3-
The `filter.yml` file controls how the `trace2receiver` component
3+
The filter settings control how the `trace2receiver` component
44
translates the Trace2 data stream from Git commands into OTEL data
55
structures. This filtering is content- and context-aware and is
66
independent of any statistical filtering performed by later stages in
77
the 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
9091
file. Using a ruleset name avoids requiring users know how and where
9192
the 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
9495
pathnames:
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

103105
Ruleset files will be loaded when the receiver starts up.
@@ -127,14 +129,15 @@ the ruleset "rs:bar".
127129

128130
A 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
131133
levels 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
164167
these 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

201205
If 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
203207
filter 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

250254
If 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

259263
Now 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
261265
are 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

282287
The value of the `defaults.ruleset` parameter will be used when a Git
@@ -292,19 +297,20 @@ used.
292297
In 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

310316
The receiver will watch for the `otel.trace2.nickname` and

Docs/config-pii-settings.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Config PII Settings
22

3-
The PII Settings file contains privacy-related feature flags for the
3+
The PII settings contain privacy-related feature flags for the
44
`trace2receiver` component. Currently, this includes flags to add
55
user and hostname data that may not be present in the original Trace2
66
data stream. Later, it may include other flags to redact or not
@@ -9,18 +9,20 @@ redact sensitive data found within the Trace2 data stream.
99
NOTE: These flags may add GDPR-sensitive data to the OTEL telemetry
1010
data stream. Use them at your own risk.
1111

12-
The PII settings pathname is set in the
12+
The PII settings are specified inline under the
1313
`receivers.trace2receiver.pii`
14-
parameter in the main `config.yml` file.
14+
parameter in the main `config.yml` file. Alternatively, you can use
15+
the `${file:PATH}` syntax to reference an external YAML file.
1516

16-
## `pii.yml` Syntax
17+
## PII Settings Syntax
1718

18-
The PII settings file has the following syntax:
19+
The PII settings have the following syntax:
1920

2021
```
21-
include:
22-
hostname: <bool>
23-
username: <bool>
22+
pii:
23+
include:
24+
hostname: <bool>
25+
username: <bool>
2426
```
2527

2628
### `include.hostname`

Docs/configure-custom-collector.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ receivers:
4444
trace2receiver:
4545
socket: <unix-domain-socket-pathname>
4646
pipe: <windows-named-pipe-pathname>
47-
pii: <pii-settings-pathname>
48-
filter: <filter-settings-pathname>
47+
pii:
48+
<pii-settings>
49+
filter:
50+
<filter-settings>
51+
summary:
52+
<summary-settings>
4953
```
5054

5155
For example:
@@ -55,8 +59,25 @@ receivers:
5559
trace2receiver:
5660
socket: "/usr/local/my-collector/trace2.socket"
5761
pipe: "//./pipe/my-collector.pipe"
58-
pii: "/usr/local/my-collector/pii.yml"
59-
filter: "/usr/local/my-collector/filter.yml"
62+
pii:
63+
include:
64+
hostname: true
65+
username: false
66+
filter:
67+
defaults:
68+
ruleset: "dl:verbose"
69+
```
70+
71+
If you prefer to keep the `pii`, `filter`, or `summary` configuration
72+
in a separate file, you can use the `${file:PATH}` syntax:
73+
74+
```
75+
receivers:
76+
trace2receiver:
77+
socket: "/usr/local/my-collector/trace2.socket"
78+
pipe: "//./pipe/my-collector.pipe"
79+
pii: "${file:/usr/local/my-collector/pii.yml}"
80+
filter: "${file:/usr/local/my-collector/filter.yml}"
6081
```
6182

6283
### `<unix-domain-socket-pathname>` (Required on Unix)
@@ -103,16 +124,16 @@ for details.
103124
$ git config --system trace2.eventtarget "//./pipe/my-collector.pipe"
104125
```
105126

106-
### `<pii-settings-pathname>` (Optional)
127+
### `pii` (Optional)
107128

108-
The pathname to a `pii.yml` file containing privacy-related feature flags.
129+
Inline PII settings controlling privacy-related feature flags.
109130
This is optional. These features are disabled by default.
110131

111132
See [config PII settings](./config-pii-settings.md) for details.
112133

113-
### `<filter-settings-pathname>` (Optional)
134+
### `filter` (Optional)
114135

115-
The pathname to a `filter.yml` file controlling the verbosity of the
136+
Inline filter settings controlling the verbosity of the
116137
generated OTEL telemetry data. This is optional. If omitted,
117138
summary-level telemetry will be emitted.
118139

0 commit comments

Comments
 (0)