Uploaded image for project: 'Kafka Connector'
  1. Kafka Connector
  2. KAFKA-273

Improve Logging and Diagnosability Regarding Heartbeat Messages Problems

      Hi Team,

      Currently, if heartbeat messages and SMT transformations are used together in a Source Connector configuration it can result in invalid heartbeat messages due to the SMT transformations modifying the heartbeat messages.

      Special configuration has to be put in place to avoid the above. See an example below:

      "predicates": "isHeartbeat"
      "predicates.isHeartbeat.pattern": "__mongodb_heartbeats"
      "predicates.isHeartbeat.type": "org.apache.kafka.connect.transforms.predicates.TopicNameMatches"
      "transforms": "documentKeyToKey,flattenKey,extractId"
      "transforms.extractId.field": "documentKey._id"
      "transforms.extractId.type": "org.apache.kafka.connect.transforms.ExtractField$Key"
      "transforms.extractId.predicate": "isHeartbeat"
      "transforms.extractId.negate": true
      "transforms.documentKeyToKey.type": "org.apache.kafka.connect.transforms.ValueToKey"
      "transforms.documentKeyToKey.fields": "documentKey"
      "transforms.documentKeyToKey.predicate": "isHeartbeat"
      "transforms.documentKeyToKey.negate": true
      "transforms.flattenKey.delimiter": ".",
      "transforms.flattenKey.type": "org.apache.kafka.connect.transforms.Flatten$Key"
      "transforms.flattenKey.predicate": "isHeartbeat"
      "transforms.flattenKey.negate": true
      

      Similarly, if heartbeat messages cannot be produced because of permission issues the Connector stays in RUNNING stage but without producing any messages. The only clue are permissions issues while trying to produce heartbeat messages:

      [2022-01-03 19:15:55,002] INFO [connector|task-0] Generating heartbeat event. {"_data": "8261D34B68000000012B0229296E04"} (com.mongodb.kafka.connect.source.heartbeat.HeartbeatManager:77)
      [2022-01-03 19:15:55,514] ERROR [connector|task-0] [Producer clientId=confluent.monitoring.interceptor.connector-connector] Connection to node -1 (****) failed authentication due to: Client SASL mechanism 'PLAIN' not enabled in the server, enabled mechanisms are [SCRAM-SHA-256] (org.apache.kafka.clients.NetworkClient:785)
      

      It would be nice if we add a warning to the logs and/or prohibit a Connector without the needed properties and/or permissions to be launched. In the case of missing permissions to produce heartbeat messages, maybe the Connector should shift to the FAILED state with a clear message.

      Regards
      Diego

            Assignee:
            robert.walters@mongodb.com Robert Walters (Inactive)
            Reporter:
            diego.rodriguez@mongodb.com Diego Rodriguez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: