Skip to content

Commit

Permalink
[Model Monitoring] Fix default HTTP path when CE namespace is not `ml…
Browse files Browse the repository at this point in the history
…run` (mlrun#5229)
  • Loading branch information
Eyal-Danieli committed Mar 3, 2024
1 parent c8b9eb6 commit fac6f7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions mlrun/common/model_monitoring/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ def parse_monitoring_stream_path(
if application_name is None:
stream_uri = (
mlrun.mlconf.model_endpoint_monitoring.default_http_sink.format(
project=project
project=project, namespace=mlrun.mlconf.namespace
)
)
else:
stream_uri = (
mlrun.mlconf.model_endpoint_monitoring.default_http_sink_app.format(
project=project, application_name=application_name
project=project,
application_name=application_name,
namespace=mlrun.mlconf.namespace,
)
)
return stream_uri
Expand Down
4 changes: 2 additions & 2 deletions mlrun/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@
"offline_storage_path": "model-endpoints/{kind}",
# Default http path that points to the monitoring stream nuclio function. Will be used as a stream path
# when the user is working in CE environment and has not provided any stream path.
"default_http_sink": "http://nuclio-{project}-model-monitoring-stream.mlrun.svc.cluster.local:8080",
"default_http_sink_app": "http://nuclio-{project}-{application_name}.mlrun.svc.cluster.local:8080",
"default_http_sink": "http://nuclio-{project}-model-monitoring-stream.{namespace}.svc.cluster.local:8080",
"default_http_sink_app": "http://nuclio-{project}-{application_name}.{namespace}.svc.cluster.local:8080",
"batch_processing_function_branch": "master",
"parquet_batching_max_events": 10_000,
"parquet_batching_timeout_secs": timedelta(minutes=1).total_seconds(),
Expand Down
2 changes: 1 addition & 1 deletion mlrun/model_monitoring/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ def _update_drift_in_prometheus(
"""
stream_http_path = (
mlrun.mlconf.model_endpoint_monitoring.default_http_sink.format(
project=self.project
project=self.project, namespace=mlrun.mlconf.namespace
)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/model_monitoring/test_target_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_get_stream_path():
stream_path = mlrun.model_monitoring.get_stream_path(project=TEST_PROJECT)
assert (
stream_path
== f"http://nuclio-{TEST_PROJECT}-model-monitoring-stream.mlrun.svc.cluster.local:8080"
== f"http://nuclio-{TEST_PROJECT}-model-monitoring-stream.{mlrun.mlconf.namespace}.svc.cluster.local:8080"
)

# kafka stream path from env
Expand Down

0 comments on commit fac6f7a

Please sign in to comment.