diff options
| -rw-r--r-- | debuginfod/ChangeLog | 5 | ||||
| -rw-r--r-- | debuginfod/debuginfod.cxx | 12 | ||||
| -rw-r--r-- | tests/ChangeLog | 5 | ||||
| -rwxr-xr-x | tests/run-debuginfod-find.sh | 4 |
4 files changed, 26 insertions, 0 deletions
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 58ba85cf..989a9029 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,5 +1,10 @@ 2020-03-26 Frank Ch. Eigler <fche@redhat.com> + * debuginfod.cxx (handler_cb): Export two families of metrics for + prometheus traffic analysis: response times and data amounts. + +2020-03-26 Frank Ch. Eigler <fche@redhat.com> + * debuginfod.cxx (parse_opt): For -U, prefer dpkg-deb after all if access(3)-able, fallback to bsdtar. diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 9e8d5560..98491c2c 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -1767,6 +1767,7 @@ handler_cb (void * /*cls*/, inc_metric("http_responses_total","result","error"); e.report(clog); http_code = e.code; + http_size = e.message.size(); rc = e.mhd_send_response (connection); } @@ -1778,6 +1779,17 @@ handler_cb (void * /*cls*/, << ' ' << (int)(deltas*1000) << "ms" << endl; + // related prometheus metrics + string http_code_str = to_string(http_code); + if (http_size >= 0) + add_metric("http_responses_transfer_bytes_sum","code",http_code_str, + http_size); + inc_metric("http_responses_transfer_bytes_count","code",http_code_str); + + add_metric("http_responses_duration_milliseconds_sum","code",http_code_str, + deltas*1000); // prometheus prefers _seconds and floating point + inc_metric("http_responses_duration_milliseconds_count","code",http_code_str); + return rc; } diff --git a/tests/ChangeLog b/tests/ChangeLog index c06d8924..ba88ecf6 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,10 @@ 2020-03-26 Frank Ch. Eigler <fche@redhat.com> + * run-debuginfod-find.sh: Look for debuginfod's new + http_responses_* metrics. + +2020-03-26 Frank Ch. Eigler <fche@redhat.com> + * run-debuginfod-find.sh: Look for bsdtar instead of dpkg. 2020-03-26 Frank Ch. Eigler <fche@redhat.com> diff --git a/tests/run-debuginfod-find.sh b/tests/run-debuginfod-find.sh index cc826f96..db36420f 100755 --- a/tests/run-debuginfod-find.sh +++ b/tests/run-debuginfod-find.sh @@ -416,6 +416,10 @@ curl -s http://127.0.0.1:$PORT2/metrics curl -s http://127.0.0.1:$PORT1/metrics | grep -q 'http_responses_total.*result.*error' curl -s http://127.0.0.1:$PORT1/metrics | grep -q 'http_responses_total.*result.*fdcache' curl -s http://127.0.0.1:$PORT2/metrics | grep -q 'http_responses_total.*result.*upstream' +curl -s http://127.0.0.1:$PORT1/metrics | grep 'http_responses_duration_milliseconds_count' +curl -s http://127.0.0.1:$PORT1/metrics | grep 'http_responses_duration_milliseconds_sum' +curl -s http://127.0.0.1:$PORT1/metrics | grep 'http_responses_transfer_bytes_count' +curl -s http://127.0.0.1:$PORT1/metrics | grep 'http_responses_transfer_bytes_sum' # And generate a few errors into the second debuginfod's logs, for analysis just below curl -s http://127.0.0.1:$PORT2/badapi > /dev/null || true |
