Deploy Go auto instrumentation in Kubernetes

Step 1: Create an autoinstrument.yaml file with the following content.

spec:
template:
spec:
shareProcessNamespace: true
containers:
- name: autoinstrumentation-go
image: otel/autoinstrumentation-go
imagePullPolicy: IfNotPresent
env:
- name: OTEL_GO_AUTO_TARGET_EXE
value: /<File_executable_path>
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://<Applicare_ip>:<Applicare_collector_port>"
- name: OTEL_SERVICE_NAME
value: "<service_name>"
securityContext:
runAsUser: 0
privileged: true

It is important to change the following values ​​in the above file.

<File_executable_path>= Directory for starting the Go application

<Applicare_ip>= IP address of the machine running Applicare

<Applicare_collector_port>= Port of the machine running Applicare

<Service_Name>= The name of the agent as shown in the Applicare console.

Step 2: Go to the directory with the YAML file and run the command below

kubectl patch deployment <deployment_name> --patch "$(cat autoinstrument.yaml )"

It is important to change the below values ​​in the above command.

<deployment_name>= Go Application Deployment Name

Step 3: This will restart your pods in the Kubernetes deployment.

The following document outlines how to access Go application data in Applicare after configuration.

Go application data in Kubernetes Monitoring

Was this article helpful?

Votes and follows are kept by Zendesk, so they need a Help Center account. These buttons open this article there.

Opens Zendesk · needs internet and sign-in

Still stuck? Contact support