Hi Mikyo is it actually possible to not only get a span_df from px.Client() but also to pass a modified span_df to px.Client()? I was thinking of creating an additional ID column for a group of traces. Would be quite nice to get this displayed as an additional column as part of the span_df in the dashboard in the browser ... 馃檪
Hey Daniel, on modifying the spans - certainly possible since you can actually just do px.launch_app(trace=px.TraceDataset(df)) However augmenting Traces is a bit of an an anti-pattern for telemetry data as it's meant to be a runtime artifact. We probably will not support direct modification of spans from a technical standpoint. There are a few options that are actually tracing compliant for adding custom attributes to the spans themselves at runtime.
Add metadata to your spans via langchain metadata (e.x. https://github.com/Arize-ai/openinference/pull/175) - note this requires moving to OpenInference for now.
Create your own spans or modify spans at runtime (https://docs.arize.com/phoenix/telemetry/custom-spans) - this is the most flexible and will be coming next week fully into phoenix
We probably will support "human" annotations on spans just the way we support "ai" evaluations on the spans but these will be implemented as annotations in addition to the spans. Does this match your use-case? What labels would you like to add to your spans? The above solution might solve them. I hear ya on wanting to show and pin specific attributes on the table. Good feature ask! I filed a ticket - please upvote if this makes sense and let us know what some of your use-cases may be! https://github.com/Arize-ai/phoenix/issues/2236
Thank you!! Adding metadata might be already sufficient for a start. Great hint! Is this already part of the latest release?
Good question - it's part of the langchain instrumentation code so if you would like to use it today you will need to instrument langchain using openinference: https://github.com/Arize-ai/openinference/releases/tag/python-openinference-instrumentation-langchain-v0.1.2 It will land in phoenix.trace probably next week.
Hey Daniel you just need to update the instrumentation but yes, it should be there!https://github.com/Arize-ai/openinference/pull/175
Add metadata to your spans via langchain metadata (e.x. https://github.com/Arize-ai/openinference/pull/175)
This might end up being more of a langchain question, but the example here is using a deprecated langchain API so I don鈥檛 know how to take advantage of this phoenix feature. What鈥檚 the new way for passing metadata through in langchain?
