Skip to main content
Version: v0.62.0

Enable or disable monitor proxy

This page describes how you can enable or disable the transmission of monitoring data (for example, scoring data like model input and output and inference metrics like scoring latency) for a deployment at creation using the monitor_disable flag. This can be helpful if you don’t want H2O to store your deployment data. (Note: By default, the monitor_disable flag is set to False.)

Note that while the monitoring proxy is disabled, model monitoring is not available for any data sent to the deployment.

The following sections describe each of the possible scenarios for disabling or enabling monitor proxy when creating a new deployment or updating an existing deployment with the deployer API:

Create new deployment with monitor proxy disabled

The following example demonstrates how to create a new deployment where the monitoring proxy is disabled. This means that the deployment will not send or store any monitoring data like model input, output, or inference metrics.

In this example, the DeployDeployment method is used to define the properties of the deployment. Specifically, the monitor_disable flag is set to True. After defining the deployment's properties, the create_deployment method of the client.deployer.deployment is used to start the deployment process.

new_deployment = mlops.DeployDeployment(
project_id=project_id,
deployment_environment_id=env.id,
single_deployment=mlops.DeploySingleDeployment(
deployment_composition=composition,
),
monitor_disable=True,
)
client.deployer.deployment.create_deployment(
mlops.DeployCreateDeploymentRequest(deployment=new_deployment)
)

Create new deployment with monitor proxy enabled (default)

The following example demonstrates how to create a new deployment with the monitoring proxy enabled. By default, if the monitor_disable flag is not provided, the monitoring proxy remains active. This ensures that the deployment will automatically collect and store relevant monitoring data such as model input, output, and inference metrics.

In this example, the DeployDeployment method is used to define the properties of the deployment without setting the monitor_disable flag, indicating the use of the default behavior. After setting up the deployment details, the create_deployment method of the client.deployer.deployment is used to start the deployment process.

new_deployment = mlops.DeployDeployment(
project_id=project_id,
deployment_environment_id=env.id,
single_deployment=mlops.DeploySingleDeployment(
deployment_composition=composition,
),
)
client.deployer.deployment.create_deployment(
mlops.DeployCreateDeploymentRequest(deployment=new_deployment)
)

Update existing deployment with monitor proxy from enabled to disabled

The following example demonstrates how to modify an existing deployment to turn off its monitoring proxy. This can be useful if you initially had monitoring enabled but later decide that you no longer want to collect or store the associated monitoring data.

note

Any monitoring data that has already been collected prior to disabling the monitoring proxy is retained and is not automatically deleted.

In this example, the DeployDeployment method is used to specify the properties of the existing deployment you want to modify, notably using the id parameter to reference it. Setting the monitor_disable flag to True, disables the monitoring proxy for that deployment. The update_model_deployment method of the client.deployer.deployment is then used to update the specified deployment.

existing_deployment = mlops.DeployDeployment(
id=deployment_id,
project_id=project_id,
deployment_environment_id=env.id,
single_deployment=mlops.DeploySingleDeployment(
deployment_composition=composition,
),
monitor_disable=True,
)
client.deployer.deployment.update_model_deployment(
mlops.DeployCreateDeploymentRequest(deployment=new_deployment)
)

Update existing deployment with monitor proxy from disabled to enabled

The following example demonstrates how to update an existing deployment to enable its monitoring proxy. This can be useful if monitoring was previously turned off, but there's now a need to gather and store monitoring data, such as model input, output, and inference metrics.

In this example, the DeployDeployment method is used to specify the properties of the deployment you want to update using the id parameter to reference the specific deployment. By omitting the monitor_disable flag or ensuring that it is not set to True, you can enable the monitoring proxy. Once the changes have been specified, the update_model_deployment method of the client.deployer.deployment is used to update the specified deployment.

new_deployment = mlops.DeployDeployment(
id=deployment_id,
project_id=project_id,
deployment_environment_id=env.id,
single_deployment=mlops.DeploySingleDeployment(
deployment_composition=composition,
),
)
client.deployer.deployment.update_model_deployment(
mlops.DeployCreateDeploymentRequest(deployment=new_deployment)
)

Feedback