-
Notifications
You must be signed in to change notification settings - Fork 11
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
Bridge: Improved observability for our bridges #874
Comments
Update: The bridge outputs human-readable logs and tracks only a few events that happen and acts upon them. My current focus is to come up with an efficient schema for the logs and categorize them as well. |
Update: Please note that the merge will be blocked due to a small change required in Tfchain minting events. An issue will be opened for it. The logs below is Outdated: before:
after: [
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event": {
"bridge_account": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"horizon_url": "https://horizon-testnet.stellar.org/",
"cursor": "9742459001114624"
},
"event_type": "transactions_fetched",
"count": 1,
"time": "2023-10-30T11:37:12+02:00",
"message": "stellar transactions fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"span_id": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"event_type": "payment_received",
"event": {
"_links": {
"self": {
"href": "https://horizon-testnet.stellar.org/operations/9742940037459969"
},
"transaction": {
"href": "https://horizon-testnet.stellar.org/transactions/3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9"
},
"effects": {
"href": "https://horizon-testnet.stellar.org/operations/9742940037459969/effects"
},
"succeeds": {
"href": "https://horizon-testnet.stellar.org/effects?order=desc&cursor=9742940037459969"
},
"precedes": {
"href": "https://horizon-testnet.stellar.org/effects?order=asc&cursor=9742940037459969"
}
},
"id": "9742940037459969",
"paging_token": "9742940037459969",
"transaction_successful": true,
"source_account": "GD4MUF7FTWOGNREGKMQWC3NOJGBNASEFNEOUJTLNW4FDONV5CEUTGKS4",
"type": "payment",
"type_i": 1,
"created_at": "2023-10-30T09:37:05Z",
"transaction_hash": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"asset_type": "credit_alphanum4",
"asset_code": "TFT",
"asset_issuer": "GA47YZA3PKFUZMPLQ3B5F2E3CJIB57TGGU7SPCQT2WAEYKN766PWIMB3",
"from": "GD4MUF7FTWOGNREGKMQWC3NOJGBNASEFNEOUJTLNW4FDONV5CEUTGKS4",
"to": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"amount": "50.0000000"
},
"time": "2023-10-30T11:37:12+02:00",
"message": "a payment received on bridge stellar account"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"span_id": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"event_type": "transfer_initiated",
"event": {
"type": "deposit"
},
"time": "2023-10-30T11:37:12+02:00",
"message": "transfer with id 3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9 initiated"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event": {
"bridge_account": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"horizon_url": "https://horizon-testnet.stellar.org/",
"cursor": "9742940037459968"
},
"event_type": "transactions_fetched",
"count": 0,
"time": "2023-10-30T11:37:12+02:00",
"message": "stellar transactions fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event_type": "block_events_fetched",
"event": {
"height": 17637
},
"time": "2023-10-30T11:37:13+02:00",
"message": "tfchain events fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"span_id": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"event_type": "refund_proposed",
"event": {
"reason": "memo is not formatted correctly"
},
"time": "2023-10-30T11:37:18+02:00",
"message": "refund initiated due to memo is not formatted correctly"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event_type": "block_events_fetched",
"event": {
"height": 17638
},
"time": "2023-10-30T11:37:19+02:00",
"message": "tfchain events fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event": {
"bridge_account": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"horizon_url": "https://horizon-testnet.stellar.org/",
"cursor": "9742940037459968"
},
"event_type": "transactions_fetched",
"count": 0,
"time": "2023-10-30T11:37:22+02:00",
"message": "stellar transactions fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event_type": "block_events_fetched",
"event": {
"height": 17639
},
"time": "2023-10-30T11:37:26+02:00",
"message": "tfchain events fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event_type": "block_events_fetched",
"event": {
"height": 17640
},
"time": "2023-10-30T11:37:32+02:00",
"message": "tfchain events fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event_type": "event_refund_tx_ready_received",
"span_id": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"time": "2023-10-30T11:37:32+02:00",
"message": "found refund transaction ready event"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"event": {
"bridge_account": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"horizon_url": "https://horizon-testnet.stellar.org/",
"cursor": "9742940037459968"
},
"event_type": "transactions_fetched",
"count": 0,
"time": "2023-10-30T11:37:33+02:00",
"message": "stellar transactions fetched"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"span_id": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"event_type": "refund_completed",
"time": "2023-10-30T11:37:36+02:00",
"message": "refund processed"
},
{
"level": "info",
"version": 1,
"source": {
"Instance_public_key": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Bridge_wallet_address": "GBD3PXJEQOCQ5VR2JSMFNXYBBQF5RDEZP5GMTXDYZWMNZQJHR6HFX3AJ",
"Stellar_network": "testnet",
"Tfchain_url": "ws://localhost:9944"
},
"span_id": "3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9",
"event_type": "transfer_completed",
"event": {
"outcome": "refunded"
},
"time": "2023-10-30T11:37:36+02:00",
"message": "transfer with id 3c88c4ca5144cee37a1d2a6a4f2bf5c874adb74f1f85bee1b84d3dbd86e81fd9 completed"
}
] |
Update: With the aim of improving observability and the ability to perform tracing on cross-chain transfers, I designed an event schema for the bridge and included its documentation here: https://github.com/threefoldtech/tfchain/blob/development-feat-structured-logging/bridge/docs/observability.md I also finished instrumenting the bridge source code and the PR is ready for review but is currently blocked on #882. |
The text was updated successfully, but these errors were encountered: