Lightbend Console relies on Prometheus discovery for finding your application metric data. The following section describes how to do this by annotating Kubernetes resources.
To enable Lightbend Console to discover your workloads, you need to modify the
PodSpec of the Kubernetes
Deployment or similar resource so that Prometheus can determine how to scrape the metrics. Prometheus will scrape all named ports on a pod where the port name ends with
- the port names end in
prometheus.io/portannotation is unset
prometheus.io/scrapeannotation is set to the string
spec: template: metadata: annotations: prometheus.io/scrape: 'true' spec: containers: - name: multiple-metric-ports ports: - containerPort: 9001 name: first-metrics - containerPort: 9002 name: second-metrics
You can also use the
prometheus.io/port annotation to tell Prometheus to scrape the port(s). In this case the port name doesn’t matter.
spec: template: metadata: annotations: prometheus.io/scrape: 'true' prometheus.io/port: '9001'