Observability
App Metadata
Porter injects some default environment variables in all Porter-provisioned apps, containing basic metadata around your app and the current deployment revision. A full list of these environment variables may be found here:
PORTER_RESOURCES_RAM
- The amount of RAM assigned to the current service.PORTER_RESOURCES_CPU
- The number of vCPU cores assigned to the current service.PORTER_RESOURCES_REPLICAS
- The static replica count for the current service. Note that this may differ from the actual number of replicas running, if you have autoscaling enabled.PORTER_NODE_NAME
- The node the current service replica is running on.PORTER_NODE_IP
- The internal IP of the node the current service replica is running on.PORTER_POD_NAME
- This is the same as the internal hostname for the current service replica.PORTER_POD_IP
- The internal private IP assigned to the current service replica.PORTER_POD_IMAGE_TAG
- The image tag being used to run the current service replica. This is typically the same asPORTER_IMAGE_TAG
.PORTER_IMAGE_TAG
- The image tag being used for the current app. This is typically the same asPORTER_POD_IMAGE_TAG
.PORTER_POD_REVISION
- The revision ID assigned to the latest app deployment by Porter.PORTER_APP_SERVICE_NAME
- A portmanteau of the app name and service name:<APP>-SERVICE
.
If you’re looking at adding more metadata to logs or traces, these environment variables can be used to inject metadata about the origin of a log/trace into your observability tooling.