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

Add tag(s) DNS lookup time out. #67

Merged
merged 9 commits into from
Jan 26, 2023

Conversation

mashhurs
Copy link
Contributor

@mashhurs mashhurs commented Jun 23, 2022

Description

We had feature requests (#24, #47) to support the tag on DNS look up timeouts and it seems we had a contribution (PR) but author didn't follow up to end.

This change covers followings:

  • adds a tag on timeout, defaults to _dnstimeout
  • adds warn_on_timeout config to tune the log level when dns time out occurs

This PR intends to cover remain works of original PR.

Closes

Closes #24
Closes #47

@mashhurs mashhurs linked an issue Jun 23, 2022 that may be closed by this pull request
@mashhurs mashhurs marked this pull request as ready for review June 24, 2022 17:33
@mashhurs mashhurs mentioned this pull request Jun 24, 2022
@mashhurs mashhurs requested a review from yaauie June 24, 2022 21:54
Keep the config orders in a right way.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
@mashhurs mashhurs requested a review from yaauie January 14, 2023 09:28
…version, this will not break the behavior and they will have an opportunity to configure the warn on timeout.
@jsvd jsvd self-requested a review January 24, 2023 16:49
@logger.warn(log_message, :field => field, :value => raw)
else
@logger.info(log_message, :field => field, :value => raw)
end
Copy link

@roaksoax roaksoax Jan 24, 2023

Choose a reason for hiding this comment

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

Same as the the other relevant change.

@logger.warn(log_message, :field => field, :value => raw)
else
@logger.info(log_message, :field => field, :value => raw)
end
Copy link

@roaksoax roaksoax Jan 24, 2023

Choose a reason for hiding this comment

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

it seems this change tries to address this issue.

The requested feature is asking for a way to disable logging. It is NOT asking for a way to change this logging from WARN to INFO. Can you please clarify why is this change relevant to the attached issue?

Choose a reason for hiding this comment

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

another option is to make this DEBUG as the original PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Long history and it is true that now the logic is adding extra noise :( and doesn't solve the user need.
Stepping back and analyzing, I agree with the debug approach as we added the tag. Users will have two granular options: receiving with tag and debug logs.
Please take a look at the final approach and provide your comments.
Thanks so much for catching this up!

…ly warn timeouts. Also, as user requested, it is now a noise but can be triggered in debug logs.
@mashhurs mashhurs requested a review from roaksoax January 25, 2023 12:46
@@ -219,8 +222,9 @@ def resolve(event)
end
rescue Resolv::ResolvTimeout
@failed_cache[raw] = true if @failed_cache
@logger.warn("DNS: timeout on resolving the hostname.",
@logger.debug("DNS: timeout on resolving the hostname.",

Choose a reason for hiding this comment

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

Ok I think it is fair to say that changing the log level is not a breaking change, and we need to re-evalute in the future how we handle logging for event processing, so I'm fine leaving this as debug.

@mashhurs mashhurs merged commit 065df2f into logstash-plugins:main Jan 26, 2023
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.

FR: Option to disable logging DNS lookup failures tag on failure
4 participants