-
Notifications
You must be signed in to change notification settings - Fork 278
tracing sdk operations #1615
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
Comments
One friction point in an external implementation of HttpClient: try_from_method is not exposed, along with to_headers and try_from_status. If those were From / TryFrom implementations, that would expose them quite cleanly, I think. |
... and PinnedStream is private |
As a comparison point, the google rust sdk explicitly uses request-middleware : https://github.com/yoshidan/google-cloud-rust/tree/main/storage#passing-a-custom-reqwest-middleware-cliemt |
Thank you for your report. Since we are working on official, supported crates and have no plans to release further versions of the previously unsupported crates, we have decided to close this issue. Some older issues were migrated to the new crates if they seemed relevant. If you feel that this issue was relevant even to newer code that has been or will be rewritten, please reopen and comment as to why you consider it relevant. |
@weshaggard why can't users - especially those who opened the issue - reopen? They've always been able to prior. @rbtcollins this was flagged as "previous versions" because it was opened against our unsupported, unofficial crates. This was called out in the root README.md. They were never supported, nor will they ever be. We have started almost complete fresh with official crates, such as But implementing an azure-sdk-for-rust/sdk/typespec/typespec_client_core/src/http/policies/custom_headers.rs Line 28 in b4307af
ClientOptions that each HTTP client takes.
But tracing in the official, supported crates is ongoing. We already have issues opened and will get to them soon. We're currently discussing whether we'll even using the Since we already have issues tracking telemetry e.g., #1881, I don't see a need to reopen this one, but I did open #2378 to track adding a pipeline policy example or two. |
@heaths thank you! If I understand correctly, the new crates are in this same repository? If I interpret what you say, you're saying the recommended path is the one from my last paragraph ? (
) Thank you for opening the new bug! |
Yes, you just need to implement let my_http_client = new_my_http_client(); // assumes returns an Arc<dyn HttpClient>
let mut options = SecretClientOptions::default();
options.client_options.transport = Some(TransportOptions::new(my_http_client.clone());
let client = SecretClient::new("https://my-vault.vault.azure.net", credential.clone(), Some(options)); |
I'm happy to put up a patch for this, but thought it should be discussed first.
The problem to be solved is getting visibility into HTTP requests made by the azure SDK.
The obvious thing to do is add a dependency on tracing, and call #[tracing::instrument] on
execute_request
. Perhaps with skip_all as a parameter, to avoid logging the request.However this isn't particularly great for being able to categorise things, and it won't use standard otel metadata nor the http status etc, unless more work is done.
We use https://crates.io/crates/reqwest-tracing to do 2 things:
add a span with otel standard metadata to each request
trigger otel trace propogation to the next service.
is probably less relevant to azure (unless azure has a service like AWS X-Ray, where customer traces can integrate deeply) ? However the DisableOtelPropagation extension can be used to disable that.
But 1) is really quite nice - and it means less to maintain.
An alternative approach would be to just implement HTTPClient on a newtype wrapper of ReqwestMiddlewareClient myself - which I haven't tested yet - but that would need a way of injecting that into the various factories like DefaultAzureCredentialBuilder to keep ergnomics nice, and is going to require keeping the implementation in sync with the reqwest one in the sdk
The text was updated successfully, but these errors were encountered: