lib/getaround_utils/railties/lograge.rb in getaround_utils-0.2.18 vs lib/getaround_utils/railties/lograge.rb in getaround_utils-0.2.19
- old
+ new
@@ -20,14 +20,21 @@
payload[:lograge][:user_id] = current_user&.id if defined?(current_user)
payload[:lograge][:origin] = 'lograge'
if defined?(NewRelic::Agent::Tracer)
if span_id = NewRelic::Agent::Tracer.span_id
- payload[:lograge]["span.id"] = span_id
+ payload[:lograge]['span.id'] = span_id
end
if trace_id = NewRelic::Agent::Tracer.trace_id
- payload[:lograge]["trace.id"] = trace_id
+ payload[:lograge]['trace.id'] = trace_id
end
+ payload[:lograge]['entity.type'] = 'SERVICE'
+ payload[:lograge]['entity.guid'] = NewRelic::Agent.config[:entity_guid]
+ payload[:lograge]['entity.name'] = NewRelic::Agent.config[:app_name]&.first
+ end
+
+ if defined?(NewRelic::Agent::Hostname)
+ payload[:lograge]['hostname'] = NewRelic::Agent::Hostname.get
end
nil
end
end