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

JobErrorReporter: Report connector_command tag for errors encountered during sync #15925

Merged
merged 8 commits into from
Aug 26, 2022

Conversation

pedroslopez
Copy link
Contributor

@pedroslopez pedroslopez commented Aug 24, 2022

What

fixes #15680

We had been reporting the connector_command tag for synchronous jobs (check, spec, discover) but not for errors encountered during the sync process (check (before sync), read, write)

How

Moves the connector command tag to being set as metadata on the FailureReason instead of directly when reporting to sentry. This is because we're reporting all sync errors from a single spot where we didn't have info whether this came from check-before-sync, reading or writing.

The FailureHelper is now in charge of setting this metadata, just like it had been doing with from_trace_message. The JobErrorReporter now grabs this information from the failure reason. I also added some more testing around the FailureHelper since it was a bit lacking.

While I was in here, I also added the workspace_url as a tag since the synchronous commands did not run in the context of a connection, so there was no url being set for them.

@github-actions github-actions bot added area/platform issues related to the platform area/scheduler area/worker Related to worker labels Aug 24, 2022
@pedroslopez pedroslopez changed the title Pedroslopez/sentry cmd tag Report connector_command tag for errors encountered during sync Aug 24, 2022
@pedroslopez pedroslopez changed the title Report connector_command tag for errors encountered during sync JobErrorReporter: Report connector_command tag for errors encountered during sync Aug 24, 2022
Comment on lines +28 to +32
SPEC("spec"),
CHECK("check"),
DISCOVER("discover"),
WRITE("write"),
READ("read");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting a string value for these to keep reporting the existing tags the same way to sentry (check, spec, discover)

Copy link
Contributor

Choose a reason for hiding this comment

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

Could add another command for normalize and set that appropriately for the normalizationFailure cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I intended connector_command to map directly to commands that are run against the connectors according to the protocol in order to differentiate more between failures that have an origin of Source or Destination - I think in the case of normalization since the FailureOrigin is always Normalization this shouldn't be necessary (and normalize isn't a real connector command)

Comment on lines -121 to -145
Map.of(
JOB_ID_KEY, jobContext.jobId().toString(),
CONNECTOR_COMMAND_META_KEY, "check"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Connector command will now be already set on the FailureReason as metadata, so don't need to set it here when reporting the error

@pedroslopez pedroslopez temporarily deployed to more-secrets August 24, 2022 15:48 Inactive
@pedroslopez pedroslopez temporarily deployed to more-secrets August 24, 2022 17:31 Inactive
Comment on lines +224 to +225
Map.entry(WORKSPACE_ID_META_KEY, workspaceId.toString()),
Map.entry(WORKSPACE_URL_META_KEY, workspaceUrl));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This wasn't in scope on the original issue, but added this here quickly since we're not getting any urls for synchronous job errors (due to them not being encountered in the context of a connection)

Copy link
Contributor

@Phlair Phlair left a comment

Choose a reason for hiding this comment

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

approving to avoid blocking, looks mostly good.

Could do with adding normalize command (now that the normalization integration has been merged to master)

Comment on lines +28 to +32
SPEC("spec"),
CHECK("check"),
DISCOVER("discover"),
WRITE("write"),
READ("read");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could add another command for normalize and set that appropriately for the normalizationFailure cases.

@pedroslopez pedroslopez temporarily deployed to more-secrets August 25, 2022 20:06 Inactive
@pedroslopez pedroslopez temporarily deployed to more-secrets August 25, 2022 22:50 Inactive
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

nice!

@pedroslopez pedroslopez temporarily deployed to more-secrets August 26, 2022 01:42 Inactive
@pedroslopez pedroslopez merged commit 07bfe05 into master Aug 26, 2022
@pedroslopez pedroslopez deleted the pedroslopez/sentry-cmd-tag branch August 26, 2022 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/scheduler area/worker Related to worker team/extensibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JobErrorReporter: Report connector_command tag for errors encountered during sync
3 participants