I am using Python phoenix_otel to trace the use of LLMs via LiteLLM, using openinference.instrumentation.litellm This works fine and I am getting the traces into my locally running phoenix dashboard and can view them. Now I would love to add additional structured logging entries to this, but I am not sure how to best do this. With the LLM tracing everything works "under the hood", but is there also a standard way for sending structured logs to phoenix so I can view them and explore the nested log structure? What is the adequate documentation or tutorial page for learning about how to do this in addition to the LLM tracing?
Hey Johann P. - You have a few options:
you can capture spans using our decorators or OpenTelemetry. Since Phoenix just accepts OTEL traces, you can create spans which are spans of time and you can attach events (https://opentelemetry.io/docs/languages/python/instrumentation/#adding-events). Phoenix has rudimentary support for these. I will be honest they are basically log lines right now.
You can use opentelemetry logging(https://opentelemetry.io/blog/2023/logs-collection/) or some sort of structured logging solution. This is what we do internally. These logs are correlated by the span and trace IDs so if there's a span in question under which we want to see the logs we can copy the ID and look up the logs. You don't get the single pane of glass under phoenix but you get the best of both worlds because spans and logs can be correlated.
I guess the TLDR is Phoenix purely focused on the tracing side to focus on timing, cost, and evals. It doesn't have structured logging support to the level that you may need. Arize AX - the enterprise SAAS platform does have support for raw inferences (basically ML/LLM focused logs) which does have troubleshooting, monitors, and dashboards. Another option you might consult outside of other structured log collectors. Hope that helps.
