Programatically accessing Kafka cloudwatch matrices

0

I tried to access the metrices and try to get the insights from them using AWS CLI / Python scirpt, but its tricky to access since. For an example, i have a kafka, and there are 3 brokers, and inside topics and partitions. if i want to get the partitions count for the cluster.

1 Answer
0

Hello.

How about getting the following metrics?
https://docs.aws.amazon.com/msk/latest/developerguide/metrics-details.html

  • GlobalPartitionCount
    • The number of partitions across all topics in the cluster, excluding replicas. Because GlobalPartitionCount doesn't include replicas, the sum of the PartitionCount values can be higher than GlobalPartitionCount if the replication factor for a topic is greater than 1.

To get metric values ​​with boto3, you can use the "get_metric_data()" API. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudwatch/client/get_metric_data.html

profile picture
EXPERT
answered a month ago