10
10
from sagemaker .hyperpod .inference .hp_jumpstart_endpoint import HPJumpStartEndpoint
11
11
from sagemaker .hyperpod .inference .hp_endpoint import HPEndpoint
12
12
from sagemaker_core .resources import Endpoint
13
+ from sagemaker .hyperpod .common .telemetry .telemetry_logging import (
14
+ _hyperpod_telemetry_emitter ,
15
+ )
16
+ from sagemaker .hyperpod .common .telemetry .constants import Feature
13
17
14
18
15
19
# CREATE
26
30
schema_pkg = "hyperpod_jumpstart_inference_template" ,
27
31
registry = JS_REG ,
28
32
)
33
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "create_js_endpoint_cli" )
29
34
def js_create (namespace , version , js_endpoint ):
30
35
"""
31
36
Create a jumpstart model endpoint.
@@ -47,6 +52,7 @@ def js_create(namespace, version, js_endpoint):
47
52
schema_pkg = "hyperpod_custom_inference_template" ,
48
53
registry = C_REG ,
49
54
)
55
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "create_custom_endpoint_cli" )
50
56
def custom_create (namespace , version , custom_endpoint ):
51
57
"""
52
58
Create a custom model endpoint.
@@ -76,6 +82,7 @@ def custom_create(namespace, version, custom_endpoint):
76
82
default = "application/json" ,
77
83
help = "Optional. The content type of the request to invoke. Default set to 'application/json'" ,
78
84
)
85
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "invoke_custom_endpoint_cli" )
79
86
def custom_invoke (
80
87
endpoint_name : str ,
81
88
body : str ,
@@ -128,6 +135,7 @@ def custom_invoke(
128
135
default = "default" ,
129
136
help = "Optional. The namespace of the jumpstart model endpoint to list. Default set to 'default'" ,
130
137
)
138
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "list_js_endpoints_cli" )
131
139
def js_list (
132
140
namespace : Optional [str ],
133
141
):
@@ -170,6 +178,7 @@ def js_list(
170
178
default = "default" ,
171
179
help = "Optional. The namespace of the custom model endpoint to list. Default set to 'default'" ,
172
180
)
181
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "list_custom_endpoints_cli" )
173
182
def custom_list (
174
183
namespace : Optional [str ],
175
184
):
@@ -226,6 +235,7 @@ def custom_list(
226
235
required = False ,
227
236
help = "Optional. If set to `True`, the full json will be displayed" ,
228
237
)
238
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "get_js_endpoint_cli" )
229
239
def js_describe (
230
240
name : str ,
231
241
namespace : Optional [str ],
@@ -374,6 +384,7 @@ def js_describe(
374
384
required = False ,
375
385
help = "Optional. If set to `True`, the full json will be displayed" ,
376
386
)
387
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "get_custom_endpoint_cli" )
377
388
def custom_describe (
378
389
name : str ,
379
390
namespace : Optional [str ],
@@ -548,6 +559,7 @@ def custom_describe(
548
559
default = "default" ,
549
560
help = "Optional. The namespace of the jumpstart model endpoint to delete. Default set to 'default'." ,
550
561
)
562
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "delete_js_endpoint_cli" )
551
563
def js_delete (
552
564
name : str ,
553
565
namespace : Optional [str ],
@@ -573,6 +585,7 @@ def js_delete(
573
585
default = "default" ,
574
586
help = "Optional. The namespace of the custom model endpoint to delete. Default set to 'default'." ,
575
587
)
588
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "delete_custom_endpoint_cli" )
576
589
def custom_delete (
577
590
name : str ,
578
591
namespace : Optional [str ],
@@ -592,6 +605,7 @@ def custom_delete(
592
605
default = "default" ,
593
606
help = "Optional. The namespace of the jumpstart model to list pods for. Default set to 'default'." ,
594
607
)
608
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "list_pods_js_endpoint_cli" )
595
609
def js_list_pods (
596
610
namespace : Optional [str ],
597
611
):
@@ -611,6 +625,7 @@ def js_list_pods(
611
625
default = "default" ,
612
626
help = "Optional. The namespace of the custom model to list pods for. Default set to 'default'." ,
613
627
)
628
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "list_pods_custom_endpoint_cli" )
614
629
def custom_list_pods (
615
630
namespace : Optional [str ],
616
631
):
@@ -642,6 +657,7 @@ def custom_list_pods(
642
657
default = "default" ,
643
658
help = "Optional. The namespace of the jumpstart model to get logs for. Default set to 'default'." ,
644
659
)
660
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "get_logs_js_endpoint" )
645
661
def js_get_logs (
646
662
pod_name : str ,
647
663
container : Optional [str ],
@@ -675,6 +691,7 @@ def js_get_logs(
675
691
default = "default" ,
676
692
help = "Optional. The namespace of the custom model to get logs for. Default set to 'default'." ,
677
693
)
694
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "get_logs_custom_endpoint" )
678
695
def custom_get_logs (
679
696
pod_name : str ,
680
697
container : Optional [str ],
@@ -695,6 +712,7 @@ def custom_get_logs(
695
712
required = True ,
696
713
help = "Required. The time frame to get logs for." ,
697
714
)
715
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "get_js_operator_logs" )
698
716
def js_get_operator_logs (
699
717
since_hours : float ,
700
718
):
@@ -713,6 +731,7 @@ def js_get_operator_logs(
713
731
required = True ,
714
732
help = "Required. The time frame get logs for." ,
715
733
)
734
+ @_hyperpod_telemetry_emitter (Feature .HYPERPOD_CLI , "get_custom_operator_logs" )
716
735
def custom_get_operator_logs (
717
736
since_hours : float ,
718
737
):
0 commit comments