Metrics

When building applications with Algoreus, you have the ability to incorporate metrics to monitor the behavior and performance of your application. Algoreus Cerebellum provides both system metrics and user-defined metrics.


System metrics

They are pre-defined and common across applications. They include metrics such as event processing count and data operation count. On the other hand, user-defined metrics are specific to your application and can be added to track custom aspects of your application.

Algoreus supports two types of metrics: count and gauge.

  • Count metrics allow you to increment or decrement a metric by a specified value:

    count(metricName, delta)

  • Gauge metrics enable you to set the metric to a specific value:

    gauge(metricName, value)

You can emit these metrics within the methods that define the components of your application. The emitted metrics can be retrieved using Algoreus Cerebellum, alongside the system metrics. Ensure that your metric names consist only of alphanumeric characters.

To prevent overloading the system under high load, Algoreus provides an option to enable or disable metrics using the app.program.metrics.enabled parameter. By default, program metrics are enabled (true). This option can be configured at different levels:

  1. System-wide: In the configuration file, you can control whether application nodes emit metrics.

  2. Per run: You can override the system-wide setting by using the config system.metrics.enabled as a program argument during a specific run.

  3. Program preference: To establish a permanent preference, you can set system.metrics.enabled for a specific program.


Flow Control

Algoreus includes a flow control mechanism to prevent an excessive number of requests, which could lead to issues with axon runs. This mechanism applies to start requests for various types of axons and jobs.

Flow control relies on two thresholds:

  1. Launch threshold: This threshold limits the number of launch requests. If the number of launch requests that are not yet in the running state exceeds the launch threshold, new requests will be rejected.

  2. Runs threshold: This threshold limits the number of outstanding launch requests in the system. If the number of outstanding launch requests that have not yet finished exceeds the runs threshold, new requests will be rejected.

Rejected requests

When either threshold is reached, new start requests will be rejected. For example, a rejected batch axon will be logged as "Rejected" status, and a notification will be displayed in the user interface explaining the rejection.

Metrics: To monitor the flow control status, you can access the following metrics:

  • Launching metric: This metric reports the number of launch requests in the system that are in the provisioning or starting states.

    Metrics name: flowcontrol.launching.count POST /v3/metrics/query?metric=system.flowcontrol.launching.count

  • Running metric: This metric reports the number of running axons and jobs in the system. The run threshold is based on the sum of the launching and running metrics.

    Metrics name: flowcontrol.running.count POST /v3/metrics/query?metric=system.flowcontrol.running.count

  • Rejected metric: This metric reports the number of rejected runs due to the flow control mechanism.

    Metrics name: program.rejected.runs POST /v3/metrics/query?metric=system.program.rejected.runs


Last updated