

Parameter | Description |
name | Exporter name, which should meet the following requirements: The name should be unique. The name should conform to the following regular expression: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'. |
address | Fill in the Kafka Broker connection address. |
kafka version | Optional, partial specified versions are required, such as 0.10.2.0. |
tag | Custom labels for metrics. |
Scrape interval | Data scrape interval, fill example: 60s, 1m30s, 5m, 1h30m. |
Scrape timeout | The scrape timeout must be less than or equal to the scrape interval. Enter the same way as the scrape interval. |
topic regular | Optional. Collects all topics by default if left blank. After filling in, only topics that meet the regular expression will be collected. |
group regular | Optional. Collects all groups by default if left blank. After filling in, only groups that meet the regular expression will be collected. |
apiVersion: apps/v1kind: Deploymentmetadata:labels:k8s-app: kafka-exporter # Rename the exporter based on the business needs. We recommend you add the Kafka instance information, such as ckafka-2vrgx9fd-kafka-exportername: kafak-exporter # Rename the exporter based on the business needs. We recommend you add the Kafka instance information, such as ckafka-2vrgx9fd-kafka-exporternamespace: kafka-demo # The namespace of the cluster where the exporter will be deployedspec:replicas: 1selector:matchLabels:k8s-app: kafka-exporter # Rename the exporter based on the business needs. We recommend you add the Kafka instance information, such as ckafka-2vrgx9fd-kafka-exportertemplate:metadata:labels:k8s-app: kafka-exporter # Rename the exporter based on the business needs. We recommend you add the Kafka instance information, such as ckafka-2vrgx9fd-kafka-exporterspec:containers:- args:--kafka.server=x.x.x.x:9092 # Address of the Kafka instanceimage: ccr.ccs.tencentyun.com/rig-agent/kafka-exporter:v1.3.0imagePullPolicy: IfNotPresentname: kafka-exporterports:- containerPort: 9308name: metric-port # This name is required when configuring a scraping tasksecurityContext:privileged: falseterminationMessagePath: /dev/termination-logterminationMessagePolicy: FilednsPolicy: ClusterFirstimagePullSecrets:- name: qcloudregistrykeyrestartPolicy: AlwaysschedulerName: default-schedulersecurityContext: {}terminationGracePeriodSeconds: 30
PodMonitors. YAML configuration example as follows:apiVersion: monitoring.coreos.com/v1kind: PodMonitormetadata:name: kafka-exporter # Enter a unique namenamespace: cm-prometheus # Pay-as-you-go instance: cluster namespace; Monthly subscription instance (no longer available): namespace is fixed, do not changespec:podMetricsEndpoints:-interval: 30s # sampling intervalport: metric-port # Fill the spec.template.spec.containers[0].ports[0].name in the yaml file in Step 1.path: /metrics # Exporter metric collection path, default is /metricsrelabelings:- action: replacesourceLabels:- instanceregex: (.*)targetLabel: instancereplacement: 'ckafka-xxxxxx' # Adjust to the corresponding Kafka instance ID- action: replacesourceLabels:- instanceregex: (.*)targetLabel: ipreplacement: '1.x.x.x' # Adjust to the corresponding Kafka instance IPnamespaceSelector:matchNames:-kafka-demo # Fill in the namespace where the Exporter residesselector: # Enter the Label value of the pod to be monitored to locate the target pod.matchLabels:k8s-app: kafka-exporter
Exporter and Kafka are deployed on different servers, it is recommended that the Kafka instance information be placed into monitoring metrics via the Prometheus Relabel Mechanism so that you can troubleshoot.

Feedback