-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: track dial failures #59
base: master
Are you sure you want to change the base?
Conversation
e096849
to
9c8b273
Compare
9c8b273
to
171275d
Compare
|
||
var ( | ||
DialFailureProcessor = &DialFailure{} | ||
) |
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.
This is missing the implementation isn't it?
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.
Nope! After my generic metrics PR this is all that is necessary to add all the db logic 😄 https://github.com/status-im/telemetry/pull/56/files#diff-c4d76f1754d2a1b8e04e65bde83777fa2509c22740f0dff2d8e8a7efcb19ae3b
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.
All the column names and values necessary to create the insert query are derived based on the json attributes of the DialFailure
type. As long as the name of the field matches the name of the column, it works.
telemetry/lib/metrics/generic.go
Line 103 in 53fa8ac
func getColumnsAndValues(v interface{}) ([]string, []interface{}) { |
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.
Oh, right, I completely forgot. That's awesome!
CONSTRAINT dialFailure_unique UNIQUE (recordId, errorType, protocols, timestamp) | ||
); | ||
|
||
ALTER TABLE dialFailure ADD CONSTRAINT fk_dialFailure_telemetryRecord |
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.
Shouldn't there be a foreign key constraint for dial_error_types
as well? Just to make sure we don't insert non-existant error types?
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.
Added one more comment, but otherwise looks good
No description provided.