Replies: 1 comment 4 replies
-
@DavidSouther Did you ever come up with an example for this? I feel like you did but I don't recall. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As far as I can tell there are no xray examples in the examples folder.
For context I'm trying to build a Axum X-Ray middleware to be able to trace incoming request.
This is what I've done so far.
Set up client:
and according to the docs I should use builders to create documents and then finally call the relevant method on the client like so:
However, what I fail to understand is what builders are required to use in between. My best bet is a combination of
types::builders
andoperation::put_trace_segments::builders
.Some types that seems relevant:
types::builders::HttpBuilder
: capture information about http requeststypes::builders::SegmentBuilder
: however, it seems very limiting in what data you can add to it. E.g. no start- and end-time. It takesdocuments
which are something that turns into String. What is this used for?types::builders::TraceBuilder
: this builder creates aTrace
and you can set a duration along withSegment
s, but not start- and end-time here eithertypes::builders::TraceSummaryBuilder
: This builder seems to capable of registering many aspects, e.g. theHttp
type can be included here, and annotations can be added as well.Also I fail to understand how to create a root and sub segments. The type descriptions are also a bit confusing to me.
Segment
description is worded in away that is mainly used for reading from the api:This leads me to think that I don't use
Segment
when tracing.Fail to see the point of Trace and Segment and also the point of setting duration, when it could be calculated by start and end time? Is it because you don't always have an end time so duration would be now - start?
Disclaimer, I may lack some basic tracing knowledge.
Beta Was this translation helpful? Give feedback.
All reactions