-
Notifications
You must be signed in to change notification settings - Fork 1
Integration EventBridge Extension
Track Amazon EventBridge operations in your test diagrams. This extension intercepts PutEvents, rule management, target management, event bus lifecycle, and other EventBridge API calls via the AWS SDK HTTP pipeline.
NuGet Package: Kronikol.Extensions.EventBridge
Namespace: Kronikol.Extensions.EventBridge
Since: v2.20.0
Using a shared library or abstraction layer? If your code doesn't use the EventBridge SDK directly — e.g. it goes through a shared event-routing library, wrapper, or custom abstraction — this extension won't be able to intercept the underlying calls. See Tracking Custom Dependencies for alternative approaches including
MessageTrackerandTrackingProxy<T>.
using Amazon.EventBridge;
using Kronikol.Extensions.EventBridge;
var config = new AmazonEventBridgeConfig
{
RegionEndpoint = RegionEndpoint.USEast1
};
config.WithTestTracking(new EventBridgeTrackingMessageHandlerOptions
{
CurrentTestInfoFetcher = CurrentTestInfo.Fetcher
});
var client = new AmazonEventBridgeClient(credentials, config);Amazon EventBridge uses JSON-RPC over HTTP POST — all requests go to the same endpoint with the operation identified by the X-Amz-Target header (e.g. AWSEvents.PutEvents). This is the same pattern used by DynamoDB.
The extension plugs a DelegatingHandler into the AWS SDK's HTTP pipeline via AmazonEventBridgeConfig.HttpClientFactory. Every HTTP request/response is intercepted, classified, and logged to RequestResponseLogger for diagram generation.
This follows the exact same AWS SDK interception pattern as the Integration S3 Extension, Integration DynamoDB Extension, Integration SQS Extension, and Integration SNS Extension extensions.
var config = new AmazonEventBridgeConfig
{
RegionEndpoint = RegionEndpoint.USEast1
};
var options = new EventBridgeTrackingMessageHandlerOptions
{
ServiceName = "EventBridge",
CallerName = "OrderService",
Verbosity = EventBridgeTrackingVerbosity.Detailed,
CurrentTestInfoFetcher = CurrentTestInfo.Fetcher
};
config.WithTestTracking(options);
var client = new AmazonEventBridgeClient(credentials, config);public class MyWebAppFactory : WebApplicationFactory<Program>
{
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.ConfigureServices(services =>
{
services.PostConfigure<EventBridgeTrackingMessageHandlerOptions>(opts =>
{
opts.CurrentTestInfoFetcher = CurrentTestInfo.Fetcher;
});
});
}
}| Property | Type | Default | Description |
|---|---|---|---|
ServiceName |
string |
"EventBridge" |
Name shown in diagrams for the EventBridge service |
CallerName |
string |
"Caller" |
Name shown for the calling service |
Verbosity |
EventBridgeTrackingVerbosity |
Detailed |
Level of detail in logged entries |
CurrentTestInfoFetcher |
Func<(string Name, string Id)>? |
null |
Required — provides current test context |
CurrentStepTypeFetcher |
Func<string?>? |
null |
Optional step type for BDD frameworks |
HttpContextAccessor |
IHttpContextAccessor? |
null |
Optional — enables dual-resolution of test identity from HTTP headers. Auto-resolved by DI extensions (v2.26.3+). See HTTP Tracking Setup#Dual-Resolution Test Identity (v2.23.0+) |
ExcludedOperations |
HashSet<EventBridgeOperation> |
Tag + ListEventBuses ops | Operations to skip logging |
ExcludedHeaders |
HashSet<string> |
AWS auth/SDK headers | Headers to omit from logs |
SetupVerbosity |
EventBridgeTrackingVerbosity? |
null |
Verbosity override for the Setup phase. See Phase-Aware Tracking |
ActionVerbosity |
EventBridgeTrackingVerbosity? |
null |
Verbosity override for the Action phase. See Phase-Aware Tracking |
TrackDuringSetup |
bool |
true |
When false, tracking is suppressed during Setup. See Phase-Aware Tracking
|
TrackDuringAction |
bool |
true |
When false, tracking is suppressed during Action. See Phase-Aware Tracking
|
v2.23.0+ Dual-Resolution:
EventBridgeTrackingMessageHandleraccepts an optionalIHttpContextAccessor? httpContextAccessorconstructor parameter for resolving test identity from HTTP request headers when running inside the SUT's request pipeline. v2.26.3+: SetHttpContextAccessoronEventBridgeTrackingMessageHandlerOptionsinstead — the tracker reads it automatically. See HTTP Tracking Setup#Dual-Resolution Test Identity (v2.23.0+) for details.
-
TagResource,UntagResource,ListTagsForResource— noisy tag management -
ListEventBuses— infrastructure query with low diagram value
Authorization, x-amz-date, x-amz-security-token, x-amz-content-sha256, User-Agent, amz-sdk-invocation-id, amz-sdk-request
Full HTTP details — method is POST, URI is the actual AWS endpoint, all request/response bodies and non-excluded headers logged.
Classified labels with contextual detail:
-
PutEvents [OrderCreated]— includes DetailType from first entry -
PutEvents [OrderCreated] x5— includes entry count when > 1 -
PutEvents x3— entry count without DetailType -
PutRule my-rule— includes rule name DeleteRule old-rule-
CreateEventBus orders-bus— includes bus name - Other operations: enum name (e.g.
ListRules,StartReplay)
URI: eventbridge://{busName}/ (defaults to eventbridge://default/ when no bus name)
Grouped, minimal labels:
PutEvents-
ManageRule(PutRule, DeleteRule) -
ManageTargets(PutTargets, RemoveTargets) -
ManageBus(CreateEventBus, DeleteEventBus) - Other: enum name
No request/response bodies or headers logged. Other operations are skipped entirely.
The classifier recognises 28 EventBridge API operations via X-Amz-Target:
| Category | Operations |
|---|---|
| Events | PutEvents, PutPartnerEvents, TestEventPattern |
| Rules | PutRule, DeleteRule, DescribeRule, EnableRule, DisableRule, ListRules |
| Targets | PutTargets, RemoveTargets, ListTargetsByRule |
| Event Buses | CreateEventBus, DeleteEventBus, DescribeEventBus, ListEventBuses |
| Archives | CreateArchive, DeleteArchive, DescribeArchive, ListArchives |
| Replays | StartReplay, DescribeReplay, ListReplays |
| Connections | CreateApiDestination, CreateConnection |
| Tags | TagResource, UntagResource, ListTagsForResource |
Unrecognised targets map to EventBridgeOperation.Other.
For PutEvents, the classifier parses the JSON body to extract:
-
EventBusName— from top-level or first entry -
DetailType— from first entry (e.g."OrderCreated") -
Source— from first entry (e.g."my.service") -
EntryCount— number of entries in the batch (max 10 per API call)
For PutRule, DeleteRule, DescribeRule, it extracts:
-
Name→RuleName EventBusName
Body parsing is best-effort — malformed JSON is silently ignored.
EventBridgeTrackingMessageHandler implements ITrackingComponent and auto-registers with TrackingComponentRegistry in its constructor. This enables unused-component diagnostic warnings (passive, since v2.3.0).
This extension covers the Amazon EventBridge service (AWSSDK.EventBridge). The following are separate AWS services with their own SDK clients and are not covered:
-
EventBridge Pipes (
AWSSDK.Pipes) -
EventBridge Scheduler (
AWSSDK.Scheduler)
- Integration S3 Extension — same AWS SDK DelegatingHandler pattern
- Integration DynamoDB Extension — same X-Amz-Target JSON-RPC classification
- Integration SQS Extension — same AWS SDK pattern
- Integration SNS Extension — same AWS SDK pattern
Getting Started
Common Tasks
Integration Guides
- Integration xUnit3
- Integration xUnit2
- Integration NUnit
- Integration MSTest
- Integration TUnit
- Integration BDDfy xUnit3
- Integration LightBDD xUnit2
- Integration LightBDD xUnit3
- Integration LightBDD TUnit
- Integration ReqNRoll xUnit2
- Integration ReqNRoll xUnit3
- Integration ReqNRoll TUnit
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage Extension
- Integration CloudStorage Extension
- Integration CosmosDB Extension
- Integration Dapper Extension
- Integration DynamoDB Extension
- Integration EF Core Relational Extension
- Integration Elasticsearch Extension
- Integration EventBridge Extension
- Integration EventHubs Extension
- Integration Grpc Extension
- Integration Kafka Extension
- Integration MassTransit Extension
- Integration MongoDB Extension
- Integration MySqlConnector Extension
- Integration Npgsql Extension
- Integration Oracle Extension
- Integration PubSub Extension
- Integration Redis Extension
- Integration S3 Extension
- Integration ServiceBus Extension
- Integration SNS Extension
- Integration Spanner Extension
- Integration SqlClient Extension
- Integration Sqlite Extension
- Integration SQS Extension
- Integration StorageQueues Extension
- Integration OpenTelemetry Extension
- Integration DispatchProxy Extension
- Integration MediatR Extension
- Integration PlantUML IKVM
Configuration
- Tracking Dependencies
- Tracking Custom Dependencies
- HTTP Tracking Setup
- Report Configuration
- Diagram Customisation
- Phase-Aware Tracking
- Content Formatting
- PlantUML Server Configuration
Features
- Generated Reports
- Search Syntax
- Component Diagrams
- PlantUML Browser Rendering
- Inline SVG Rendering
- Internal Flow Tracking
- Tags and Attributes
- Excluding Requests
- Excluded Headers
- Multi-Host Test Architectures
- Event-Driven Architecture Testing
- Service Bus Tracking Patterns
- Background Thread Correlation
- Parallel-Safe Background Correlation
- Event & Message Tracking
- Assertion Tracking
- Step Tracking
- Tabular Attributes
- Large Response and Diagram Handling
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
Reference