How do i update these names in tracing ?
To update names in tracing (such as span names), you should set the desired name when creating the span using the tracer. For manual instrumentation in Python, use tracer.start_as_current_span("your-new-span-name") to specify the name at creation. Span names cannot be changed after the span is created; you must set the correct name when starting the span. For auto-instrumentation, the name is typically set by the instrumentor, but you can override it by using manual spans or decorators as needed. For example: LBKSfrom opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("new_span_name") as span: # your traced code here passLBKSYou cannot retroactively rename spans after they are created and sent to Phoenix; you must set the name at creation time. For more, see the manual instrumentation guide and OpenTelemetry span creation docs.Would you like more detail or examples for a specific language or framework?Sources:
- Manual Instrumentation Guide
- OpenTelemetry Span Creation
馃挕聽Hint: Mention RunLLM in the thread for followups.
Darshan T. RunLLM is correct here
I tried that, it is creating a new span rather than renaming it
馃敀[private user] any way to rename auto instrumented spans?
There is not. Spans in OpenTelemetry are immutable once created. Darshan T. what are you trying to accomplish by renaming? Filtering, grouping, etc.?
Yes for filtering
Your best bet will be to use one of our context managers to add metadata to the span, which will allow you to filter using the query DSL. https://arize.com/docs/phoenix/tracing/how-to-tracing/add-metadata/customize-spans#using_metadata
metadata["key"] == "value"yes thinking of something like that only
馃敀[private user] One more challenge- In code while fetching spans- we don't have option add such filter, I needs to get all the spans based on time and then apply filter to get specific data. Any help to make this process easy ? (reason : for huge numbers of data- fetching all data and then applying df filter on metadata is not feasible)
