fix: Enable Tracing Support For Self-Hosted Phoenix Instance (#8256)
* fix: Enable Tracing Support For Self-Hosted Phoenix Instance * [autofix.ci] apply automated fixes * fix: Clarify Phoenix Tracing Without Auth --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
2bf7e96dc1
commit
85ed6a6ae9
1 changed files with 10 additions and 5 deletions
|
|
@ -111,12 +111,17 @@ class ArizePhoenixTracer(BaseTracer):
|
|||
# Phoenix Config
|
||||
phoenix_api_key = os.getenv("PHOENIX_API_KEY", None)
|
||||
phoenix_collector_endpoint = os.getenv("PHOENIX_COLLECTOR_ENDPOINT", "https://app.phoenix.arize.com")
|
||||
enable_phoenix_tracing = bool(phoenix_api_key)
|
||||
phoenix_auth_disabled = "localhost" in phoenix_collector_endpoint or "127.0.0.1" in phoenix_collector_endpoint
|
||||
enable_phoenix_tracing = bool(phoenix_api_key) or phoenix_auth_disabled
|
||||
phoenix_endpoint = f"{phoenix_collector_endpoint}/v1/traces"
|
||||
phoenix_headers = {
|
||||
"api_key": phoenix_api_key,
|
||||
"authorization": f"Bearer {phoenix_api_key}",
|
||||
}
|
||||
phoenix_headers = (
|
||||
{
|
||||
"api_key": phoenix_api_key,
|
||||
"authorization": f"Bearer {phoenix_api_key}",
|
||||
}
|
||||
if phoenix_api_key
|
||||
else {}
|
||||
)
|
||||
|
||||
if not (enable_arize_tracing or enable_phoenix_tracing):
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue