From 62dd2e793959d70a44dff48599e2cd60be185389 Mon Sep 17 00:00:00 2001 From: Mikyo King Date: Wed, 25 Sep 2024 10:45:54 -0700 Subject: [PATCH] docs(auth): instrumentation migration (#4732) * docs: migrate to openinference * Add a reference to `phoenix.otel` and link to docs --------- Co-authored-by: Dustin Ngo --- MIGRATION.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index 24fedde53c..538a084239 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -6,6 +6,8 @@ Phoenix 5 introduces authentication. By default authentication is disabled and P With authentication enabled, all API and UI access will be gated with credentials or API keys. Because of this, you will encounter some down time so please plan accordingly. +Phoenix 5 also fully de-couples instrumentation from the Phoenix package. All instrumentation should be installed and run via the OpenInference package. This allows for more flexibility in instrumentation and allows Phoenix to focus on its core functionality. + ### Enabling Authentication To get started, simply set two environment variables for your deployment: @@ -19,6 +21,30 @@ Once these environment variables are set, Phoenix scaffold and admin login and t For more details, please see the [authentication setup guide](https://docs.arize.com/phoenix/setup/authentication). +### Migrating to OpenInference + +If you are using Phoenix's `phoenix.trace` modules for LlamaIndex, LangChain, or OpenAI, you will need to migrate to OpenInference. OpenInference is a separate set of packages that provides instrumentation for Phoenix. Phoenix 5 no longer supports LlamaIndex or LangChain instrumentation from the `phoenix.trace` module. + +Phoenix now includes a `phoenix.otel` module that provides simplified setup for OpenTelemetry. See the [`phoenix.otel` documentation](https://docs.arize.com/phoenix/tracing/how-to-tracing/setup-tracing/setup-tracing-python) for more details. + +**Before** + +```python +from phoenix.trace.openai import OpenAIInstrumentor + +OpenAIInstrumentor().instrument() +``` + +**After** + +```python +from openinference.instrumentation.openai import OpenAIInstrumentor + +OpenAIInstrumentor().instrument(tracer_provider=tracer_provider) +``` + +For an extensive list of supported instrumentation, please see the [OpenInference](https://github.com/Arize-ai/openinference) + ## v3.x to v4.0.0 ### Migrating from legacy `phoenix.Dataset` to `phoenix.Inferences`