Method: Datadog::Contrib::ActionCable::Events::Broadcast.process

Defined in:
lib/ddtrace/contrib/action_cable/events/broadcast.rb

.process(span, _event, _id, payload) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ddtrace/contrib/action_cable/events/broadcast.rb', line 32

def process(span, _event, _id, payload)
  channel = payload[:broadcasting] # Channel has high cardinality
  span.service = configuration[:service_name]
  span.span_type = span_type

  # Set analytics sample rate
  if Contrib::Analytics.enabled?(configuration[:analytics_enabled])
    Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate])
  end

  span.set_tag(Ext::TAG_CHANNEL, channel)
  span.set_tag(Ext::TAG_BROADCAST_CODER, payload[:coder])
end