-
Notifications
You must be signed in to change notification settings - Fork 305
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
Hostname lookup in debug and on/off setup #428
Hostname lookup in debug and on/off setup #428
Conversation
I'm wondering whether it might be better to add an argument to |
That is a possibility, good point. Will look into that.
No I was looking at other optional arguments such as Lines 63 to 66 in 42b578c
initialize method either, so was not sure how to reference it.
|
I'm not sure about the cacert specifically, but we should either:
|
1153e6f
to
c8a2b18
Compare
75660fd
to
c2de2ca
Compare
Just a bump to ask how this one is going? I was reminded this morning when adding a new log source and realizing I see over 250,000 of these errors a day in our logs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearly log.info
was not a good choice here. :)
You're the best! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additional work, @dabcoder. Some points (trying to make my last comment clearer):
- As mentioned in my previous comment, I'd prefer if this was configurable through
initialize
(so add a new argumenthostname_from_config=True
, so that users can set that toFalse
and try what their app will do in future when we remove this completely. - I think the warning should be emitted on
log.warning
level, additionally recommending that the user should callinitialize
withhostname_from_config=False
to get rid of this warning. This will make sure that users who want to get rid of this warning explicitly consent to not using config while users who want to keep trying to use the config will get warned when the config is not accessible.
Does that sound good to everyone? (@apenney would appreciate your feedback on this)
datadog/__init__.py
Outdated
@@ -29,7 +29,7 @@ | |||
logging.getLogger('datadog.threadstats').addHandler(NullHandler()) | |||
|
|||
|
|||
def initialize(api_key=None, app_key=None, host_name=None, api_host=None, | |||
def initialize(api_key=None, app_key=None, host_name=None, hostname_from_config=True, api_host=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd honestly put the new argument at the very end of the argument list, because it someone is doing right now initialize("xxx", "yyy", None, "some_api_host")
, this would break their code. Optional arguments should always be added to the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Done in the last commit
/azp run DataDog.datadogpy.integration |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, merging. Thanks!
Attempts to address #416.