> For the complete documentation index, see [llms.txt](https://docs.bindplane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bindplane.com/integrations/destinations/middlewareio.md).

# Middleware

Exports logs, metrics, and traces from a Bindplane pipeline to [Middleware](https://middleware.io/) using the OpenTelemetry Protocol (OTLP) HTTP exporter. Telemetry is sent to your account's Middleware OTLP endpoint, `https://<uid>.middleware.io:443`.

### Supported Telemetry

| Metrics | Logs | Traces |
| ------- | ---- | ------ |
| ✓       | ✓    | ✓      |

### Prerequisites

* A Middleware account.
* Your Middleware account UID. This is the `<uid>` portion of your Middleware URL (`<uid>.middleware.io`) and forms the OTLP endpoint `https://<uid>.middleware.io:443`.
* A Middleware API key for authentication. Get one from the [Middleware getting-started guide](https://docs.middleware.io/docs/getting-started).
* Network connectivity from the collector to the Middleware OTLP endpoint over HTTPS (port 443).

For details on Middleware's OTLP ingestion, see the [Middleware OpenTelemetry documentation](https://docs.middleware.io/open-telemetry/otel-getting-started).

### Configuration

<figure><img src="/files/oXA5QPCctCIXw6QzVhTy" alt="Bindplane docs - Middleware - image 1"><figcaption></figcaption></figure>

**Basic**

| Parameter             | Type               | Required | Default                     | Description                                                                                                                                                                  |
| --------------------- | ------------------ | -------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Choose Telemetry Type | Telemetry Selector | No       | `Logs`, `Metrics`, `Traces` | Which signals to export. Any subset of Logs, Metrics, and Traces.                                                                                                            |
| Account UID           | String             | Yes      | *(empty)*                   | Your Middleware account UID. Appears in your Middleware URL (for `<uid>.middleware.io`, enter the `uid` portion). Forms the OTLP endpoint `https://<uid>.middleware.io:443`. |
| API Key               | String             | Yes      | *(empty)*                   | Your Middleware API key, sent as the `authorization` header. Sensitive value.                                                                                                |

**Advanced**

| Parameter                         | Type                   | Required | Default   | Description                                                                                          |
| --------------------------------- | ---------------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------- |
| Compression                       | Enum: none, gzip, zstd | No       | `gzip`    | Compression algorithm used when sending data to Middleware.                                          |
| Additional Headers                | Map                    | No       | *(empty)* | Extra headers attached to each HTTP request. The `authorization` header is configured automatically. |
| Timeout                           | Integer                | Yes      | `30`      | Timeout, in seconds, for sending batches to Middleware.                                              |
| Skip TLS Certificate Verification | Boolean                | No       | `false`   | Skip TLS certificate verification. Not recommended for production.                                   |

**Retry on Failure**

| Parameter               | Type    | Required | Default | Description                                                                                       |
| ----------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------- |
| Enable Retry on Failure | Boolean | No       | `true`  | Attempt to resend telemetry that fails to transmit to Middleware.                                 |
| Initial Interval        | Integer | No       | `5`     | Time, in seconds, to wait after the first failure before retrying. Applies when retry is enabled. |
| Max Interval            | Integer | No       | `30`    | Maximum time, in seconds, to wait between retries. Applies when retry is enabled.                 |
| Max Elapsed Time        | Integer | No       | `300`   | Maximum time, in seconds, to keep retrying. Applies when retry is enabled.                        |

**Sending Queue**

| Parameter                 | Type      | Required | Default                         | Description                                                                                                                                                                                                                                 |
| ------------------------- | --------- | -------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable Sending Queue      | Boolean   | No       | `true`                          | Buffer telemetry in memory before sending so data is not lost during network outages or collector restarts.                                                                                                                                 |
| Number of Consumers       | Integer   | No       | `10`                            | Number of consumers used to pull events from the sending queue. Applies when the sending queue is enabled.                                                                                                                                  |
| Queue Size                | Integer   | No       | `5000`                          | Number of spans, logs, or metrics the queue can store. Applies when the sending queue is enabled.                                                                                                                                           |
| Enable Persistent Queuing | Boolean   | No       | `true`                          | Buffer telemetry to disk before sending so data survives network outages or collector restarts. Applies when the sending queue is enabled.                                                                                                  |
| Persistent Queue Storage  | Extension | Yes      | `file_storage_persistent_queue` | The storage extension used for the persistent queue. Applies when the sending queue and persistent queuing are enabled. See [persistent queue storage](https://docs.bindplane.com/configuration/bindplane-otel-collector/persistent-queue). |

### Examples

#### Export all signals to Middleware

Send logs, metrics, and traces to a Middleware account with `gzip` compression (the default) and the default queue and retry settings.

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
  name: middlewareio
spec:
  type: middleware_otlp
  parameters:
    - name: telemetry_types
      value:
        - Logs
        - Metrics
        - Traces
    - name: mw_uid
      value: my-account
    - name: api_key
      value: ${MW_API_KEY}
```

### Configuration Tips

* The OTLP endpoint is derived from Account UID as `https://<uid>.middleware.io:443`. Enter only the UID portion, not the full hostname.
* Leave Compression at `gzip` to reduce egress bandwidth. Switch to `zstd` for a higher compression ratio, or `none` only when debugging.
* Keep Persistent Queuing enabled for mission-critical data so buffered telemetry survives collector restarts. Point Persistent Queue Storage at a directory with adequate disk space.

### Troubleshooting

#### 401 Unauthorized or authentication errors

Symptoms: telemetry is rejected with `401` or authorization errors in collector logs.

Solutions:

1. Verify the API Key is correct and active in your Middleware account.
2. Confirm the API Key is the value sent as the `authorization` header; do not add a second `authorization` entry under Additional Headers.

#### Connection or TLS failures

Symptoms: connection timeouts, DNS resolution errors, or TLS handshake failures.

Solutions:

1. Verify Account UID resolves to a valid endpoint (`https://<uid>.middleware.io:443`) and that outbound HTTPS to port 443 is allowed.
2. Do not enable Skip TLS Certificate Verification in production; use it only to isolate a certificate problem during testing.

#### Dropped telemetry after restarts or outages

Symptoms: telemetry is lost when the collector restarts or the network is unavailable.

Solutions:

1. Enable Sending Queue and Persistent Queuing so data is buffered to disk.
2. Enable Retry on Failure to resend transient failures, and increase Queue Size if the queue fills under load.

### Standalone Destination

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Destination
metadata:
  name: middlewareio
spec:
  type: middleware_otlp
  parameters:
    - name: telemetry_types
      value:
        - Logs
        - Metrics
        - Traces
    - name: mw_uid
      value: my-account
    - name: api_key
      value: ${MW_API_KEY}
    - name: timeout
      value: 30
```

### Related Resources

* [OTLP/HTTP Exporter (otlphttpexporter)](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter)
* [Middleware OpenTelemetry getting started](https://docs.middleware.io/open-telemetry/otel-getting-started)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bindplane.com/integrations/destinations/middlewareio.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
