Amazon CloudWatch Integration Guide
Publish custom metrics and log events to Amazon CloudWatch from a pipeline, and read metric statistics and log events back.
- Status
- Beta
- Authentication
- IAM access keys or AWS SDK default credential chain
- Operations
- Put Metric Data · Get Metric Data · List Metrics · Put Log Events · Filter Log Events
- Limits
- 1,000 metric values or 10,000 log events per call
- Triggers
- None
Amazon CloudWatch is the monitoring service of AWS: custom metrics with dimensions, alarms and dashboards on them, and CloudWatch Logs for searchable log events. This guide covers connection setup, the five function types, and how the nodes fit into the Pipeline Designer.
The connector is tested against LocalStack, an AWS emulator, and not yet against AWS itself. LocalStack does not enforce every CloudWatch limit, so the connector checks the limits itself before it sends anything. See What is and is not checked.
Overview
The connector provides:
- Custom metrics with Put Metric Data: up to 1,000 values per call, each with a unit, a timestamp, up to 30 dimensions, and standard (60 s) or high (1 s) resolution
- Metric statistics with Get Metric Data: up to 500 metrics per call, any statistic CloudWatch computes (Average, Sum, Minimum, Maximum, SampleCount, percentiles such as p99)
- Metric discovery with List Metrics, by namespace, name and dimension
- Log events with Put Log Events: up to 10,000 events per call into a log stream, put into time order for you, with the stream created when it is missing
- Log search with Filter Log Events: a CloudWatch filter pattern over a log group in a time window
- Flexible authentication with IAM access keys or the AWS SDK default credential chain (environment variables, shared config, IRSA, instance profile)
- Custom endpoint support for LocalStack and VPC endpoints
CloudWatch bills every distinct combination of namespace, metric name and dimension values as one custom metric. Keep dimension values to a fixed set, such as a line or a machine. A dimension filled from a timestamp, a run id or free text creates a new billed metric on every write. The connector adds no dimension of its own. Use List Metrics on a namespace to count the combinations a pipeline has created.
Connection Configuration


The Amazon CloudWatch connection form
Amazon CloudWatch Connection Creation Fields
1. Profile Information
| Field | Default | Description |
|---|---|---|
| Profile Name | - | A descriptive name for this connection profile (required, max 100 characters) |
| Description | - | Optional description for this connection |
2. AWS Region
| Field | Default | Description |
|---|---|---|
| Region | us-east-1 | The AWS region of the metrics and log groups. Choose Custom Region... for a region not in the list. |
3. Authentication
| Field | Default | Description |
|---|---|---|
| Access Key ID | - | AWS Access Key ID. Leave empty to use the AWS SDK default credential chain. |
| Secret Access Key | - | AWS Secret Access Key. Required when Access Key ID is set. |
| Session Token | - | Session token for temporary credentials from AWS STS (optional). |
An Access Key ID without its Secret Access Key, or the reverse, is refused when you save. Half a key pair would otherwise fall through to the default chain and act as another identity.
The connection test calls cloudwatch:ListMetrics (on a namespace nothing lives in, so it costs one small call) and logs:DescribeLogGroups. Each function then needs its own permission:
| Function | Permission |
|---|---|
| Put Metric Data | cloudwatch:PutMetricData |
| Get Metric Data | cloudwatch:GetMetricData |
| List Metrics | cloudwatch:ListMetrics |
| Put Log Events | logs:PutLogEvents, and logs:CreateLogStream when the stream may be missing |
| Filter Log Events | logs:FilterLogEvents |
4. Advanced
| Field | Default | Description |
|---|---|---|
| Custom Endpoint | - | One endpoint URL for both CloudWatch and CloudWatch Logs, such as http://localhost:4566 for LocalStack. Leave empty for AWS. |
| Request Timeout | 30s | Default timeout for each CloudWatch call, between 1s and 1h. |
| Max Retries | 3 | SDK retries for transient failures (0 to 10). A write buffered by store-and-forward is sent once per attempt and the platform retries it. |
Function Builder
Creating Amazon CloudWatch Functions
- Open the connection and go to its Functions tab, then New Function
- Select the function type
- Configure the function parameters


