Struct GrpcExporter
pub struct GrpcExporter<S = ()> { /* private fields */ }Expand description
Wrapper type which allows you to use a rama gRPC GrpcService
as a gRPC OTLP exporter for your OpenTelemetry setup.
Implementations§
§impl<S> OtelExporter<S>
impl<S> OtelExporter<S>
pub fn new(service: S) -> OtelExporter<S>
pub fn new(service: S) -> OtelExporter<S>
Create a new OtelExporter with default OTLP gRPC settings.
Defaults to http://localhost:4317 and no extra metadata or compression.
pub fn from_env(service: S) -> Result<OtelExporter<S>, OtelExporterConfigError>
pub fn from_env(service: S) -> Result<OtelExporter<S>, OtelExporterConfigError>
Configure this exporter using the OTLP environment variables.
pub fn with_endpoint(self, endpoint: Uri) -> OtelExporter<S>
pub fn with_endpoint(self, endpoint: Uri) -> OtelExporter<S>
Override the base OTLP endpoint.
pub fn set_endpoint(&mut self, endpoint: Uri) -> &mut OtelExporter<S>
pub fn set_endpoint(&mut self, endpoint: Uri) -> &mut OtelExporter<S>
Override the base OTLP endpoint.
pub fn maybe_with_timeout(self, timeout: Option<Duration>) -> OtelExporter<S>
pub fn maybe_with_timeout(self, timeout: Option<Duration>) -> OtelExporter<S>
Override the base OTLP timeout.
pub fn maybe_set_timeout(
&mut self,
timeout: Option<Duration>,
) -> &mut OtelExporter<S>
pub fn maybe_set_timeout( &mut self, timeout: Option<Duration>, ) -> &mut OtelExporter<S>
Override the base OTLP timeout.
pub fn with_timeout(self, timeout: Duration) -> OtelExporter<S>
pub fn with_timeout(self, timeout: Duration) -> OtelExporter<S>
Override the base OTLP timeout.
pub fn set_timeout(&mut self, timeout: Duration) -> &mut OtelExporter<S>
pub fn set_timeout(&mut self, timeout: Duration) -> &mut OtelExporter<S>
Override the base OTLP timeout.
pub fn without_timeout(self) -> OtelExporter<S>
pub fn without_timeout(self) -> OtelExporter<S>
Override the base OTLP timeout.
pub fn unset_timeout(&mut self) -> &mut OtelExporter<S>
pub fn unset_timeout(&mut self) -> &mut OtelExporter<S>
Override the base OTLP timeout.
pub fn maybe_with_compression(
self,
compression: Option<CompressionEncoding>,
) -> OtelExporter<S>
pub fn maybe_with_compression( self, compression: Option<CompressionEncoding>, ) -> OtelExporter<S>
Override the base OTLP compression.
pub fn maybe_set_compression(
&mut self,
compression: Option<CompressionEncoding>,
) -> &mut OtelExporter<S>
pub fn maybe_set_compression( &mut self, compression: Option<CompressionEncoding>, ) -> &mut OtelExporter<S>
Override the base OTLP compression.
pub fn with_compression(
self,
compression: CompressionEncoding,
) -> OtelExporter<S>
pub fn with_compression( self, compression: CompressionEncoding, ) -> OtelExporter<S>
Override the base OTLP compression.
pub fn set_compression(
&mut self,
compression: CompressionEncoding,
) -> &mut OtelExporter<S>
pub fn set_compression( &mut self, compression: CompressionEncoding, ) -> &mut OtelExporter<S>
Override the base OTLP compression.
pub fn without_compression(self) -> OtelExporter<S>
pub fn without_compression(self) -> OtelExporter<S>
Override the base OTLP compression.
pub fn unset_compression(&mut self) -> &mut OtelExporter<S>
pub fn unset_compression(&mut self) -> &mut OtelExporter<S>
Override the base OTLP compression.
pub fn with_metadata(self, metadata: MetadataMap) -> OtelExporter<S>
pub fn with_metadata(self, metadata: MetadataMap) -> OtelExporter<S>
Override the base OTLP metadata.
pub fn set_metadata(&mut self, metadata: MetadataMap) -> &mut OtelExporter<S>
pub fn set_metadata(&mut self, metadata: MetadataMap) -> &mut OtelExporter<S>
Override the base OTLP metadata.
pub fn maybe_with_traces_endpoint(
self,
endpoint: Option<Uri>,
) -> OtelExporter<S>
pub fn maybe_with_traces_endpoint( self, endpoint: Option<Uri>, ) -> OtelExporter<S>
Override the trace-specific endpoint.
pub fn maybe_set_traces_endpoint(
&mut self,
endpoint: Option<Uri>,
) -> &mut OtelExporter<S>
pub fn maybe_set_traces_endpoint( &mut self, endpoint: Option<Uri>, ) -> &mut OtelExporter<S>
Override the trace-specific endpoint.
pub fn with_traces_endpoint(self, endpoint: Uri) -> OtelExporter<S>
pub fn with_traces_endpoint(self, endpoint: Uri) -> OtelExporter<S>
Override the trace-specific endpoint.
pub fn set_traces_endpoint(&mut self, endpoint: Uri) -> &mut OtelExporter<S>
pub fn set_traces_endpoint(&mut self, endpoint: Uri) -> &mut OtelExporter<S>
Override the trace-specific endpoint.
pub fn without_traces_endpoint(self) -> OtelExporter<S>
pub fn without_traces_endpoint(self) -> OtelExporter<S>
Override the trace-specific endpoint.
pub fn unset_traces_endpoint(&mut self) -> &mut OtelExporter<S>
pub fn unset_traces_endpoint(&mut self) -> &mut OtelExporter<S>
Override the trace-specific endpoint.
pub fn maybe_with_traces_timeout(
self,
timeout: Option<Duration>,
) -> OtelExporter<S>
pub fn maybe_with_traces_timeout( self, timeout: Option<Duration>, ) -> OtelExporter<S>
Override the trace-specific timeout.
pub fn maybe_set_traces_timeout(
&mut self,
timeout: Option<Duration>,
) -> &mut OtelExporter<S>
pub fn maybe_set_traces_timeout( &mut self, timeout: Option<Duration>, ) -> &mut OtelExporter<S>
Override the trace-specific timeout.
pub fn with_traces_timeout(self, timeout: Duration) -> OtelExporter<S>
pub fn with_traces_timeout(self, timeout: Duration) -> OtelExporter<S>
Override the trace-specific timeout.
pub fn set_traces_timeout(&mut self, timeout: Duration) -> &mut OtelExporter<S>
pub fn set_traces_timeout(&mut self, timeout: Duration) -> &mut OtelExporter<S>
Override the trace-specific timeout.
pub fn without_traces_timeout(self) -> OtelExporter<S>
pub fn without_traces_timeout(self) -> OtelExporter<S>
Override the trace-specific timeout.
pub fn unset_traces_timeout(&mut self) -> &mut OtelExporter<S>
pub fn unset_traces_timeout(&mut self) -> &mut OtelExporter<S>
Override the trace-specific timeout.
pub fn maybe_with_traces_compression(
self,
compression: Option<CompressionEncoding>,
) -> OtelExporter<S>
pub fn maybe_with_traces_compression( self, compression: Option<CompressionEncoding>, ) -> OtelExporter<S>
Override the trace-specific compression.
pub fn maybe_set_traces_compression(
&mut self,
compression: Option<CompressionEncoding>,
) -> &mut OtelExporter<S>
pub fn maybe_set_traces_compression( &mut self, compression: Option<CompressionEncoding>, ) -> &mut OtelExporter<S>
Override the trace-specific compression.
pub fn with_traces_compression(
self,
compression: CompressionEncoding,
) -> OtelExporter<S>
pub fn with_traces_compression( self, compression: CompressionEncoding, ) -> OtelExporter<S>
Override the trace-specific compression.
pub fn set_traces_compression(
&mut self,
compression: CompressionEncoding,
) -> &mut OtelExporter<S>
pub fn set_traces_compression( &mut self, compression: CompressionEncoding, ) -> &mut OtelExporter<S>
Override the trace-specific compression.
pub fn without_traces_compression(self) -> OtelExporter<S>
pub fn without_traces_compression(self) -> OtelExporter<S>
Override the trace-specific compression.
pub fn unset_traces_compression(&mut self) -> &mut OtelExporter<S>
pub fn unset_traces_compression(&mut self) -> &mut OtelExporter<S>
Override the trace-specific compression.
pub fn with_traces_metadata(self, metadata: MetadataMap) -> OtelExporter<S>
pub fn with_traces_metadata(self, metadata: MetadataMap) -> OtelExporter<S>
Override the trace-specific metadata.
pub fn set_traces_metadata(
&mut self,
metadata: MetadataMap,
) -> &mut OtelExporter<S>
pub fn set_traces_metadata( &mut self, metadata: MetadataMap, ) -> &mut OtelExporter<S>
Override the trace-specific metadata.
pub fn maybe_with_metrics_endpoint(
self,
endpoint: Option<Uri>,
) -> OtelExporter<S>
pub fn maybe_with_metrics_endpoint( self, endpoint: Option<Uri>, ) -> OtelExporter<S>
Override the metrics-specific endpoint.
pub fn maybe_set_metrics_endpoint(
&mut self,
endpoint: Option<Uri>,
) -> &mut OtelExporter<S>
pub fn maybe_set_metrics_endpoint( &mut self, endpoint: Option<Uri>, ) -> &mut OtelExporter<S>
Override the metrics-specific endpoint.
pub fn with_metrics_endpoint(self, endpoint: Uri) -> OtelExporter<S>
pub fn with_metrics_endpoint(self, endpoint: Uri) -> OtelExporter<S>
Override the metrics-specific endpoint.
pub fn set_metrics_endpoint(&mut self, endpoint: Uri) -> &mut OtelExporter<S>
pub fn set_metrics_endpoint(&mut self, endpoint: Uri) -> &mut OtelExporter<S>
Override the metrics-specific endpoint.
pub fn without_metrics_endpoint(self) -> OtelExporter<S>
pub fn without_metrics_endpoint(self) -> OtelExporter<S>
Override the metrics-specific endpoint.
pub fn unset_metrics_endpoint(&mut self) -> &mut OtelExporter<S>
pub fn unset_metrics_endpoint(&mut self) -> &mut OtelExporter<S>
Override the metrics-specific endpoint.
pub fn maybe_with_metrics_timeout(
self,
timeout: Option<Duration>,
) -> OtelExporter<S>
pub fn maybe_with_metrics_timeout( self, timeout: Option<Duration>, ) -> OtelExporter<S>
Override the metrics-specific timeout.
pub fn maybe_set_metrics_timeout(
&mut self,
timeout: Option<Duration>,
) -> &mut OtelExporter<S>
pub fn maybe_set_metrics_timeout( &mut self, timeout: Option<Duration>, ) -> &mut OtelExporter<S>
Override the metrics-specific timeout.
pub fn with_metrics_timeout(self, timeout: Duration) -> OtelExporter<S>
pub fn with_metrics_timeout(self, timeout: Duration) -> OtelExporter<S>
Override the metrics-specific timeout.
pub fn set_metrics_timeout(&mut self, timeout: Duration) -> &mut OtelExporter<S>
pub fn set_metrics_timeout(&mut self, timeout: Duration) -> &mut OtelExporter<S>
Override the metrics-specific timeout.
pub fn without_metrics_timeout(self) -> OtelExporter<S>
pub fn without_metrics_timeout(self) -> OtelExporter<S>
Override the metrics-specific timeout.
pub fn unset_metrics_timeout(&mut self) -> &mut OtelExporter<S>
pub fn unset_metrics_timeout(&mut self) -> &mut OtelExporter<S>
Override the metrics-specific timeout.
pub fn maybe_with_metrics_compression(
self,
compression: Option<CompressionEncoding>,
) -> OtelExporter<S>
pub fn maybe_with_metrics_compression( self, compression: Option<CompressionEncoding>, ) -> OtelExporter<S>
Override the metrics-specific compression.
pub fn maybe_set_metrics_compression(
&mut self,
compression: Option<CompressionEncoding>,
) -> &mut OtelExporter<S>
pub fn maybe_set_metrics_compression( &mut self, compression: Option<CompressionEncoding>, ) -> &mut OtelExporter<S>
Override the metrics-specific compression.
pub fn with_metrics_compression(
self,
compression: CompressionEncoding,
) -> OtelExporter<S>
pub fn with_metrics_compression( self, compression: CompressionEncoding, ) -> OtelExporter<S>
Override the metrics-specific compression.
pub fn set_metrics_compression(
&mut self,
compression: CompressionEncoding,
) -> &mut OtelExporter<S>
pub fn set_metrics_compression( &mut self, compression: CompressionEncoding, ) -> &mut OtelExporter<S>
Override the metrics-specific compression.
pub fn without_metrics_compression(self) -> OtelExporter<S>
pub fn without_metrics_compression(self) -> OtelExporter<S>
Override the metrics-specific compression.
pub fn unset_metrics_compression(&mut self) -> &mut OtelExporter<S>
pub fn unset_metrics_compression(&mut self) -> &mut OtelExporter<S>
Override the metrics-specific compression.
pub fn with_metrics_metadata(self, metadata: MetadataMap) -> OtelExporter<S>
pub fn with_metrics_metadata(self, metadata: MetadataMap) -> OtelExporter<S>
Override the metrics-specific metadata.
pub fn set_metrics_metadata(
&mut self,
metadata: MetadataMap,
) -> &mut OtelExporter<S>
pub fn set_metrics_metadata( &mut self, metadata: MetadataMap, ) -> &mut OtelExporter<S>
Override the metrics-specific metadata.
pub fn with_temporality(self, temporality: Temporality) -> OtelExporter<S>
pub fn with_temporality(self, temporality: Temporality) -> OtelExporter<S>
Configure the metric temporality used by this exporter.
pub fn set_temporality(
&mut self,
temporality: Temporality,
) -> &mut OtelExporter<S>
pub fn set_temporality( &mut self, temporality: Temporality, ) -> &mut OtelExporter<S>
Configure the metric temporality used by this exporter.
Trait Implementations§
§impl<S> Clone for OtelExporter<S>where
S: Clone,
impl<S> Clone for OtelExporter<S>where
S: Clone,
§fn clone(&self) -> OtelExporter<S>
fn clone(&self) -> OtelExporter<S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<S> Debug for OtelExporter<S>where
S: Debug,
impl<S> Debug for OtelExporter<S>where
S: Debug,
§impl<S> PushMetricExporter for OtelExporter<S>where
S: Debug + Clone + GrpcService<Body>,
<S as GrpcService<Body>>::ResponseBody: Body + Send + Sync + 'static,
<<S as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
impl<S> PushMetricExporter for OtelExporter<S>where
S: Debug + Clone + GrpcService<Body>,
<S as GrpcService<Body>>::ResponseBody: Body + Send + Sync + 'static,
<<S as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
§async fn export(&self, metrics: &ResourceMetrics) -> Result<(), OTelSdkError>
async fn export(&self, metrics: &ResourceMetrics) -> Result<(), OTelSdkError>
§fn force_flush(&self) -> Result<(), OTelSdkError>
fn force_flush(&self) -> Result<(), OTelSdkError>
§fn shutdown_with_timeout(&self, _timeout: Duration) -> Result<(), OTelSdkError>
fn shutdown_with_timeout(&self, _timeout: Duration) -> Result<(), OTelSdkError>
§fn temporality(&self) -> Temporality
fn temporality(&self) -> Temporality
§fn shutdown(&self) -> Result<(), OTelSdkError>
fn shutdown(&self) -> Result<(), OTelSdkError>
§impl<S> SpanExporter for OtelExporter<S>where
S: Debug + Clone + GrpcService<Body>,
<S as GrpcService<Body>>::ResponseBody: Body + Send + Sync + 'static,
<<S as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
impl<S> SpanExporter for OtelExporter<S>where
S: Debug + Clone + GrpcService<Body>,
<S as GrpcService<Body>>::ResponseBody: Body + Send + Sync + 'static,
<<S as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
§async fn export(&self, batch: Vec<SpanData>) -> Result<(), OTelSdkError>
async fn export(&self, batch: Vec<SpanData>) -> Result<(), OTelSdkError>
§fn shutdown_with_timeout(
&mut self,
_timeout: Duration,
) -> Result<(), OTelSdkError>
fn shutdown_with_timeout( &mut self, _timeout: Duration, ) -> Result<(), OTelSdkError>
§fn force_flush(&mut self) -> Result<(), OTelSdkError>
fn force_flush(&mut self) -> Result<(), OTelSdkError>
§fn set_resource(&mut self, resource: &Resource)
fn set_resource(&mut self, resource: &Resource)
§fn shutdown(&mut self) -> Result<(), OTelSdkError>
fn shutdown(&mut self) -> Result<(), OTelSdkError>
Auto Trait Implementations§
impl<S = ()> !Freeze for OtelExporter<S>
impl<S = ()> !RefUnwindSafe for OtelExporter<S>
impl<S> Send for OtelExporter<S>where
S: Send,
impl<S> Sync for OtelExporter<S>where
S: Sync,
impl<S> Unpin for OtelExporter<S>where
S: Unpin,
impl<S> UnsafeUnpin for OtelExporter<S>where
S: UnsafeUnpin,
impl<S = ()> !UnwindSafe for OtelExporter<S>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more