node.jsのapp-engineから現在のインスタンス ID を取得する方法はありますか?
javaとpythonのソリューションのみが見つかりましたが、 nodeのソリューションは見つかりませんでした。
node.jsのapp-engineから現在のインスタンス ID を取得する方法はありますか?
javaとpythonのソリューションのみが見つかりましたが、 nodeのソリューションは見つかりませんでした。
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!