Skip to content

Commit

Permalink
Revert "Revert "Das: Log account publickey (metaplex-foundation#87)" (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Acharya authored Jul 14, 2023
1 parent 47cda6b commit fde64fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 7 additions & 5 deletions nft_ingester/src/account_updates.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use std::{
sync::Arc,
};
use std::sync::Arc;

use crate::{
metric, metrics::capture_result,
program_transformers::ProgramTransformer, tasks::TaskData,
metric, metrics::capture_result, program_transformers::ProgramTransformer, tasks::TaskData,
};
use cadence_macros::{is_global_default_set, statsd_count, statsd_time};
use chrono::Utc;
Expand Down Expand Up @@ -91,6 +88,10 @@ async fn handle_account(manager: Arc<ProgramTransformer>, item: RecvData) -> Opt
"stream" => ACCOUNT_STREAM
);
}
let mut account = None;
if let Some(pubkey) = account_update.pubkey() {
account = Some(bs58::encode(pubkey.0.as_slice()).into_string());
}
let begin_processing = Instant::now();
let res = manager.handle_account_update(account_update).await;
ret_id = capture_result(
Expand All @@ -101,6 +102,7 @@ async fn handle_account(manager: Arc<ProgramTransformer>, item: RecvData) -> Opt
res,
begin_processing,
None,
account,
);
}
ret_id
Expand Down
9 changes: 8 additions & 1 deletion nft_ingester/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub fn capture_result(
res: Result<(), IngesterError>,
proc: Instant,
txn_sig: Option<&str>,
account: Option<String>,
) -> Option<String> {
let mut ret_id = None;
match res {
Expand Down Expand Up @@ -78,6 +79,8 @@ pub fn capture_result(
}
if let Some(sig) = txn_sig {
warn!("Error deserializing txn {}: {:?}", sig, e);
} else if let Some(account) = account {
warn!("Error deserializing account {}: {:?}", account, e);
} else {
warn!("{}", e);
}
Expand All @@ -89,6 +92,8 @@ pub fn capture_result(
}
if let Some(sig) = txn_sig {
warn!("Error parsing txn {}: {:?}", sig, e);
} else if let Some(account) = account {
warn!("Error parsing account {}: {:?}", account, e);
} else {
warn!("{}", e);
}
Expand All @@ -97,8 +102,10 @@ pub fn capture_result(
Err(err) => {
if let Some(sig) = txn_sig {
error!("Error handling update for txn {}: {:?}", sig, err);
} else if let Some(account) = account {
error!("Error handling update for account {}: {:?}", account, err);
} else {
error!("Error handling account update: {:?}", err);
error!("Error handling update: {:?}", err);
}
metric! {
statsd_count!("ingester.ingest_update_error", 1, label.0 => &label.1, "stream" => stream, "error" => "u");
Expand Down
1 change: 1 addition & 0 deletions nft_ingester/src/transaction_notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ async fn handle_transaction(manager: Arc<ProgramTransformer>, item: RecvData) ->
res,
begin,
tx.signature(),
None,
);
}
ret_id
Expand Down

0 comments on commit fde64fb

Please sign in to comment.