Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

[ENG-108] Epic: Developer Sync Run logs #18

Closed
tomkit opened this issue Feb 1, 2023 · 1 comment
Closed

[ENG-108] Epic: Developer Sync Run logs #18

tomkit opened this issue Feb 1, 2023 · 1 comment
Assignees

Comments

@tomkit
Copy link
Contributor

tomkit commented Feb 1, 2023

From SyncLinear.com | ENG-108

@lucasmarshall lucasmarshall self-assigned this Feb 2, 2023
@lucasmarshall
Copy link
Contributor

lucasmarshall commented Feb 9, 2023

This is now available on main, to be included in the 0.2.0 release:

supaglue syncs logs

You can list all logs in the system using the supaglue syncs logs command. The output is ndjson, with the following fields:

  • timestamp: an ISO 8601 UTC datetime specifying when the sync was run
  • syncConfigName: the sync config name for the sync
  • customerId: the ID of the customer the sync is running for
  • status: either "success" on successful sync or "error" if an error occurred, and
  • errorMessage: if there was an error, what the error message was
$ supaglue syncs logs
{"timestamp":"2023-02-09T18:15:24.027Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T18:15:24.021Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T18:00:00.360Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T18:00:00.348Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T02:00:00.337Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T02:00:00.311Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:45:00.229Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:45:00.220Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:30:00.275Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:30:00.260Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:15:00.260Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:15:00.188Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:45:00.350Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:45:00.194Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:30:00.281Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:30:00.270Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:15:00.266Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:15:00.252Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:00:00.296Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T23:00:00.286Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T22:45:00.273Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T22:45:00.263Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T22:30:00.231Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T22:30:00.227Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T21:00:21.022Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T21:00:21.015Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T20:45:00.378Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T20:45:00.203Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T19:45:00.224Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T19:45:00.218Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T19:30:00.543Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T19:30:00.220Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T19:15:00.198Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T19:15:00.191Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:45:00.252Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:45:00.247Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:30:00.320Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:30:00.298Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:15:00.320Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:15:00.313Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:00:00.697Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T18:00:00.684Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:45:00.280Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:45:00.276Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:30:00.263Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:30:00.259Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:15:00.252Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:15:00.239Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-08T00:00:00.287Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-07T23:45:00.278Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-07T22:09:11.879Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-07T22:09:06.781Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-07T21:28:11.932Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:39:13.152Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:37:17.238Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:36:51.217Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:36:11.809Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:32:40.640Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:30:24.444Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:29:40.444Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:22:21.292Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:20:47.008Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}

Since by default this outputs all logs, you probably want to limit it a bit. You can limit the number of log lines that are output via the (--limit) flag:

$ supaglue syncs logs --limit 10
{"timestamp":"2023-02-09T18:15:24.027Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T18:15:24.021Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T18:00:00.360Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T18:00:00.348Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T02:00:00.337Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T02:00:00.311Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:45:00.229Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:45:00.220Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:30:00.275Z","syncConfigName":"Opportunities","customerId":"user1","status":"success"}
{"timestamp":"2023-02-09T00:30:00.260Z","syncConfigName":"Contacts","customerId":"user1","status":"success"}

Logs also can be filtered using flags to show only logs from a particular customer ID (--customer-id), status (--status), sync config name (--sync-config-name), or any combination of these flags (including --limit)

$ yarn supaglue syncs logs --status error --limit 5
{"timestamp":"2023-02-07T21:28:11.932Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:39:13.152Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:37:17.238Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:36:51.217Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}
{"timestamp":"2023-02-07T20:36:11.809Z","syncConfigName":"Contacts","customerId":"user1","status":"error","errorMessage":"Sample error"}

supaglue syncs resume

If you determine that what caused a customer's sync to fail has been resolved, you can manually resume the sync via the supaglue syncs resume command. This command requires two flags:

  • --customer-id: used to specify which of your customer to resume a sync for, and
  • --sync-config-name: used to specify which of the cutomer's syncs to resume
$ supaglue syncs resume --customer-id user1 --sync-config-name Opportunities
ℹ Info: Sync Opportunities for customer user1 resumed

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

No branches or pull requests

2 participants