Crates.io | cloud_profiler_rust |
lib.rs | cloud_profiler_rust |
version | 1.2.2 |
source | src |
created_at | 2024-04-16 23:26:14.193699 |
updated_at | 2024-09-19 23:54:34.820728 |
description | Google Cloud Profiler Rust Agent |
homepage | https://github.com/statsig-io/cloud-profiler-rust |
repository | https://github.com/statsig-io/cloud-profiler-rust |
max_upload_size | |
id | 1210823 |
size | 14,085 |
This library was created based on the google support implementations:
As a result of this being completed by examining those other libraries. This is not officially supported by Google at this point in time.
That being said, it seems to work as long as you don't give away the fact that we are actually a rust binary and not go, per:
https://github.com/statsig-io/cloud-profiler-rust/blob/main/src/lib.rs#L64
Using this library is extremely straight forward, this is an example from our forward proxy, that uses both a static enablement and dynamic enablement method:
cloud_profiler_rust::maybe_start_profiling(
"statsig-forward-proxy".to_string(),
std::env::var("DD_VERSION").unwrap_or("missing_dd_version".to_string()),
move || {
force_enable
|| Statsig::check_gate(&statsig_user, "enable_gcp_profiler_for_sfp").unwrap_or(false)
},
)
.await;