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

App not passing FQDNs to datadog. #97

Closed
rparcus opened this issue Oct 20, 2022 · 3 comments
Closed

App not passing FQDNs to datadog. #97

rparcus opened this issue Oct 20, 2022 · 3 comments

Comments

@rparcus
Copy link

rparcus commented Oct 20, 2022

We noticed that :inet.gethostname() is not sending fully qualified domain names to datadog.
A simple fix would be to use :net_adm.localhost() and the --name option.

iex(app@corp-7220.us-central1-c.c.corp-integ-0.internal)3> :inet.gethostname()
{:ok, 'corp-7220'}
iex(app@corp-7220.us-central1-c.c.corp-integ-0.internal)4> :net_adm.localhost()
'corp-7220.us-central1-c.c.corp-integ-0.internal'

We can have a PR swapping the two functions and call it a day.
Would you see any drawbacks in abandoning :inet.gethostname/0?

cc: @rudebono

@AndrewDryga
Copy link
Member

AndrewDryga commented Oct 21, 2022

I think this issue is already solved in one of the recent releases, take a look: #87. You can override the hostname with any value reading it from the system environment or just avoid setting it and let DataDog agent to put it for you.

FYI: The problem with swapping them is that not everyone is using --name option and even :net_adm.localhost() is not reliable in some cases, for example for our production environment results for both of those functions are precisely the same and not a FQDN:

iex(talkinto-domain@10-3-0-14.talkinto.pod.cluster.local)1> :inet.gethostname()
{:ok, 'talkinto-workers-messaging-5f7996c66f-n9t5s'}
iex(talkinto-domain@10-3-0-14.talkinto.pod.cluster.local)2> :net_adm.localhost()
'talkinto-workers-messaging-5f7996c66f-n9t5s'

@rparcus
Copy link
Author

rparcus commented Oct 21, 2022

There are some limitations for which those two options do not work for us.
Would adding a config that allows users to pick between :inet.gethostname() and :net_adm.localhost() be ok?

@AndrewDryga
Copy link
Member

This can be set in the current version using the hostname option of the formatter.

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

No branches or pull requests

2 participants