AzureMLApplicationInsightsNotebookHandler 类
表示基于 Application Insights 的笔记本执行处理程序。
- 继承
-
azureml.contrib.notebook._notebook_handler.NotebookExecutionHandlerAzureMLApplicationInsightsNotebookHandler
构造函数
AzureMLApplicationInsightsNotebookHandler(appinsights_key, tag, payload=None, history=True, timeout=None, **kwargs)
参数
注解
# 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)
此处理程序将笔记本执行状态作为名为标记的事件记录到 ApplicationInsights 中。 CustomDimensions 有效负载包含:
papermill 执行中的笔记本元数据
用户指定的有效负载
状态 - 失败、已完成或超时之一
如果出现故障,则使用以下属性扩展 CustomDimensions:
失败单元的 cell_index 执行计数
源 - 单元的源代码
error_type - 异常类型
error_message - 异常消息
回溯 - 堆栈跟踪
属性
supported_options
supported_options = ['progress_bar', 'log_output', 'kernel_name', 'cwd']
反馈
提交和查看相关反馈