Introductions
To expose JMX metrics from a Kafka instance to OpenTelemetry, you’ll need to configure the OpenTelemetry JMX Receiver to scrape the JMX metrics exposed by Kafka. Here’s an example of how you can configure the JMX receiver and Kafka workload to expose the metrics:
Steps to Configure
Step 1: Check for Existing ConfigMap
Run the following command to see if the opsramp-workload-metric-user-config ConfigMap already exists:
kubectl get configmap opsramp-workload-metric-user-config -n <agent-installed-namespace>Step 2: Create a New ConfigMap (if not available)
If this is your first setup, create a workload-master ConfigMap. Use the following template and update it as per your workload requirements:
apiVersion: v1
kind: ConfigMap
metadata:
name: opsramp-workload-metric-user-config
namespace: opsramp-agent
data:
workloads: |
kafka/jmx:
- name: kafka1
collectionInterval: 10s
port: 11442
targetPodSelector:
matchLabels:
- key: app
operator: ==
value:
- kafkaNote
In the workload, we have specified that the workload type iskafka/jmx. This configuration is specific to Kafka applications. For other workloads, the format should be workloadname/jmx, where “workloadname” corresponds to the relevant application.Step 3: Apply the ConfigMap
kubectl apply -f <path-to-your-manifest-file>Step 4: Verify in OpsRamp Portal
After a few minutes, check metrics in the OpsRamp Portal > Dashboards > Dashboard.
Step 5: Set Up Alerts and Availability Rules
Once metrics are visible, you can configure alerts and availability rules in the OpsRamp portal. Edit the relevant ConfigMaps to adjust workload or application-specific monitoring.