Kubernetes sidecar implementation

Kubernetes version:v1.29.2
Cloud being used: bare-metal
Installation method: Docker Desktop
Host OS: Windows 11
CNI and version:
CRI and version: Docker version 26.1.4

I have a Golang application to check system resources in a target web application.

Can I deploy this Golang application as a sidecar in the same pod where the target web application is running so that I can access top command in the target web container?

What are the minimum changes required in the target web container and the Golang application to achieve this?

Thanks