Skip to content

Monitor client performance

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

Applies to

  • Aerospike Developer SDK preview (Java 21+ and Python 3.10+)
  • Aerospike Database 6.0 or later unless a section states otherwise

Client-side performance monitoring helps you detect regressions, troubleshoot timeouts and connection issues, and correlate application behavior with cluster health. Typical signals include operation volume, error and retry rates, latency distributions, and connection pool usage, aggregated by cluster, node, or namespace when your observability stack supports those dimensions.

The Aerospike Developer SDK for Java and Python does not embed a built-in metrics collector or periodic metrics log like the classic Aerospike clients. Instead, you instrument your application around SDK calls and export measurements to the tools your team already uses (for example Prometheus, OpenTelemetry, Datadog, or structured logs). The sections below show common metric categories, example instrumentation patterns, and integration approaches. For complementary request-level detail during development, see Configure logging.

Except where noted, snippets on this page use the imports below. A snippet lists additional import lines only when it needs a type not shown here. When this page includes a Complete example section, that block is fully self-contained with every import required to run it.

import com.aerospike.client.sdk.Cluster;
import com.aerospike.client.sdk.ClusterDefinition;

Available metrics

Standard metrics

MetricTypeDescription
aerospike.operations.totalCounterTotal operations executed
aerospike.operations.errorsCounterFailed operations
aerospike.latency.readHistogramRead operation latency
aerospike.latency.writeHistogramWrite operation latency
aerospike.connections.activeGaugeCurrent open connections
aerospike.connections.poolGaugeConnections in pool

Extended metrics

MetricTypeDescription
aerospike.batch.sizeHistogramBatch operation sizes
aerospike.retriesCounterOperation retry count
aerospike.timeoutsCounterTimeout events
aerospike.cluster.nodesGaugeNodes in cluster

Enable metrics programmatically

// Additional imports for this example:
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import io.micrometer.prometheus.PrometheusConfig;
import io.micrometer.prometheus.PrometheusMeterRegistry;
// Application-owned registry (not provided by the Aerospike JAR)
MeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
try (Cluster cluster = new ClusterDefinition("localhost", 3000).connect()) {
Timer.Sample sample = Timer.start(registry);
try {
// session.query(...).execute(); etc.
} finally {
sample.stop(registry.timer("aerospike.sdk.requests"));
}
}

📖 API reference: ClusterDefinition(String,int) | ClusterDefinition.connect() | Cluster.close() | ChainableQueryBuilder.execute()

Access metrics snapshots

Get current metric values programmatically:

// The preview Java client does not expose cluster.getMetrics() / MetricsSnapshot.
// Export Micrometer/Prometheus from your app or scrape logs for connection events.

📖 API reference: com.aerospike.client.sdk

Metrics log files

Enable periodic metrics logging to files:

// No built-in periodic metrics log in the preview client; use your logging framework
// and rotate files under /var/log/... as needed (see Configure logging).

📖 API reference: com.aerospike.client.sdk

Client identification labels

Add labels to identify metrics by application or environment:

// Apply labels in your metrics backend (Prometheus relabel, Datadog tags, etc.), not on ClusterDefinition.

📖 API reference: com.aerospike.client.sdk

Integration with monitoring systems

Prometheus + Grafana

  1. Export metrics via HTTP endpoint
  2. Configure Prometheus to scrape your application
  3. Import the Aerospike client dashboard in Grafana

Datadog

// Additional imports for this example:
import io.micrometer.datadog.DatadogConfig;
import io.micrometer.datadog.DatadogMeterRegistry;
import java.time.Clock;
DatadogMeterRegistry registry = new DatadogMeterRegistry(
DatadogConfig.DEFAULT, Clock.SYSTEM);
// Register timers/counters around your own Aerospike calls; the SDK does not wire this for you.

📖 API reference: com.aerospike.client.sdk

Performance impact

Metrics collection has minimal overhead:

  • Counter/gauge operations: ~100ns
  • Histogram recording: ~500ns
  • Total impact: <1% CPU overhead

For latency-critical applications, you can disable histograms:

// Configure Micrometer histogram buckets on your own meters; unrelated to the Aerospike JAR.

📖 API reference: com.aerospike.client.sdk

Next steps

Configure Logging

Set up client-side logging for debugging.

Logging →

Tune Performance

Optimize client configuration with Behaviors.

Behaviors →

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?