Hi, I would really appreciate any help with integration of Phoenix with Google ADK agent deployed to AgentEngine. I see the traces in Phoenix when I run the agent locally using 'test_adk_phoenix.py' script. However, when I deploy the agent to Google AgentEngine and test it from there, I see no errors in the logs and no traces in Phoenix. I use the following environment variables: OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=True, GOOGLE_GENAI_USE_VERTEXAI=True, GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY=False. The Phoenix API key is the System API key. What am I doing wrong?
For Google AgentEngine deployments, instrumentation must be configured inside the remote agent module, not just in your main application. You need to ensure that the Phoenix tracing setup (including the register function and the relevant instrumentor, e.g., GoogleADKInstrumentor().instrument(tracer_provider=tracer_provider)) is included in your agent module code that runs on AgentEngine. Also, make sure all required packages are listed in your deployment requirements and that environment variables for the Phoenix endpoint and API key are set in the remote environment. Setting GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY=False is correct, as Phoenix uses OpenTelemetry directly, not the built-in telemetry. See the official Phoenix Google ADK Agent Engine deployment guide for details.If traces appear locally but not in AgentEngine, it's likely the remote agent module is missing the tracing setup or the environment variables are not correctly passed to the remote environment. Double-check that the tracing code is executed in the remote agent context and that the Phoenix endpoint and API key are available there. Would you like a step-by-step deployment example?Sources:
- Phoenix Google ADK Agent Engine deployment guide
💡 Hint: Mention RunLLM in the thread for followups.
GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY=False and I use GoogleADKInstrumentor().instrument(tracer_provider=tracer_provider)
the Phoenix endpoint and API key are available and correct, because I see the traces when I run the agent locally
Hi Elena. Was the Phoenix Google ADK Agent Engine deployment guide (referenced above by the bot) helpful for you?
Hey Roger. No, it didn't help. As I said, I've already used GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY=False and GoogleADKInstrumentor().instrument(tracer_provider=tracer_provider)
I think, arize-otel is for Arize, not for Phoenix
it should be exchangeable. let me ask the team
thank you
what does your deploy script look like?
something like this?
import os
import vertexai
from vertexai import agent_engines
project_id = os.environ.get("GOOGLE_CLOUD_PROJECT")
if not project_id:
raise RuntimeError("Set GOOGLE_CLOUD_PROJECT before deploying.")
# Initialize the Vertex AI client
vertexai.init(project=project_id, location=os.environ.get("GOOGLE_CLOUD_LOCATION", "us-central1"))
client = vertexai.Client(project=project_id, location=os.environ.get("GOOGLE_CLOUD_LOCATION", "us-central1"))
print("Deploying ADK Agent to Vertex AI Agent Engine...")
remote_agent = client.agent_engines.create(
# Tell Agent Engine to run the 'agent_engine' object inside 'agent.py'
agent_engine=agent_engines.ModuleAgent(module_name="agent", agent_name="agent_engine"),
config={
"requirements": [
"google-cloud-aiplatform[agent_engines,adk]>=1.139.0",
"openinference-instrumentation-google-adk>=0.1.9",
"arize-phoenix-otel>=0.15.0",
],
"extra_packages": [
"agent.py",
"agent_engine_app.py",
],
"env_vars": {
"GOOGLE_CLOUD_PROJECT": project_id,
"PHOENIX_COLLECTOR_ENDPOINT": os.environ.get("PHOENIX_COLLECTOR_ENDPOINT", "https://app.phoenix.arize.com/v1/traces"),
"PHOENIX_PROJECT_NAME": os.environ.get("PHOENIX_PROJECT_NAME", "default"),
"PHOENIX_API_KEY": os.environ.get("PHOENIX_API_KEY", ""),
}
}
)
print(f"Deployment complete! Agent Resource Name: {remote_agent.api_resource.name}")
it works fine. The agent is deployed to AgentEngine and the agent itself works. Environment variables: OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=True, GOOGLE_GENAI_USE_VERTEXAI=True, GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY=False
