gatus icon indicating copy to clipboard operation
gatus copied to clipboard

feat(core): do not include DNS query time in HTTP response time

Open Exagone313 opened this issue 2 years ago • 5 comments

Fix #49

Summary

See #49

  • Fixing response time for other request types needs to be added in a newer issue
  • I don't know how to add a test for this, it would need some kind of mock for getting the time to be able to override it in the test.

Checklist

  • [ ] Tested and/or added tests to validate that the changes work as intended, if applicable.
  • [ ] Updated documentation in README.md, if applicable.

Exagone313 avatar Jul 16 '23 12:07 Exagone313

I know the issue's been open for a while, but I'm perplexed about whether this is the right call. In a real-life production scenario, a DNS call does occur, so is excluding the DNS call from Gatus really the right move? 🤔

TwiN avatar Jul 20 '23 03:07 TwiN

I can probably make this an optional feature (disabled by default) for each HTTP endpoint. But then maybe it makes more sense to add the feature for each kind of request.

Exagone313 avatar Jul 20 '23 03:07 Exagone313

@TwiN What do you think about creating new placeholders specifically for the values for DNS query time and protocol response time, and leaving the [RESPONSE_TIME] placeholder untouched?

My patch has to be improved in any case because it is not clear if the DNSDone event can be triggered multiple times (is it asynchronous? what happens when there are multiple records for a name?)

Exagone313 avatar Sep 03 '23 14:09 Exagone313