fix(csharp): report informational version in telemetry driver_version#516
Closed
eric-wang-1990 wants to merge 2 commits into
Closed
fix(csharp): report informational version in telemetry driver_version#516eric-wang-1990 wants to merge 2 commits into
eric-wang-1990 wants to merge 2 commits into
Conversation
Telemetry's driver_version was sourced from s_assemblyVersion, i.e. ApacheUtility.GetAssemblyVersion = Assembly.GetName().Version.ToString(3) — a purely numeric AssemblyVersion (e.g. "1.1.4"). That drops the -SNAPSHOT prerelease label and the +<commit-sha> build metadata, so every 1.1.4 build (nightly, PR CI, release) reports an identical version and analysts cannot pinpoint the build/commit. Production lumberjack data shows older builds reporting the informational form "0.23.0-SNAPSHOT+<sha>", so the field's semantics had silently regressed to coarser numeric values. Feed AssemblyInformationalVersion (via the existing ApacheUtility.GetAssemblyProductVersion) into ConnectionTelemetry.Create through a new s_telemetryDriverVersion, falling back to the numeric version when the attribute is absent. s_assemblyVersion stays the source for the ADBC AssemblyVersion contract and trace tags. Adds ConnectionTelemetryDriverVersionTests pinning that the telemetry version equals the assembly informational version and is not the bare numeric AssemblyVersion when a SNAPSHOT/sha suffix is present. Co-authored-by: Isaac
string.Contains(char) does not exist on net472/netstandard2.0 (only the string overload), which broke the Windows net472 build (CS1503). Use the string literals "-"/"+". Co-authored-by: Isaac
Collaborator
Author
|
Closing — not a needed fix. The current code emits a correct |
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.
What
Telemetry's
driver_versionnow reports the assembly'sAssemblyInformationalVersion(e.g.1.1.4-SNAPSHOT+<sha>) instead of the bare numericAssemblyVersion(1.1.4).Why
DatabricksConnection.InitializeTelemetrypasseds_assemblyVersionintoConnectionTelemetry.Create, ands_assemblyVersion = ApacheUtility.GetAssemblyVersion(...) = Assembly.GetName().Version.ToString(3)— a purely numericmajor.minor.build. That drops the-SNAPSHOTprerelease label and the+<commit-sha>build metadata, so:1.1.4build (nightly, PR CI, release — each a different commit) reports an identicaldriver_version; you can't pinpoint which build/commit emitted an event (defeats build-cutover detection).0.23.0-SNAPSHOT+b716671<sha>(an informational version), so the field's semantics had silently regressed to the coarser numeric form.AssemblyVersionis the strong-name binding identity and is commonly pinned; if it's ever pinned for binding stability, telemetry would report a stale/wrong version.The assembly selection was already correct (the
newoverride reads the Databricks assembly, not the base Apache/HiveServer2 one) — only the version field was wrong.Change
DatabricksConnection.s_telemetryDriverVersion=ApacheUtility.GetAssemblyProductVersion(typeof(DatabricksConnection), s_assemblyVersion)(the informational version, falling back to the numeric version if the attribute is absent), and feed it intoConnectionTelemetry.Create.s_assemblyVersion(numeric) stays the source for the ADBCAssemblyVersionproperty and trace tags — unchanged.Test
ConnectionTelemetryDriverVersionTestspins that:AssemblyInformationalVersion.-SNAPSHOT/+shasuffix is present (true for all dev/CI builds viaVersionSuffix=SNAPSHOT), it does not collapse to the bare numericAssemblyVersion— the discriminating regression guard (this assertion fails on the pre-fix numeric source).Verification
Could not build/run locally due to an unrelated
net10.0submodule vs. SDK 9.0.304 mismatch (all build errors are inhiveserver2/*, none in the changed files). CI will compile and runConnectionTelemetryDriverVersionTests.This pull request and its description were written by Isaac.