Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: track dial failures #59

wants to merge 1 commit into from

Conversation

adklempner
Copy link
Collaborator

No description provided.


var (
DialFailureProcessor = &DialFailure{}
)
Copy link
Member

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?

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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.

func getColumnsAndValues(v interface{}) ([]string, []interface{}) {

Copy link
Member

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
Copy link
Member

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?

Copy link
Member

@vpavlin vpavlin left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants