Skip to main content

Load Balancer Metrics

info

Load Balancer Metrics is currently in Limited Availability. Metrics are automatically available for all customers with access to Load Balancers.

Load Balancer Metrics provide comprehensive insights into the throughput of your load balancers. These metrics help you monitor traffic patterns, analyze connection behavior, and understand data flow through your load balancers. The following key metrics are collected in 30-second intervals for a period of 30 days for each load balancer.

MetricsDefinitionSuggested Query
Outbound PacketsThe number of packets transmitted by the load balancer.rate(crusoe_elb_out_packets[5m])
Inbound PacketsThe number of packets received by the load balancer.rate(crusoe_elb_in_packets[5m])
Bytes OutThe total bytes transmitted by the load balancer.rate(crusoe_elb_bytes_out[5m])
Bytes InThe total bytes received by the load balancer.rate(crusoe_elb_bytes_in[5m])
Active FlowsThe number of currently active connections through the load balancer.crusoe_elb_active_flows
New FlowsThe number of new connections established through the load balancer.rate(crusoe_elb_new_flows[5m])

Load Balancer Metrics are available by default for all load balancers—no agent installation is required. They are accessible via a PromQL API. Console UI support will be available in a future release.

Querying Load Balancer Metrics via API

To query load balancer metrics via the API, please follow the steps below.

Step 1: Install or Update Crusoe CLI

Please follow the instructions to install and configure Crusoe CLI on your device. If you already have the CLI installed and configured, please ensure you upgrade to the latest version.

Step 2: Generate Your Monitoring Token

To generate the monitoring token for load balancer metrics, run the following CLI command:

crusoe monitoring tokens create

This command generates an API-Key that you'll use for authentication when querying the metrics API.

Step 3: Construct and Execute Your Query

Once the token is generated, you can directly query the metrics API endpoint to retrieve data for a single instant or a specific time range. The API endpoint is:

https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries

Here's an example curl command to retrieve the most recent data point for active flows across all load balancers in a project:

curl -G https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries\?query=\
crusoe_elb_active_flows \
-H 'Authorization: Bearer <API-Key>'

By default, queries return metrics for all load balancers within a project. To query metrics for a specific load balancer, you can specify the load balancer name in your query. Example for a specific load balancer:

crusoe_elb_active_flows{elb_name="my-load-balancer"}

Importing Data into Grafana

To import data into your own Grafana instance, add a Prometheus data source with the following options:

Prometheus Server URL: https://api.crusoecloud.com/v1alpha5/projects/<project-id>/metrics/timeseries

Authentication → HTTP Headers:

Header: Authorization
Value: Bearer <API-Key>

Use the <API-Key> generated in the 'Generate Your Monitoring Token' section.