Five function types: two writes, two reads and a discovery listing
Put Metric Data Function
Purpose: Publish metric values to a namespace with one PutMetricData call.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| Namespace | String | Yes | - | Your namespace, such as Plant/Line1. AWS/ is reserved for AWS services and refused. Supports ((parameter)) syntax. |
| Metric Data (JSON) | JSON | Yes | - | One value as an object, or an array of up to 1,000. Supports ((parameter)) syntax. |
| Timeout Override | Duration | No | - | Overrides the connection's request timeout for this function. |
Each value has these keys:
| Key | Required | Description |
|---|---|---|
metricName | Yes | The metric's name, up to 255 characters |
value | Yes | A finite number within ±2^360 |
unit | No | A CloudWatch unit: Seconds, Percent, Count, Bytes, None and the others CloudWatch lists |
timestamp | No | RFC 3339, such as 2026-11-17T08:00:00Z, or Unix milliseconds. Without one, the value is stamped with the produce time the platform hands the connector; give each value its own timestamp when its exact time matters |
dimensions | No | An object of dimension name to value, at most 30 |
storageResolution | No | 60 (standard) or 1 (high resolution) |
Example:
[
{"metricName": "Temperature", "value": ((temperature)), "unit": "None", "dimensions": {"line": "A", "machine": "M1"}},
{"metricName": "ScrapCount", "value": ((scrap)), "unit": "Count", "dimensions": {"line": "A"}}
]
CloudWatch keeps every value it is sent. If a write is sent again, for example when store-and-forward resends after a connection cut, the value becomes a second sample: Sum and SampleCount count it twice, while Average, Minimum and Maximum stay the same. CloudWatch has no request id that would let it drop a repeat.
The connector refuses, without calling AWS, more than 1,000 values, more than 30 dimensions, an empty dimension value, an unknown unit, a key it does not know (such as metric_name), and the AWS/ namespace. CloudWatch itself refuses values more than two weeks old or more than two hours ahead. Every such refusal is final: the node fails at once and is not retried.
Get Metric Data Function
Purpose: Read datapoints of one or more metrics of a namespace over a time window, newest first.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| Namespace | String | Yes | - | The namespace, such as Plant/Line1 or AWS/EC2 |
| Metrics (JSON) | JSON | Yes | - | An array of up to 500 objects with metricName, stat and optional dimensions and label |
| Period | Duration | No | 1m | The length of one datapoint: 1s, 5s, 10s, 20s, 30s, or any whole number of minutes. CloudWatch sets no limit beyond multiples of 60 s; the connector accepts up to 35791394m (2,147,483,640 seconds) |
| Window | Duration | No | 1h | How far back from the end time to read, up to 15 months (10920h) |
| End Time | String | No | now | RFC 3339. Empty means now, and the window then ends with the current period, so a value written a moment ago is included |
| Max Datapoints | Integer | No | 1000 | The most datapoints across every metric, 1 to 100,800 |
Example:
[{"metricName": "Temperature", "stat": "Average", "dimensions": {"line": "A"}},
{"metricName": "Temperature", "stat": "p99", "dimensions": {"line": "A"}}]
Max Datapoints goes to CloudWatch as MaxDatapoints on every page, so a small budget costs one small call. When the budget stops the read and more datapoints exist, _metadata.truncated is true. CloudWatch keeps 1-second data for 3 hours, 1-minute data for 15 days, 5-minute data for 63 days and 1-hour data for 455 days.
List Metrics Function
Purpose: List metrics with their namespace, name and dimensions.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| Namespace | String | No | - | Only metrics of this namespace |
| Metric Name | String | No | - | Only metrics with this name |
| Dimensions (JSON) | JSON | No | - | An object of name to value; an empty value matches any value, such as {"line": "A", "machine": ""} |
| Recently Active Only | Boolean | No | false | Only metrics that received data in the past three hours |
| Max Items | Integer | No | 100 | The most metrics to return, 1 to 10,000 |
CloudWatch answers 500 metrics per page. The connector stops paging once Max Items is met and sets _metadata.truncated when more exist.
Put Log Events Function
Purpose: Write events into one log stream of an existing log group.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| Log Group | String | Yes | - | An existing log group, such as /plant/line1. The connector never creates a log group: its retention and encryption are yours to choose. |
| Log Stream | String | Yes | - | The stream inside the group. It is created when it does not exist. |
| Events | Text | Yes | - | Text that is a JSON array is the list of events: up to 10,000, each a string or an object with message and an optional timestamp (RFC 3339 or Unix milliseconds); a message that is not a string is JSON-encoded, and any key beside message and timestamp is refused. An object without message, such as {"line":"A"}, is itself the message, as its JSON text. A ((lines)) filled with an upstream array works this way. Any other text is exactly one event, as written: [WARN] spindle overload, {machine M1} stopped and a JSON object line such as {"line":"A"} alike. Only a line that is itself a valid JSON array, such as [1,2], is read as a list of events. Supports ((parameter)) syntax. |
| Timeout Override | Duration | No | - | Overrides the connection's request timeout for this function. |
Example (one event): line ((line)) stopped: ((reason))
Example (several events; or ((lines)) filled with such an array upstream):
[{"message": {"line": "A", "state": "stopped", "code": 42}, "timestamp": "2026-11-17T08:00:00Z"}, "operator acknowledged"]
CloudWatch Logs refuses a call whose events are out of time order, so the connector sorts them by timestamp first. Events with the same timestamp keep the order you gave. One call may hold at most 1 MiB (each event counts its message plus 26 bytes), and its valid events (those within 14 days back and 2 hours ahead) may span at most 24 hours; a larger call is refused before sending, so split it upstream.
CloudWatch Logs can take some events of a call and refuse others: those older than 14 days or the group's retention, and those more than two hours ahead. The node reports each refused event in result.rejected, by its position in what you gave. With store-and-forward on and a write key, the call then fails as permanent, since CloudWatch would refuse those events again, so an On Error branch sees which events landed; without store-and-forward the node succeeds and is marked partial. When store-and-forward resends the write, only the events that did not land are sent again. An event sent twice is two events: CloudWatch Logs does not drop a repeat.
Filter Log Events Function
Purpose: Search a log group for events matching a filter pattern in a time window, oldest first.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| Log Group | String | Yes | - | The log group to search |
| Log Stream Prefix | String | No | - | Only streams whose names start with this |
| Filter Pattern | String | No | - | A CloudWatch Logs filter pattern, such as ERROR, "disk full" or { $.level = "error" } |
| Window | Duration | No | 1h | How far back from the end time to search |
| End Time | String | No | now | RFC 3339 |
| Max Events | Integer | No | 100 | The most events to return, 1 to 10,000 |
Max Events goes to CloudWatch Logs as the page limit. The result is also held to the platform's query-result byte budget (40 MiB by default, the same budget SQL query results keep); reaching it ends the search with _metadata.truncated true and _metadata.truncatedBy bytes. The connector follows the next-page token until the budget is met or the window is searched; CloudWatch Logs may answer empty pages while it scans, and the call's timeout bounds the search. A search cut short by its timeout fails; it never returns the events found so far as a success.
Using Parameters
The ((parameterName)) syntax makes a function reusable. Parameters are detected from the text fields and can be given a type, a default and a description.


Dynamic parameters for a Put Metric Data function
Every text field takes parameters: Namespace, Metric Data, Metrics, End Time, Metric Name, Dimensions, Log Group, Log Stream, Events, Log Stream Prefix and Filter Pattern. A value that holds a parameter is checked when the pipeline fills it in, not when you save.
Pipeline Integration
Use the functions you create here as nodes in the Pipeline Designer.
- Amazon CloudWatch Nodes: Put Metric Data, Get Metric Data, List Metrics, Put Log Events and Filter Log Events as pipeline steps
Put Metric Data and Put Log Events can be buffered by store-and-forward when CloudWatch is unreachable. Delivery is at least once: a write in flight at a connection cut can arrive twice.
Common Use Cases
Plant KPIs on a CloudWatch Dashboard
Scenario: OEE, scrap rate and cycle time per line should appear on the operations team's CloudWatch dashboard, with an alarm when OEE drops.
Function: Put Metric Data, namespace Plant/Line1, one value per KPI with the dimension line.
Pipeline Integration: A schedule trigger computes the KPIs every minute and the Put Metric Data node publishes them. A CloudWatch alarm on OEE notifies the shift lead.
Machine Alarms in CloudWatch Logs
Scenario: Alarms from the PLCs should be searchable next to the application logs of the plant's cloud services.
Function: Put Log Events into /plant/line1, stream alarms, with the alarm as a JSON message.
Pipeline Integration: An OPC UA trigger fires per alarm and the node writes it. A Logs Insights query or a metric filter on the group counts alarms per machine.
Shift Report From Metric Statistics
Scenario: The end-of-shift report needs the average and p99 temperature of each line.
Function: Get Metric Data with a 5 minute period over an 8 hour window.
Pipeline Integration: The node's result.series feeds a transform that builds the report table.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Connection test: "not authorized to call logs:DescribeLogGroups" | The principal lacks a permission the connection check needs | Grant cloudwatch:ListMetrics and logs:DescribeLogGroups |
| "namespace starts with AWS/" | AWS/ is reserved for AWS services | Use your own namespace, such as Plant/Line1 |
| "log group does not exist" | The connector never creates log groups | Create the group with the retention you want, then run again |
Some events in result.rejected with tooOld or expired | Their timestamps are older than 14 days (tooOld) or than the group's retention (expired) | Send events while they are recent, or raise the group's retention |
A line such as [1,2] arrived as two events | Text that is a valid JSON array is read as a list of events | Send it inside an array, ["[1,2]"], to keep it one event |
| Throttling errors | The account's request quota was exceeded | The platform waits and retries; batch more values per call |
| The metric bill grows with every run | A dimension takes a new value every run | Keep dimension values to a fixed set; check with List Metrics |
What Is and Is Not Checked
The connector is tested against LocalStack 3.8.1. These parts are emulated faithfully and covered by tests against it: publishing and reading metrics (a repeated value counts as a second sample), listing metrics with dimension filters, writing log events (including the time order rule and a missing group or stream), and the page limit of Filter Log Events.
LocalStack does not enforce the 1,000 values per call, the reserved AWS/ namespace, the 24 hour span or empty messages: the connector checks these before sending, and unit tests cover them. How CloudWatch Logs numbers the events it refuses (too old, too new, expired) cannot be checked on LocalStack, which numbers them differently from AWS; the connector follows the AWS API reference, and unit tests hold it to that. LocalStack ignores filter patterns and emulates no throttling: tests check that the pattern is sent and that throttling errors get the right verdict. The CloudWatch API is called over the AWS Query protocol, which CloudWatch has always accepted, because LocalStack does not serve the CBOR protocol newer AWS SDKs use by default.