diff --git a/metadata-ingestion/src/datahub/ingestion/source/confluent_schema_registry.py b/metadata-ingestion/src/datahub/ingestion/source/confluent_schema_registry.py index fba71240282c43..f40e6504f11885 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/confluent_schema_registry.py +++ b/metadata-ingestion/src/datahub/ingestion/source/confluent_schema_registry.py @@ -249,7 +249,7 @@ def _get_schema_and_fields( if topic_subject is not None: logger.debug( - f"The {schema_type_str} schema subject:'{topic_subject}' is found for {kafka_entity}:'{topic}'." + f"The {schema_type_str} schema subject:'{topic_subject}' is found for {kafka_entity}: '{topic}'." ) try: registered_schema = self.schema_registry_client.get_latest_version( @@ -257,12 +257,13 @@ def _get_schema_and_fields( ) schema = registered_schema.schema except Exception as e: - logger.warning( - f"For {kafka_entity}: {topic}, failed to get {schema_type_str} schema from schema registry using subject:'{topic_subject}': {e}." - ) - self.report.report_warning( - topic, - f"failed to get {schema_type_str} schema from schema registry using subject:'{topic_subject}': {e}.", + self.report.warning( + title="Failed to get subject schema from schema registry", + message=f"Failed to get {kafka_entity} {schema_type_str or ''} schema from schema registry", + context=f"{topic}: {topic_subject}" + if not is_subject + else topic_subject, + exc=e, ) else: logger.debug( @@ -270,10 +271,11 @@ def _get_schema_and_fields( ) if not is_key_schema: # Value schema is always expected. Report a warning. - self.report.report_warning( - topic, - f"The schema registry subject for the {schema_type_str} schema is not found." - f" The {kafka_entity} is either schema-less, or no messages have been written to the {kafka_entity} yet.", + self.report.warning( + title="Unable to find a matching subject name for the topic in the schema registry", + message=f"The {kafka_entity} {schema_type_str or ''} is either schema-less, or no messages have been written to the {kafka_entity} yet. " + "If this is unexpected, check the topic_subject_map and topic_naming related configs.", + context=topic, ) # Obtain the schema fields from schema for the topic.