Conversation
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry (Activity-based) instrumentation to additional store adapters (EventStoreDb, legacy EventStore, SqlStreamStore) and updates integration test infrastructure to assert store-operation classifications via captured Activities, with an ADR + changelog notes documenting the migration and breaking API change.
Changes:
- Instrument store adapter operations by tagging
Activity.Currentand emitting store-operation Activities for test/OTel capture. - Update shared integration-test infrastructure to capture/assert store operations via
ActivityListener(plus add an OTel→Serilog bridge helper and mapping tests). - Remove the legacy EventStore TCP connector’s Serilog-specific
LoggerAPI surface and adjust project/package validation configuration and references accordingly.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Equinox.SqlStreamStore.Postgres.Integration/Equinox.SqlStreamStore.Postgres.Integration.fsproj | Links new shared OTel test helpers into Postgres SqlStreamStore integration tests. |
| tests/Equinox.SqlStreamStore.MySql.Integration/Equinox.SqlStreamStore.MySql.Integration.fsproj | Links new shared OTel test helpers into MySql SqlStreamStore integration tests. |
| tests/Equinox.SqlStreamStore.MsSql.Integration/Equinox.SqlStreamStore.MsSql.Integration.fsproj | Links new shared OTel test helpers into MsSql SqlStreamStore integration tests. |
| tests/Equinox.MessageDb.Integration/Equinox.MessageDb.Integration.fsproj | Links new shared OTel test helpers into MessageDb integration tests. |
| tests/Equinox.EventStoreDb.Integration/StoreIntegration.fs | Switches assertions to Activity-based capture and adds OTel↔Serilog mapping/bridge tests. |
| tests/Equinox.EventStoreDb.Integration/Infrastructure.fs | Introduces Activity-based store operation capture (AsyncLocal-isolated) and updates test logging helpers. |
| tests/Equinox.EventStoreDb.Integration/Equinox.EventStoreDb.Integration.fsproj | Links new shared OTel test helpers into EventStoreDb integration tests. |
| tests/Equinox.EventStore.Integration/Equinox.EventStore.Integration.fsproj | Links new shared OTel test helpers into legacy EventStore integration tests. |
| src/Equinox.SqlStreamStore/SqlStreamStore.fs | Adds Activity tagging + store-operation emission for write/read operations. |
| src/Equinox.SqlStreamStore/Equinox.SqlStreamStore.fsproj | Links shared per-store Tracing.fs into SqlStreamStore. |
| src/Equinox.SqlStreamStore.Postgres/Equinox.SqlStreamStore.Postgres.fsproj | Switches wrapper to unconditional ProjectReference; comments out baseline version. |
| src/Equinox.SqlStreamStore.MySql/Equinox.SqlStreamStore.MySql.fsproj | Switches wrapper to unconditional ProjectReference; comments out baseline version. |
| src/Equinox.SqlStreamStore.MsSql/Equinox.SqlStreamStore.MsSql.fsproj | Switches wrapper to unconditional ProjectReference; comments out baseline version. |
| src/Equinox.MessageDb/Tracing.fs | Adds MessageDb ActivitySource + emitStoreOp. |
| src/Equinox.MessageDb/MessageDb.fs | Emits store-operation Activities on write/read paths. |
| src/Equinox.EventStoreDb/Tracing.fs | Adds shared store-specific tracing module (EventStoreDb/EventStore/SqlStreamStore) + emitStoreOp. |
| src/Equinox.EventStoreDb/EventStoreDb.fs | Adds Activity tagging + store-operation emission for EventStoreDB operations. |
| src/Equinox.EventStoreDb/Equinox.EventStoreDb.fsproj | Enables STORE_EVENTSTOREDB constant; includes Tracing.fs; comments out baseline. |
| src/Equinox.EventStore/EventStore.fs | Adds Activity tagging + store-operation emission; removes Serilog-specific connector logger API. |
| src/Equinox.EventStore/Equinox.EventStore.fsproj | Enables STORE_EVENTSTORE_LEGACY constant; links Tracing.fs; comments out baseline. |
| samples/Store/Integration/TestOutput.fs | Makes log capture buffer thread-safe via locking. |
| samples/Store/Integration/OtelToSerilogBridge.fs | Adds helper to translate completed Activities into Serilog log events. |
| samples/Store/Integration/ActivityCapture.fs | Adds generic Activity capture helper for tests. |
| adr/0001-replace-serilog-with-opentelemetry-in-store-adapters.md | Documents rationale/approach and breaking change details. |
| CHANGELOG.md | Records new tracing support and breaking API removal. |
Comment on lines
+9
to
+15
| let listener = new ActivityListener( | ||
| ShouldListenTo = (fun source -> source.Name.StartsWith(sourceNamePrefix, StringComparison.Ordinal)), | ||
| Sample = (fun _ -> ActivitySamplingResult.AllDataAndRecorded), | ||
| ActivityStopped = (fun act -> captured.Add(act))) | ||
| do ActivitySource.AddActivityListener(listener) | ||
| member _.Clear() = captured.Clear() | ||
| member _.Activities = captured |> Seq.toList |
| .AddSource("Equinox") | ||
| .AddSource("Equinox.MessageDb") | ||
| .AddSource("StoreIntegration") | ||
| .AddSource("Npqsl") |
| @@ -70,7 +70,7 @@ open Equinox.EventStore | |||
| /// WARNING: Applies INSECURE overrides to match the docker-compose config. NEVER do this in staging or production. | |||
| let connectToLocalStore log = | |||
Comment on lines
+17
to
+18
| let tagStr name = match tag name with :? string as s -> s | _ -> null | ||
| let tagInt name = match tag name with :? int as i -> i | _ -> 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.