Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding metric for Max connections #461

tronda started this conversation in Ideas
Discussion options

We are using ODP.NET Managed driver's metrics through OpenTelemetry. One issue that we want to pursue is the possibility to trigger an alert if a given ASP.NET WebApi process the metric odp_number_of_active_connections equals the number of max connections. Since we are using Prometheus and Prometheus AlertManager we need to know what is the maximum connections that a given process can create. For this reason we would like ODP.NET to produce odp_number_of_max_connections metric.

There might be a use case for alerting on minimum connections as well - for instance if a process never goes above the minimum number of connections. For us the max connection metric would be more valuable at this time.

You must be logged in to vote

Replies: 5 comments

Comment options

@tronda Can you provide more details about what you mean by "maximum connections that a given process can create"?

An ODP.NET process continuously creates connections and destroys connections when there are too many idle ones for too long. There is no maximum number that an ODP.NET process can create over time. There is a maximum that ODP.NET can have at any point in time. That is the Max Pool Size.

If you want to track the total number of connections there are, you can monitor NumberOfPooledConnections.

You must be logged in to vote
0 replies
Comment options

Given a team which does not have overview over the load towards the database. If they have specified Min Pool Size to 20 and Max Pool Size to 50 as part of the connection string for an ASP.NET webapi service, then it would be beneficial if we could generate an alert from Prometheus Alertmanager if the number of active connection reaches 50. This would indicate that the service requires more connections.

On the other side we could trigger an alert if during peek the number of active connections never ends up coming up to 20.

In order to achieve this then the Prometheus database must have a metric for maximum number of connection and the minimum number of connections.

You must be logged in to vote
0 replies
Comment options

ODP.NET publishes .NET metrics currently. The NumberOfActiveConnections metric tracks the active connection count, which you can then compare with your Max Pool Size. I believe that's the metric you'll want to monitor.

You must be logged in to vote
0 replies
Comment options

I am aware of the .NET metrics that currently are present. We are using them in Grafana dashboards already. The challenge is that Prometheus AlertManager only uses the metrics database when generating an alert which means that the webapi process has to push the Max Pool Size as a metric. Not sure if there is an API to get the Max Pool Size besides parsing the ConnectionString, but if there is - I could create a custom metric to push the Max Pool Size as a metric. When you have hundreds of micro-services using the ODP.NET driver, then you have to do this for all the services. Would be great if ODP.NET could push this number for me instead as long as I have setup the OTEL pipeline for the process.

You must be logged in to vote
0 replies
Comment options

ODP.NET publishes the Max Pool Size value via the OracleConnectionStringBuilder.MaxPoolSize property. You could populate your custom metric with this value.

Making Max Pool Size a formal .NET metric would be odd. Its value doesn't change during the connection pool's lifetime. Metrics are intended to monitor properties whose values change over time. Are there any data access drivers that publish their Max Pool Size equivalent attribute as an OpenTelemetry metric?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /