Technologies/LocalStack/localstack.cloudwatch.metrics.put
LocalStackLocalStackMetric

localstack.cloudwatch.metrics.put

CloudWatch metrics published
Dimensions:None
Available on:Native (1)PrometheusPrometheus (1)
Interface Metrics (2)
Native
Number of custom metrics published to CloudWatch
Dimensions:None
PrometheusPrometheus
Total number of CloudWatch metric data points published
Dimensions:None

Technical Annotations (33)

Configuration Parameters (1)
PROVIDER_OVERRIDE_CLOUDWATCHrecommended: v1
Reverts to CloudWatch v1 provider to bypass strict dimension matching in v2
Error Signatures (7)
exception while calling cloudwatch.GetMetricData: 'MetricStat'exception
KeyError: 'MetricStat'exception
500http status
InternalErrorerror code
Cannot read properties of undefined (reading 'Sum')exception
500 Internal Server Errorhttp status
KeyError: 'Value'exception
CLI Commands (8)
awslocal cloudwatch get-metric-data --metric-data-queries file:///path/to/metrics.json --start-time 2024-10-01T00:00:0000 --end-time 2024-10-01T23:00:0000diagnostic
awslocal cloudwatch put-metric-data --namespace "service/my-service" --metric-name "request.count" --dimensions call_type=service_call --value 0.2diagnostic
awslocal cloudwatch put-metric-data --namespace test --metric-data MetricName=TestCounter,Values=10,1,Counts=1,1diagnostic
awslocal cloudwatch get-metric-statistics --namespace test --metric-name TestCounter --statistics Maximum --period 60 --start-time 2022-11-9T00:00:00Z --end-time 2022-11-11T00:00:00Zdiagnostic
aws --endpoint=http://localhost:4566 cloudwatch put-metric-data --namespace test --statistic-values "Maximum=10,Minimum=1,Sum=50,SampleCount=5" --timestamp 2022-11-15T18:00:00Z --unit Count --metric-name "TestMetric"diagnostic
aws --endpoint=http://localhost:4566 cloudwatch get-metric-statistics --metric-name TestMetric --namespace test --start-time 2022-11-15T00:00:00Z --end-time 2022-11-15T20:00:00Z --period 60 --statistics Averagediagnostic
aws --endpoint=http://localhost:4582 cloudwatch put-metric-data --metric-name RequestLatency --namespace GetStarted --timestamp 2016-10-14T20:30:00Z --value 235 --unit Millisecondsdiagnostic
aws --endpoint=http://localhost:4582 cloudwatch put-metric-data --metric-name RequestLatency --namespace GetStarted --timestamp 2016-10-14T21:30:00Z --statistic-values Sum=577,Minimum=65,Maximum=189,SampleCount=5 --unit Millisecondsdiagnostic
Technical References (17)
MetricStatcomponentExpressioncomponentprovider_v2.pyfile pathREMOVE_EMPTYconceptSEARCHconceptCloudWatch v2 providercomponentDimensionsconceptPutMetricDatacomponentCloudWatchcomponentawslocalcomponentStatisticValuescomponentStatisticsValuesconceptMetricDatumcomponentmotocomponentGetMetricStatisticsconceptput-metric-datacomponentstatistic-valuescomponent
Related Insights (6)
CloudWatch get-metric-data with Expression parameter fails with KeyErrorwarning
Dimension mismatch causes empty CloudWatch metric query resultswarning
CloudWatch PutMetricData with array values returns zero in LocalStack 1.2.0warning
CloudWatch PutMetricData with StatisticValues returns zero in LocalStackwarning
CloudWatch StatisticsValues parameter ignored in PutMetricDatawarning
CloudWatch put-metric-data fails with statistic-values parameterwarning