From 6bf3befb21afa40303439ed22421c552e78ebb0e Mon Sep 17 00:00:00 2001 From: Kelvin Isievwore Date: Fri, 10 Apr 2026 22:18:31 +0100 Subject: [PATCH] Fix cross-platform date command in SageMaker guide --- guides/2_sagemaker.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guides/2_sagemaker.md b/guides/2_sagemaker.md index f84eeda1..98b4f0bd 100644 --- a/guides/2_sagemaker.md +++ b/guides/2_sagemaker.md @@ -273,11 +273,24 @@ Beyond what we've deployed, SageMaker offers: While your endpoint is running, check its CloudWatch metrics: +**Mac:** +```bash +# View invocation metrics +aws cloudwatch get-metric-statistics --namespace "AWS/SageMaker" --metric-name "Invocations" --dimensions Name=EndpointName,Value=alex-embedding-endpoint --start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) --period 300 --statistics Sum --region $(aws configure get region) +``` + +**Linux:** ```bash # View invocation metrics aws cloudwatch get-metric-statistics --namespace "AWS/SageMaker" --metric-name "Invocations" --dimensions Name=EndpointName,Value=alex-embedding-endpoint --start-time $(date -u -d '1 hour ago' +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) --period 300 --statistics Sum --region $(aws configure get region) ``` +**Windows (PowerShell):** +```powershell +# View invocation metrics +aws cloudwatch get-metric-statistics --namespace "AWS/SageMaker" --metric-name "Invocations" --dimensions Name=EndpointName,Value=alex-embedding-endpoint --start-time (Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ss") --end-time (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss") --period 300 --statistics Sum --region (aws configure get region) +``` + This shows how SageMaker automatically tracks model usage - essential for MLOps! ## Troubleshooting