Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Integrate custom ADO.NET provider with NewRelic?

.net
databases
mysql

#1

I’m writing a fully async (and .NET Core compatible) ADO.NET MySQL driver: https://github.com/bgrainger/MySqlConnector

It’s intended to be a drop-in replacement for the official MySql.Data connector (a big difference is the NuGet package name and DLL name).

After deploying it, the database performance recorded by NewRelic (e.g., at https://rpm.newrelic.com/accounts/X/applications/Y/databases) went to zero. This isn’t surprising, because NewRelic has no way of knowing that my MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery method is actually accessing a database.

I would like the time spent executing queries through my connector to be recorded and reported by New Relic. Are there New Relic Agent API methods that I should integrate with? Or do the methods in my connector simply need to be recognised by the New Relic agent as DB calls? How can I help make this integration work?

Please share your agent version and other relevant versions below:

New Relic Agent: 5.20.61.0
Windows Server 2012 R2 x64
MySqlConnector 0.1.0-alpha10


#2

Hi @bgrainger - I think you are looking for custom transactions or custom instrumentation which can be configured.


#3

Hey @bgrainger!

Did @stefan_garnham answer your question? Let us know if you need anything else! :blush:


#4

Thanks @stefan_garnham; I added a custom instrumentation XML file and that seems to have restored my DB timings. (They’re a lot faster than I was expecting to see, so I may need to keep tweaking my custom XML to make sure it’s accurate.)


#5

@bgrainger - thanks for your work on this!

@Linds who is the right person to talk to about getting this officially supported by NR? The MySqlConnector is now more popular than the package NR currently supports.

It would be really great to get this officially supported? We’re happy to work with you on this and contribute resources to get this working.


#6

I haven’t been able to get the custom XML file I added to the repo (https://github.com/mysql-net/MySqlConnector/tree/master/contrib/NewRelic) working recently. (I’m not sure when it stopped.) Looks like NR is tracking this here: Feature Idea: Support MySqlConnector driver for DB instrumentation — go there and upvote it!