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

Why do we try to read /etc/dd-agent/datadog.conf? #176

Closed
tgwizard opened this issue Oct 30, 2016 · 4 comments
Closed

Why do we try to read /etc/dd-agent/datadog.conf? #176

tgwizard opened this issue Oct 30, 2016 · 4 comments
Milestone

Comments

@tgwizard
Copy link

Why does the datadog library try to read the Datadog Agent config on /etc/dd-agent/datadog.conf? It seems to only be used in

config = get_config()
, and it is causing some issues for us.

To be able to read the config file, the service running the datadog library must have read privileges for that file. However, the default settings from the datadog cookbook marks the config file as owned by dd-agent:root, with permissions 0640. We don't want to run our services as either the dd-agent user or a user in the root group, and the datadog cookbook doesn't allow us to change the permissions.

It all works fine even without the read permissions - datadog defaults to parsing hostname -f. However, as of #161, we get a log line like

2016-10-30 20:57:28,874: INFO: (-) datadog.api: No agent or invalid configuration file found

every time we start our services.

Why do we need to read the hostname from the config file - isn't hostname -f good enough? Or do people often have custom hostnames in the datadog agent config file? How do people solve the config file permission issue?

@yannmh yannmh added this to the Triage milestone Nov 4, 2016
@yannmh
Copy link
Member

yannmh commented Nov 4, 2016

Thanks for reporting @tgwizard.

The idea is to grab, if defined, the hostname configured in the datadog.conf so that metrics, events and service checks sent via the HTTP API (datadog.api or datadog.threadstats packages) can use the same hostname as the agent active on the same host.

However, I realize this is not a good idea:

  1. As you described, the library should not and may not have the permission to read the datadog.conf agent configuration file.
  2. This is unnecessary. If an agent is running on the host, one can use datadog.statsd to automatically tag resources with the agent's hostname.

@yannmh yannmh modified the milestones: 0.15.0, Triage Nov 4, 2016
@yannmh yannmh modified the milestones: 0.15.0, 0.16.0 Jan 23, 2017
@yannmh yannmh modified the milestones: 1.0.0, 0.16.0 Feb 13, 2017
@shpoont
Copy link

shpoont commented Nov 19, 2017

Is fix for this issue planned for release?

@dabcoder
Copy link
Contributor

dabcoder commented Oct 2, 2019

Apologies for the really long delay in updating this thread. We've taken care of this in #428 (downgrade to warning and add an option hostname_from_config=False to turn this off completely and we aim to deprecate this feature in the future.

@bkabrda
Copy link
Contributor

bkabrda commented Oct 2, 2019

Closing this issue now, see @dabcoder's comment above on how to get rid of these errors.

@bkabrda bkabrda closed this as completed Oct 2, 2019
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 a pull request may close this issue.

5 participants