Skip to content

Commit ebb73c4

Browse files
mjcheethamclaude
andcommitted
config: update callers to use new inline settings fields
This is part of the effort to support inline pii, filter, and summary settings in the main config file, replacing the previous file-path-based approach that required separate YAML files. Now that the Config struct uses exported Pii, Filter, and Summary fields instead of the old private piiSettings, filterSettings, and summary fields, update all call sites in rcvr_base, platform_unix, platform_windows, and trace2dataset to reference the new field names. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
1 parent 6c11868 commit ebb73c4

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

platform_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ func createTraces(_ context.Context,
4545
// possibly the connection from the client process.
4646
// Add any requested PII data to `tr2.pii[]`.
4747
func (tr2 *trace2Dataset) pii_gather(cfg *Config, conn *net.UnixConn) {
48-
if cfg.piiSettings != nil && cfg.piiSettings.Include.Hostname {
48+
if cfg.Pii != nil && cfg.Pii.Include.Hostname {
4949
if h, err := os.Hostname(); err == nil {
5050
tr2.pii[string(Trace2PiiHostname)] = h
5151
}
5252
}
5353

54-
if cfg.piiSettings != nil && cfg.piiSettings.Include.Username {
54+
if cfg.Pii != nil && cfg.Pii.Include.Username {
5555
if u, err := getPeerUsername(conn); err == nil {
5656
tr2.pii[string(Trace2PiiUsername)] = u
5757
}

platform_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ func createTraces(_ context.Context,
4545
// possibly the connection from the client process.
4646
// Add any requested PII data to `tr2.pii[]`.
4747
func (tr2 *trace2Dataset) pii_gather(cfg *Config) {
48-
if cfg.piiSettings != nil && cfg.piiSettings.Include.Hostname {
48+
if cfg.Pii != nil && cfg.Pii.Include.Hostname {
4949
if h, err := os.Hostname(); err == nil {
5050
tr2.pii[string(Trace2PiiHostname)] = h
5151
}
5252
}
5353

54-
if cfg.piiSettings != nil && cfg.piiSettings.Include.Username {
54+
if cfg.Pii != nil && cfg.Pii.Include.Username {
5555
// TODO For now, just lookup the current user. This may
5656
// or may not be valid when the service is officially
5757
// installed. Ideally we should get the user-id of the

rcvr_base.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ func (rcvr_base *Rcvr_Base) Start(unused_ctx context.Context, host component.Hos
3535
rcvr_base.Logger.Info("Command verbs are enabled")
3636
}
3737

38-
if rcvr_base.RcvrConfig.piiSettings != nil {
39-
if rcvr_base.RcvrConfig.piiSettings.Include.Hostname {
38+
if rcvr_base.RcvrConfig.Pii != nil {
39+
if rcvr_base.RcvrConfig.Pii.Include.Hostname {
4040
rcvr_base.Logger.Info("PII: Hostname logging is enabled")
4141
}
42-
if rcvr_base.RcvrConfig.piiSettings.Include.Username {
42+
if rcvr_base.RcvrConfig.Pii.Include.Username {
4343
rcvr_base.Logger.Info("PII: Username logging is enabled")
4444
}
4545
}

trace2dataset.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ func NewTrace2Dataset(rcvr_base *Rcvr_Base) *trace2Dataset {
268268
tr2.exec = make(map[int64]*TrExec)
269269

270270
// Initialize summary accumulator if configured
271-
if rcvr_base != nil && rcvr_base.RcvrConfig != nil && rcvr_base.RcvrConfig.summary != nil {
272-
tr2.process.summary = configuredSummary(rcvr_base.RcvrConfig.summary)
271+
if rcvr_base != nil && rcvr_base.RcvrConfig != nil && rcvr_base.RcvrConfig.Summary != nil {
272+
tr2.process.summary = configuredSummary(rcvr_base.RcvrConfig.Summary)
273273
}
274274

275275
return tr2
@@ -512,7 +512,7 @@ func (tr2 *trace2Dataset) exportTraces() {
512512
}
513513

514514
dl, dl_debug := computeDetailLevel(
515-
tr2.rcvr_base.RcvrConfig.filterSettings,
515+
tr2.rcvr_base.RcvrConfig.Filter,
516516
tr2.process.paramSetValues,
517517
tr2.process.qualifiedNames)
518518

@@ -522,7 +522,7 @@ func (tr2 *trace2Dataset) exportTraces() {
522522
return
523523
}
524524

525-
traces := tr2.ToTraces(dl, tr2.rcvr_base.RcvrConfig.filterSettings.Keynames)
525+
traces := tr2.ToTraces(dl, tr2.rcvr_base.RcvrConfig.Filter.Keynames)
526526

527527
err := tr2.rcvr_base.TracesConsumer.ConsumeTraces(tr2.rcvr_base.ctx, traces)
528528
if err != nil {

0 commit comments

Comments
 (0)