Skip to content

Commit c0139fa

Browse files
committed
otel transactions
1 parent 248e62f commit c0139fa

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

core/transactions/atr_cleanup_entry.cxx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ atr_cleanup_entry::atr_cleanup_entry(const std::shared_ptr<attempt_context>& ctx
9696
void
9797
atr_cleanup_entry::clean(transactions_cleanup_attempt* result)
9898
{
99-
CB_ATTEMPT_CLEANUP_LOG_TRACE("cleaning {}", *this);
99+
CB_LOG_TRACE("cleaning {cleanup_entry_ptr}",
100+
opentelemetry::common::MakeAttributes({
101+
{ "subsystem", "transactions_cleanup" },
102+
{ "cleanup_entry_ptr", fmt::format("{}", *this) },
103+
}));
100104
// get atr entry if needed
101105
const atr_entry entry;
102106
if (nullptr == atr_entry_) {
@@ -110,10 +114,18 @@ atr_cleanup_entry::clean(transactions_cleanup_attempt* result)
110114
atr_entry_ = &(*it);
111115
return check_atr_and_cleanup(result);
112116
}
113-
CB_ATTEMPT_CLEANUP_LOG_TRACE("could not find attempt {}, nothing to clean", attempt_id_);
117+
CB_LOG_TRACE("could not find attempt {attempt_id}, nothing to clean",
118+
opentelemetry::common::MakeAttributes({
119+
{ "subsystem", "transactions_cleanup" },
120+
{ "attempt_id", attempt_id_ },
121+
}));
114122
return;
115123
}
116-
CB_ATTEMPT_CLEANUP_LOG_TRACE("could not find atr {}, nothing to clean", atr_id_);
124+
CB_LOG_TRACE("could not find atr {attempt_id}, nothing to clean",
125+
opentelemetry::common::MakeAttributes({
126+
{ "subsystem", "transactions_cleanup" },
127+
{ "attempt_id", attempt_id_ },
128+
}));
117129
return;
118130
}
119131
check_atr_and_cleanup(result);
@@ -173,8 +185,11 @@ atr_cleanup_entry::cleanup_docs(durability_level dl)
173185
remove_txn_links(atr_entry_->removed_ids(), dl);
174186
break;
175187
default:
176-
CB_ATTEMPT_CLEANUP_LOG_TRACE("attempt in {}, nothing to do in cleanup_docs",
177-
attempt_state_name(atr_entry_->state()));
188+
CB_LOG_TRACE("attempt in {state}, nothing to do in cleanup_docs",
189+
opentelemetry::common::MakeAttributes({
190+
{ "subsystem", "transactions_cleanup" },
191+
{ "state", attempt_state_name(atr_entry_->state()) },
192+
}));
178193
}
179194
}
180195

0 commit comments

Comments
 (0)