# Heartbeats

The OpAMP protocol explicitly outlines how client-initiated heartbeat messages can be performed. Additionally, Bindplane also uses server-initiated heartbeats if the client doesn't have this capability.

The heartbeat interval can be configured in Bindplane with the parameter `agents.heartbeatInterval` or the environment variable `BINDPLANE_AGENTS_HEARTBEAT_INTERVAL`. The default is 30 seconds.

### Client Heartbeats

Client heartbeats are available if the client reports the `ReportsHeartbeat` [capability](https://opentelemetry.io/docs/specs/opamp/#agenttoservercapabilities). When this capability is present, Bindplane will tell the client to report heartbeats at the interval Bindplane is configured with.

Two parameters that are helpful for controlling heartbeat behavior:

| Parameter                      | Environment Variable                           | Default    | Description                                                                                   |
| ------------------------------ | ---------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------- |
| agents.heartbeatTTL            | BINDPLANE\_AGENTS\_HEARTBEAT\_TTL              | 1 minute   | Controls how long to wait between client heartbeats before marking the connection as expired. |
| agents.heartbeatExpiryInterval | BINDPLANE\_AGENTS\_HEARTBEAT\_EXPIRY\_INTERVAL | 30 seconds | Controls how frequently to delete any expired agents.                                         |

It's important to note that client heartbeats are only possible with Bindplane `v1.75.0+` and BDOT `v1.70.0+` or supervisors `v0.136.0+`.

### Server Heartbeats

For Bindplane versions older than `v1.75.0` or deployments that don't support client heartbeats, server heartbeats are used instead. This heartbeat message is an empty message to keep the WebSocket alive.

If the message fails to send, the collector connection is removed from Bindplane. Independently, there is a job running every 70 seconds (interval is not configurable) to delete collectors that Bindplane hasn't talked to in that interval.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/configuration/bindplane-otel-collector/opamp/heartbeats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
