Friday, July 25, 2025

Monitor and debug event-driven purposes with new Amazon EventBridge logging

Voiced by Polly

Beginning as we speak, you should use enhanced logging functionality in Amazon EventBridge to observe and debug your event-driven purposes with complete logs. These new enhancements assist enhance the way you monitor and troubleshoot occasion flows.

Right here’s how yow will discover this new functionality on the Amazon EventBridge console:

The brand new observability capabilities handle microservices and event-driven structure monitoring challenges by offering complete occasion lifecycle monitoring. EventBridge now generates detailed log entries each time a matched occasion towards guidelines is printed, delivered to subscribers, or encounters failures and retries.

You achieve visibility into the entire occasion journey with detailed details about successes, failures, and standing codes that make figuring out and diagnosing points easy. What used to take hours of trial-and-error debugging now takes minutes with detailed occasion lifecycle monitoring and built-in question instruments.

Utilizing Amazon EventBridge enhanced observability
Let me stroll you thru an indication that showcases the logging functionality in Amazon EventBridge.

I can allow logging for an present occasion bus or when creating a brand new customized occasion bus. First, I navigate to the EventBridge console and select Occasion buses within the left navigation pane. In Customized occasion bus, I select Create occasion bus.

I can see this new functionality within the Logs part. I’ve three choices to configure the Log vacation spot: Amazon CloudWatch Logs, Amazon Knowledge Firehose Stream, and Amazon Easy Storage Service (Amazon S3). If I wish to stream my logs into a knowledge lake, I can choose Amazon Kinesis Knowledge Firehose Stream. Logs are encrypted in transit with TLS and at relaxation if a customer-managed key (CMK) is supplied for the occasion bus. CloudWatch Logs helps customer-managed keys, and Knowledge Firehose gives server-side encryption for downstream locations.

For this demo, I choose CloudWatch logs and S3 logs.

I may select Log degree, from Error, Data, or Hint. I select Hint and choose Embrace execution knowledge as a result of I have to evaluation the payloads. It’s essential to be conscious as logging payload knowledge might include delicate info, and this setting applies to all log locations you choose. Then, I configure two locations, one every for CloudWatch log group and S3 logs. Then I select Create.

After logging is enabled, I can begin publishing check occasions to watch the logging habits.

For the primary state of affairs, I’ve constructed an AWS Lambda operate and configured this Lambda operate as a goal.

I navigate to my occasion bus to ship a pattern occasion by selecting Ship occasions.

Right here’s the payload that I exploit:

{   "Supply": "ecommerce.orders",   "DetailType": "Order Positioned",   "Element": {     "orderId": "12345",     "customerId": "cust-789",     "quantity": 99.99,     "gadgets": [       {         "productId": "prod-456",         "quantity": 2,         "price": 49.99       }     ]   } } 

After I despatched the pattern occasion, I can see the logs can be found in my S3 bucket.

I may see the log entries showing within the Amazon CloudWatch logs. The logs present the occasion lifecycle, from EVENT_RECEIPT to SUCCESS. Study extra concerning the full occasion lifecycle on What Amazon EventBridge logs for occasion buses documentation web page.

Now, let’s consider these logs. For brevity, I solely embrace a couple of logs and have redacted them for readability. Right here’s the log from after I triggered the occasion:

