---
title: "Client.end( [options] ) | Grafana k6 documentation"
description: "Disconnect from the MQTT broker"
---

# Client.end()

Disconnect from the broker synchronously. When the disconnection is complete, the `end` event is triggered.

## Signature

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
client.end(options)
```

## Parameters

Expand table

| Parameter    | Type   | Description                               |
|--------------|--------|-------------------------------------------|
| options      | object | Optional disconnect configuration         |
| options.tags | object | Custom tags for metrics (key-value pairs) |
