flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6998) Kafka connector needs to expose metrics for failed/successful offset commits in the Kafka Consumer callback
Date Mon, 17 Jul 2017 22:32:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-6998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090699#comment-16090699
] 

ASF GitHub Bot commented on FLINK-6998:
---------------------------------------

Github user zhenzhongxu commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4187#discussion_r127842765
  
    --- Diff: flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase.java
---
    @@ -505,6 +519,21 @@ public void run(SourceContext<T> sourceContext) throws Exception
{
     			throw new Exception("The partitions were not set for the consumer");
     		}
     
    +		// initialize commit metrics and default offset callback method
    +		this.successfulCommits = this.getRuntimeContext().getMetricGroup().counter("commitsSucceeded");
    +		this.failedCommits =  this.getRuntimeContext().getMetricGroup().counter("commitsFailed");
    +
    +		this.offsetCommitCallback = new KafkaCommitCallback() {
    +			@Override
    +			public void onComplete(Exception exception) {
    +				if (exception == null) {
    +					successfulCommits.inc();
    --- End diff --
    
    I think I'll add a detailed javadoc to describe the current unprotected implementation.
I am hesitant to add in lock protection because higher level abstraction currently guarantees
no concurrent commit at the moment.


> Kafka connector needs to expose metrics for failed/successful offset commits in the Kafka
Consumer callback
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-6998
>                 URL: https://issues.apache.org/jira/browse/FLINK-6998
>             Project: Flink
>          Issue Type: Improvement
>          Components: Kafka Connector
>            Reporter: Zhenzhong Xu
>            Assignee: Zhenzhong Xu
>
> Propose to add "kafkaCommitsSucceeded" and "kafkaCommitsFailed" metrics in KafkaConsumerThread
class.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message