lib/elastic_apm/transport/serializers/context_serializer.rb in elastic-apm-3.0.0 vs lib/elastic_apm/transport/serializers/context_serializer.rb in elastic-apm-3.1.0
- old
+ new
@@ -11,11 +11,12 @@
{
custom: context.custom,
tags: mixed_object(context.labels),
request: build_request(context.request),
response: build_response(context.response),
- user: build_user(context.user)
+ user: build_user(context.user),
+ service: build_service(context.service)
}
end
private
@@ -75,9 +76,20 @@
hostname: keyword_field(url.hostname),
port: keyword_field(url.port),
pathname: keyword_field(url.pathname),
search: keyword_field(url.search),
hash: keyword_field(url.hash)
+ }
+ end
+
+ def build_service(service)
+ return unless service
+
+ {
+ framework: {
+ name: keyword_field(service.framework.name),
+ version: keyword_field(service.framework.version)
+ }
}
end
end
end
end