You need to enable JavaScript to run this app.
Volcengine Managed Service for Prometheus

Volcengine Managed Service for Prometheus

Copy page
Download PDF
Exporter integration
Kafka exporter integration
Copy page
Download PDF
Kafka exporter integration
Volcengine Managed Service for Prometheus (VMP) monitors the operational status of Kafka by using the exporter. This topic describes how to deploy kafka-exporter in a cluster and monitor Kafka.​
Prerequisites​
  • VMP​
  • VKE​
  • A Volcano Engine root user has been created, and VKE has been activated.​
  • The VKE cluster has been integrated with VMP. For details, see VKE integration.​
  • Grafana has been deployed and integrated with the workspace.​
Procedure​
Step 1: Deploy kafka-exporter​
  1. Log in to the VKE console.​
  1. In the left navigation pane, click Cluster. In the cluster list on the right side, find the target cluster.​
  1. Click the name of the cluster to go to the cluster details page.​
  1. Click Workload > Deployment in the left navigation pane. Click Create with Yaml to deploy kafka-exporter.​
​
apiVersion: apps/v1​
kind: Deployment​
metadata: ​
name: kafka-exporter # Specify the name of the exporter.​
namespace: volcano-metrics # Specify the namespace of the exporter.​
labels: ​
app-name: kafka-exporter # Configure the labels of the exporter.​
spec: ​
replicas: 1 # Specify the number of replicas for the exporter.​
selector: ​
matchLabels: ​
app-name: kafka-exporter # Change the name based on your business requirements. It is recommended to add information about the Kafka instance.​
template: ​
metadata: ​
labels: ​
app-name: kafka-exporter # Change the name based on your business requirements. It is recommended to add information about the Kafka instance.​
spec: ​
containers: ​
- args: ​
- --kafka.server=x.x.x.x:9092 # Specify the address and port number of the Kafka instance.​
image: danielqsj/kafka-exporter:latest # Pull the exporter image from Docker Hub.​
imagePullPolicy: IfNotPresent​
name: kafka-exporter # Specify the container name.​
ports:​
- containerPort: 9308 # Specify the container port number.​
name: metric-port # Specify the container port name.​
dnsPolicy: ClusterFirst​
restartPolicy: Always​
terminationGracePeriodSeconds: 30​
​
tip​
For detailed parameters of kafka-exporter, refer to kafka-exporter.​
Step 2: Configure service discovery​
  1. Click Workload > Resource Explorer in the left navigation pane.​
  1. Click Create with Yaml to configure service discovery by using PodMonitor.​
  • Select Custom from the Type drop-down menu.​
  • Enter the YAML configuration in the Yaml field.​
​
apiVersion: monitoring.coreos.com/v1​
kind: PodMonitor​
metadata:​
name: kafka-exporter # Specify the name of PodMonitor.​
namespace: volcano-metrics # Specify the namespace of PodMonitor.​
labels: ​
volcengine.vmp: "true" # Configure the labels for PodMonitor to allow the labels to be identified by prometheus-agent.​
spec:​
podMetricsEndpoints:​
- interval: 30s​
port: metric-port # Specify the container port name of the exporter.​
path: /metrics # Specify the URI path for metric exposure. The value is /metrics by default if it is not specified.​
relabelings: # Configure metric relabeling. This parameter can be omitted if it is not required.​
- action: replace​
sourceLabels:​
- instance​
regex: (.*)​
targetLabel: instance​
replacement: 'kafka-xxxxxx' # Specify the ID of the Kafka instance.​
namespaceSelector:​
matchNames: ​
- volcano-metrics # Specify the namespace where the exporter is located.​
selector: ​
matchLabels:​
app-name: kafka-exporter # Specify the label value of the exporter to locate and select the target pod.​
​
Validate results​
  1. Execute the following command to configure Grafana port forwarding:​
​
kubectl port-forward service/grafana 3000:3000 -n volcano-metrics​
​
  1. Open a browser in your local environment (Linux/Mac), enter localhost:3000 into the address bar to go to the Grafana login interface. Use the default username admin, with the password admin, to log in. ​
  • ​alt​​
  1. After you log in to Grafana, you can create a dashboard to view the metric information of Kafka.​
  • ​alt​​
tip​
For detailed parameters of kafka-exporter, refer to kafka-exporter.​
​
Last updated: 2026.10.10 10:16:50