Skip to content

reporter: Upload symbols only if in given allowlist#3035

Open
metalmatze wants to merge 1 commit intomainfrom
reporter-upload-allowlist
Open

reporter: Upload symbols only if in given allowlist#3035
metalmatze wants to merge 1 commit intomainfrom
reporter-upload-allowlist

Conversation

@metalmatze
Copy link
Member

If an allowlist is given Parca Agent will only upload symbols for binaries matching the strings that are specific. The match happens with strings.Contains. So parca matches both parca and parca-agent.

@metalmatze
Copy link
Member Author

Relevant logs for this feature.

time="2025-02-27T12:12:13+01:00" level=info msg="using config file: config.yaml"
2025/02/27 12:12:13 INFO reporter found allowlist list="[parca ollama cuda torch]"
time="2025-02-27T12:12:14+01:00" level=info msg="executable found in allowlist, file: 'parca-agent' matches 'parca'"
time="2025-02-27T12:12:18+01:00" level=info msg="executable found in allowlist, file: 'libtorch_global_deps.so' matches 'torch'"
time="2025-02-27T12:12:18+01:00" level=info msg="executable found in allowlist, file: 'libcudart.so.12.8.57' matches 'cuda'"
time="2025-02-27T12:12:18+01:00" level=info msg="executable found in allowlist, file: 'libc10_cuda.so' matches 'cuda'"
time="2025-02-27T12:12:18+01:00" level=info msg="executable found in allowlist, file: 'libtorch.so' matches 'torch'"
time="2025-02-27T12:12:19+01:00" level=info msg="executable found in allowlist, file: 'libtorch_cpu.so' matches 'torch'"
time="2025-02-27T12:12:19+01:00" level=info msg="executable found in allowlist, file: 'libcuda.so.570.86.16' matches 'cuda'"
time="2025-02-27T12:12:20+01:00" level=info msg="executable found in allowlist, file: 'libtorch_python.so' matches 'torch'"
time="2025-02-27T12:12:20+01:00" level=info msg="executable found in allowlist, file: 'libtorch_cuda.so' matches 'cuda'"

@metalmatze metalmatze force-pushed the reporter-upload-allowlist branch from 2271455 to 1f66082 Compare February 27, 2025 18:47
If an allowlist is given Parca Agent will only upload symbols for binaries matching the strings that are specific. The match happens with `strings.Contains`. So `parca` matches both `parca` and `parca-agent`.
@metalmatze metalmatze force-pushed the reporter-upload-allowlist branch from 1f66082 to 193ad94 Compare February 27, 2025 18:48
var allowed bool
for _, s := range r.symbolUploadAllowlist {
if strings.Contains(args.FileName, s) {
log.Infof("executable found in allowlist, file: '%s' matches '%s'", args.FileName, s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info logs seem excessive

// Config holds all the configuration information for Parca Agent.
type Config struct {
RelabelConfigs []*relabel.Config `yaml:"relabel_configs,omitempty"`
SymbolUpload SymbolUpload `yaml:"symbol_upload,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it odd to place this here, seems more appropriate to be a flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants