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

[EPIC] All CDK Connectors emit AirbyteTraceMessage when something goes wrong #12322

Closed
4 tasks done
Tracked by #12118
evantahler opened this issue Apr 25, 2022 · 3 comments
Closed
4 tasks done
Tracked by #12118
Assignees

Comments

@evantahler
Copy link
Contributor

evantahler commented Apr 25, 2022

Using AirbyteTraceMessage will set failure_reason metadata automagically. This replaces the current failure behavior of logging and throwing when something goes wrong. This story is to update the CDK as naively as possible such that any crash produces a log message in the right format before existing. e.g. this would be wrapping the calls to read() and write() in a try/catch.

Relevant Spec: https://docs.google.com/document/d/1ctrj3Yh_GjtQ93aND-WH3ocqGxsmxyC3jfiarrF6NY0/edit#

Class AirbyteLoggedException () {
  constructor(e:Error, display_message:string, failureType=ENUM<failure_types>=”system_error”) {
    log(new AirbyteLogMessage(e, level)) ;   
    log(new AirbyteTraceMessage(type=”error”, display_message, internalMessage=e, stack_trace=e.stack, failureType)) ;
    process.exit(1)
  }
}

// usage

try {
  await read(config, configured_catalog);
} catch (error) {
  throw AirbyteLoggedException(error, ‘could not connect to API, check your password’, “user_error”);
}

Which produces:

 AirbyteTraceMessage:
    type: error_status
    emitted_at: 123456
    error_status: 
        message: Cannot connect to postgres.  Check your credentials
        internal_message: JDBC Error - ssl cert invalid
        stack_trace: JDBC Error - ssl cert invalid (line 101)\nfrom connect() on line 101\nfrom read() on line 202
        failure_type: config_error

CDKs


SAT Ideas:

  • All connectors have an invalid config file - so, if you run a sync with the invalid config file, an AirbyteTraceMessage should be emitted
@evantahler evantahler changed the title [EPIC] All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong - which will set failureReason metadata properly [EPIC] All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong Apr 25, 2022
@evantahler evantahler changed the title [EPIC] All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong Apr 25, 2022
@evantahler evantahler changed the title All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong [EPIC] All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong Apr 25, 2022
@evantahler
Copy link
Contributor Author

This story is naïve by design in this first pass so what we can have filled-out failureReasons to work with. Future stories will work within each connector to produce better and more meaningful failure reasons.

@evantahler evantahler changed the title [EPIC] All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong Apr 27, 2022
@evantahler evantahler removed the Epic label Apr 27, 2022
@evantahler evantahler changed the title All GA Connectors emit AirbyteLogMessage with a human-readable message when something goes wrong All GA Connectors emit AirbyteTraceMessage with a human-readable message when something goes wrong Apr 28, 2022
@evantahler evantahler changed the title All GA Connectors emit AirbyteTraceMessage with a human-readable message when something goes wrong All GA Connectors emit AirbyteTraceMessage when something goes wrong Apr 28, 2022
@evantahler evantahler changed the title All GA Connectors emit AirbyteTraceMessage when something goes wrong All GA Connectors emit AirbyteTraceMessage when something goes wrong Apr 28, 2022
@evantahler evantahler changed the title All GA Connectors emit AirbyteTraceMessage when something goes wrong All GA Connectors emit AirbyteTraceMessage when something goes wrong Apr 28, 2022
@sherifnada
Copy link
Contributor

note for implementer: we need to first publish the protocol / java/ python generated files to unblock this ticket. It's a small part of #12161

@sherifnada sherifnada changed the title All GA Connectors emit AirbyteTraceMessage when something goes wrong All CDK Connectors emit AirbyteTraceMessage when something goes wrong Apr 28, 2022
@evantahler evantahler removed their assignment Apr 28, 2022
@Phlair
Copy link
Contributor

Phlair commented Apr 29, 2022

@evantahler evantahler changed the title All CDK Connectors emit AirbyteTraceMessage when something goes wrong [EPIC] All CDK Connectors emit AirbyteTraceMessage when something goes wrong May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants