@@ -536,6 +536,10 @@ def connect(self, secrets=None):
536
536
server_cfg .get ("model_monitoring_tsdb_connection" )
537
537
or config .model_endpoint_monitoring .tsdb_connection
538
538
)
539
+ config .model_endpoint_monitoring .stream_connection = (
540
+ server_cfg .get ("stream_connection" )
541
+ or config .model_endpoint_monitoring .stream_connection
542
+ )
539
543
config .packagers = server_cfg .get ("packagers" ) or config .packagers
540
544
server_data_prefixes = server_cfg .get ("feature_store_data_prefixes" ) or {}
541
545
for prefix in ["default" , "nosql" , "redisnosql" ]:
@@ -3397,6 +3401,7 @@ def enable_model_monitoring(
3397
3401
image : str = "mlrun/mlrun" ,
3398
3402
deploy_histogram_data_drift_app : bool = True ,
3399
3403
rebuild_images : bool = False ,
3404
+ fetch_credentials_from_sys_config : bool = False ,
3400
3405
) -> None :
3401
3406
"""
3402
3407
Deploy model monitoring application controller, writer and stream functions.
@@ -3406,14 +3411,16 @@ def enable_model_monitoring(
3406
3411
The stream function goal is to monitor the log of the data stream. It is triggered when a new log entry
3407
3412
is detected. It processes the new events into statistics that are then written to statistics databases.
3408
3413
3409
- :param project: Project name.
3410
- :param base_period: The time period in minutes in which the model monitoring controller
3411
- function triggers. By default, the base period is 10 minutes.
3412
- :param image: The image of the model monitoring controller, writer & monitoring
3413
- stream functions, which are real time nuclio functions.
3414
- By default, the image is mlrun/mlrun.
3415
- :param deploy_histogram_data_drift_app: If true, deploy the default histogram-based data drift application.
3416
- :param rebuild_images: If true, force rebuild of model monitoring infrastructure images.
3414
+ :param project: Project name.
3415
+ :param base_period: The time period in minutes in which the model monitoring controller
3416
+ function triggers. By default, the base period is 10 minutes.
3417
+ :param image: The image of the model monitoring controller, writer & monitoring
3418
+ stream functions, which are real time nuclio functions.
3419
+ By default, the image is mlrun/mlrun.
3420
+ :param deploy_histogram_data_drift_app: If true, deploy the default histogram-based data drift application.
3421
+ :param rebuild_images: If true, force rebuild of model monitoring infrastructure images.
3422
+ :param fetch_credentials_from_sys_config: If true, fetch the credentials from the system configuration.
3423
+
3417
3424
"""
3418
3425
self .api_call (
3419
3426
method = mlrun .common .types .HTTPMethod .POST ,
@@ -3423,6 +3430,7 @@ def enable_model_monitoring(
3423
3430
"image" : image ,
3424
3431
"deploy_histogram_data_drift_app" : deploy_histogram_data_drift_app ,
3425
3432
"rebuild_images" : rebuild_images ,
3433
+ "fetch_credentials_from_sys_config" : fetch_credentials_from_sys_config ,
3426
3434
},
3427
3435
)
3428
3436
@@ -3548,6 +3556,23 @@ def deploy_histogram_data_drift_app(
3548
3556
params = {"image" : image },
3549
3557
)
3550
3558
3559
+ def set_model_monitoring_credentials (
3560
+ self ,
3561
+ project : str ,
3562
+ credentials : dict [str , str ],
3563
+ ) -> None :
3564
+ """
3565
+ Set the credentials for the model monitoring application.
3566
+
3567
+ :param project: Project name.
3568
+ :param credentials: Credentials to set.
3569
+ """
3570
+ self .api_call (
3571
+ method = mlrun .common .types .HTTPMethod .POST ,
3572
+ path = f"projects/{ project } /model-monitoring/set-model-monitoring-credentials" ,
3573
+ params = {** credentials },
3574
+ )
3575
+
3551
3576
def create_hub_source (
3552
3577
self , source : Union [dict , mlrun .common .schemas .IndexedHubSource ]
3553
3578
):
0 commit comments