Skip to content

Compliance suite: IEventStoreInstrumentation and the append observer #5152

Description

@jeremydmiller

Part of #5118 (compliance wave growth), epic #5110.

JasperFx.Events.IEventStoreInstrumentation is a shared interface (JasperFx.Events/IEventStoreInstrumentation.cs) that both products implement and register — Marten hangs the append observer off EventGraph (Marten/Events/EventGraph.cs:248), Polecat registers it in DI (PolecatServiceCollectionExtensions.cs:86-94, its #177). It exists specifically so external tooling (CritterWatch) can observe appends without knowing which store it is talking to.

That makes it a contract with an out-of-repo consumer and no cross-store test — the same argument that makes the explorer surface worth pinning.

Seam additions required

  1. ComplianceStoreConfig.Instrumentation — an IEventStoreInstrumentation instance the fixture wires in at store-build time. Fixture-owned property (the registration point differs: options object vs DI), same precedent as MaxConcurrentRebuildsPerDatabase.

Everything asserted is on the shared interface.

What each store tests today

Marten Polecat
CoreTests/Events/EventGraph_IEventStoreInstrumentation.cs Events/event_store_instrumentation_tests.cs
EventSourcingTests/event_append_observation.cs Events/event_store_instrumentation_di_tests.cs
EventSourcingTests/get_committed_events_from_listener_Tests.cs Events/event_append_observer_tests.cs, Events/event_append_counter_tests.cs
Events/advanced_tracking_propagation_tests.cs

Scope

New EventStoreInstrumentationCompliance suite:

  1. The append observer is invoked once per committed append, with the committed events and their assigned sequences/versions
  2. It is not invoked when SaveChangesAsync rolls back or when there is no outstanding work
  3. Ordering relative to the inline projection write
  4. Counts across multiple streams in one unit of work
  5. Whatever advanced_tracking_propagation_tests pins on the Polecat side that Marten's advanced_async_tracking.cs also pins — reconcile the pair and take the stronger

Acceptance

  • One config property added; suite enrolled in both stores
  • Originals retired for the absorbed behavior in both repos
  • Any behavioral difference found here is triaged against CritterWatch's expectations before either side is changed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions