Grafana-agent kubernetes app metrics different namespace

Hi, im running the grafana-agent on an Azure Kubernetes Cluster and thats working fine with de kube state metrics and the default dashboards.
However i keep having trouble with getting the spring boot actuator prometheus endpoint getting picked up. Is it required that the agent and the application are in the same namespace?
Is there a way to have 1 agent that monitors multiple namespaces?