Преглед изворни кода

fix(kafka trace): do not include query type in trace entry

For Kafka that has its internal buffering the on_query_async callback is
used both for sync and async queries (for sync queries the caller waits
for a response directly after calling on_query_async). Therefore, before
this commit, the trace included incorrect query type information. This
has been fixed by removing the query type information from the trace.
This should be okay since the query type is not essential information
and can be derived from the configuration.

Fixes:
https://emqx.atlassian.net/browse/EMQX-12363
Kjell Winblad пре 1 година
родитељ
комит
121084b2ff
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      apps/emqx_bridge_kafka/src/emqx_bridge_kafka_impl_producer.erl

+ 2 - 2
apps/emqx_bridge_kafka/src/emqx_bridge_kafka_impl_producer.erl

@@ -320,7 +320,7 @@ on_query(
             #{headers_config => KafkaHeaders, instance_id => InstId}
             #{headers_config => KafkaHeaders, instance_id => InstId}
         ),
         ),
         emqx_trace:rendered_action_template(MessageTag, #{
         emqx_trace:rendered_action_template(MessageTag, #{
-            message => KafkaMessage, send_type => sync
+            message => KafkaMessage
         }),
         }),
         do_send_msg(sync, KafkaMessage, Producers, SyncTimeout)
         do_send_msg(sync, KafkaMessage, Producers, SyncTimeout)
     catch
     catch
@@ -380,7 +380,7 @@ on_query_async(
             #{headers_config => KafkaHeaders, instance_id => InstId}
             #{headers_config => KafkaHeaders, instance_id => InstId}
         ),
         ),
         emqx_trace:rendered_action_template(MessageTag, #{
         emqx_trace:rendered_action_template(MessageTag, #{
-            message => KafkaMessage, send_type => async
+            message => KafkaMessage
         }),
         }),
         do_send_msg(async, KafkaMessage, Producers, AsyncReplyFn)
         do_send_msg(async, KafkaMessage, Producers, AsyncReplyFn)
     catch
     catch