Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to disable sending debug info to Parca server #274

Merged
merged 1 commit into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ Flags:
Pods to select.
--systemd-units=SYSTEMD-UNITS,...
systemd units to profile on this node.
--temp-dir="/tmp" Temporary directory path to use for object
files.
--temp-dir="/tmp" Temporary directory path to use for processing
object files.
--socket-path=STRING The filesystem path to the container runtimes
socket. Leave this empty to use the defaults.
--profiling-duration=10s The agent profiling duration to use. Leave
this empty to use the defaults.
--systemd-cgroup-path=STRING
The cgroupfs path to a systemd slice.
--debug-info-disable Disable debuginfo collection.
```

### systemd
Expand Down
11 changes: 8 additions & 3 deletions cmd/parca-agent/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 The Parca Authors
// Copyright (c) 2022 The Parca Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand All @@ -10,6 +10,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package main

Expand Down Expand Up @@ -75,10 +76,11 @@ type flags struct {
Kubernetes bool `kong:"help='Discover containers running on this node to profile automatically.',default='true'"`
PodLabelSelector string `kong:"help='Label selector to control which Kubernetes Pods to select.'"`
SystemdUnits []string `kong:"help='systemd units to profile on this node.'"`
TempDir string `kong:"help='Temporary directory path to use for object files.',default='/tmp'"`
TempDir string `kong:"help='Temporary directory path to use for processing object files.',default='/tmp'"`
SocketPath string `kong:"help='The filesystem path to the container runtimes socket. Leave this empty to use the defaults.'"`
ProfilingDuration time.Duration `kong:"help='The agent profiling duration to use. Leave this empty to use the defaults.',default='10s'"`
SystemdCgroupPath string `kong:"help='The cgroupfs path to a systemd slice.'"`
DebugInfoDisable bool `kong:"help='Disable debuginfo collection.',default='false'"`
}

func externalLabels(flagExternalLabels map[string]string, flagNode string) model.LabelSet {
Expand Down Expand Up @@ -130,7 +132,10 @@ func main() {

// Initialize actual clients with the connection.
profileStoreClient = profilestorepb.NewProfileStoreServiceClient(conn)
debugInfoClient = parcadebuginfo.NewDebugInfoClient(conn)
if !flags.DebugInfoDisable {
level.Info(logger).Log("msg", "Debug information collection is enabled")
debugInfoClient = parcadebuginfo.NewDebugInfoClient(conn)
}
}

var (
Expand Down
6 changes: 6 additions & 0 deletions deploy/lib/parca-agent/parca-agent.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ local defaults = {
insecure: false,
insecureSkipVerify: false,

debugInfoDisable: false,

samplingRatio: 0.0,

commonLabels:: {
Expand Down Expand Up @@ -215,6 +217,10 @@ function(params) {
if pa.config.insecureSkipVerify then [
'--insecure-skip-verify',
] else []
) + (
if pa.config.debugInfoDisable then [
'--debug-info-disable',
] else []
) + (
if pa.config.tempDir != '' then [
'--temp-dir=' + pa.config.tempDir,
Expand Down