Click or drag to resize

DseClusterBuilderWithMetrics Method (IDriverMetricsProvider, DriverMetricsOptions)

Enables metrics. DataStax provides an implementation based on a third party library (App.Metrics) on a separate NuGet package: Dse.AppMetrics Alternatively, you can implement your own provider that implements IDriverMetricsProvider.

This method enables all individual metrics without a bucket prefix. To customize these settings, use WithMetrics(IDriverMetricsProvider, DriverMetricsOptions). For explanations on these settings, see the API docs of the DriverMetricsOptions class.

The AppMetrics provider also has some settings that can be customized, check out the API docs of Dse.AppMetrics.DriverAppMetricsOptions.

Here is an example:

var cluster = 
    DseCluster.Builder()
           .WithMetrics(
               metrics.CreateDriverMetricsProvider(new DriverAppMetricsOptions()),
               new DriverMetricsOptions()
                   .SetEnabledNodeMetrics(NodeMetric.DefaultNodeMetrics.Except(new [] { NodeMetric.Meters.BytesSent }))
                   .SetEnabledSessionMetrics(
                       SessionMetric.DefaultSessionMetrics.Except(new[] { SessionMetric.Meters.BytesReceived }))
                   .SetBucketPrefix("web.app"))
           .Build();

Namespace:  Dse
Assembly:  Dse (in Dse.dll) Version: 2.9.0
Syntax
C#
public DseClusterBuilder WithMetrics(
	IDriverMetricsProvider driverMetricsProvider,
	DriverMetricsOptions metricsOptions
)

Parameters

driverMetricsProvider
Type: Dse.Metrics.AbstractionsIDriverMetricsProvider
Metrics Provider implementation.
metricsOptions
Type: Dse.MetricsDriverMetricsOptions
Metrics Provider implementation.

Return Value

Type: DseClusterBuilder
This builder
See Also