Skip to content

Visibility of User-Created Consumer Groups and Topics in AWS MSK CloudWatch Metrics

1

According to the AWS MSK documentation on CloudWatch metrics (https://docs.aws.amazon.com/msk/latest/developerguide/metrics-details.html), the SumOffsetLag metric is included in Default Level monitoring and has two dimensions: Consumer Group and Topic.

However, when I checked the MSK metrics in the CloudWatch dashboard, I noticed that the user-created topics and consumer groups are not available. Instead, the following details are shown: Consumer Groups: amazon.msk.canary.group.broker-1, amazon.msk.canary.group.broker-2 Topic: __amazon_msk_canary It appears that the consumer groups and topics listed are created and used internally by MSK. Unfortunately, these do not provide useful information for monitoring user-created consumer groups and topics with the SumOffsetLag metric.

Additionally, I understand that enabling Enhanced Topic Level monitoring is necessary to get insights for user-created topics. Given this context, why is the SumOffsetLag metric with Consumer Group and Topic dimensions included in Default Level monitoring if it does not provide visibility into user-created consumer groups and topics?

There are so many user-created topics but I need to monitor only few topics. So is it possible to enable Enhanced Topic Level monitoring for few topics only? If all the topics are considered for Monitoring then it will be unnecessary cost overhead.

Thanks in Advance.

2 Answers
0

The situation you're describing highlights some nuances in how Amazon MSK (Managed Streaming for Apache Kafka) metrics are reported in CloudWatch.

The SumOffsetLag metric is indeed included in the Default Level monitoring, but its visibility for user-created consumer groups and topics can be limited. The default metrics you're seeing (amazon.msk.canary.group.broker-1, amazon.msk.canary.group.broker-2, and __amazon_msk_canary) are internal MSK metrics used for system health monitoring.

To gain visibility into user-created consumer groups and topics, you need to enable more detailed monitoring levels. The PER_TOPIC_PER_BROKER or PER_TOPIC_PER_PARTITION monitoring levels provide metrics for user-created topics and consumer groups.

The inclusion of SumOffsetLag in Default Level monitoring might be to provide a baseline metric for overall cluster health and performance, even if it doesn't give granular insights into user-specific data at that level.

Regarding your question about enabling Enhanced Topic Level monitoring for only a few topics: Unfortunately, Amazon MSK doesn't currently offer a way to enable detailed monitoring for specific topics only. When you upgrade the monitoring level, it applies to all topics in the cluster. This can indeed lead to unnecessary costs if you only need to monitor a few topics.

To mitigate this, you might consider:

  1. Using application-level monitoring for the specific topics you're interested in.
  2. Implementing custom metrics collection for your critical topics.
  3. Using CloudWatch Logs Insights or other log analysis tools to extract relevant information about specific topics from broker logs.

While these approaches may require more setup, they can help you achieve more targeted monitoring without incurring the full cost of cluster-wide enhanced monitoring.

It's worth noting that AWS continually updates its services based on customer feedback. If selective topic monitoring is important to you, consider providing this feedback to AWS support or through their feature request channels.
Sources
Basic monitoring and detailed monitoring in CloudWatch - Amazon CloudWatch
Amazon MSK metrics for monitoring with CloudWatch - Amazon Managed Streaming for Apache Kafka

answered 2 years ago

0

Hello,

Default/Basic level of monitoring DOES cover user-created consumers and user-created topic. Here is what I can see in my CloudWatch:

Enter image description here

I run my consumer: kafka/bin/kafka-console-consumer.sh --topic sampletopic --bootstrap-server $b --group custom-group-1 --consumer.config ~/environment/config/client_iam.properties --from-beginning

This is what I have in CW: Enter image description here

Note, It is possible though, that default naming of console consumers, like console-consumer-*** will be excluded from the metrics. At least I don't see them in CW.

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.