Skip to content

tracing(csharp): parameter-validation failures emit zero spans (DatabricksConnectionTest.CanDetectConnectionParameterErrors) #488

@eric-wang-1990

Description

@eric-wang-1990

Severity: Medium

Observation

DatabricksConnectionTest.CanDetectConnectionParameterErrors runs 93 parameterized sub-cases that intentionally throw ArgumentException / ArgumentOutOfRangeException from the connection-parameter parser (bad timeout values, non-bool strings for bool flags, etc.). All 93 pass — but the archive produced zero spans for those failure paths.

In the same archive, the 1× TrySetGetDirectResults_UsesDatabricksDefaultGetDirectResults test produced ~20 spans. So the test suite IS tracing — but the parameter-validation throws happen synchronously, before any Activity is opened.

Contrast: DriverTests.CanDetectInvalidServer / CanDetectInvalidAuthentication DO produce Status=Error spans on HiveServer2Connection.OpenAsync / SendAsync because those failures happen inside instrumented async methods. So the gap is specifically the synchronous-throw-before-Activity code path.

Why it matters

For one-off debugging, the caller catches the ArgumentException and sees the message — limited value to also trace it. But for fleet-level observability ("X% of connection attempts fail at param validation"), you need a span with Status=Error to aggregate on. Today that signal is invisible.

Suggested fix

Wrap the parameter-parser entry point in an Activity (or just the throw site). Even a thin "validation" span with Status=Error and exception.type = ArgumentException would close the loop for fleet metrics.

Evidence

  • Traces.DatabricksConnectionTest.20260527_144209/ — 93 invalid-param tests, 0 spans emitted for them; 515 spans total all Status=Ok
  • Traces.DriverTests.20260527_153928/ — invalid-server / invalid-auth tests DO emit Status=Error spans (different code path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions