pub struct DMSCObservabilityModule { /* private fields */ }Expand description
Main observability module for DMSC.
This module provides distributed tracing and metrics collection capabilities, following modern
observability best practices. It implements the ServiceModule trait for seamless integration
with the DMSC application lifecycle.
Implementations§
Source§impl DMSCObservabilityModule
impl DMSCObservabilityModule
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new observability module with default configuration.
§Returns
A new DMSCObservabilityModule instance with default configuration
Sourcepub fn with_config(self, config: DMSCObservabilityConfig) -> Self
pub fn with_config(self, config: DMSCObservabilityConfig) -> Self
Sourcepub fn export_data(&self) -> DMSCObservabilityData
pub fn export_data(&self) -> DMSCObservabilityData
Exports observability data.
This method collects and returns the current observability data, including metrics in Prometheus format and information about active traces and spans.
§Returns
A DMSCObservabilityData struct containing the exported observability data
Trait Implementations§
Source§impl DMSCModule for DMSCObservabilityModule
impl DMSCModule for DMSCObservabilityModule
Source§fn is_critical(&self) -> bool
fn is_critical(&self) -> bool
Indicates whether the observability module is critical.
The observability module is non-critical, meaning that if it fails to initialize or operate, it should not break the entire application. This allows the core functionality to continue even if observability features are unavailable.
§Returns
false since observability is non-critical
Source§fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Initializes the observability module.
This method performs the following steps:
- Loads configuration from the service context
- Initializes tracing with the configured sampling rate
- Initializes the metrics registry
- Creates common service metrics
- Registers lifecycle hooks for automatic metrics collection
- Logs initialization completion
§Parameters
ctx: The service context containing configuration and other services
§Returns
A DMSCResult<()> indicating success or failure
Source§fn after_shutdown<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_shutdown<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Performs cleanup after the application has shut down.
This method exports the final observability data and logs information about active traces and spans at the time of shutdown.
§Parameters
ctx: The service context containing the logger service
§Returns
A DMSCResult<()> indicating success or failure
Source§fn before_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn after_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn before_shutdown<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_shutdown<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut DMSCServiceContext,
) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Default for DMSCObservabilityModule
impl Default for DMSCObservabilityModule
Source§impl<'py> IntoPyObject<'py> for DMSCObservabilityModule
impl<'py> IntoPyObject<'py> for DMSCObservabilityModule
Source§type Target = DMSCObservabilityModule
type Target = DMSCObservabilityModule
Source§type Output = Bound<'py, <DMSCObservabilityModule as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <DMSCObservabilityModule as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for DMSCObservabilityModule
impl PyClass for DMSCObservabilityModule
Source§impl PyClassImpl for DMSCObservabilityModule
impl PyClassImpl for DMSCObservabilityModule
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// with the DMSC application lifecycle.
const RAW_DOC: &'static CStr = /// with the DMSC application lifecycle.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<DMSCObservabilityModule>
type ThreadChecker = SendablePyClass<DMSCObservabilityModule>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyMethods<DMSCObservabilityModule> for PyClassImplCollector<DMSCObservabilityModule>
impl PyMethods<DMSCObservabilityModule> for PyClassImplCollector<DMSCObservabilityModule>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for DMSCObservabilityModule
impl PyTypeInfo for DMSCObservabilityModule
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.impl DerefToPyAny for DMSCObservabilityModule
impl ExtractPyClassWithClone for DMSCObservabilityModule
Auto Trait Implementations§
impl Freeze for DMSCObservabilityModule
impl RefUnwindSafe for DMSCObservabilityModule
impl Send for DMSCObservabilityModule
impl Sync for DMSCObservabilityModule
impl Unpin for DMSCObservabilityModule
impl UnwindSafe for DMSCObservabilityModule
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
§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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read moreSource§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::RequestSource§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more