{     "resource_arn": "arn:aws:occasions:us-east-1:123:event-bus/demo-logging",     "message_timestamp_ms": 1751608776896,     "event_bus_name": "demo-logging", // REDACTED FOR BREVITY //     "message_type": "EVENT_RECEIPT",     "log_level": "TRACE",     "particulars": {         "caller_account_id": "123",         "source_time_ms": 1751608775000,         "supply": "ecommerce.orders",         "detail_type": "Order Positioned",         "assets": [],         "event_detail": "REDACTED FOR BREVITY"     } } 

Right here’s the log when the occasion was efficiently invoked:

{     "resource_arn": "arn:aws:occasions:us-east-1:123:event-bus/demo-logging",     "message_timestamp_ms": 1751608777091,     "event_bus_name": "demo-logging", // REDACTED FOR BREVITY //     "message_type": "INVOCATION_SUCCESS",     "log_level": "INFO",     "particulars": { // REDACTED FOR BREVITY //         "total_attempts": 1,         "final_invocation_status": "SUCCESS",         "ingestion_to_start_latency_ms": 105,         "ingestion_to_complete_latency_ms": 183,         "ingestion_to_success_latency_ms": 183,         "target_duration_ms": 53,         "target_response_body": "",         "http_status_code": 202     } } 

The extra log entries embrace wealthy metadata that makes troubleshooting easy. For instance, on a profitable occasion, I can see the latency timing from beginning to finishing the occasion, length for the goal to complete processing, and HTTP standing code.

Debugging failures with full occasion lifecycle monitoring
The good thing about EventBridge logging turns into obvious when issues go incorrect. To check failure eventualities, I deliberately misconfigure a Lambda operate’s permissions and alter the rule to level to a distinct Lambda operate with out correct permissions.

The try failed with a everlasting failure on account of lacking permissions. The log exhibits it’s a FIRST try that resulted in NO_PERMISSIONS standing.

{     "message_type": "INVOCATION_ATTEMPT_PERMANENT_FAILURE",     "log_level": "ERROR",     "particulars": {         "rule_arn": "arn:aws:occasions:us-east-1:123:rule/demo-logging/demo-order-placed",         "role_arn": "arn:aws:iam::123:function/service-role/Amazon_EventBridge_Invoke_Lambda_123",         "target_arn": "arn:aws:lambda:us-east-1:123:operate:demo-evb-fail",         "attempt_type": "FIRST",         "attempt_count": 1,         "invocation_status": "NO_PERMISSIONS",         "target_duration_ms": 25,         "target_response_body": "{"requestId":"a4bdfdc9-4806-4f3e-9961-31559cb2db62","errorCode":"AccessDeniedException","errorType":"Shopper","errorMessage":"Consumer: arn:aws:sts::123:assumed-role/Amazon_EventBridge_Invoke_Lambda_123/db4bff0a7e8539c4b12579ae111a3b0b isn't approved to carry out: lambda:InvokeFunction on useful resource: arn:aws:lambda:us-east-1:123:operate:demo-evb-fail as a result of no identity-based coverage permits the lambda:InvokeFunction motion","statusCode":403}",         "http_status_code": 403     } } 

The ultimate log entry summarizes the entire failure with timing metrics and the precise error message.

{     "message_type": "INVOCATION_FAILURE",     "log_level": "ERROR",     "particulars": {         "rule_arn": "arn:aws:occasions:us-east-1:123:rule/demo-logging/demo-order-placed",         "role_arn": "arn:aws:iam::123:function/service-role/Amazon_EventBridge_Invoke_Lambda_123",         "target_arn": "arn:aws:lambda:us-east-1:123:operate:demo-evb-fail",         "total_attempts": 1,         "final_invocation_status": "NO_PERMISSIONS",         "ingestion_to_start_latency_ms": 62,         "ingestion_to_complete_latency_ms": 114,         "target_duration_ms": 25,         "http_status_code": 403     },     "error": {         "http_status_code": 403,         "error_message": "Consumer: arn:aws:sts::123:assumed-role/Amazon_EventBridge_Invoke_Lambda_123/db4bff0a7e8539c4b12579ae111a3b0b isn't approved to carry out: lambda:InvokeFunction on useful resource: arn:aws:lambda:us-east-1:123:operate:demo-evb-fail as a result of no identity-based coverage permits the lambda:InvokeFunction motion",         "aws_service": "AWSLambda",         "request_id": "a4bdfdc9-4806-4f3e-9961-31559cb2db62"     } } 

The logs present detailed efficiency metrics that assist determine bottlenecks. The ingestion_to_start_latency_ms: 62 exhibits the time from occasion ingestion to beginning invocation, whereas ingestion_to_complete_latency_ms: 114 represents the overall time from ingestion to completion. Moreover, target_duration_ms: 25 signifies how lengthy the goal service took to reply, serving to distinguish between EventBridge processing time and goal service efficiency.

The error message clearly states what failed, lambda:InvokeFunction motion, why it failed, (no identity-based coverage permits the motion), which function was concerned (Amazon_EventBridge_Invoke_Lambda_1428392416), and which particular useful resource was affected, which was indicated by the Lambda operate Amazon Useful resource Identify (ARN).

Debugging API Locations with EventBridge Logging
One specific use case that I believe EventBridge logging functionality will likely be useful is to debug points with API locations. EventBridge API locations are HTTPS endpoints which you can invoke because the goal of an occasion bus rule or pipe. HTTPS endpoints show you how to to route occasions out of your occasion bus to exterior methods, software-as-a-service (SaaS) purposes, or third-party APIs utilizing HTTPS calls. They use connections to deal with authentication and credentials, making it straightforward to combine your event-driven structure with any HTTPS-based service. 

API locations are generally used to ship occasions to exterior HTTPS endpoints and debugging failures from the exterior endpoint generally is a problem. These issues sometimes stem from modifications to the endpoint authentication necessities or modified credentials.

To show this debugging functionality, I deliberately configured an API vacation spot with incorrect credentials within the connection useful resource.

After I ship an occasion to this misconfigured endpoint, the improved logging exhibits the foundation explanation for this failure.

{     "resource_arn": "arn:aws:occasions:us-east-1:123:event-bus/demo-logging",     "message_timestamp_ms": 1750344097251,     "event_bus_name": "demo-logging",     //REDACTED FOR BREVITY//,     "message_type": "INVOCATION_FAILURE",     "log_level": "ERROR",     "particulars": {         //REDACTED FOR BREVITY//,         "total_attempts": 1,         "final_invocation_status": "SDK_CLIENT_ERROR",         "ingestion_to_start_latency_ms": 135,         "ingestion_to_complete_latency_ms": 549,         "target_duration_ms": 327,         "target_response_body": "",         "http_status_code": 400     },     "error": {         "http_status_code": 400,         "error_message": "Unable to invoke ApiDestination endpoint: The request failed as a result of the credentials included for the connection aren't approved for the API vacation spot."     } }

The log gives fast readability concerning the failure. The target_arn exhibits this includes an API vacation spot, the final_invocation_status signifies SDK_CLIENT_ERROR, and the http_status_code of 400 , which factors to a client-side challenge. Most significantly, the error_message explicitly states that: Unable to invoke ApiDestination endpoint: The request failed as a result of the credentials included for the connection aren't approved for the API vacation spot.

This entire log sequence gives helpful debugging insights as a result of I can see precisely how the occasion moved via EventBridge — from occasion receipt, to ingestion, to rule matching, to invocation makes an attempt. This degree of element eliminates guesswork and factors on to the foundation explanation for the problem.

Further issues to know
Listed here are a few issues to notice:

  • Structure assist – Logging works with all EventBridge options together with customized occasion buses, accomplice occasion sources, and API locations for HTTPS endpoints.
  • Efficiency influence – Logging operates asynchronously with no measurable influence on occasion processing latency or throughput.
  • Pricing – You pay normal Amazon S3, Amazon CloudWatch Logs or Amazon Knowledge Firehose pricing for log storage and supply. EventBridge logging itself incurs no further prices. For particulars, go to the Amazon EventBridge pricing web page .
  • Availability – Amazon EventBridge logging functionality is accessible in all AWS Areas the place EventBridge is supported.
  • Documentation — For extra particulars, check with the Amazon EventBridge monitoring and debugging Documentation.

Get began with Amazon EventBridge logging functionality by visiting the EventBridge console and enabling logging in your occasion buses.

Completely satisfied constructing!
— Donnie 

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles