Transaction Reports

Finding a Transaction

If you do not have the transaction ID for a transaction you can find a transaction using various sync-manager endpoints.

You can use the /activeTransactions or /inactiveTransactions to get the list of transactions that are either currently running and active or finished and inactive.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/activeTransactions'
curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/inactiveTransactions'

Transaction Report

You can get reports for multiple transactions by calling the /report. This will return multiple transactions based on the parameters set. If you want to view a report for a specific transaction you should find the start time of the transaction and set it as part of the parameters.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/report?start={{startTime}}&end={{endTime}}&limit=100&detailLimit=100'

This will show the details of the transaction and any additional details in the report.

Note:

  • When using time ranges across days, you will need to use multiple requests. At least 1 request per day.

  • Depending on the amount of content being synced or the number of syncs happening, there could be a large amount of data to be queried. You may want to make use of the limits or a smaller time range. Otherwise the request could be incredibly large.

You can also get details for a specific transaction by using the /transactions/{{transaction-id}} endpoint.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/transactions/{{transaction-id}}'

This will show the details of the transaction as well additional information for the transaction.

Diff Report

To get a diff report you will need to use both the kal-el and diffinator API.

A diff report can only be gotten if the transaction is finished. You can use the /transactions/{{transaction-id}} endpoint to check if the transaction is active or not before attempting to get a diff report.

Kal-El

Getting the Endpoints

To get a diff report you first need to call the /diff/{{transaction-id}} endpoint to find the endpoints involved with the diff report.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/kal-el/diff/{{transaction-id}}'

This will return all the endpoints related to the transaction that can be used to find a diff.

Building the Diff

Once you know the endpoints that can be diffed for a transaction, you can use the /diff/{{transaction-id}}/{{endpoint1Id}}/{{endpoint2Id}} endpoint to build the diff report of content.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/kal-el/diff/{{transaction-id}}/{{endpoint1Id}}/{{endpoint2Id}}'

The response is based as endpoint1Id as the "left" of the diff and endpoint2Id as the "right" of the diff.

The response will include an array of diffs for the transaction. Each diff will have a few pieces of information.

  • Content ids from both endpoints

  • The motation id for the old content and what it updated to

  • The first field for the content

  • The diff type

There is also the total number of diffs for the transaction.

This will give you a general sense of what content is new, or updated. As well as what content is missing from endpoint 1.

Diffinator

To get the actual diff of the content fields you need to use the diffinator API. You will need to perform the steps in "List Diff Fields" before the steps in "Get Field Diff".

Diffs are built using data stored in motation. The diffinator stores it's diff data into diesel. The diffinator builds a diff based on the value of fields. Meaning the name of a field is not diffed.

List Diff Fields

To know what fields have a diff you can use the diffinator's /diff/{{motation1Id}}/{{motation2Id}} endpoint. This will return a list of fields that have a diff.

The motation IDs can be gotten from the response of the kal-el /diff/{{transaction-id}}/{{endpoint1Id}}/{{endpoint2Id}} endpoint above.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/diffinator/diff/{{motation1Id}}/{{motation2Id}}'

The response is based as motation1Id as the "left" of the diff and motation2Id as the "right" of the diff.

The response will list all the fields with a diff that can be used in the next API. These fields can be used in the next API call.

Get Field Diff

To view the actual diff of a field's content, you can use the diffinator's /diff/{{motation1Id}}/{{motation2Id}}/{{field}} endpoint. This will return the diff of the fields prepended with either a '-' or '+' for removed or added data.

This endpoint will only work after the previous step has been performed. As such, these motation IDs should be the same as used in the above API. The field is gotten from the above API call's response.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/diffinator/diff/{{motation1Id}}/{{motation2Id}}/{{field}}'

The response will return the differences between the two contents for the specific field. It will look akin to this.

-sync1
+sync1 - updated

Heartbeats

With a transaction ID you can get the heartbeats of the transaction to see more details on where the transaction is in the sync process.

Heartbeats

To view the heartbeats of a transaction use sync-manager's /transactions/{{transactionId}}/heartbeats endpoint.

You can use time stamps to filter what heartbeats to view as well as how many to view.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/transactions/{{transactionId}}/heartbeats?start={{startTime}}&end={{endTime}}&limit={{limit}}'

Pulses

To view the pulses from other services for a transaction use sync-manager's /transactions/{{transactionId}}/heartbeats/pulses endpoint.

You can use time stamps to filter what pulses to view as well as how many to view.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/transactions/{{transactionId}}/heartbeats/pulses?start={{startTime}}&end={{endTime}}&limit={{limit}}'

Running Heartbeats

To view the currently running heartbeats for a transaction use sync-manager's /transactions/{{transactionId}}/heartbeats/running endpoint.

You can use time stamps to filter what heartbeats to view as well as how many to view.

curl --request GET '{{impulse-protocol}}://{{impulse-domain}}:{{impulse-port}}/private/sync-manager/transactions/aee621f7-e68b-11ec-b2dd-0242ac190013/heartbeats/running?start={{startTime}}&end={{endTime}}&limit={{limit}}'

Last updated