mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-20 22:05:42 +00:00
remove gum dependency on jaeger (#2106)
Co-authored-by: Marcin S <marcin@realemail.net>
This commit is contained in:
@@ -9,6 +9,5 @@ description = "Stick logs together with the TraceID as provided by tempo"
|
||||
[dependencies]
|
||||
coarsetime = "0.1.22"
|
||||
tracing = "0.1.35"
|
||||
jaeger = { package = "polkadot-node-jaeger" , path = "../jaeger" }
|
||||
gum-proc-macro = { package = "tracing-gum-proc-macro" , path = "proc-macro" }
|
||||
gum-proc-macro = { package = "tracing-gum-proc-macro", path = "proc-macro" }
|
||||
polkadot-primitives = { path = "../../primitives", features = ["std"] }
|
||||
|
||||
@@ -105,8 +105,23 @@
|
||||
|
||||
pub use tracing::{enabled, event, Level};
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use jaeger::hash_to_trace_identifier;
|
||||
// jaeger dependency
|
||||
|
||||
/// Alias for the 16 byte unique identifier used with jaeger.
|
||||
pub(crate) type TraceIdentifier = u128;
|
||||
|
||||
/// A helper to convert the hash to the fixed size representation
|
||||
/// needed for jaeger.
|
||||
#[inline]
|
||||
pub fn hash_to_trace_identifier(hash: Hash) -> TraceIdentifier {
|
||||
let mut buf = [0u8; 16];
|
||||
buf.copy_from_slice(&hash.as_ref()[0..16]);
|
||||
// The slice bytes are copied in reading order, so if interpreted
|
||||
// in string form by a human, that means lower indices have higher
|
||||
// values and hence corresponds to BIG endian ordering of the individual
|
||||
// bytes.
|
||||
u128::from_be_bytes(buf) as TraceIdentifier
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use polkadot_primitives::{CandidateHash, Hash};
|
||||
|
||||
Reference in New Issue
Block a user