Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sagemaker-core/src/sagemaker/core/experiments/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from sagemaker.core.experiments.trial import _Trial
from sagemaker.core.experiments.trial_component import _TrialComponent
from sagemaker.core.common_utils import format_tags
from sagemaker.core.telemetry.telemetry_logging import _telemetry_emitter
from sagemaker.core.telemetry.constants import Feature


class Experiment(_base_types.Record):
Expand Down Expand Up @@ -93,6 +95,7 @@ def load(cls, experiment_name, sagemaker_session=None):
)

@classmethod
@_telemetry_emitter(feature=Feature.MLOPS, func_name="experiment.create")
def create(
cls,
experiment_name,
Expand Down
14 changes: 6 additions & 8 deletions sagemaker-core/src/sagemaker/core/telemetry/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
class Feature(Enum):
"""Enumeration of feature names used in telemetry."""

SDK_DEFAULTS = 1
LOCAL_MODE = 2
REMOTE_FUNCTION = 3
MODEL_TRAINER = 4
ESTIMATOR = 5
HYPERPOD = 6 # Added to support telemetry in sagemaker-hyperpod-cli
HYPERPOD_CLI = 7 # Added to support telemetry in sagemaker-hyperpod-cli
MODEL_CUSTOMIZATION = 8
SDK_DEFAULTS = 11
LOCAL_MODE = 12
REMOTE_FUNCTION = 13
MODEL_TRAINER = 14
MODEL_CUSTOMIZATION = 15
MLOPS = 16

def __str__(self): # pylint: disable=E0307
"""Return the feature name."""
Expand Down
11 changes: 6 additions & 5 deletions sagemaker-core/src/sagemaker/core/telemetry/telemetry_logging.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want MLOPS to also be equal to 8 like model customization? Should this be 9?

Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@
)

FEATURE_TO_CODE = {
str(Feature.SDK_DEFAULTS): 1,
str(Feature.LOCAL_MODE): 2,
str(Feature.REMOTE_FUNCTION): 3,
str(Feature.MODEL_TRAINER): 4,
str(Feature.MODEL_CUSTOMIZATION): 8,
str(Feature.SDK_DEFAULTS): 11,
str(Feature.LOCAL_MODE): 12,
str(Feature.REMOTE_FUNCTION): 13,
str(Feature.MODEL_TRAINER): 14,
str(Feature.MODEL_CUSTOMIZATION): 15,
str(Feature.MLOPS): 16,
}

STATUS_TO_CODE = {
Expand Down
4 changes: 4 additions & 0 deletions sagemaker-mlops/src/sagemaker/mlops/workflow/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
)
from sagemaker.core.workflow.utilities import list_to_request
from sagemaker.mlops.workflow._steps_compiler import StepsCompiler
from sagemaker.core.telemetry.telemetry_logging import _telemetry_emitter
from sagemaker.core.telemetry.constants import Feature

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -139,6 +141,7 @@ def latest_pipeline_version_id(self):
else:
return summaries[0].get("PipelineVersionId")

@_telemetry_emitter(feature=Feature.MLOPS, func_name="pipeline.create")
def create(
self,
role_arn: str = None,
Expand Down Expand Up @@ -348,6 +351,7 @@ def delete(self) -> Dict[str, Any]:
)
return self.sagemaker_session.sagemaker_client.delete_pipeline(PipelineName=self.name)

@_telemetry_emitter(feature=Feature.MLOPS, func_name="pipeline.start")
def start(
self,
parameters: Dict[str, Union[str, bool, int, float]] = None,
Expand Down
Loading