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

Avoid starting the agent if the api key is too short #3546

Merged
merged 3 commits into from
Oct 13, 2017
Merged

Conversation

masci
Copy link
Contributor

@masci masci commented Oct 13, 2017

Note: Please remember to review the Datadog Contribution Guidelines
if you have not yet done so.

What does this PR do?

Performs a sanity check before starting the agent to avoid collecting anything if the api key is obviously wrong.

Enhance the message on the status page when an api key is invalid

Motivation

The agent might start collecting metrics but never flush if users paste a wrong api key

@masci masci added this to the 5.19.0 milestone Oct 13, 2017
@xvello
Copy link
Contributor

xvello commented Oct 13, 2017

Fixes DataDog/docker-dd-agent#250

Copy link
Contributor

@xvello xvello left a comment

Choose a reason for hiding this comment

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

LGTM !

@masci masci merged commit e3ffd1e into master Oct 13, 2017
@masci masci deleted the massi/api-key-check branch October 13, 2017 14:59
@olivielpeau olivielpeau modified the milestones: 5.19.0, 5.20.0 Oct 31, 2017
@ISauve
Copy link

ISauve commented Nov 17, 2017

Note: the process-agent and trace-agent treat a missing/empty/shortened API key differently than the dd-agent does, and since supervisor does not have the concept of “dependencies” each process is on its own. We observed that an empty API key lead the process-agent to start as usual, an API key that was too short made both processes start, and a missing API key (line completely commented on in conf.d) meant neither started. This PR doesn't affect those agents at all, so the observed behaviour is not a bug that introduced here - it's just how the other agents work.

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.

4 participants