ads.telemetry package¶
Submodules¶
ads.telemetry.telemetry module¶
- class ads.telemetry.telemetry.Surface(value)[source]¶
Bases:
Enum
An Enum class used to label the surface where ADS is being utilized.
- DATAFLOW = 5¶
- DATASCIENCE_JOB = 2¶
- DATASCIENCE_MODEL_DEPLOYMENT = 4¶
- DATASCIENCE_NOTEBOOK = 3¶
- DATASCIENCE_PIPELINE = 7¶
- OCI_SERVICE = 6¶
- WORKSTATION = 1¶
- class ads.telemetry.telemetry.Telemetry(name: str = '', environ_variable: str = 'EXTRA_USER_AGENT_INFO')[source]¶
Bases:
object
This class is designed to capture a telemetry sequence and store it in the specified environment variable. By default the EXTRA_USER_AGENT_INFO environment variable is used.
- name¶
The name of the telemetry. The very beginning of the telemetry string.
- Type:
(str, optional). Default to empty string.
- environ_variable¶
The name of the environment variable to capture the telemetry sequence.
- Type:
(str, optional). Defaults to EXTRA_USER_AGENT_INFO.
- begin(value: str = '') Telemetry [source]¶
This method should be invoked at the start of telemetry sequence capture. It resets the value of the associated environment variable.
- ads.telemetry.telemetry.telemetry(entry_point: str = '', name: str = '', environ_variable: str = 'EXTRA_USER_AGENT_INFO') Callable [source]¶
The telemetry decorator. Injects the Telemetry object into the kwargs arguments of the decorated function. This is essential for adding additional information to the telemetry from within the decorated function. Eventually this information will be merged into the additional_user_agent.
Important Note: The telemetry decorator exclusively updates the specified environment variable and does not perform any additional actions. “
- Parameters:
Examples
>>> @telemetry(entry_point="plugin=project&action=run", name="ads") ... def test_function(**kwargs) ... telemetry = kwargs.get("telemetry") ... telemetry.add("param=hello_world") ... print(telemetry)
>>> test_function() ... "ads&plugin=project&action=run¶m=hello_world"