Update ODBC Support to include .NET Core+ and capturing ODBC connection details. #2922
Closed
Description
Describe the story, please be clear on scope of the story.
Background:
This story is a part of the work to support AWS Redshift which uses ODBC as a primary command type.
- Redshift can also be used via ODBC with an AWS provided ODBC driver.
- This uses the OdbcConnection/Command types with the AWS driver.
- We instrument this (Framework), but not in the same way as SQL (ADO.NET).
- We do not capture the connection string, meaning we don’t have the hostname.
- That requires adding a new parser and vendor to enable fetching that data.
- This is nearly identical to the existing SQL parser, except with additional logic for capturing the Port.
- We do not instrument ODBC for .NET Core+
- There is a library for it now and it supports .NET Framework 4.5.1+, netstandard2.0, and net5+
- The only difference from the existing .NET Framework is the assembly name going from System.Data to System.Data.Odbc
- The method signatures are identical.
Work:
Examine https://github.com/newrelic/newrelic-dotnet-agent/compare/poc/redshift-relationship for examples of the work being described. Most of the changes are complete.
- Update NewRelic.Agent.Extensions and the SQL instrumentation to add a dependency on System.Data.Odbc.
a. Version can be 6.0.0 or an older one.
b. Needs to be limited to netstandard2.0 - Add ODBC to DatastoreVendor in Constants.cs. This name is up for debate, but we need a new entry in order to select the correct Parser later on.
- Update SQLWrapperHelper.cs to relocate the IFDEF, and add support for ODBC.
- Add ODBC to IConnectionStringParser.cs.
- Implement OdbcConnectionStringParser.cs.
- Update the SQL Instrumentation.xml to support the new ODBC library.
- Update the OdbcCommandWrapper to remove the IFDEF and add connection string parsing.
- Add unit and integration tests. Integration tests will need to check basic ODBC connection to SQL and connection to Redshift!
Acceptance Criteria
- ODBC wrapper works for Framework and Core+
- ODBC connection data is parsed and reports like other SQL
- Redshift tests updated to use ODBC driver in addition to Npgsql.
Additional context
See comments.
Estimates
M
Metadata
Assignees
Labels
No labels