GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Adds .NET distributed tracing instrumentation & metrics. by fdcastel · Pull Request #1200 · FirebirdSQL/NETProvider Conversation
Member
Initial work for #1196.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Thanks @willibrandon. This surely can be improved. Could you kindly share the steps/configuration you used for the above benchmark results? Mine here produces a comparison between |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@willibrandon I pushed a new PR in #1203 (it is based on this PR). Could you please clone it and run The script will compare the current project (built from sources with .NET8) with the latest NuGet release ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@fdcastel - Interesting, and thanks! Taking a look now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Okay, I see how the performance project works now with the conditional project/package reference, and with the latest Nuget release being the baseline. That is way better approach than the way I was attempting to compare the the results historically. @fdcastel - Thank you very much for showing me how the performance project works. I just want try and confirm we haven't regressed in someway with this change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
47a5b9b to
fe2b942
Compare
|
Rebased with latest |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@cincuranet Do you wish to move this work forward? If yes, I could rebase it with the latest |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@fdcastel Yes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
fe2b942 to
7fe1327
Compare
|
Rebased onto latest |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
StartActivity() returns null when no listeners are interested in the
activity. The code accessed activity.IsAllDataRequested without a null
check, causing a NullReferenceException. Use the Npgsql-style pattern
'activity is not { IsAllDataRequested: true }' for early return.
Stopwatch ticks are not TimeSpan ticks when Stopwatch.IsHighResolution is true (most systems). TimeSpan.FromTicks(stopwatchTicks) produces incorrect durations. Use Stopwatch.GetElapsedTime() which correctly handles the frequency conversion.
The semantic conventions renamed db.system to db.system.name. The well-known value for Firebird is 'firebirdsql', not 'firebird'. Updated in both FbActivitySource (spans) and FbConnection (metrics).
The semantic conventions mark db.namespace as Conditionally Required when available. The connection's Database property is used as the value.
The semantic conventions mark error.type as Conditionally Required on failure. For FbException, use the SQLSTATE code; for other exceptions, use the full exception type name.
Per OTel semantic conventions, db.query.text and db.query.parameter.* are Opt-In level attributes that may expose sensitive data. They should not be collected by default. Added IsQueryTextTracingEnabled flag and reuse IsParameterLoggingEnabled for parameter tracing.
Replace hardcoded '1.0.0' version with the assembly's informational version, keeping the telemetry version in sync with the NuGet package.
…ecording TraceCommandException now records metrics immediately and resets _startedAtTicks so the later TraceCommandStop (called during Release) does not record a second, inflated duration that includes cleanup time.
- Remove db.transaction_id custom tag (not in OTel spec, causes server round-trip per traced command) - Remove commented-out db.snapshot_id code - Remove deprecated exception.escaped attribute - Remove NormalizeDbNull helper, inline DBNull check
- Set server.port on spans when using a non-default port - Set db.stored_procedure.name for StoredProcedure command types - Fix server.address in MetricsConnectionAttributes to not concatenate the port (server.port is now a separate attribute) - Clean up leftover placeholder comments
Set db.query.summary as the low-cardinality activity name on all spans. For Text commands, extract the first SQL verb (SELECT, INSERT, etc.) and use it as db.operation.name and in the activity name.
Debug.Assert checks that TraceCommandStart was called before the stop or exception path, helping catch lifecycle bugs during development.
Prevents potential NullReferenceException if metrics are recorded before the connection string is set.
Change GetMetrics() to return IEnumerable of tuples via Select instead of allocating a Dictionary via ToDictionary on every collection cycle. Also simplify GetConnectionMax to use Select instead of SelectMany.
Suggest default histogram bucket boundaries for operation duration and connection create time histograms, improving out-of-the-box resolution. Guarded by NET9_0_OR_GREATER since InstrumentAdvice is a .NET 9 API.
Expose the telemetry source names as public constants so consumers can easily subscribe: builder.AddSource(FbTelemetry.ActivitySourceName) and builder.AddMeter(FbTelemetry.MeterName). Internal code updated to use the constants.
Document the ActivitySource and Meter names, available span attributes, opt-in sensitive attributes, and available metrics with their types and semantic convention references.
|
New fixes / improvements: Critical fixes:
Semantic convention compliance:
Architecture improvements:
New features:
Documentation:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For anyone interested: I’ve generated some unofficial packages of the .NET Provider (including this PR) available at: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.