Repository navigation
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>.
The package asks for AWSSDK.EventBridge 4.0.5.7 or later, so a suite can pin whichever 4.x from 4.0.5.7 its
application ships with. The package's own suite runs on the newest 4.x, and in CI on 4.0.5.7 as well. A project that
takes the client only through this package resolves 4.0.5.7; reference the client yourself for a newer one. The floor is
4.0.5.7, the first release that asks for an AWSSDK.Core past GHSA-9cvc-h2w8-phrp (low); the suite passes from 4.0.0.
Before 5.27.12 the package asked for 4.0.5.29.
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 S3, DynamoDB, SQS, and SNS 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 |
Has no effect: nothing in the EventBridge package reads it (only the HTTP handler's option of the same name does). Its removal is a v6 question |
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; a bus given by its ARN (arn:aws:events:eu-west-1:123456789012:event-bus/orders) is named by the part after:event-bus/(5.17.0; before, the handler threw into the caller'sPutEvents) -
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)
A send that throws, or a response body that breaks off as it is read, is answered with the exception's type behind a bang (!HttpRequestException) and its message chain in error, and the exception reaches the caller as it was thrown (5.34.3, #232). The diagram draws the return with the type as its label and, from 5.35.0, the reason in the note on it, Failures.md prints the reason under the calls table, and the call reads as answered, as HTTP Tracking Setup › A call that threw describes. Before 5.34.3 the request stood alone, with no answer and no reason. History's older rules still read the call as the release before recorded it, so a suite that upgrades reads no change there (Cross-Run History).
- 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
Home · 🔍 Search this wiki Full-text search across every page. The “Pages” list above matches page and heading names, not page content.
Getting Started
- Quick Start (xUnit)
- Project Templates
- AI Integration Prompt
- Framework Integration Guides
- Migrating to v5
- Migrating to v4
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
- Integration Playwright
Uninstrumentable / polyglot backends
- Integration ProxyTap Extension
- Integration TcpTap Extension
- Integration Otlp Extension
- Exporting to OpenTelemetry
- Ingesting External Captures
- Ingesting from Jest
- Integration Cucumber Messages
- Capture-Time Redaction
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage Extension
- Integration ClickHouse 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
- Report Themes
- Search and Filter 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
- Querying Reports
- Service Card
- Cross-Run History
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
- Merging Parallel Reports
Reference