Is there any way to get the current instance id from app-engine in node.js?
I found solutions only for java and python but nothing for node.
Node. js is an open source server environment. Node. js allows you to run JavaScript on the server.
As there's no traditional App Engine runtime for nodejs, I'm assuming you're using Flexible Environment (AKA "Custom Runtimes"). In such a case, you can read in the docs that using the Compute Engine Metadata Server can provide the information you're looking for. Custom Runtime / Flex apps are actually running in a Docker container on a Compute Engine VM. The docs say:
Each instance of your application can use the Compute Engine metadata server to query information about the instance, including its host name, external IP address, instance ID, custom metadata, and service account information. App Engine does not allow you to set custom metadata for each instance, but you can set project-wide custom metadata and read it from your App Engine and Compute Engine instances.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With