pub struct Telemetry {
pub test_id: String,
pub spans: Vec<Span>,
pub logs: Vec<Log>,
pub strays: Vec<Span>,
pub recording: String,
}Expand description
Spans and logs recorded by the test session for a single system test.
Fields§
§test_id: StringUnique identifier for the test.
spans: Vec<Span>All spans triggered by the test, ordered by start time, including the test’s trace and any Pub/Sub message delivery traces.
logs: Vec<Log>Log lines and captured request events from those traces, ordered by timestamp.
strays: Vec<Span>Inter-service requests observed while the test ran that carried neither a test ID nor a parent trace. When a service drops request context on an outgoing call, downstream work loses test attribution and runs against shared data. Stray spans may belong to this test or to a concurrent test.
recording: StringPath to the HTML browser replay recording written when the test ends, or empty if recording is disabled.
Implementations§
Source§impl Telemetry
impl Telemetry
Sourcepub fn decode(
test_id: &str,
spans: &[u8],
logs: &[u8],
own: Option<OwnSpan<'_>>,
) -> Result<Telemetry, Error>
pub fn decode( test_id: &str, spans: &[u8], logs: &[u8], own: Option<OwnSpan<'_>>, ) -> Result<Telemetry, Error>
Reads what the session answered a telemetry request with: spans,
an encoded ExportTraceServiceRequest, and logs, an encoded
ExportLogsServiceRequest. own is the test’s span, added where
the session does not have it.
Sourcepub fn requests(&self) -> Requests<'_> ⓘ
pub fn requests(&self) -> Requests<'_> ⓘ
The requests services were handed, and gateways took, in order.
Narrowed by Requests::service, Requests::endpoint and
Requests::caller:
assert_eq!(recorded.requests().service("catalog").caller("test").count(), 1);Sourcepub fn queries(&self) -> Queries<'_> ⓘ
pub fn queries(&self) -> Queries<'_> ⓘ
The queries run on the app’s databases, in order. Narrowed by
Queries::database.
Sourcepub fn publishes(&self) -> Publishes<'_> ⓘ
pub fn publishes(&self) -> Publishes<'_> ⓘ
The messages published, in order. Narrowed by Publishes::topic.
Sourcepub fn deliveries(&self) -> Deliveries<'_> ⓘ
pub fn deliveries(&self) -> Deliveries<'_> ⓘ
The deliveries of messages to subscriptions, an attempt each, in
order. Narrowed by Deliveries::topic and
Deliveries::subscription.
Sourcepub fn errors(&self) -> Vec<String>
pub fn errors(&self) -> Vec<String>
What went wrong in what the test caused, a line each: requests answered with a server error, spans that failed, deliveries the handler did not handle, calls between services that lost their request’s context, and lines logged as errors.
Sourcepub fn lost_context(&self) -> Vec<LostContext>
pub fn lost_context(&self) -> Vec<LostContext>
The calls between services that lost their request’s context, and
with it the test: those in the test’s own traces
(of_test), which a service made for the
test, then those that are only known to have been made while it ran
(strays), each kind of call once.
What a service does for a call that carries no test it does on the data the services share: a test that finds its own data without what it expected finds why here.
Sourcepub fn with_strays(self, strays: &[u8]) -> Telemetry
pub fn with_strays(self, strays: &[u8]) -> Telemetry
With the spans of the calls that carried no test while the test ran,
as the session answers them: an encoded OTLP
ExportTraceServiceRequest. What cannot be read is none.
Sourcepub fn with_recording(self, recording: String) -> Telemetry
pub fn with_recording(self, recording: String) -> Telemetry
With where the recording of the test’s browser will be, as the session answers it: empty for a test with none.
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
What the test caused, as a tree: each request and what the service
did for it, then each delivery, with statuses and how long each
took. Under it, the calls between services that lost the test
(lost_context). What a failed test prints.
Trait Implementations§
Source§impl Serialize for Telemetry
impl Serialize for Telemetry
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for Telemetry
impl Freeze for Telemetrywhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Span>: Freeze,
PhantomData<Log>: Freeze,
impl Move for Telemetry
impl RefUnwindSafe for Telemetry
impl Send for Telemetry
impl Sync for Telemetry
impl Unpin for Telemetry
impl UnsafeUnpin for Telemetrywhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Span>: UnsafeUnpin,
PhantomData<Log>: UnsafeUnpin,
impl UnwindSafe for Telemetry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request