Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c651b6f

Browse files
committedMar 26, 2024
Adding timestamp to single_metric
1 parent dee6313 commit c651b6f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

‎aws_lambda_powertools/metrics/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def set_timestamp(self, timestamp: int | datetime.datetime):
307307
# See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Monitoring-CloudWatch-Metrics.html
308308
if not validate_emf_timestamp(timestamp):
309309
warnings.warn(
310-
"This metric is outside of constraints and will be skipped By Amazon CloudWatch. "
310+
"This metric doesn't meet the requirements and will be skipped by Amazon CloudWatch. "
311311
"Ensure the timestamp is within 14 days past or 2 hours future.",
312312
stacklevel=2,
313313
)

‎aws_lambda_powertools/metrics/provider/cloudwatch_emf/cloudwatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def set_timestamp(self, timestamp: int | datetime.datetime):
315315
# See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Monitoring-CloudWatch-Metrics.html
316316
if not validate_emf_timestamp(timestamp):
317317
warnings.warn(
318-
"This metric is outside of constraints and will be skipped By Amazon CloudWatch. "
318+
"This metric doesn't meet the requirements and will be skipped by Amazon CloudWatch. "
319319
"Ensure the timestamp is within 14 days past or 2 hours future.",
320320
stacklevel=2,
321321
)

‎tests/functional/metrics/test_metrics_cloudwatch_emf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,6 @@ def lambda_handler(evt, ctx):
12851285
lambda_handler({}, {})
12861286
assert len(w) == 1
12871287
assert str(w[-1].message) == (
1288-
"This metric is outside of constraints and will be skipped By Amazon CloudWatch. "
1288+
"This metric doesn't meet the requirements and will be skipped by Amazon CloudWatch. "
12891289
"Ensure the timestamp is within 14 days past or 2 hours future."
12901290
)

0 commit comments

Comments
 (0)
Please sign in to comment.