AzureMLApplicationInsightsNotebookHandler Class
Represents an Application Insights-based notebook execution handler.
Construct PapermillExecutionHandler object.
- Inheritance
-
azureml.contrib.notebook._notebook_handler.NotebookExecutionHandlerAzureMLApplicationInsightsNotebookHandler
Constructor
AzureMLApplicationInsightsNotebookHandler(appinsights_key, tag, payload=None, history=True, timeout=None, **kwargs)
Parameters
- history
- bool
Whether to enable metrics logs to run history. The default is True.
Remarks
# Import dependencies
from azureml.core import Workspace, Experiment, RunConfiguration
from azureml.contrib.notebook import NotebookRunConfig, AzureMLApplicationInsightsNotebookHandler
# Create new experiment
workspace = Workspace.from_config()
experiment_name = "azureml_notebook_experiment"
exp = Experiment(workspace, experiment_name)
# Customize run configuration to execute in user managed environment
run_config_user_managed = RunConfiguration()
run_config_user_managed.environment.python.user_managed_dependencies = True
# Instante AzureML Application Insights notebook handler
handler = AzureMLApplicationInsightsNotebookHandler(appinsights_key=_appinsights_key,
tag="notebook-test",
payload={"experiment_name": experiment_name},
timeout=600)
# Create notebook run configuration
cfg = NotebookRunConfig(source_directory="./notebooks",
notebook="notebook-sample.ipynb",
handler=handler,
parameters={"arg2": "Universe"},
run_config=run_config_user_managed)
# Submit experiment and wait for completion
run = exp.submit(cfg)
run.wait_for_completion(show_output=True)
This handler logs notebook execution status as an event named as tag to ApplicationInsights. CustomDimensions payload contains:
notebook metadata from papermill execution
user specified payload
status - one of failed, completed or timeout
In case of a failure, CustomDimensions is extended with the following properties:
cell_index - execution count of a failed cell
source - source code of the cell
error_type - exception type
error_message - exception message
traceback - stack trace
Attributes
supported_options
supported_options = ['progress_bar', 'log_output', 'kernel_name', 'cwd']
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for