Skip to content

Commit a159099

Browse files
committed
add more instruments
1 parent 220db0b commit a159099

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

src/agent/pyth/rpc/get_all_products.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use {
22
crate::agent::state,
33
anyhow::Result,
4+
tracing::instrument,
45
};
56

7+
#[instrument(skip_all)]
68
pub async fn get_all_products<S>(state: &S) -> Result<serde_json::Value>
79
where
810
S: state::Prices,

src/agent/pyth/rpc/get_product.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ use {
1212
Request,
1313
Value,
1414
},
15+
tracing::instrument,
1516
};
1617

18+
#[instrument(skip_all, fields(account))]
1719
pub async fn get_product<S>(
1820
state: &S,
1921
request: &Request<Method, Value>,
@@ -27,6 +29,8 @@ where
2729
}?;
2830

2931
let account = params.account.parse::<solana_sdk::pubkey::Pubkey>()?;
32+
tracing::Span::current().record("account", account.to_string());
33+
3034
let product = state.get_product(&account).await?;
3135
Ok(serde_json::to_value(product)?)
3236
}

src/agent/pyth/rpc/get_product_list.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use {
22
crate::agent::state,
33
anyhow::Result,
4+
tracing::instrument,
45
};
56

7+
#[instrument(skip_all)]
68
pub async fn get_product_list<S>(state: &S) -> Result<serde_json::Value>
79
where
810
S: state::Prices,

src/agent/pyth/rpc/subscribe_price.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ use {
1515
Value,
1616
},
1717
tokio::sync::mpsc,
18+
tracing::instrument,
1819
};
1920

21+
#[instrument(skip_all, fields(account))]
2022
pub async fn subscribe_price<S>(
2123
state: &S,
2224
notify_price_tx: &mpsc::Sender<NotifyPrice>,
@@ -33,6 +35,8 @@ where
3335
)?;
3436

3537
let account = params.account.parse::<solana_sdk::pubkey::Pubkey>()?;
38+
tracing::Span::current().record("account", account.to_string());
39+
3640
let subscription = state
3741
.subscribe_price(&account, notify_price_tx.clone())
3842
.await;

src/agent/pyth/rpc/subscribe_price_sched.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ use {
1515
Value,
1616
},
1717
tokio::sync::mpsc,
18+
tracing::instrument,
1819
};
1920

21+
#[instrument(skip_all, fields(account))]
2022
pub async fn subscribe_price_sched<S>(
2123
state: &S,
2224
notify_price_sched_tx: &mpsc::Sender<NotifyPriceSched>,
@@ -33,6 +35,8 @@ where
3335
)?;
3436

3537
let account = params.account.parse::<solana_sdk::pubkey::Pubkey>()?;
38+
tracing::Span::current().record("account", account.to_string());
39+
3640
let subscription = state
3741
.subscribe_price_sched(&account, notify_price_sched_tx.clone())
3842
.await;

0 commit comments

Comments
 (0)