Skip to content

Bytecode instrumentation of (legacy) SqlClient code #4343

@stevejgordon

Description

@stevejgordon

Feature Request

Are you requesting automatic instrumentation for a framework or library? Please describe.

When using auto-instrumentation, the contrib SQL instrumentation is added. We have a customer stuck on an older version of System.Data.SqlClient, who reported that span names are very sparce (just the server name) and that the sql command is not available in the attributes. This issue describes the problem which is a known issue due to the underlying implementation.

As a potential solution, we made a POC that switches to using a bytecode instrumentation for SQL, when using auto-instrumentation. This allows for richer (sem-con compliant) spans to be created.

We would like to discuss whether there would be an appetite to switch to a bytecode instrumentation to improve the experience for customers with legacy applications? We have the POC for this, and would be happy to tidy that up in order to make a PR to contribute this. Currently it focuses on just System.Data.SqlClient but removes the contrib instrumentation to avoid duplicated spans. We may need to instrument all libraries, including Microsoft.Data.SqlClient using bytecode.

Is your feature request related to a problem? Please describe.

Limited attributes and span naming

Describe the solution you'd like

Add new bytecode instrumentation. Likely behind a config switch so it would be opt-in.

Describe alternatives you've considered

If/when autoinstrumentation supports plugin of custom bytecode instrumentations, use that mechanism to support opting into the bytecode for SQL.

Additional context
N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions