pub struct UsageAgentBuilder { /* private fields */ }Implementations§
Source§impl UsageAgentBuilder
impl UsageAgentBuilder
Sourcepub fn token(self, token: String) -> Self
pub fn token(self, token: String) -> Self
Your Registry Access Token with write permission.
Sourcepub fn endpoint(self, endpoint: String) -> Self
pub fn endpoint(self, endpoint: String) -> Self
For self-hosting, you can override /usage endpoint (defaults to https://app.graphql-hive.com/usage).
Sourcepub fn target_id(self, target_id: String) -> Self
pub fn target_id(self, target_id: String) -> Self
A target ID, this can either be a slug following the format “$organizationSlug/$projectSlug/$targetSlug” (e.g “the-guild/graphql-hive/staging”) or an UUID (e.g. “a0f4c605-6541-4350-8cfe-b31f21a4bf80”). To be used when the token is configured with an organization access token.
Sourcepub fn buffer_size(self, buffer_size: usize) -> Self
pub fn buffer_size(self, buffer_size: usize) -> Self
A maximum number of operations to hold in a buffer before sending to Hive Console Default: 1000
Sourcepub fn connect_timeout(self, connect_timeout: Duration) -> Self
pub fn connect_timeout(self, connect_timeout: Duration) -> Self
A timeout for only the connect phase of a request to Hive Console Default: 5 seconds
Sourcepub fn request_timeout(self, request_timeout: Duration) -> Self
pub fn request_timeout(self, request_timeout: Duration) -> Self
A timeout for the entire request to Hive Console Default: 15 seconds
Sourcepub fn accept_invalid_certs(self, accept_invalid_certs: bool) -> Self
pub fn accept_invalid_certs(self, accept_invalid_certs: bool) -> Self
Accepts invalid SSL certificates Default: false
Sourcepub fn flush_interval(self, flush_interval: Duration) -> Self
pub fn flush_interval(self, flush_interval: Duration) -> Self
Frequency of flushing the buffer to the server Default: 5 seconds
Sourcepub fn user_agent(self, user_agent: String) -> Self
pub fn user_agent(self, user_agent: String) -> Self
User-Agent header to be sent with each request
Sourcepub fn retry_policy(self, retry_policy: ExponentialBackoff) -> Self
pub fn retry_policy(self, retry_policy: ExponentialBackoff) -> Self
Retry policy for sending reports Default: ExponentialBackoff with max 3 retries
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Maximum number of retries for sending reports Default: ExponentialBackoff with max 3 retries
pub fn sample_rate(self, sample_rate: f64) -> Self
pub fn exclude_operation_names(self, operation_names: Vec<String>) -> Self
pub fn at_least_once_sampling( self, key: AtLeastOnceSamplingKey, max_distinct_keys: u64, ) -> Self
pub fn exclude_expression(self, expression: String) -> Self
pub fn build(self) -> Result<UsageAgent, AgentError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UsageAgentBuilder
impl !UnwindSafe for UsageAgentBuilder
impl Freeze for UsageAgentBuilder
impl Send for UsageAgentBuilder
impl Sync for UsageAgentBuilder
impl Unpin for UsageAgentBuilder
impl UnsafeUnpin for UsageAgentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more