Support for tracing query execution logs, added /trace endpoint
-
Review changes -
-
Download -
Patches
-
Plain diff
Currently there is a policy.QTRACE
to print out messages relevant to matching policy filter.
This is nice for tracing specific names in the background, but not very useful for ad-hoc troubleshooting.
This MR adds support for per-request tracing of query execution, so it's possible to install a callback function to the request structure, and it will get called for each log message (regardless of whether verbose logging to stdout is enabled or not). This by itself isn't super helpful in C modules. It also changes the way how verbose logging was done before, from:
WITH_VERBOSE {
VERBOSE_MSG(qry, "hello");
}
To:
WITH_VERBOSE(qry) {
VERBOSE_MSG(qry, "hello");
}
The second part of the MR adds a new endpoint /trace
to the HTTP module to trace execution of individual requests.
It looks sort of like this:
$ curl http://localhost:8080/trace/e.root-servers.net
iter | 'e.root-servers.net.' type 'A' created outbound query, parent id 0
rc | => rank: 020, lowest 020, e.root-servers.net. A
rc | => satisfied from cache
iter | <= answer received:
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 14771
;; Flags: qr aa QUERY: 1; ANSWER: 0; AUTHORITY: 0; ADDITIONAL: 0
;; QUESTION SECTION
e.root-servers.net. A
;; ANSWER SECTION
e.root-servers.net. 3599821 A 192.203.230.10
iter | <= rcode: NOERROR
resl | finished: 4, queries: 1, mempool: 81952 B
This is nice for troubleshooting problems with a specific resolver instance, or to generate test files (as it writes out answers received).
I'm planning to add more tracepoints next, more specifically to add a timeline of request processing events (function calls, or layer executions) to show where the time is spent for given request, but this will be more invasive, so it should probably be done in a separate set of patches.
Also added basic tests for this endpoint and the rest in the http
module.
Merge request reports
- version 275de04a32
- version 26f348b4bf
- version 25960c8901
- version 245f0b840d
- version 2397729953
- version 22a732fca8
- version 21ab4fb466
- version 2079628be3
- version 199ca537e8
- version 186500ed98
- version 17a1c56f8f
- version 16a3d38b58
- version 15c75b1176
- version 14d66d1563
- version 1330b4baa3
- version 12cf14cfa5
- version 11f7ddaae4
- version 104832e213
- version 9c626a65e
- version 834f113aa
- version 7f7cb907c
- version 6c0d5b1f0
- version 517f98432
- version 417f98432
- version 317f98432
- version 20137369b
- version 15c860391
- master (base)
- latest versiona006e7f426 commits,
- version 275de04a3226 commits,
- version 26f348b4bf25 commits,
- version 25960c890125 commits,
- version 245f0b840d23 commits,
- version 239772995321 commits,
- version 22a732fca821 commits,
- version 21ab4fb46621 commits,
- version 2079628be321 commits,
- version 199ca537e820 commits,
- version 186500ed9819 commits,
- version 17a1c56f8f16 commits,
- version 16a3d38b5814 commits,
- version 15c75b117613 commits,
- version 14d66d156312 commits,
- version 1330b4baa312 commits,
- version 12cf14cfa514 commits,
- version 11f7ddaae412 commits,
- version 104832e21312 commits,
- version 9c626a65e11 commits,
- version 834f113aa10 commits,
- version 7f7cb907c9 commits,
- version 6c0d5b1f08 commits,
- version 517f9843213 commits,
- version 417f9843213 commits,
- version 317f984326 commits,
- version 20137369b6 commits,
- version 15c8603917 commits,
- Side-by-side
- Inline
There are no changes yet
No changes between version 11 and master