Commit 55927df0 authored by John Murray's avatar John Murray
Browse files

Cast namespace to symbol when parsing event data

The worker is looking for a namespace field in the event 
and uses it if it is available. However, the namespace 
needs to be a symbol and there is no way to currently 
represent that is JSON. So, we have to explicitly parse 
the namespace in the event as a symbol (if there is one).
parent 442fa5b1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -74,7 +74,9 @@ class FnordMetric::Worker
  end

  def parse_json(data)
    Yajl::Parser.new(:symbolize_keys => true).parse(data)
    event = Yajl::Parser.new(:symbolize_keys => true).parse(data)
    event[:_namespace] = event[:_namespace].to_sym if event[:_namespace]
    event
  end

end