pub struct GcpCloudLoggingApiConfig { /* private fields */ }Expand description
How the Cloud Logging API sink writes: which log to write to, what resource the entries are attributed to, and how aggressively they are batched.
Implementations§
Source§impl GcpCloudLoggingApiConfig
impl GcpCloudLoggingApiConfig
Sourcepub fn new(log_id: LogId) -> Self
pub fn new(log_id: LogId) -> Self
Writes to projects/{project}/logs/{log_id}, with / in log_id URL-encoded as
%2F, as Cloud Logging stores it.
Sourcepub fn with_resource(self, resource: MonitoredResource) -> Self
pub fn with_resource(self, resource: MonitoredResource) -> Self
Attributes every entry to this monitored resource. Defaults to type
global labelled with the project id, which is accepted everywhere;
set a specific resource (gce_instance, k8s_container, …) to have
the entries grouped with the rest of that resource’s logs.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Writes as soon as this many entries are queued. Defaults to 200.
Sourcepub fn with_flush_interval(self, flush_interval: Duration) -> Self
pub fn with_flush_interval(self, flush_interval: Duration) -> Self
Writes a partial batch this long after its first entry was queued. Defaults to two seconds.
Sourcepub fn with_queue_capacity(self, queue_capacity: usize) -> Self
pub fn with_queue_capacity(self, queue_capacity: usize) -> Self
Bounds the queue between the layer and the background task. Events recorded when the queue is full are dropped rather than blocking the thread that logged them. Defaults to 10 000.
Sourcepub fn with_shutdown_timeout(self, shutdown_timeout: Duration) -> Self
pub fn with_shutdown_timeout(self, shutdown_timeout: Duration) -> Self
Bounds how long GcpCloudLoggingHandle::shutdown waits for the final
write. Defaults to five seconds.
Auto Trait Implementations§
impl Forget for GcpCloudLoggingApiConfig
impl Freeze for GcpCloudLoggingApiConfig
impl Move for GcpCloudLoggingApiConfig
impl RefUnwindSafe for GcpCloudLoggingApiConfig
impl Send for GcpCloudLoggingApiConfig
impl Sync for GcpCloudLoggingApiConfig
impl Unpin for GcpCloudLoggingApiConfig
impl UnsafeUnpin for GcpCloudLoggingApiConfig
impl UnwindSafe for GcpCloudLoggingApiConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request