Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core][cloud_metadata] Use Metadata-Flavor header to avoid request exception for GCE tags #3288

Merged
merged 1 commit into from
Mar 28, 2017

Conversation

CodeHex
Copy link
Contributor

@CodeHex CodeHex commented Mar 28, 2017

What does this PR do?

We get the following log when we start the dd-agent on an instance in GCE.
dd.collector | utils.cloud_metadata(cloud_metadata.py:45) | Collecting GCE Metadata failed Header value True must be of type str or bytes, not <type 'bool'>

It looks like the header in the request sent to GCE to get the metadata is in the wrong format. Also I think this is now deprecated in favour of Metadata-Flavor: Google (see https://cloud.google.com/compute/docs/metadata#transitioning)

This PR uses the new Metadata-Flavor: Google

Motivation

We're relying on GCE tags to identify important groups of instances and none of these tags are coming through.

@gmmeyer gmmeyer self-requested a review March 28, 2017 17:24
Copy link
Contributor

@gmmeyer gmmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@gmmeyer gmmeyer merged commit 784a794 into DataDog:master Mar 28, 2017
@gmmeyer gmmeyer added this to the 5.12.2 milestone Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants