Search code examples
pythongoogle-cloud-platformgoogle-cloud-profiler

google-cloud-profiler metadata server WARNING


I am trying to use Google Cloud Profiler in a python script running locally. It seems it is having problems to connect with a metadata server:

WARNING:googlecloudprofiler.client:Failed to fetch instance/zone from GCE metadata server: HTTPConnectionPool(host='metadata', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/zone (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',))

WARNING:googlecloudprofiler.client:Failed to fetch instance/name from GCE metadata server: HTTPConnectionPool(host='metadata', port=80): Max retries exceeded with url: /computeMetadata/v1/instance/name (Caused by NewConnectionError(': Failed to establish a new connection: [Errno -2] Name or service not known',))

Since the app seems to be running correctly and the profiler is collecting data successfully, is it OK if I just ignore the warnings or will I likely encounter some problems in the future?


Solution

  • If you're running locally (and haven't, for example, manually zone in the config), these warnings are expected, so ignoring them is definitely okay.

    (Disclosure: I work at Google on Stackdriver Profiler)