Skip to content

Commit 11695d1

Browse files
committed
Fix ruby-kafka instrumentation bug
1 parent 10c9527 commit 11695d1

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

lib/datadog/data_streams.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ class << self
2525
# @return [String, nil] Base64 encoded pathway context or nil if disabled
2626
# @public_api
2727
def set_produce_checkpoint(type:, destination:, auto_instrumentation: false, tags: {}, &block)
28-
Datadog.logger.debug("[DSM PUBLIC API] set_produce_checkpoint called: type=#{type}, dest=#{destination}, processor=#{processor.class}")
29-
result = processor&.set_produce_checkpoint(
28+
processor&.set_produce_checkpoint(
3029
type: type,
3130
destination: destination,
3231
manual_checkpoint: !auto_instrumentation,
3332
tags: tags,
3433
&block
3534
)
36-
Datadog.logger.debug("[DSM PUBLIC API] set_produce_checkpoint returned: #{result.inspect}")
37-
result
3835
end
3936

4037
# Set a consume checkpoint for Data Streams Monitoring

lib/datadog/data_streams/processor.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ def track_kafka_consume(topic, partition, offset, now)
100100
# @yield [key, value] Block to inject context into carrier
101101
# @return [String] Base64 encoded pathway context
102102
def set_produce_checkpoint(type:, destination:, manual_checkpoint: true, tags: {}, &block)
103-
@logger.debug("[DSM PROCESSOR] set_produce_checkpoint called: type=#{type}, dest=#{destination}")
104103
checkpoint_tags = ["type:#{type}", "topic:#{destination}", 'direction:out']
105104
checkpoint_tags << 'manual_checkpoint:true' if manual_checkpoint
106105
checkpoint_tags.concat(tags.map { |k, v| "#{k}:#{v}" }) unless tags.empty?
107106

108107
span = Datadog::Tracing.active_span
109108
pathway = set_checkpoint(tags: checkpoint_tags, span: span)
110109

111-
@logger.debug("[DSM PROCESSOR] set_produce_checkpoint pathway=#{pathway.inspect}")
112110
yield(PROPAGATION_KEY, pathway) if pathway && block
113111

114112
pathway

lib/datadog/tracing/contrib/kafka/instrumentation/consumer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Kafka
77
module Instrumentation
88
# Instrumentation for Kafka::Consumer
99
module Consumer
10-
def self.included(base)
10+
def self.prepended(base)
1111
base.prepend(InstanceMethods)
1212
end
1313

lib/datadog/tracing/contrib/kafka/instrumentation/producer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Kafka
77
module Instrumentation
88
# Instrumentation for Kafka::Producer
99
module Producer
10-
def self.included(base)
10+
def self.prepended(base)
1111
base.prepend(InstanceMethods)
1212
end
1313

0 commit comments

Comments
 (0)