-
Notifications
You must be signed in to change notification settings - Fork 191
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 5 comments
-
@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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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?
Beta Was this translation helpful? Give feedback.