lib/instana/instrumentation/instrumented_request.rb in instana-1.200.0.pre1 vs lib/instana/instrumentation/instrumented_request.rb in instana-1.200.0

- old
+ new

@@ -72,11 +72,11 @@ method: request_method, url: CGI.unescape(path_info), host: host_with_port, header: extra_header_tags, params: request_params - }.compact + }.reject { |_, v| v.nil? } end def correlation_data @correlation_data ||= parse_correlation_data end @@ -121,11 +121,11 @@ trace_id: long_instana_id? ? sanitized_t[16..-1] : sanitized_t, # rubocop:disable Style/SlicingWithRange, Lint/RedundantCopDisableDirective long_instana_id: long_instana_id? ? sanitized_t : nil, external_trace_id: external_trace_id, external_state: @env['HTTP_TRACESTATE'], from_w3: false - }.compact + }.reject { |_, v| v.nil? } end def context_from_trace_parent return {} unless @env.has_key?('HTTP_TRACEPARENT') matches = @env['HTTP_TRACEPARENT'].match(W3_TRACE_PARENT_FORMAT) @@ -148,11 +148,11 @@ { trace_id: state[:t], span_id: state[:p], from_w3: false - }.compact + }.reject { |_, v| v.nil? } end def parse_trace_state return {} unless @env.has_key?('HTTP_TRACESTATE') token = @env['HTTP_TRACESTATE'] @@ -177,9 +177,9 @@ .select { |a| a.length == 2 }.to_h { type: data['correlationType'], id: data['correlationId'] - }.compact + }.reject { |_, v| v.nil? } end end end