Set custom span names to traces
Learn how to ett custom span names to traces in Langtrace. You can use the inject_additional_attributes
function to set custom span names to traces. This name will be appended to the operation name and will be identifed as the name of the span in the trace.
Overview
When you’re using the Langtrace SDK with any of the supported vendors, you can set custom span names to traces. This allows you to identify the span in the trace with a custom name. You can use the inject_additional_attributes
function to set custom span names to traces. This name will be appended to the operation name and will be identified as the name of the span in the trace.
Please see the example below to learn how to set custom span names to traces. Note that the key langtrace.span.name
is used to pass the custom span name to the trace.
langtrace.span.name
as key inside inject_additional_attributes
, custom span naming will not work