-
Notifications
You must be signed in to change notification settings - Fork 341
Extract metrics from a connection pool #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is not currently any such method. Do you know of another ADO.NET provider that exposes similar metrics? (Just curious if there's an existing example of exposing such an API.) |
We can gather it from the MySql Oracle driver through the reflection, however, I'm wondering if we can do it in this driver in a more elegant way |
Interesting question indeed! Would a pull-request be accepted which introduces some metrics abstraction on the lines of the logging abstraction? I'm thinking about a |
I am looking for guidance (from the ADO.NET or ASP.NET Core team) about high-performance instrumentation with EventSource or DiagnosticSource (#471). One can also imagine exposing Prometheus-style metrics or integrating with OpenTracing, and I'd like to do it in a way that's standardised with other ADO.NET providers, not just implemented in an ad-hoc way. It would also be extremely important to implement in a zero-overhead way when not activated, e.g., to not impact TFB performance benchmarks. |
I see, thanks! I've stumbled over #471 after I wrote this comment and figured this would be the way to go anyway. |
#1137 provides a link to SQL Server Provider Statistics, which is an in-memory (?) Dictionary enabled via a connection-string setting. This could provide a template for a low-overhead approach, but also seems like it might be an historical method that would now be implemented instead with OpenTelemetry. |
We can now use System.Diagnostics.Metrics for integration-agnostic metrics: |
Hi, @bgrainger. Do you have any update for this topic? |
Based on Metric APIs comparison, This namespace doesn't appear to be used by Npsql or Microsoft.Data.SqlClient, so there's no "prior art" to adapt for MySQL. |
@bgrainger https://www.npgsql.org/doc/diagnostics/metrics.html It is possible to create metrics view as maked in pgsql? |
Using |
@bgrainger |
Correct; this issue is still open because the change has not been implemented. |
I opened a PR with a proposal for a specification for using This will provide a way to "extract some metrics from the pool like idle connections, connections in use, available connections" using the latest supported .NET APIs. |
This is based on the specification at https://github.com/open-telemetry/semantic-conventions/blob/main/specification/metrics/semantic_conventions/database-metrics.md. Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
This is based on the specification at https://github.com/open-telemetry/semantic-conventions/blob/main/specification/metrics/semantic_conventions/database-metrics.md. Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
This is based on the specification at https://github.com/open-telemetry/semantic-conventions/blob/main/specification/metrics/semantic_conventions/database-metrics.md. Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
This is based on the specification at https://github.com/open-telemetry/semantic-conventions/blob/main/specification/metrics/semantic_conventions/database-metrics.md. Signed-off-by: Bradley Grainger <bgrainger@gmail.com>
Is there a way to extract some metrics from the pool like idle connections, connections in use, available connections... ?
The text was updated successfully, but these errors were encountered: