36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/datadog/tracing/contrib/racecar/event.rb', line 36
def process(span, event, _id, payload)
span.service = configuration[:service_name]
span.resource = payload[:consumer_class]
span.set_tag(Contrib::Ext::Messaging::TAG_SYSTEM, Ext::TAG_MESSAGING_SYSTEM)
span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)
if Contrib::Analytics.enabled?(configuration[:analytics_enabled])
Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate])
end
Contrib::Analytics.set_measured(span)
if span.service != Datadog.configuration.service
span.set_tag(Tracing::Contrib::Ext::Metadata::TAG_BASE_SERVICE, Datadog.configuration.service)
end
span.set_tag(Ext::TAG_TOPIC, payload[:topic])
span.set_tag(Ext::TAG_CONSUMER, payload[:consumer_class])
span.set_tag(Ext::TAG_PARTITION, payload[:partition])
span.set_tag(Ext::TAG_OFFSET, payload[:offset]) if payload.key?(:offset)
span.set_tag(Ext::TAG_FIRST_OFFSET, payload[:first_offset]) if payload.key?(:first_offset)
span.set_tag(Ext::TAG_MESSAGE_COUNT, payload[:message_count]) if payload.key?(:message_count)
span.set_error(payload[:exception_object]) if payload[:exception_object]
end
|