execute_promql_query | Execute an instant PromQL query against CloudWatch.
Returns the current value of metrics at a single point in time (instant vector).
For time series over a range, use execute_promql_range_query instead.
Use this tool when:
- The user provides a PromQL expression
- The user references OTLP-ingested metrics or labels (@resource.*, @aws.*, @instrumentation.*)
- The user asks about enriched vended AWS metrics with OTel labels
- The user wants to query by AWS resource tags (@aws.tag.*)
Use get_metric_data instead when:
- The user references classic CloudWatch namespaces/dimensions (AWS/EC2, etc.)
- The user wants Metrics Insights SQL syntax
PromQL label conventions (OTLP scope to label mapping):
- @resource.{attr} - OTel resource attributes (e.g., @resource.service.name="myservice")
- @instrumentation.{attr} - instrumentation scope (e.g., @instrumentation.@name="cloudwatch.aws/ec2")
- @datapoint.{attr} or bare - datapoint attributes / CW dimensions (e.g., InstanceId="i-xxx")
- @aws.account_id, @aws.region - AWS system labels
- @aws.tag.{Key} - AWS resource tags (e.g., @aws.tag.Environment="production", @aws.tag.Team="backend")
For enriched vended AWS metrics, use histogram functions
(OTel enrichment must be enabled first: `aws cloudwatch start-otel-enrichment`):
- histogram_avg({CPUUtilization, "@instrumentation.@name"="cloudwatch.aws/ec2"})
- histogram_sum({Invocations, FunctionName="my-func"})
Limits: max 500 series returned, 7-day range, 20s timeout.
Example queries:
- {"http.server.active_requests", "@resource.service.name"="myservice"}
- histogram_avg({CPUUtilization, "@instrumentation.@name"="cloudwatch.aws/ec2"})
- sum by ("@aws.tag.Team")(histogram_sum({Invocations, "@instrumentation.@name"="cloudwatch.aws/lambda"})) |
execute_promql_range_query | Execute a PromQL range query against CloudWatch.
Returns time series data over a time range (matrix). Use for trend analysis and graphs.
Use this tool when:
- The user provides a PromQL expression and wants data over a time window
- The user references OTLP-ingested metrics or labels (@resource.*, @aws.*, @instrumentation.*)
- The user asks about enriched vended AWS metrics with OTel labels
Use get_metric_data instead when:
- The user references classic CloudWatch namespaces/dimensions (AWS/EC2, etc.)
- The user wants Metrics Insights SQL syntax
For enriched vended AWS metrics, use histogram functions
(OTel enrichment must be enabled first: `aws cloudwatch start-otel-enrichment`):
- histogram_avg({CPUUtilization, "@instrumentation.@name"="cloudwatch.aws/ec2"})
- histogram_sum({Errors, "@instrumentation.@name"="cloudwatch.aws/lambda", "@aws.tag.Team"="backend"})
Limits: max 500 series, max 7-day range (including lookback), 20s timeout.
Example:
query: 'avg_over_time({"http.server.active_requests", "@resource.service.name"="myservice"}[5m])'
start: "2024-01-01T00:00:00Z"
end: "2024-01-01T01:00:00Z"
step: "5m" |