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

Integrate airbrake with datastore #146

Merged
merged 1 commit into from
Apr 5, 2024
Merged

Conversation

agbpatro
Copy link
Collaborator

@agbpatro agbpatro commented Apr 5, 2024

Description

Report datastore errors to airbrake. Note that it will only dispatch errors to airbrake if its actually configured otherwise func (a *AirbrakeHandler) ReportLogMessage acts as a noop.

Fixes # (issue)

Type of change

Please select all options that apply to this change:

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update

Checklist:

Confirm you have completed the following steps:

  • My code follows the style of this project.
  • I have performed a self-review of my code.
  • I have made corresponding updates to the documentation.
  • I have added/updated unit tests to cover my changes.
  • I have added/updated integration tests to cover my changes.

// ReportError to airbrake and logger
func (p *ZMQProducer) ReportError(message string, err error, logInfo logrus.LogInfo) {
p.airbrakeHandler.ReportLogMessage(logrus.ERROR, message, err, logInfo)
p.ReportError(message, err, logInfo)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Infinite recursion. Did you mean p.logger.ErrorLog?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for each of the datastores.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm.. my branch got messed on rebase. Fixed

@@ -208,6 +214,7 @@ var _ = Describe("BinarySerializer", func() {
result, _ = bs.Deserialize(msgBytes, "Socket-42")
bs.Dispatch(result)
Expect(CallbackTester.counter).To(Equal(1))
Expect(CallbackTester.errors).To(Equal(0))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we test when ReportError gets called?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not on this test - but can we test the case that does

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would be hard to simulate this scenario in tests. Will prefer keeping the testing as is.

Report datastore errors to airbrake. Note that it will only dispatch errors to airbrake if its actually configured otherwise func (a *AirbrakeHandler) ReportLogMessage acts as a noop.
@agbpatro agbpatro merged commit c4dbc6a into main Apr 5, 2024
5 checks passed
@agbpatro agbpatro deleted the add_airbrake_to_datastore branch April 5, 2024 21:49
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.

None yet

2 participants