### Initialize and Use ObservabilityService Source: https://github.com/splunk/addonfactory-solutions-library-python/blob/develop/docs/release_8_0_0.md Initializes the ObservabilityService with modular input details and logs event counts and bytes. Ensure `ta_name` and `ta_version` are provided explicitly when not running in a full Splunk environment. ```python import logging from solnlib.observability import ObservabilityService, ATTR_MODINPUT_NAME logger = logging.getLogger(__name__) obs = ObservabilityService( modinput_type="my-input", logger=logger, ta_name="my_ta", ta_version="1.0.0", ) # In your event collection loop: if obs.event_count_counter: obs.event_count_counter.add(len(events), {ATTR_MODINPUT_NAME: stanza_name}) if obs.event_bytes_counter: obs.event_bytes_counter.add(total_bytes, {ATTR_MODINPUT_NAME: stanza_name}) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.