Motivation
Currently, we have a topic_load_times metric to track how long a topic load succeeds.
But when loading a topic, there may be some chances the topic load failed due to MetadataStore or Bookkeeper, and we don't have related metrics to track it.
Goal
Provide topic_load_failed_count metric to track topics loaded failed.
API Changes
No response
Implementation
Points
Topics are created in BrokerService.java.
For NonPersistentTopic:
private CompletableFuture<Optional<Topic>> createNonPersistentTopic(String topic) {
CompletableFuture<Optional<Topic>> topicFuture = new CompletableFuture<>();
topicFuture.exceptionally(ex -> {
// Record metric
recordTopicLoadFailed();
});
// ignore ...
return topicFuture;
}
For PersistentTopic:
private void createPersistentTopic(final String topic, boolean createIfMissing,
CompletableFuture<Optional<Topic>> topicFuture,
Map<String, String> properties) {
topicFuture.exceptionally(ex -> {
// Record metric
recordTopicLoadFailed();
});
// ignore....
}
Metrics
| Name |
Type |
Description |
| topic_load_failed |
Counter |
The number of topic load failed |
Labels
- cluster: the cluster name of the broker belongs to.
Alternatives
No response
Anything else?
No response
Motivation
Currently, we have a
topic_load_timesmetric to track how long a topic load succeeds.But when loading a topic, there may be some chances the topic load failed due to MetadataStore or Bookkeeper, and we don't have related metrics to track it.
Goal
Provide
topic_load_failed_countmetric to track topics loaded failed.API Changes
No response
Implementation
Points
Topics are created in BrokerService.java.
For NonPersistentTopic:
For PersistentTopic:
Metrics
Labels
Alternatives
No response
Anything else?
No response