This article assumes you have a Parca deployment in the same model as your COS Lite bundle and configured as a datasource in Grafana. If you don’t have a COS Lite (or Parca) deployment, please navigate to the guide below first.
See more: Deploy Charmed Parca on top of COS Lite
In the same model, deploy the parca-scrape-target charm:
juju deploy parca-scrape-target --channel latest/edge
Your application must expose a pprof endpoint in order for parca
to be able to scrape it. The endpoint must also be reachable from the location where parca
is deployed.
Connect parca-scrape-target to the application. In the example, it is assumed the application is exposing pprof endpoints at pprof-example-app-go:8080
:
juju config parca-scrape-target targets="pprof-example-app-go:8080"
juju relate parca-scrape-target parca
For troubleshooting, you can use the pprof-example-app-go
application available on Github. You can deploy the Kubernetes manifest in the same model as your parca
deployment by running kubectl apply -f deployment.yaml -n YOUR_MODEL_NAME
.
Observe in Grafana that profiling data is being shown.