Skip to content

Commit

Permalink
Add a flag to disable sending debug info to Parca server
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
  • Loading branch information
kakkoyun committed Mar 3, 2022
1 parent d215464 commit 6828acd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
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
@@ -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
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

0 comments on commit 6828acd

Please sign in to comment.