Skip to content

Commit 1a53503

Browse files
committed
removed print statements
1 parent 9f6e48a commit 1a53503

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

pkg/discovery/process.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"sync"
1212
"time"
1313

14-
"github.com/k0kubun/pp"
1514
"github.com/shirou/gopsutil/v4/process"
1615
)
1716

@@ -128,7 +127,6 @@ func (d *discoverer) filterNodeProcesses(processes []*process.Process) []*proces
128127
for _, proc := range processes {
129128
if d.isNodeProcess(proc) {
130129
nodeProcesses = append(nodeProcesses, proc)
131-
// pp.Println("FOUND YA LITTLE NODE: ", nodeProcesses)
132130
}
133131
}
134132

@@ -552,7 +550,6 @@ func (d *discoverer) extractPackageInfo(nodeProc *NodeProcess, workingDir string
552550
if _, err := os.Stat(packageJsonPath); err == nil {
553551
// TODO: Parse package.json and extract name, version, dependencies
554552
// This would require json.Unmarshal(data, &PackageInfo{})
555-
pp.Println("Does not exist, package")
556553
nodeProc.PackageName = "unknown" // Placeholder
557554
nodeProc.PackageVersion = "unknown" // Placeholder
558555
}
@@ -925,7 +922,6 @@ func (d *discoverer) processOne(ctx context.Context, proc *DiscoveryCandidate, o
925922
} else {
926923
javaProc.ContainerInfo = containerInfo
927924

928-
pp.Println("Found container info", javaProc.ContainerInfo)
929925
// If we're excluding containers and this is in a container, return nil
930926
if opts.ExcludeContainers && containerInfo.IsContainer {
931927
return nil, fmt.Errorf("process %d is running in container, skipping", javaProc.ProcessPID)

pkg/discovery/report.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func GetAgentReportValue() (AgentReportValue, error) {
7272
// Decide if this should be a fatal error or just logged (assuming logged for now)
7373
}
7474

75-
// nodeProcs, err := FindAllNodeProcesses(ctx)
75+
nodeProcs, err := FindAllNodeProcesses(ctx)
7676

7777
// b) Docker Containers (java/Node)
7878
// dockerDiscoverer := NewDockerDiscoverer(ctx)
@@ -108,10 +108,10 @@ func GetAgentReportValue() (AgentReportValue, error) {
108108
// settings[setting.Key] = setting
109109
// }
110110

111-
// for _, proc := range nodeProcs {
112-
// setting := convertNodeProcessToServiceSetting(proc)
113-
// settings[setting.Key] = setting
114-
// }
111+
for _, proc := range nodeProcs {
112+
setting := convertNodeProcessToServiceSetting(proc)
113+
settings[setting.Key] = setting
114+
}
115115

116116
reportValue := AgentReportValue{
117117
osKey: OSConfig{

pkg/docker/operations.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ type ContainerState struct {
168168
// InstrumentContainer instruments a specific Docker container
169169
func (do *DockerOperations) InstrumentContainer(containerName string, cfg *config.ProcessConfiguration) error {
170170
// Discover the container
171-
pp.Println("Container name: ", containerName)
172171
container, err := do.discoverer.GetContainerByName(containerName)
173172
if err != nil {
174173
return fmt.Errorf("container not found: %w", err)
@@ -181,7 +180,6 @@ func (do *DockerOperations) InstrumentContainer(containerName string, cfg *confi
181180

182181
// Determine instrumentation strategy
183182
if container.IsCompose {
184-
pp.Println("Compose container")
185183
if container.IsJava {
186184
return do.instrumentComposeContainer(container, cfg)
187185
} else if container.IsNodeJS {
@@ -442,7 +440,6 @@ func (do *DockerOperations) instrumentComposeNodeContainer(
442440
if container.ComposeFile == "" {
443441
return fmt.Errorf("compose file not found for container %s", container.ContainerName)
444442
}
445-
pp.Println("Compose File for node: ", container.ComposeFile)
446443
modifier := NewComposeModifier(container.ComposeFile)
447444

448445
// Step 1: Validate compose file
@@ -883,7 +880,6 @@ func (do *DockerOperations) buildDockerRunCommand(config map[string]interface{},
883880

884881
// runContainer runs a docker run command
885882
func (do *DockerOperations) runContainer(command string) error {
886-
pp.Println("Running the docker command: ", command)
887883
cmd := exec.CommandContext(do.ctx, "sh", "-c", command)
888884
return cmd.Run()
889885
}
@@ -918,7 +914,6 @@ func (do *DockerOperations) modifyComposeFile(container *discovery.DockerContain
918914

919915
// Add instrumentation to service
920916
if container.IsNodeJS {
921-
pp.Println("Service: ", service)
922917
if err := modifier.addNodeInstrumentation(&service, cfg, do.hostAgentPath); err != nil {
923918
return fmt.Errorf("failed to add instrumentation: %w", err)
924919
}
@@ -928,7 +923,6 @@ func (do *DockerOperations) modifyComposeFile(container *discovery.DockerContain
928923

929924
// Update the service in the compose data
930925
composeData.Services[container.ComposeService] = service
931-
pp.Println("compose Data, ", composeData)
932926

933927
// Write the modified compose file
934928
if err := modifier.Write(composeData); err != nil {
@@ -967,10 +961,6 @@ func (cm *ComposeModifier) Write(composeFile *ComposeFile) error {
967961
return fmt.Errorf("failed to marshal YAML: %w", err)
968962
}
969963

970-
pp.Println("=== MODIFIED COMPOSE FILE CONTENT ===")
971-
pp.Println(string(data))
972-
pp.Println("=== END MODIFIED CONTENT ===")
973-
974964
// Write to file
975965
if err := os.WriteFile(cm.filePath, data, 0o644); err != nil {
976966
return fmt.Errorf("failed to write file: %w", err)
@@ -1089,8 +1079,6 @@ func (cm *ComposeModifier) addNodeInstrumentation(
10891079
hostAgentPath string,
10901080
) error {
10911081
cfg.MWServiceName = ""
1092-
pp.Println("----------------------------------------------------------")
1093-
pp.Println("cfg: OTEL SERVICE NAME: ", cfg.OtelServiceName)
10941082
mwEnv := cfg.ToEnvironmentVariables()
10951083
nodeOptions := fmt.Sprintf("NODE_OPTIONS=--import ${PWD}/autoinstrumentation/mw-register.js")
10961084

0 commit comments

Comments
 (0)