Skip to Main Content
  • Questions
  • ODP.NET Monitoring on Linux (PerformanceCounters)

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Morgan.

Asked: April 14, 2021 - 10:07 am UTC

Last updated: April 27, 2021 - 6:59 am UTC

Version: 19c + ODP.NET 3.21

Viewed 1000+ times

You Asked

Using Oracle.ManagedDataAccess.Core 3.21.1 to create .Net Core 5.0 and C#-based microservices running in Linux-based containers. I'd like to at least log perfomance counters for later analysis of performance. I know System.Diagnostics.PerfomanceCounters is only available on Windows .Net Framework (right?), is there any chance I can get those numbers when on Linux?

EventCounter for .Net Core? I might be on a wrong track here, can't find any information on this. What I want to do is a simple log of open/closed connections in the pool. To explain why it takes a while to open a connection sometimes. Don't want to do it with a huge software package, just a simple log-post to our Elastic/Kibana.

If you have any idea who can help me I would be very grateful.

and Connor said...

Thanks for your patience. I spoke to the dot.net team and got the following information

Using Oracle.ManagedDataAccess.Core 3.21.1 to create .Net Core 5.0 and C#-based microservices running in Linux-based containers. I'd like to at least log perfomance counters for later analysis of performance. I know System.Diagnostics.PerfomanceCounters is only available on Windows .Net Framework (right?),

System.Diagnostics.PerformanceCounters can be used with .NET Core on Windows as well. ODP.NET Core counters on Windows supports this.

is there any chance I can get those numbers when on Linux?


Not this library as MS does not plan to port it so that it’s cross-platform.

EventCounter for .Net Core?


EventCounter is the preferred direction for DB performance counters. MS recently added this support for SqlClient last month.
https://github.com/dotnet/SqlClient/issues/523
https://github.com/dotnet/SqlClient/pull/719
The .NET team at Oracle is taking a look at this. For further follow up, please email alex.keh(at)oracle.com who is the PM for ODP.NET.


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library