lib/elastic_apm/transport/serializers/context_serializer.rb in elastic-apm-2.5.0 vs lib/elastic_apm/transport/serializers/context_serializer.rb in elastic-apm-2.6.0
- old
+ new
@@ -4,9 +4,11 @@
module Transport
module Serializers
# @api private
class ContextSerializer < Serializer
def build(context)
+ return nil if context.nil? || context.empty?
+
{
custom: context.custom,
tags: keyword_object(context.tags),
request: build_request(context.request),
response: build_response(context.response),