lib/instana/instrumentation/rack.rb in instana-1.11.8-java vs lib/instana/instrumentation/rack.rb in instana-1.12.0
- old
+ new
@@ -74,9 +74,14 @@
# Because of the 5xx response, we flag this span as errored but
# without a backtrace (no exception)
::Instana.tracer.log_error(nil)
end
+ # If the framework instrumentation provides a path template,
+ # pass it into the span here.
+ # See: https://www.instana.com/docs/tracing/custom-best-practices/#path-templates-visual-grouping-of-http-endpoints
+ kvs[:http][:path_tpl] = env['INSTANA_HTTP_PATH_TEMPLATE'] if env['INSTANA_HTTP_PATH_TEMPLATE']
+
# Save the IDs before the trace ends so we can place
# them in the response headers in the ensure block
trace_id = ::Instana.tracer.current_span.trace_id
span_id = ::Instana.tracer.current_span.id
end