State#

Fully qualified name: omni::observability::State

Defined in omni/observability/IObservabilityProvider.h

class State#

Wrapper object to manage the lifetime of the telemetry system.

This will manage initializing and configuring the IObservabilityProvider interface on construction and shut it down on object destruction.

Public Functions

inline State()#

Default Constructor: initializes the OpenTelemetry system with the default settings.

Remark

This initializes and configures OpenTelemetry using the default settings. This will not provide any host app session ID, logger object, or settings helper object. The session ID and settings helper object may not be changed without shutting the system down and reinitializing. A new logger object may be registered at any time with IObservabilityProvider::registerLogger() though.

inline State(const InitializeDesc &desc)#

Constructor: initializes the OpenTelemetry system with the given settings.

Remark

This initializes and configures OpenTelemetry using the given settings. If a settings or logger object is provided in desc, they will be retained for internal use during setup. The caller is free to release its own references to these objects upon return.

Parameters:

desc[in] A descriptor containing additional host app specific information and objects to help initialize with. The objects in the desc parameter will be retained internally until the library is shut down.

inline ~State()#

Destructor: shuts down the OpenTelemetry system.

Remark

This shuts down the OpenTelemetry system and leaves it in a state where it can be reinitialized.

inline IObservabilityProvider *getObservabilityProvider() const#

Retrieves the internally held IObservabilityProvider interface.

Returns:

The IObservabilityProvider object as returned from a call to acquireIObservabilityProvider(). Note that this is a singleton object and multiple State objects cannot be initialized in different ways simultaneously. If a second object is created, it will simply increase the reference count of the object and not change the OpenTelemetry configuration at all.