SplunkAOLoggerSingleton
A singleton class that manages a collection of SplunkAOLogger instances. This class ensures that only one instance exists across the application and provides a thread-safe way to retrieve or create SplunkAOLogger clients based on the given ‘project’ and ‘agent_stream’ parameters. If the parameters are not provided, the class attempts to read the values from the environment variables SPLUNK_AO_PROJECT and SPLUNK_AO_AGENT_STREAM. The loggers are stored in a dictionary using a tuple (project, agent_stream) as the key.flush
project (Optional[str], optional): The project name. Defaults to None.project_id (Optional[str], optional): The project ID. Defaults to None.agent_stream (Optional[str], optional): The agent stream name. Defaults to None.agent_stream_id (Optional[str], optional): The agent stream ID. Defaults to None.experiment_id (Optional[str], optional): The experiment ID. Defaults to None.mode (Optional[str], optional): The logger mode. Defaults to SPLUNK_AO_MODE env var, or “batch” if not set.
flush_all
get
project (Optional[str], optional): The project name. Defaults to None.agent_stream (Optional[str], optional): The agent stream name. Defaults to None.experiment_id (Optional[str], optional): The experiment ID. Defaults to None.local_metrics (Optional[list[LocalScorerConfig]], optional): Local scorers to run on traces/spans. Only used if initializing a new logger, ignored otherwise. Defaults to None.
SplunkAOLogger: An instance of SplunkAOLogger corresponding to the key.
get_all_loggers
- A dictionary mapping keys to their corresponding SplunkAOLogger instances.
reset
project (Optional[str], optional): The project name. Defaults to None.project_id (Optional[str], optional): The project ID. Defaults to None.agent_stream (Optional[str], optional): The agent stream name. Defaults to None.agent_stream_id (Optional[str], optional): The agent stream ID. Defaults to None.experiment_id (Optional[str], optional): The experiment ID. Defaults to None.mode (Optional[str], optional): The logger mode. Defaults to SPLUNK_AO_MODE env var, or “batch” if not set.