Best practices for deploying applications using the Agent Governance SDK to production environments.
AgentMonitor
configuration is set for production (e.g., appropriate batchSize
, flushInterval
, and logLevel
).AGENT_GOVERNANCE_API_KEY
and other secrets are managed securely and are not hardcoded.Serverless (AWS Lambda, Vercel)
shutdown()
is essential: Because serverless functions can terminate at any time, you must flush()
or shutdown()
the monitor at the end of each invocation that tracks events.Containers (Docker, Kubernetes)
Dockerfile
correctly installs dependencies (npm ci --only=production
) and copies necessary files.-e
flag in Docker or env
in Kubernetes manifests).SIGTERM
signal to pods before termination. Your application must handle this signal to call monitor.shutdown()
.Traditional Servers (EC2, Virtual Machines)
SIGINT
to your application, which you can catch to trigger monitor.shutdown()
..env
file or the OS’s environment to manage secrets.