-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions & Suggestions #3
Comments
Lovely, let me answer some things but keep in mind, the only reason I created the repo is to not to have to explain it every time and so I'm not that much into
About the suggestions:
|
And I have added an example for json with the disabled colors |
Regarding I might have missed it, but I didn't see any |
I'm updating that I have tried most of the code in the example and it gives me pretty much the same results that I got when using response.set_raw_header("request_id", request_id.0.to_string()); |
About the About the Edit: Just added it to the file |
Thanks for the reply. re 2nd point: I didn't really understand what are you trying to say. Is it a good thing to add |
ok, so for the first point. I'm not saying that numeros 2: |
When I send e.g. a GET request to the server I get a response. This activity is being logged by multiple entries (each with its own timestamp etc. like usually) because the log level is set to
But I don't see it appended in other log lines also related to the response such as those with:
or
|
The latter two are from within rocket, which doesn't support tracing |
hey; this is super interesting as I started looking into it two weeks ago and adopted a similar approach.
Minor stuff, but W3C says that tracing header should be "traceparent" https://www.w3.org/TR/trace-context/#header-name. I suppose it would be neat if we could suggest name of the header to use for span id. I am trying to make "Use 'tracing' library instead of 'log'" up to date with the master and see how that behaves. |
hey @dawid-nowak I'm currently busy studing some things, so I might have missed something out.
Are you talking about If you are trying to use tracing inside rocket instead of log, there's already a PR for that and we are working on a fork and will add that |
sure,
Both these points are relatively trivial, but as the project grows and more endpoints are added you will need to ensure that everybody follows the same convention. X-Requst-Id is commonly used, but with adoption of OpenTelemetry applications should really switch to "traceparent" HTTP header as per W3C. Not too mention that Zipkin headers are still very popular for tracing. |
Ok yeah, isn't really neat to have that I'm not really getting the point the point of correlating auth data with the request id within your route, but your point on implementation is right, so yes If you try to shrae conventions, maybe put up a crate on crates.io or via a git repository (if you are using it on on-prem systsems), that way you need to implement it once and use the code via a usual crate everwhere in your projects. I'm kinda new to that tracing thing, X-Request-Id doesn't really have to do with tracing per-se but is just a header set by loadbalancer like f5 to identify and track requests, just took it as an example to take that id as your application is probably hosted on some platform which provides one anyway, If you mind, do you have some lectures about that on your mind? |
no worries, these are mere suggestions |
That's not true, you can tell it to either skip some or all of the arguments using It's quite unfortunate that Rocket still doesn't have tracing support as this method isn't really tenable for anything other than small examples. For the small example in this repo it doesn't look that bad since it's 'just' three additional function calls in the function body, but that's only because the example isn't actually doing anything async. For real handlers where you have await points it gets very hairy because it is incorrect to hold a span entered across await points. Doing that will result in broken traces if the runtime switches to another task while the span is entered. That's why things like the |
Thanks for creating this repo, it is quite helpful!
Continuing the discussion from rwf2/Rocket#982 :
Questions
.local_cache()
in the response methods? As I understood, you can pass a new value and if there is, e.g., a request_id already that is there, it won't be created. Or I got this wrong?#[instrument]
macro with this instead of the explicitenter
anddrop
? (maybe I am wrong but I thought that the span is dropped automatically when the scope ends)filter_layer()
? (Rocket options likerocket::support=info
orhyper=off
), I didn't know you can do that.Suggestions
TracingSpan
include aname
field in it?new
orgenerate
method forRequestId
instead of calling itdefault
? Seems more intuitive to me.debug
log level but nottrace
? As I understand, yourdebug
level includes both.I had more questions, once I remember them I'll post it here.
Thank you very much!
The text was updated successfully, but these errors were encountered: