Sunday, November 8, 2026
HomeBig DataAcquire insights into your Amazon Kinesis Information Firehose supply stream utilizing Amazon...

Acquire insights into your Amazon Kinesis Information Firehose supply stream utilizing Amazon CloudWatch

[ad_1]

The quantity of information being generated globally is rising at an ever-increasing tempo. Information is generated to assist an rising variety of use circumstances, equivalent to IoT, commercial, gaming, safety monitoring, machine studying (ML), and extra. The expansion of those use circumstances drives each quantity and velocity of streaming knowledge and requires corporations to seize, processes, rework, analyze, and cargo the info into numerous knowledge shops in near-real time.

Amazon Kinesis Information Firehose is the simplest strategy to reliably load streaming knowledge into knowledge lakes, knowledge shops, and analytics providers. As the amount of the info you stream into Kinesis Information Firehose grows, it’s best to achieve insights and monitor the well being of your knowledge ingestion, transformation, and supply.

On this put up, we assessment the capabilities of utilizing Firehose supply stream metrics and the Amazon CloudWatch dashboard situated in your Kinesis Information Firehose console. These capabilities can help you create alerts when, for instance, if the vacation spot you configured in Kinesis Information Firehose has lacking privileges, misconfigurations, or different points, then Firehose will be capable to detect it for you and report it as a failure. Different errors that may additionally happen are should you configured knowledge transformation utilizing Lambda and your Lambda operate invocation failed, or in case you have reached the Kinesis Firehose quota limits related along with your AWS account. In these circumstances, the info supply from Kinesis Information Firehose to its vacation spot could delay or fail. The CloudWatch alerts described on this put up ought to assist establish such circumstances in a well timed method.

This put up additionally covers the totally different proactive actions that you may take when alarms are being triggered, equivalent to submitting a request to extend quota or including exponential backoff to your knowledge producers.

Monitoring the supply streams and taking these actions makes positive that knowledge is delivered to your locations with out interruptions, enabling your enterprise to realize insights in near-real time.

Monitor knowledge ingestion to Kinesis Information Firehose

You’ll be able to ship knowledge out of your knowledge producers to Kinesis Information Firehose by way of Amazon Kinesis Information Streams (as described later on this put up), utilizing Kinesis Agent, or straight utilizing the Kinesis Information Firehose API operations PutRecord and PutRecordBatch. While you use Kinesis Information Streams as an information supply, Kinesis Information Firehose scales mechanically as your Kinesis Information Stream scales. When utilizing the API operations for direct ingestion, you’ll want to test the quota limits related along with your AWS account to keep away from API requests throttling. Relying in your knowledge producer conduct, this throttling may cause your knowledge producers to retry the operation, which leads to a delay of the info supply to your vacation spot. This throttling can even lead to knowledge loss in case your knowledge producers don’t implement a retry mechanism.

To achieve deeper insights into Firehose supply stream utilization, we offer extra CloudWatch metrics that provide help to monitor and proactively scale quota limits: ThrottledRecords, RecordsPerSecondLimit, BytesPerSecondLimit, and PutRequestsPerSecondLimit. You should use the CloudWatch metrics dashboard (on the Monitoring tab in your Kinesis Information Firehose console) to simply visualize present utilization and the quota limits.

When ingesting knowledge on to your supply stream utilizing PutRecord or PutRecordBatch, it’s best to monitor the ThrottledRecords metric. This metric represents the variety of information that had been really throttled as a result of knowledge ingestion exceeded one of many supply stream limits. Kinesis Information Firehose calculates the throttling charges through the ingestion at a 1-second granularity, however the knowledge ingestion metrics we talked about are aggregated and emitted to CloudWatch each 5 minutes. Due to that, you may get throttled inside that 5-minute window even when the info ingestion metrics don’t present that you simply reached the restrict.

