Construct deep-link URLs for the AWS CloudWatch console — Logs Insights queries, Alarm detail pages, Metrics graphs. Use when encoding log groups, time ranges, query strings, metric dimensions, or opening CloudWatch views in a Playwright browser session. Keywords: CloudWatch deep-link Logs-Insights alarm metrics fragment-encoding *XX-encoding epoch timestamp hash-routing url-construction SPA alarm-detail metric-graph log-group query-string cloudwatch-console.
71
89%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
CloudWatch URLs use the URL fragment (#) for all navigation state. The fragment is
never sent to the server: it is interpreted entirely by the browser-side CloudWatch SPA.
Standard %XX encoding does not apply inside fragment values; CloudWatch uses *XX
(asterisk + uppercase hex) instead.
~, (, ), ') literal.*XX encoding to value portions only. Structural characters (~, (, ), ') stay literal.references/encoding-reference.md.*3a-encoded colons, and the region appears in both the subdomain and the query string.Rule of thumb for alarms: navigate to the alarm detail page first. It shows the exact
metric that triggered the alarm, which may be a Logs metric filter rather than a native
AWS/Lambda metric.
Common *XX encodings for value portions:
| Character | Encoded |
|---|---|
| space | *20 |
, | *2c |
/ | *2f |
: | *3a |
@ | *40 |
| | *7c |
| newline | *0a |
Between path segments after the #, ? becomes $3F, = becomes $3D and & becomes $26.
python3 -c "import sys; print(''.join(c if c.isalnum() or c in \"-_.~()'?\" else '*%02x' % ord(c) for c in sys.argv[1]))" '/aws/lambda/my-service-prod-Handler'Expected result: *2faws*2flambda*2fmy-service-prod-Handler.
https://{region}.console.aws.amazon.com/cloudwatch/home?region={region}#logsV2:logs-insights$3FqueryDetail$3D~(end~'{end_iso}~start~'{start_iso}~timeType~'ABSOLUTE~tz~'UTC~editorString~'{encoded_query}~source~(~'{encoded_log_group})~lang~'CWLI~logClass~'STANDARD~queryBy~'logGroupName)Expected result: a link that opens the query pre-filled for the given UTC window.
https://{region}.console.aws.amazon.com/cloudwatch/home?region={region}#alarmsV2:alarm/{alarm_name}?~(timeRange~(startDate~'{start_iso}~endDate~'{end_iso}))Expected result: the alarm page showing the metric graph for the whole incident window.
https://{region}.console.aws.amazon.com/cloudwatch/home?region={region}#metricsV2:graph=~(metrics~(~(~'{namespace}~'{metric_name}~'{dimension_name}~'{dimension_value}))~start~'{start_iso}~end~'{end_iso}~stat~'{stat}~period~{period_seconds})Expected result: a graph for one metric and dimension with the chosen statistic and period.
2026-04-07T02*3a30*3a00.000ZExpected result: a UTC timestamp whose colons are written as *3a.
%XX percent-encoding inside CloudWatch fragment valuesWHY: CloudWatch fragment values use *XX (asterisk + uppercase hex). Using %XX produces a
broken URL the SPA silently ignores or misparses, loading the wrong query or a blank Logs Insights view.
BAD: %2faws%2flambda%2fmy-fn
GOOD: *2faws*2flambda*2fmy-fn
WHY: Logs Insights start/end require ISO 8601 UTC strings. Epoch numbers (for example
start~'1775529000) make the SPA fall back to epoch 0 (1970-01-01), giving a window spanning
decades and useless results.
BAD: start~'1775529000
GOOD: start~'2026-04-07T02*3a30*3a00.000Z with tz~'UTC and no unit~'seconds.
AWS/Lambda Errors metric to verify an alarmWHY: Lambda alarms may be driven by a CloudWatch Logs metric filter rather than the native metric. The native metric counts failed invocations; the filter counts ERROR log lines, and the two diverge when an invocation exits cleanly but logs application-level errors.
BAD: Open Metrics, then AWS/Lambda, then Errors, and treat the graph as the alarm's evidence.
GOOD: Open the alarm detail page, which shows exactly which metric triggered the alarm.
region= from the query stringWHY: CloudWatch uses region= to decide which region's data to load. Without it the console
defaults to the last-used region in that browser.
BAD: https://eu-west-1.console.aws.amazon.com/cloudwatch/home#alarmsV2:alarm/{name}
GOOD: https://eu-west-1.console.aws.amazon.com/cloudwatch/home?region=eu-west-1#alarmsV2:alarm/{name}
WHY: All CloudWatch timestamp parameters (startDate, endDate, start, end) are UTC.
Writing BST times with a Z suffix silently opens the wrong window.
BAD: An alarm fired at 03:44 BST written as 2026-04-07T03*3a44*3a00.000Z.
GOOD: 2026-04-07T02*3a44*3a00.000Z, derived from the UTC event timestamp.
WHY: Without ?~(timeRange~(...)) the page defaults to a rolling recent window. A screenshot
taken after the incident no longer shows the alarm spike.
BAD: ...#alarmsV2:alarm/{alarm_name}
GOOD: Append ?~(timeRange~(startDate~'{start_iso}~endDate~'{end_iso})) with a UTC window
bracketing the incident from a few minutes before OK to ALARM until the final OK state.
~, (, ) or 'WHY: They are the fragment's own syntax. Encoding them changes the structure the SPA parses.
BAD: *7etimeRange*7e*28startDate
GOOD: ~(timeRange~(startDate~'2026-04-07T02*3a44*3a00.000Z))
?, = or & unencoded between path segments after the #WHY: Between path segments they must be written $3F, $3D and $26, otherwise the router
splits the fragment in the wrong place.
BAD: #logsV2:logs-insights?queryDetail=~(...)
GOOD: #logsV2:logs-insights$3FqueryDetail$3D~(...)
WHY: Encoding rules differ per service, so a link built with CloudWatch rules may not open the S3 or EC2 console correctly.
BAD: Applying *XX encoding to an S3 console URL.
GOOD: Look up the encoding rules for that service before building its link.
| Topic | Reference | When to Use |
|---|---|---|
| Encoding rules and URL templates | encoding-reference.md | Composing any Logs Insights, alarm or metrics URL |
Companion skill aws-console-navigator, in the same toolkit, covers SSO auth, region switching and Playwright navigation.
pantheon-org/tekhne
48ef197
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.