Hey @prasus thanks for your message!
If your app containers are publishing metrics at the standard
/metrics endpoint, you have to create a scrape job for your apps, which will likely use Kubernetes service discovery. You can learn more here. You can find some sample job configs here.
For example, this may help you get started:
- job_name: "kubernetes-pods"
- role: pod
- action: labelmap
- source_labels: [__meta_kubernetes_namespace]
- source_labels: [__meta_kubernetes_pod_name]
This will create scrape targets for each container port of each Pod (with default scrape path of
/metrics). To filter out or specify custom ports / Pods / metric paths, you can use relabeling and annotations / Pod labels. Examples are provided in the links above. This stackoverflow answer may also be helpful.
If you’re using Services and Endpoints, you can also automatically discover targets using those abstractions, too. See Service and Endpoint.
Hope this helps!