To obtain alerts earlier than your knowledge producers are literally throttled, you should utilize extra CloudWatch metrics to warn you whenever you’re about to succeed in one of many supply stream limits. You’ll be able to obtain this through the use of the CloudWatch metrics IncomingRecords, IncomingBytes, and IncomingPutRequests. To test the boundaries of those metrics, consult with Amazon Kinesis Information Firehose Quota.

You should use the next ingestion metrics and their corresponding restrict metrics to create a CloudWatch alarm:

  • RecordsPerSecondLimit – The utmost variety of information that may be ingested in a second (IncomingRecords)
  • BytesPerSecondLimit – The utmost quantity of information that may be ingested in a second (IncomingBytes)
  • PutRequestsPerSecondLimit – The utmost variety of profitable PutRecord and PutRecordBatch API requests that may be carried out in a second (IncomingPutRequests)

To arrange an alarm that alerts you when your ingestion charges are near a quota, it’s best to search for a share relationship between the ingestion price and its corresponding restrict. As a result of Kinesis Information Firehose emits metrics to CloudWatch each 5 minutes, you’ll want to divide your metric with the 5-minute aggregation interval, expressed as seconds (300). For instance, to generate an alert when the incoming information per second price is breaching 80% of your API operations quota, your CloudWatch alarm must be outlined as follows:

This offers you a strategy to proactively perceive how shut your ingestion charges are to your supply stream limits, and the flexibleness to change the share ranges primarily based in your use case. To stop a throttling bottleneck, it’s best to individually monitor the three supply stream ingestion price metrics we mentioned.

Outline alerts utilizing CloudWatch alarms

You’ll be able to outline CloudWatch alarms manually by way of the AWS Administration Console or through the use of AWS CloudFormation. On this put up we cowl each strategies, beginning with the CloudFormation template.

The next template creates your CloudWatch alarms, which you’ll assessment and customise to fit your wants.

In the course of the stack creation course of, you present the Firehose supply stream identify that you simply need to monitor, and the quota share the place you need to be notified when it’s being breached, equivalent to 80%. After the stack creation is profitable, you may have 4 CloudWatch alarms prepared.

To create your CloudWatch alarms manually by way of the console, full the next steps:

  1. On the Kinesis Information Firehose console, discover your supply stream.
  2. On the Monitoring tab, select the extra choices icon of the metric you need to monitor (for this instance, we monitor incoming information per second).
  3. On the choices menu, select View in metrics.

On the CloudWatch console, you possibly can see a graph that represents your present API operations (blue line) and the quota restrict (purple line).

  1. To create an alarm, select Math expression.
  2. Choose Widespread and select Proportion.
  3. For the metric identify, enter Proportion of information per second quota.
  4. We use the metric expression 100*(e1/m2), which represents the formulation 100*(BytesPerSecond/BytesPerSecondLimit) that was described earlier and displays how shut you might be to your most in share.
  5. Change the expression of the metric e1 from METRICS("m1")/300 to m1/300.

You too can change the Y axis label.

  1. On the Graph choices tab, beneath Left Y Axis, for Label, enter Proportion.
  2. Now that you’ve the expression to make use of for the alarm, deselect each different expression and metric on the web page.

The one expression chosen must be the one you simply created. You must now see the specified share, as within the following screenshot.

Create a CloudWatch alarm

You may have now created an expression in your IncomingRecords and RecordsPerSecond quota, which you should utilize as a base for the alarm. With this, you possibly can configure the tolerance stage that your enterprise use case requires.

  1. Select the alarm icon subsequent to your expression.
  2. Within the Specify metric and circumstances part, select to obtain an alert when the alarms breach the 75% restrict.
  3. Within the Configure actions part, specify find out how to ahead this alarm.

You’ll be able to ahead this alarm to your monitoring methods or to an electronic mail handle by way of an Amazon Easy Notification Service (Amazon SNS) matter. For this put up, we create a brand new SNS matter and subscribe admin@instance.com to it.

Actions you possibly can take when approaching the boundaries

While you’re getting near your limits, you possibly can take a number of totally different actions, which we describe on this part.

Request a service quota improve

One motion you possibly can take when seeing an alert is to request a rise in quota utilizing the Amazon Kinesis Information Firehose Limits type. The three quotas scale proportionally, for instance, should you improve the throughput quota in US East (N. Virginia), US West (Oregon), or Europe (Eire) from 5 MiB/second to 10 MiB/second, the opposite two quotas improve from 2,000 requests/second to 4,000 requests/second and from 500,000 information/second to 1 million information/second. For extra details about the service quota limits by AWS Area, see Amazon Kinesis Information Firehose Quota.

Use the PutRecordBatch API

For those who use the API name PutRecord to ship occasions to a Firehose knowledge stream and also you’re reaching the request/second quota restrict, think about using the PutRecordBatch API operation. PutRecordBatch writes a number of knowledge information right into a supply stream in a single name to realize increased throughput per producer than writing single information, and reduces the quantity of requests per second to your supply stream.

Implement exponential backoff

As we talked about earlier than, even whenever you’re monitoring your supply stream, you possibly can nonetheless have bursts in your knowledge stream. This might be brought on by sudden spikes in utilization of your system or exterior occasions like excessive buying and selling exercise in monetary markets. To guard the producers from a number of throttled information, it’s best to implement an exponential backoff. Exponential backoff is a generally used algorithm that you should utilize to lower the speed of submitting information to Kinesis Information Firehose when being throttled, in order that the producer can slowly retry as a way to efficiently ship the information.

The next are the Kinesis Information Firehose API responses when information are throttled:

  • For those who’re utilizing the API operation PutRecord, the returned error from the service is ServiceUnavailableException with HTTP standing code 500.
  • For those who’re utilizing PutRecordBatch, it’s best to iterate by way of the RequestResponses array and search for particular person PutRecordBatchResponseEntry with ErrorCode 500 and ErrorMessage ServiceUnavailableException. Additionally be sure to test the worth of FailedPutCount within the response even when the API name succeeds.

In each circumstances, it’s best to use exponential backoff and retry the operation. For extra details about implementing exponential backoff, see Error retries and exponential backoff in AWS.

Use Kinesis Information Streams with Kinesis Information Firehose

Kinesis Information Streams is a massively scalable and sturdy real-time knowledge streaming service. Your knowledge producers can produce knowledge on to Kinesis Information Streams, and you’ll configure Kinesis Information Firehose to devour the info from Kinesis Information Streams and ship it to your vacation spot. While you use Kinesis Information Streams because the supply for the Firehose supply stream, the throughput limits talked about earlier than don’t apply. You don’t want to fret about throughput limits as a result of Kinesis Information Firehose scales mechanically to match the variety of shards your Kinesis knowledge stream has.

For those who’re attaching a Firehose supply stream as a shopper to your Kinesis knowledge stream, and you’ve got a number of shopper purposes that learn knowledge out of your Kinesis knowledge stream equivalent to AWS Lambda (see Utilizing AWS Lambda with Amazon Kinesis), be sure that the overall shopper purposes aren’t breaching the shard’s 2 MB complete learn price. This could trigger the Kinesis knowledge stream to throttle your shopper purposes’ studying throughput, together with Kinesis Information Firehose.

If extra learn capability is required, some utility shoppers equivalent to Lambda (see AWS Lambda helps Kinesis Information Streams Enhanced Fan-Out and HTTP/2 for quicker streaming) or customized shoppers that had been developed with the Kinesis Client Library can assist devoted throughput from Kinesis Information Streams utilizing enhanced fan-out, which at present isn’t supported by Kinesis Information Firehose. This function supplies these shopper purposes remoted connection to the stream with 2 MB/second outbound throughput, so that they don’t impression different shopper purposes which can be studying from the shards.

For those who want extra ingest capability, you possibly can simply scale up the variety of shards within the stream utilizing the console or the UpdateShardCount API.

Monitor knowledge supply of Kinesis Information Firehose

