Driver metrics
DataStax drivers expose metrics through different libraries and APIs depending on the language.
Whether in the process of developing an application or deploying the solution in production, it is critical to have systems in place that provide insights into the performance of the application. Many modern applications are critical to maintaining a business’s value. It is vitally important to effectively monitor and alert operators when systems are degrading. A framework for the application monitoring allows for greater ease when tracing the source of performance issues.
For example, an organization uses DSE OpsCenter to manage a DataStax Enterprise deployment. The operators receive an alert that there is a spike in latency on the server side. If application monitoring is also in place, operators investigating the issue could narrowed the latency to a single DataStax driver instance, and then evaluate how to fix the latency problem.
PHP [1] |
Ruby [1] |
C/C++
The C/C++ driver tracks its metrics through an internal object called CassMetrics. This object contains information about requests (latency and throughput), stats (connections), and errors (timeouts). The DSE C/C++ Driver also exposes information for speculative executions through a CassSpeculativeExecutionMetrics object.
Java
The Java driver delivers its internal measurements through the Dropwizard Metrics library.
For all versions of the Java Driver, metrics are exposed through a MetricRegistry
.
The reporter options include JMX, JSON (via a servlet), stdout, CSV files, SLF4J logs, and Graphite.
See the Dropwizard Documentation for more details.
C#
The C# driver offers an extension package based on the App.Metrics library. Application developers can use to export metrics to a monitoring tool.
Node.js
The Node.js driver exposes several internal driver metrics in the form of counters in two different ways:
-
A default implementation which leverages the Node.js events API to expose different counter increments and push it in your existing application metrics toolkit.
-
A
ClientMetrics
interface that can be used by metrics libraries, service providers and the community to implement support for existing toolkits like metrics, datadog, prometheus, and measured.
Python
The Python driver uses the scales library for its metrics.
Metrics collection is not enabled by default in the Python Driver.
To use these metrics, create the Cluster
object with metrics_enabled
set to True
.
To view the reported statistics, use a simple HTTP server for spot checking the metrics.
A more robust solution for collecting and reporting to Graphite is also supported via a GraphitePusher.