docs: add guides for occ, configure_client, and troubleshooting#5441
docs: add guides for occ, configure_client, and troubleshooting#5441bshaffer wants to merge 7 commits intogoogleapis:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5441 +/- ##
=======================================
Coverage 97.73% 97.73%
=======================================
Files 217 217
Lines 48177 48177
=======================================
Hits 47087 47087
Misses 1090 1090 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The The formatting error is more complicated: Maybe we need to update |
dbolduc
left a comment
There was a problem hiding this comment.
I only looked at the proxy section
|
|
||
| ### Proxy with gRPC | ||
|
|
||
| When using the gRPC transport (standard for most services), the client library |
There was a problem hiding this comment.
Nope, they almost all use REST.
| .build()?; | ||
|
|
||
| let config = ClientConfig::default() | ||
| .with_http_client(http_client); |
There was a problem hiding this comment.
This is not an API.
Which is why we compile our sample code.
coryan
left a comment
There was a problem hiding this comment.
Just some drive-by comments.
| If you are using a client that wraps the gRPC C-core, environment variables like | ||
| `GRPC_TRACE` and `GRPC_VERBOSITY` may also be relevant. |
There was a problem hiding this comment.
There is never a wrapped C-core for gRPC in Rust.
| If you are using a client that wraps the gRPC C-core, environment variables like | |
| `GRPC_TRACE` and `GRPC_VERBOSITY` may also be relevant. |
| ```bash | ||
| # Point gRPC to a CA bundle that includes your proxy's certificate | ||
| export GRPC_DEFAULT_SSL_ROOTS_FILE_PATH="/path/to/roots.pem" | ||
| ``` |
There was a problem hiding this comment.
Nothing in Rust uses that environment variable.
| export http_proxy="http://proxy.example.com:3128" | ||
| export https_proxy="http://proxy.example.com:3128" |
There was a problem hiding this comment.
I assume this is true, but frankly I have not tested this feature.
| ```rust | ||
| use google_cloud_secret_manager::v1::client::{SecretManagerClient, ClientConfig}; | ||
|
|
||
| async fn run() -> Result<(), Box<dyn std::error::Error>> { | ||
| // Configure a proxy using standard environment variables or a custom connector | ||
| let proxy = reqwest::Proxy::all("http://user:password@proxy.example.com")?; | ||
| let http_client = reqwest::Client::builder() | ||
| .proxy(proxy) | ||
| .build()?; | ||
|
|
||
| let config = ClientConfig::default() | ||
| .with_http_client(http_client); | ||
|
|
||
| let client = SecretManagerClient::new(config).await?; | ||
| Ok(()) | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Please move this to a code sample so we can compile it, it won't compile
| ## 5. Logging | ||
|
|
||
| You can use the `tracing` crate to capture client logs. By initializing a | ||
| subscriber, you can debug request metadata, status codes, and events. | ||
|
|
||
| ```rust | ||
| use tracing_subscriber; | ||
|
|
||
| fn main() { | ||
| // Initialize tracing subscriber to see debug output from the client | ||
| tracing_subscriber::fmt() | ||
| .with_max_level(tracing::Level::DEBUG) | ||
| .init(); | ||
| } | ||
| ``` |
There was a problem hiding this comment.
I think we can just reference this doc instead:
| ## 6. Other common configuration options | ||
|
|
||
| The following options can be passed to the configuration builder of most | ||
| clients. | ||
|
|
||
| | Option | Type | Description | | ||
| | ----- | ----- | ----- | | ||
| | `credentials` | `Option<Credentials>` | Explicit credentials object for authentication. | | ||
| | `endpoint` | `String` | The address of the API remote host. Used for Regional Endpoints (e.g., `https://us-central1-pubsub.googleapis.com:443`) or Private Service Connect. | | ||
|
|
||
| To use API Keys [override the default credentials with API keys][override-api-keys]. |
There was a problem hiding this comment.
Co-authored-by: Carlos O'Ryan <carlos.oryan@gmail.com>
No description provided.