In case of community timeouts, lacking privileges, or misconfigurations of your supply stream equivalent to incorrect vacation spot configuration or AWS Key Administration Service (AWS KMS) key ARN, the info supply of your knowledge from Kinesis Information Firehose to its vacation spot could delay or fail. Errors may also happen should you configured knowledge transformation utilizing Lambda and your Lambda operate invocation failed.

When Kinesis Information Firehose encounters supply or processing errors, it retries till the configured retry period expires. If the retry period ends and the info hasn’t delivered efficiently, Kinesis Information Firehose retains the info internally as much as a most interval of 24 hours. If the difficulty continues past the 24-hour most retention interval, then Kinesis Information Firehose discards the info, leading to an information loss.

When such knowledge supply points persist, the knowledge freshness metric, which is the age of the oldest report in Kinesis Information Firehose that hasn’t been delivered but, continually will increase. To be alerted in such circumstances, it’s best to create a CloudWatch alarm for when the info freshness metric exceeds the brink of 4 hours. We additionally advocate setting an alarm to look at the historic p90 of the info freshness metric worth. For instance, set a sure tolerance stage (equivalent to 50% above the noticed worth) as an alarm threshold to detect knowledge freshness variations.

You must monitor the info freshness metric that’s related to your Kinesis Information Firehose vacation spot, equivalent to DeliveryToS3.DataFreshness, DeliveryToAmazonOpenSearchService.DataFreshness, DeliveryToSplunk.DataFreshness, or DeliveryToHttpEndpoint.DataFreshness. For extra info, see Monitoring Kinesis Information Firehose Utilizing CloudWatch Metrics.

If this alarm is triggered, it’s best to take motion to know the foundation explanation for the info freshness variation. A cause for such a variation might be a change in your Lambda transformation logic or configuration change of Lambda concurrency when utilizing Kinesis Information Firehose knowledge transformation. It may be a results of change within the configuration parameters, format conversion schema, or ingested report kind. For extra info, see Information Freshness Metric Rising or Not Emitted or you possibly can submit a technical assist request if wanted.

When knowledge supply fails due to knowledge transformation or a difficulty on the vacation spot, in some circumstances you will discover detailed failure logs in CloudWatch Logs, which can assist you troubleshot the issue.

We additionally advocate monitoring the info supply byte price to your vacation spot (for instance, DeliveryToS3.Byte), which should match or exceed your knowledge ingestion byte price (IncomingBytes) on a sustained common foundation to keep away from improve of the knowledge freshness metric and doable eventual knowledge loss. If the noticed supply knowledge charges are decrease than the ingestion charges, think about tuning bottlenecks equivalent to Lambda concurrency ranges or your Lambda transformation logic if used with Kinesis Information Firehose knowledge transformation.

To achieve extra insights on the supply of your knowledge to its vacation spot, we offer CloudWatch metrics you possibly can monitor. For instance, you possibly can monitor the variety of information delivered to maintain monitor of information ingested into your locations from Kinesis Information Firehose. For extra info and extra metrics per vacation spot, see Monitoring Kinesis Information Firehose Utilizing CloudWatch Metrics.

Conclusion

On this put up, we mentioned the capabilities of utilizing the Firehose supply stream metrics and the CloudWatch dashboard situated in your Kinesis Information Firehose console. This lets you achieve operational insights into the info ingestion and knowledge supply of your Firehose deliv­­ery stream, and in addition create CloudWatch alerts to be notified when considered one of your thresholds is breached. We additionally coated the totally different actions that you may take when these alarms are triggered, equivalent to submitting a request to extend your quota or including exponential backoff to your knowledge producers.

Monitor your supply streams and take these actions to be sure that your enterprise knowledge is delivered to your locations with out interruptions, enabling your enterprise to realize insights in near-real time.


In regards to the Writer

Alon Gendler is a Startup Options Architect Supervisor at Amazon Internet Companies. He works with AWS prospects to assist them clear up complicated issues and architect safe, resilient, scalable and excessive efficiency purposes within the cloud. Alon is captivated with Information and serving to prospects get probably the most out of it.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments