Upsun performance agent
Theperformance-agent correlates a range of observability signals from an app deployed on Upsun, including Blackfire profiles, continuous profiling data, traffic, and your application source code, then generates a performance analysis report. It analyzes a configurable window of up to 7 days (24 hours by default).
Run as an Upsun task
The agent runs as an Upsuntask, so it requires no local installation.
The only credential you supply is an LLM provider API key: ANTHROPIC_API_KEY or OPENAI_API_KEY. The provider is deduced from the MODEL you set (claude* uses ANTHROPIC_API_KEY, gpt* uses OPENAI_API_KEY).
Store the API key as a sensitive variable rather than passing it inline. Passing it inline exposes the secret in shell history.
1. Add the task to your Upsun configuration
Add the following to.upsun/config.yaml:
2. Run the agent
Replace the project ID, environment, and application name with yours:AGENT_APPLICATION is the only required variable. The report is written to the task activity log.
Task environment variables
Pass additional variables undervariables.env in the run command.
Variables with a binary default are the agent’s own defaults. The task only passes a flag when the variable is set.
--project and --environment are locked to the runtime’s PLATFORM_PROJECT and PLATFORM_BRANCH and cannot be overridden through environment variables.
Available models
SetMODEL to any of the following IDs. Aliases resolve to the latest matching model. The provider is deduced from the model ID.
Cost
Cost per run depends on the model, the length of the analysis window, and how much observability data your app produces. TheMAX_BUDGET_USD variable (default 5) caps spend per run.
The figures below come from internal tests and are only a rough sense of scale, not a guarantee. Your actual cost will vary.