lib/instana/instrumentation/aws_sdk_lambda.rb in instana-1.212.0 vs lib/instana/instrumentation/aws_sdk_lambda.rb in instana-1.213.0
- old
+ new
@@ -15,18 +15,24 @@
'X-INSTANA-T' => span_context.trace_id,
'X-INSTANA-S' => span_context.span_id,
'X-INSTANA-L' => span_context.level.to_s
}
- context.params[:client_context] = JSON.dump(payload)
+ context.params[:client_context] = Base64.strict_encode64(JSON.dump(payload))
end
tags = {
function: context.params[:function_name],
type: context.params[:invocation_type]
}.reject { |_, v| v.nil? }
- ::Instana.tracer.trace(:"aws.lambda.invoke", {aws: {lambda: {invoke: tags}}}) { @handler.call(context) }
+ ::Instana.tracer.start_or_continue_trace(:"aws.lambda.invoke", {aws: {lambda: {invoke: tags}}}) do
+ response = @handler.call(context)
+ if response.respond_to? :status_code
+ ::Instana.tracer.log_info(:http => {:status => response.status_code })
+ end
+ response
+ end
end
end
def add_handlers(handlers, _config)
handlers.add(Handler, step: :initialize)