telemetry: don't report let asyncTelemetryHook wrap and log its own errors#4932
Merged
algorandskiy merged 3 commits intoalgorand:masterfrom Dec 22, 2022
Merged
Conversation
Codecov Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
algorandskiy
approved these changes
Dec 22, 2022
excalq
reviewed
Dec 22, 2022
| func (hook *asyncTelemetryHook) Fire(entry *logrus.Entry) error { | ||
| if _, ok := entry.Data["TelemetryError"]; ok { | ||
| return nil | ||
| } |
Contributor
There was a problem hiding this comment.
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.
algobarb
pushed a commit
to algobarb/go-algorand
that referenced
this pull request
Dec 22, 2022
This was referenced Dec 22, 2022
This was referenced Jan 23, 2023
This was referenced Jan 30, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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