Skip to content

telemetry: don't report let asyncTelemetryHook wrap and log its own errors#4932

Merged
algorandskiy merged 3 commits intoalgorand:masterfrom
cce:drop-telemetryhook-logging-self
Dec 22, 2022
Merged

telemetry: don't report let asyncTelemetryHook wrap and log its own errors#4932
algorandskiy merged 3 commits intoalgorand:masterfrom
cce:drop-telemetryhook-logging-self

Conversation

@cce
Copy link
Copy Markdown
Contributor

@cce cce commented Dec 22, 2022

Summary

The asyncTelemetryHook implementation (in telemetryhook.go) uses logging in a single place, when it encounters an error reporting an event. This should ensure the asyncTelemetryHook drops any events reported inside its own implementation, so it does not re-wrap and re-report events unnecessarily.

Test Plan

Added TestAsyncTelemetryHook_SelfReporting

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 22, 2022

Codecov Report

Merging #4932 (28d6144) into master (bd64ce8) will decrease coverage by 0.03%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master    #4932      +/-   ##
==========================================
- Coverage   54.08%   54.05%   -0.04%     
==========================================
  Files         427      427              
  Lines       53528    53530       +2     
==========================================
- Hits        28948    28933      -15     
- Misses      22314    22329      +15     
- Partials     2266     2268       +2     
Impacted Files Coverage Δ
logging/telemetryhook.go 51.06% <66.66%> (+0.70%) ⬆️
crypto/merkletrie/trie.go 66.42% <0.00%> (-2.19%) ⬇️
network/wsPeer.go 67.06% <0.00%> (-1.91%) ⬇️
crypto/merkletrie/node.go 91.62% <0.00%> (-1.87%) ⬇️
cmd/tealdbg/debugger.go 72.69% <0.00%> (-0.81%) ⬇️
catchup/service.go 68.59% <0.00%> (-0.49%) ⬇️
network/wsNetwork.go 64.74% <0.00%> (-0.18%) ⬇️
ledger/acctonline.go 78.81% <0.00%> (+0.51%) ⬆️
ledger/tracker.go 75.94% <0.00%> (+0.84%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@algorandskiy algorandskiy merged commit 9b8f1bd into algorand:master Dec 22, 2022
@cce cce deleted the drop-telemetryhook-logging-self branch December 22, 2022 15:46
Comment thread logging/telemetryhook.go
func (hook *asyncTelemetryHook) Fire(entry *logrus.Entry) error {
if _, ok := entry.Data["TelemetryError"]; ok {
return nil
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a better location than telemetryFilteredhook, as to avoid it being added to the async queue in the first place? telemetryFilteredhook would be a better location if that concern isn't true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants