Skip to content

TraceOptions to disable to control whether the "time-to-first-read" and "time-to-last-read" events are generated#5912

Merged
vonzshik merged 5 commits into
npgsql:tracind-add-filter-and-enrichfrom
bunkrur:tracind-add-filter-and-enrich
Nov 7, 2024
Merged

TraceOptions to disable to control whether the "time-to-first-read" and "time-to-last-read" events are generated#5912
vonzshik merged 5 commits into
npgsql:tracind-add-filter-and-enrichfrom
bunkrur:tracind-add-filter-and-enrich

Conversation

@bunkrur

@bunkrur bunkrur commented Nov 6, 2024

Copy link
Copy Markdown

This pull request introduces a new configuration option to control the "time-to-first-read" event in the Npgsql library. The most important changes include adding a new property to the NpgsqlTracingOptions class and updating the ReceivedFirstResponse method to respect this new setting.

Additionally, the time-to-last-read event was removed at the suggestion of @vonzshik

Configuration Enhancements:

  • src/Npgsql/NpgsqlTracingOptions.cs: Added a new boolean property DisableFirstResponseEvent to allow users to disable the "time-to-first-read" event. The default value is set to false to maintain existing behavior.

Method Updates:

  • src/Npgsql/NpgsqlActivitySource.cs: Updated the ReceivedFirstResponse method to check the DisableFirstResponseEvent property before triggering the "received-first-response" event.

Comment thread src/Npgsql/NpgsqlActivitySource.cs Outdated
@vonzshik vonzshik merged commit 8b42bbe into npgsql:tracind-add-filter-and-enrich Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants