From 5f3b360579cc6b4a4a856b40814bacf7a100b8c8 Mon Sep 17 00:00:00 2001 From: kozub Date: Thu, 4 Jan 2024 13:36:38 +0100 Subject: [PATCH] doc: update metrics describtion --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 23db5a71..07872ad0 100644 --- a/README.md +++ b/README.md @@ -154,16 +154,15 @@ const flow = new OnDemandFlow(stack, 'OnDemandFlow', { ### Metrcis -Each flow reports the following metrics in the `AWS/AppFlow` namespace: +Each flow allows to access metrics through the methods: +- `metricFlowExecutionsStarted` +- `metricFlowExecutionsFailed` +- `metricFlowExecutionsSucceeded` +- `metricFlowExecutionTime` +- `metricFlowExecutionRecordsProcessed` -|Metric name|Description| -|---|---| -|FlowExecutionsStarted|The number of flow runs started.| -|FlowExecutionsFailed|The number of failed flow runs.| -|FlowExecutionsSucceeded|The number of successful flow runs.| -|FlowExecutionTime|The interval, in milliseconds, between the time the flow starts and the time it finishes.| -|FlowExecutionRecordsProcessed|The number of records that Amazon AppFlow attempted to transfer for the flow run. This metric counts all records that Amazon AppFlow processed internally. The processed records include those that transferred successfully and those that failed to transfer because the flow run failed.| +For detailed information about AppFlow metrics refer to [the documentation](https://docs.aws.amazon.com/appflow/latest/userguide/monitoring-cloudwatch.html). It can be consume by CloudWatch alert using as in the example below: @@ -175,11 +174,12 @@ import { Stack } from 'aws-cdk-lib'; declare const flow: IFlow; declare const stack: Stack; -const metric = flow.metricFlowExecutionsStarted() +const metric = flow.metricFlowExecutionsStarted(); + metric.createAlarm(stack, "FlowExecutionsStartedAlarm", { threshold: 1000, evaluationPeriods: 2 -}) +}); ```