Troubleshooting Go Application Traces Configuration for SigNoz

TLDR Ayan has issues sending Go app traces to SigNoz on k8s. Prashant suggests moving environment settings out of Dockerfile, and modifying the CMD section.

Photo of Ayan
Fri, 01 Sep 2023 10:05:15 UTC

Hello Team! Iam trying to configure Go application to send traces to SigNoz. Signoz deployed on k8s and Go app is also in k8s at another namespace. So I use this example Go app for testing Contenerized that app then I deployed in k8s and started Go app with command: `CMD SERVICE_NAME=goApp INSECURE_MODE=true OTEL_EXPORTER_OTLP_ENDPOINT=signoz-otel-collector.apm-signoz.svc.cluster.local:4317 go run main.go` . But I can't see traces and metrics in Services section in UI of Signoz. Nothing. I used troublshoot image from that namespace and it's OK `troubleshoot/main.go:46 Successfully sent sample data to signoz` Java apps working very well. Go app not. Please any ideas ?

Photo of Prashant
Tue, 05 Sep 2023 08:21:36 UTC

Can you try moving the environments outside of the Dockerfile? Set these in the go application pod environment instead: ```SERVICE_NAME=goApp INSECURE_MODE=true OTEL_EXPORTER_OTLP_ENDPOINT=signoz-otel-collector.apm-signoz.svc.cluster.local:4317```

Photo of Prashant
Tue, 05 Sep 2023 08:24:01 UTC

Also, use the following instead in `CMD` section: ```CMD ["go", "run", "main.go"]``` ^ Although, I would recommend compiling the go code into a binary and using it instead of this.