Metrics

Each Connector exposes a series of metrics which can be used to monitor its health and statistics.

MetricsAdapter choice

By default, metrics are exposed using Cinnamon (aka Akka Insights, aka Lightbend Telemetry) over Prometheus.

However, it’s possible to use a different Metrics backend by specifying the MetricsAdapter when creating any type of connector, with:

.withMetricsAdapter(myMetricsAdapter)

The available options for MetricsAdapter are:

  • CinnamonMetricsAdapter (default): uses Cinnamon/Lightbend Telemetry/Akka Insights

  • MicrometerMetricsAdapter: uses Micrometer, for integration with Spring Boot metrics for example

Please note that, for technical reasons, the metric names differ depending on the type of implementation used. See the table below for more details.

Where metrics are exposed

When using the default MetricsAdapter, the default location where connector metrics are hosted is localhost:9001. If statistics are not displaying, then ensure that the Lightbend Telemetry agent is running. For more information check out the Cinnamon Agent Documentation.

When using Micrometer, these will be available as part of Spring Boot Actuator Prometheus.

Connector Metrics Breakdown

Each connector has its own set of metrics in the table below. Every metric is tagged with the relevant connector’s name. To distinguish which metrics relate to which connector, use the connector hint in the Prometheus exporter.

Metric name (Cinnamon) Metric name (Micrometer) Type Description

application_ipf_requests_sent

ipf_requests_sent

Counter

Logs the number of messages sent through a sending connector

application_ipf_requests_received

ipf_requests_received

Counter

Logs the number of messages received through a receiving connector

application_ipf_correlations_saved

ipf_correlations_saved

Counter

The number of correlation records persisted by the correlation service

application_ipf_correlations_found

ipf_correlations_found

Counter

The number of correlation records fetched from the correlation service

application_ipf_failed_correlations

ipf_failed_correlations

Histogram/Recorder

The number of failed correlation lookups from the correlation service

application_ipf_failed_requests

ipf_failed_requests

Counter

The number of failed message requests through a sending connector

application_ipf_failed_receives

ipf_failed_receives

Counter

The number of failed message receives through a receiving connector

application_ipf_response_times

ipf_response_times

Histogram/Recorder

A complex Recorder type which records min/max/average and percentiles for response times for this connector

The [application_]ipf_response_times metric is based on the CorrelationFound and RequestReplyCompleted system events for SendConnectors and RequestReplySendConnectors respectively. So it only applies for async request-reply operations with a correlation step that succeeds, or a completed synchronous request-reply.

Circuit Breaker Metrics

Circuit breaker metrics use MeterRegistry implementations to publish metrics. This can be set at a per-connector level through ResiliencySettings:

ResiliencySettings.builder()
    .initialRetryWaitDuration(Duration.ofMillis(10))
    .maxAttempts(1)
    .resetTimeout(Duration.ofSeconds(1))
    .meterRegistry(SIMPLE_METER_REGISTRY)
    .build()

Alternatively this can be set through the SendingConnector interface. This allows setting the meterRegistry implementation at an application level.

For example, if we want to set all the sendingConnectors to have the same meterRegistry implementation we can loop through and set them with the API after we have already built the connectors. This allows us to quickly switch implementations without the need to change each connector definition.