-
Notifications
You must be signed in to change notification settings - Fork 976
dnsdist: Add support for structured logging #16691
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
Conversation
Pull Request Test Coverage Report for Build 21136026407Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
| { | ||
|
|
||
| static bool doOneCarbonExport(const Carbon::Endpoint& endpoint) | ||
| static bool doOneCarbonExport(const Carbon::Endpoint& endpoint, const Logr::Logger& logger) |
Check warning
Code scanning / CodeQL
Poorly documented large function Warning
| } | ||
|
|
||
| static std::shared_ptr<DownstreamState> createBackendFromConfiguration(const dnsdist::rust::settings::BackendConfiguration& config, bool configCheck) | ||
| static std::shared_ptr<DownstreamState> createBackendFromConfiguration(const Context& context, const dnsdist::rust::settings::BackendConfiguration& config, bool configCheck) |
Check warning
Code scanning / CodeQL
Poorly documented large function Warning
| } | ||
|
|
||
| bool ServiceDiscovery::getDiscoveredConfig(const UpgradeableBackend& upgradeableBackend, ServiceDiscovery::DiscoveredResolverConfig& config) | ||
| bool ServiceDiscovery::getDiscoveredConfig(const Logr::Logger& topLogger, const UpgradeableBackend& upgradeableBackend, ServiceDiscovery::DiscoveredResolverConfig& config) |
Check warning
Code scanning / CodeQL
Poorly documented large function Warning
|
|
||
| #ifndef DISABLE_BUILTIN_HTML | ||
| static void handleJSONStats(const YaHTTP::Request& req, YaHTTP::Response& resp) | ||
| static void handleJSONStats(const YaHTTP::Request& req, YaHTTP::Response& resp, const Logr::Logger& logger) |
Check warning
Code scanning / CodeQL
Poorly documented large function Warning
| } | ||
|
|
||
| static void handleStats(const YaHTTP::Request& req, YaHTTP::Response& resp) | ||
| static void handleStats(const YaHTTP::Request& req, YaHTTP::Response& resp, const Logr::Logger& logger) |
Check warning
Code scanning / CodeQL
Poorly documented large function Warning
5fee7f5 to
6b7c5bc
Compare
|
Rebased on current master to fix a conflict with #16576. |
|
I'll have a look at #16693 to see how we can prevent or minimize conflicts, I'm not too worried. |
44f062d to
5271287
Compare
|
I looked at the possible conflicts with #16693 and edited the first commit of my branch to move |
|
Note that in the auth PR, the plumbing work consists only of moving recursor-specific bits to the common place; but there is still some code duplication until things settle. |
5271287 to
53ec974
Compare
|
Rebased on current master to fix conflicts. |
|
Observation: the With rec I always try to make sure that the |
|
Right, this is unexpected since I documented that key to be always present in dnsdist as well. I'm thinking of adding a mandatory |
Yes, I think that would work. In rec I make sure that I never use |
|
Well, if you use |
Hmm this diff compiles and runes here: |
|
Oh then it's |
Both these lines error, so no difference bewteen |
Done. |
01573b7 to
498215c
Compare
|
I like it. But startup is a bit inconsistent. With this config, I get one line of un-structured log and one line of wrongly structured log (wrong backend) before structured logging actually does the right thing: setStructuredLogging(true, { backend = "json" })
newServer({ address = "8.8.8.8" })Perhaps we should delay/buffer all logging until config has been parsed. When that was successful, log everything in the right format. If parsing was not successful, just use the default logging settings for the buffered messages. |
You can use
What bothers me about that idea is that if we crash without reaching the "successful" part we get nothing. |
|
That could be a problem indeed. Let's keep it like this and perhaps document that folks should use the command line switches if they need proper logging from the moment of startup. |
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
I had not realized before that the `Logging::Loggable` ctor takes a `const` reference to the object we pass to it, meaning that we cannot pass temporaries to it without creating dangling references. Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
e83bc74 to
ba030fb
Compare
pieterlexis
left a comment
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.
One nit, but I can live with that. Merge it!
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pieterlexis
left a comment
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.
ship it
Short description
This PR implements structured logging support for DNSdist. A small amount of code is duplicated from the recursor, I tried to refactor it but the result was ugly because some parts are really tied to the recursor.
Checklist
I have: