Serverless App Engine (SAE) automatically injects application metadata—such as the application ID and instance ID—as environment variables into each running instance. You can read these variables in your application code to access runtime information without hardcoding values.
Common uses
SAE environment variables are useful for:
Logging and tracing: Tag log entries with the application ID or instance ID to filter logs by instance in distributed tracing systems.
Debugging: Identify which instance is behaving unexpectedly when multiple instances run the same application.
Canary releases: Detect which application version is running and apply instance-specific logic during staged rollouts.
SAE environment variables
SAE injects the following environment variable into your application at runtime:
| Variable | Description |
|---|---|
EDAS_APP_ID | Unique identifier for the application |
To see all environment variables that SAE has injected into your instance—including the instance ID—log on to Webshell and run the env command.
Read variables from application code
Access SAE environment variables the same way you read any OS-level environment variable:
Java
String appId = System.getenv("EDAS_APP_ID");Python
import os
app_id = os.environ.get("EDAS_APP_ID")Node.js
const appId = process.env.EDAS_APP_ID;View all injected variables using Webshell
To see the full list of variables SAE has injected into a running instance:
Log on to the SAE console and go to your application.
Log on to Webshell for the target instance.
Run the
envcommand.
The output lists all environment variables injected by SAE, including the instance ID and other runtime metadata.