# Load balancers

**Load balancers** answers "what is this load balancer doing, and which targets are failing?" in one place. Pick a load balancer and you get its CloudWatch metrics, the health of every target behind it with the unhealthy ones first, and its listener rules written out as sentences. For Application Load Balancers that write access logs, ARNscope can also read the logs from S3 and break traffic, errors and latency down by route, host, target and client, but only when you ask, after it has told you how much it will read.

The page only reads. It does not register targets, change rules or turn logging on.

## The list

**Load balancers** lists every load balancer in the profile and region, with its type (**Application**, **Network** or **Gateway**) and, for Application Load Balancers, a **logs** or **no logs** chip. **Filter load balancers** matches the name or the DNS name. Drag a load balancer onto a side of the page, or ⌘-click it, to open it beside the current one; see [Tabs, split panes and sessions](https://arnscope.com/docs/tabs-and-sessions).

Select one to open it. The title copies the name; right-click it for the ARN, the DNS name or the `LoadBalancer` dimension used in CloudWatch. A strip under the title shows the target count (for example **2 unhealthy of 14**), the listeners (`HTTP:80, HTTPS:443`), DNS name, scheme, VPC and, for Application Load Balancers, where access logs go.

Opening a load balancer reads its listeners, rules, target groups and target health once. **Refresh** (the arrow in the title bar) reads them and the metrics again. Nothing polls.

The page has four tabs: **Overview**, **Targets**, **Listeners & rules** and **Access logs**.

## Overview: metrics

![The Overview of storefront-public: two unhealthy targets in checkout-api-tg named above the charts with their reasons, then charts of 5xx responses (from targets and from the load balancer), target response time at p50, p95 and p99, requests and rejected connections over the last hour.](https://arnscope.com/media/docs/alb/alb-overview.webp)

The Overview charts CloudWatch's 1-minute load balancer metrics for **15m, 1h, 3h, 12h, 24h** or **7d**:

| Load balancer | Charts |
| --- | --- |
| Application | **5xx responses** (from targets and from the load balancer itself), **Target response time** (p50, p95, p99), **Requests**, **Rejected connections** |
| Network | **New flows**, **TCP resets** (from targets, the load balancer and clients), **Processed bytes** |
| All types | **Unhealthy hosts** and **Healthy hosts**, one line per target group (up to 12, by name) |

Every chart on the page comes from one `GetMetricData` call, made when the Overview is open, once per load balancer, range and set of target groups, and again on Refresh. Drag across a chart to zoom all of them together.

When any target is unhealthy, a red box above the charts names each affected target group (up to four) with how many targets are failing and the first reason, for example "checkout-api-tg: 2 of 5 unhealthy · Target.ResponseCodeMismatch · Health checks failed with these codes: [502]". Click a group's name to see its targets.

An Application Load Balancer without access logs says so under the charts: the page then has CloudWatch metrics only.

## Targets

![The Targets tab: target groups with their health and health-check settings, checkout-api-tg first with 2 unhealthy, and below it the targets with the two unhealthy ones on top and their reasons.](https://arnscope.com/media/docs/alb/alb-targets.webp)

The **Targets** tab, with a red count when any target is unhealthy, has two tables.

**Target groups** come first when they have unhealthy targets, then groups whose health could not be read, then the rest, by name. Each row shows the health (**2 unhealthy**, **4 healthy**), the health check (protocol, path and port), interval and timeout, how many checks make a target healthy or unhealthy, the success codes, the protocol and port, and the target type. Select a group, or press Enter on it, to show only its targets; the chip with the group's name clears the filter.

**Targets** lists every registered target, worst first: unhealthy, then draining or initial, then healthy. Each row shows the state, the target (instance ID, IP address or Lambda function), its target group, AWS's **reason** and **description** (such as `Target.Timeout` and "Request timed out"), port and availability zone. A Lambda target group with health checks turned off reports `unavailable`; ARNscope treats that as a setting, not a failure.

An EC2 instance or Lambda function target is a link: it opens that resource on the [EC2](https://arnscope.com/docs/ec2) or [Lambda](https://arnscope.com/docs/lambda) page, in a new tab on the same profile and region.

Both tables export to CSV.

## Listeners & rules

![Listeners and rules of storefront-public: HTTP 80 redirects to HTTPS 443, and the HTTPS listener's rules in priority order, each with its condition, its action and the health of the target group it forwards to.](https://arnscope.com/media/docs/alb/alb-rules.webp)

One row per rule, for every listener, in the order AWS evaluates them: numbered rules by priority, then the default. Each row reads as a sentence:

| Column | Example |
| --- | --- |
| **Listener** | `HTTPS : 443` |
| **Priority** | `10`, or `default` |
| **If** | `Path is /api/checkout/* or /api/payments/*`, `Method is POST and Path is /api/orders/validate`, `Header X-Fernwood-Edge is 1`, or "No other rule matched" for the default |
| **Then** | `Forward to checkout-api-tg`, `Forward to storefront-web-tg 90% · edge-proxy-tg 10%`, `Redirect 301 to HTTPS:443`, `Fixed response 403`, `Authenticate (OIDC)` |
| **Target health** | The health of the groups the rule forwards to, for example **2 of 5 unhealthy** |

So "which route is broken?" is one look: the rule whose target group is red.

Network and Gateway Load Balancers have no rules; each listener forwards with its default action, which is what the tab shows.

## Access logs

The **Access logs** tab reads an Application Load Balancer's access logs from S3. It needs the load balancer to write them (`access_logs.s3.enabled` and `access_logs.s3.bucket`); Elastic Load Balancing delivers a file about every 5 minutes, so the newest few minutes may not be there yet.

| Load balancer | What the tab shows |
| --- | --- |
| Application, access logs on | An estimate, then the analysis below |
| Application, access logs off | "Access logs are off", with the two attributes to set. Make that change in your infrastructure code; ARNscope only reads. |
| Network | "Network Load Balancer logs are not analysed". Network Load Balancers write TLS connection logs, a different format; the Overview and Targets tabs cover them. |
| Gateway | "Gateway Load Balancers have no access logs". Use [VPC flow logs](https://arnscope.com/docs/vpc-flow-logs) to see their traffic. |

If the log settings cannot be read, for example because the role lacks `elasticloadbalancing:DescribeLoadBalancerAttributes`, the tab shows the error.

### The estimate comes first

![The Access logs tab before a read: how many log files and compressed bytes a read of the last hour takes, from which bucket, with an Analyse access logs button showing the size.](https://arnscope.com/media/docs/alb/alb-logs-estimate.webp)

Opening the tab lists the range's log files in S3 and downloads nothing. It says what a read would take, for example "Reads 36 log files (17.7 MB compressed) for the last 1h from s3://…, downloaded and aggregated on this computer", or, when the range holds more than one read covers, how many files there are and which newest ones it would read. **Analyse access logs (17.7 MB)** starts the read; until then the toolbar says "Nothing is read until you analyse".

Once you have analysed a load balancer, changing its range reads straight away for the rest of the session. Choose a range with **15m, 1h, 3h, 12h, 24h** or **7d**; **Refresh** reads again and bypasses the cache. While it works, a bar shows "Reading 40 of 212 log files · 18 MiB". Results stay in memory for five minutes per load balancer and range.

### The summary

A strip at the top shows requests and the number of client IPs, the **5xx rate** (with how many came from targets and how many were generated by the load balancer itself), the **4xx rate**, **p50, p95 and p99 latency** with the average and maximum, and the data in and out.

Under it, a timeline charts requests over time by status class, with p95 latency. A note on the chart says what latency is: the time each request spent going through the load balancer, which is request, target and response processing together. It includes your target's response time. Calls your targets make to other services are not visible here.

### The breakdowns

| Tab | One row per |
| --- | --- |
| **Routes** | Request path, without the query string |
| **Hosts** | Host header |
| **Targets** | Target IP and port |
| **Target groups** | Target group |
| **Clients** | Client IP |
| **User agents** | User agent |
| **Status & errors** | The load balancer's status code, and separately each error reason or request classification |
| **Slow requests** | The slowest individual requests |
| **Recent errors** | The most recent 5xx and load balancer errors, with a count on the tab |

The first six show the top 50 rows by requests, with request count and share, 5xx and 4xx counts (with their rate), p50, p95, p99, maximum and average latency, and the data in and out. Every column sorts. The two request tabs list the time, ELB and target status, method, URL, client, target, the target, request and response times, user agent and trace ID. In the URLs shown, query-string values are replaced, so tokens in a query string never reach the screen.

The status bar at the bottom shows how much was read: files, compressed size, lines parsed, lines that could not be read, and the bucket and prefix.

### How much it reads

One read covers up to **600 log files or 256 MiB** compressed, the newest first. If the range holds more, a bar says "Read the newest N of M log files" and from when the data covers; pick a shorter range to read everything. A file that cannot be read is counted in a red bar, and the figures leave it out. The range can be up to 7 days.

Reading downloads those files from S3, so S3 request and data transfer charges apply as for any `GetObject`. ARNscope does not keep the logs on disk.

## From an alarm

A firing CloudWatch alarm on an `AWS/ApplicationELB` or `AWS/NetworkELB` metric opens this page from its **Evidence** panel, in a tab on the alarm's profile and region: the load balancer is selected, the Overview's range is set to the alarm's window, and, when the alarm is about one target group, the host charts and targets narrow to that group. See [CloudWatch alarms](https://arnscope.com/docs/alarms#evidence).

## Permissions

| What | Actions |
| --- | --- |
| Load balancers and their log settings | `elasticloadbalancing:DescribeLoadBalancers`, `elasticloadbalancing:DescribeLoadBalancerAttributes` |
| Listeners, rules, target groups and target health | `elasticloadbalancing:DescribeListeners`, `elasticloadbalancing:DescribeRules`, `elasticloadbalancing:DescribeTargetGroups`, `elasticloadbalancing:DescribeTargetHealth` |
| Overview metrics | `cloudwatch:GetMetricData` |
| Access-log estimate | `elasticloadbalancing:DescribeLoadBalancerAttributes`, `s3:ListBucket` on the log bucket |
| Access-log analysis | `s3:ListBucket`, `s3:GetObject` on the log bucket and prefix. If the bucket is encrypted with a KMS key, `kms:Decrypt` on it. |

When one part cannot be read (the rules of one listener, the health of one target group), the page says which and still shows the rest. The [IAM permission check](https://arnscope.com/docs/iam-permission-check) shows which of these your role has.

## Limitations

- **Read only.** ARNscope does not register or deregister targets, change rules or health checks, or turn logging on.
- **Access-log analysis is for Application Load Balancers.** Network Load Balancer TLS logs are not analysed, and Gateway Load Balancers write none; both get metrics, targets and listeners.
- **Host charts show up to 12 target groups**, the first by name; select a group on the Targets tab to chart it alone.
- **Only what the logs hold.** Logs have no request bodies or headers beyond the ones in the log format. For long-term rates, use the Overview metrics or [CloudWatch dashboards](https://arnscope.com/docs/cloudwatch-dashboards).
- **Delivery delay.** A load balancer writes a log file about every 5 minutes.
- **Caps.** 600 files or 256 MiB a read, 50 rows a breakdown, and at most 100,000 distinct values per breakdown before the rest are folded together. Very long values are cut at 300 characters.

Missing something you check during incidents? Write to [hello@arnscope.com](mailto:hello@arnscope.com).

Source: https://arnscope.com/docs/load-balancer-logs
