---
title: Prometheus Remote Write
slug: telemetry-pipeline/prometheus-remote-write
docTags: 
createdAt: 2025-04-21T00:45:22.212Z
---

# Prometheus Remote Write Source

Collect metrics pushed by Prometheus using the remote write protocol.

This source allows worker to act as a Prometheus Remote Write receiver, accepting metric data sent by Prometheus servers and integrating it into worker-based telemetry pipelines.

## Ingestion Model

- Prometheus sends metric samples using the Remote Write protocol&#x20;
- worker exposes an HTTP endpoint to receive write requests&#x20;
- Incoming requests are parsed and validated&#x20;
- Metric samples are converted into worker metric events&#x20;
- Successfully processed samples participate in end-to-end acknowledgements&#x20;

This model enables worker to replace or complement long-term Prometheus storage backends.

## Reliability and Acknowledgements

- End-to-end acknowledgements are supported&#x20;
- Acknowledgement behavior is controlled globally or at the sink level&#x20;
- Source-level acknowledgement configuration is deprecated&#x20;

This ensures compatibility with Prometheus retry semantics and reliable delivery guarantees.

## Source Configuration Parameters

## sources.\<id>.type

**required**
&#x20;**string**

Specifies the source type.

- Must be set to prometheus\_remote\_write&#x20;

## sources.\<id>.address

**required**
&#x20;**string**

The socket address on which worker listens for incoming Prometheus remote write requests.

- Must include a port number&#x20;
- Supports binding to all interfaces or specific addresses&#x20;

Example format:

:::BlockQuote
0.0.0.0:9090
:::

## Authentication Configuration

Controls access to the remote write endpoint.

:::BlockQuote
Authentication should always be used together with HTTPS.
:::

## sources.\<id>.auth

**optional**
&#x20;**object**

Defines the authentication strategy for incoming HTTP requests.

### sources.\<id>.auth.strategy

**required**
&#x20;**string**
&#x20;**enum**

Selects the authentication mechanism.

Supported values:

- basic – HTTP Basic Authentication&#x20;
- custom – Custom authentication using VRL logic&#x20;

### sources.\<id>.auth.username

**required**
&#x20;**string**

The username used for Basic Authentication.

**Relevant when:**
&#x20;strategy = "basic"

### sources.\<id>.auth.password

**required**
&#x20;**string**

The password used for Basic Authentication.

**Relevant when:**
&#x20;strategy = "basic"

### sources.\<id>.auth.source

**required**
&#x20;**string**

A VRL boolean expression used to validate incoming requests.

- Receives the HTTP request context&#x20;
- Must evaluate to true for the request to be accepted&#x20;

**Relevant when:**
&#x20;strategy = "custom"

## HTTP Keepalive Configuration

Controls connection lifecycle behavior for incoming HTTP clients.

## sources.\<id>.keepalive

**optional**
&#x20;**object**

Configures HTTP keepalive behavior.

### sources.\<id>.keepalive.max\_connection\_age\_secs

**optional**
&#x20;**uint**

Maximum lifetime of an HTTP connection before worker closes it.

- A Connection: close header is sent when the limit is reached&#x20;
- Applies to HTTP/0.9, HTTP/1.0, and HTTP/1.1 only&#x20;
- Can be set to a very large value to effectively disable rotation&#x20;

**Default**

:::BlockQuote
300
:::

### sources.\<id>.keepalive.max\_connection\_age\_jitter\_factor

**optional**
&#x20;**float**

Adds random jitter to the maximum connection age.

- Helps avoid synchronized connection termination&#x20;
- Prevents connection storms&#x20;

Example:

- 0.1 → actual lifetime varies between 90% and 110%&#x20;

**Default**

:::BlockQuote
0.1
:::

## Metadata Conflict Handling

## sources.\<id>.metadata\_conflict\_strategy

**optional**
&#x20;**string**
&#x20;**enum**

Defines how conflicting metric metadata is handled.

Supported values:

- ignore
  &#x20;Silently keeps the first metadata entry
  &#x20;Matches Prometheus and Thanos behavior&#x20;
- reject
  &#x20;Rejects the request with HTTP 400
  &#x20;Preserves strict metadata correctness&#x20;

**Default**

:::BlockQuote
reject
:::

## Request Path Configuration

## sources.\<id>.path

**optional**
&#x20;**string**

Specifies the HTTP path used to receive remote write requests.

- Useful when exposing multiple services on the same address&#x20;
- Must match Prometheus remote\_write configuration&#x20;

**Default**

:::BlockQuote
/
:::

## Sample Validation

## sources.\<id>.skip\_nan\_values

**optional**
&#x20;**bool**

Controls handling of samples with NaN values.

- When enabled, samples with NaN values are discarded&#x20;
- Prevents invalid metrics from entering downstream systems&#x20;

**Default**

:::BlockQuote
false
:::

## TLS Configuration

Secures communication between Prometheus and worker.

## sources.\<id>.tls

**optional**
&#x20;**object**

Defines TLS behavior for incoming connections.

### sources.\<id>.tls.enabled

**optional**
&#x20;**bool**

Enables TLS encryption.

- When enabled, a server certificate is required&#x20;

### sources.\<id>.tls.crt\_file

**optional**
&#x20;**string**

Path to the server certificate file.

- PEM, DER, or PKCS#12 formats supported&#x20;
- Required when TLS is enabled&#x20;

### sources.\<id>.tls.key\_file

**optional**
&#x20;**string**

Path to the private key file.

- PEM or DER format&#x20;
- Required unless using PKCS#12&#x20;

### sources.\<id>.tls.key\_pass

**optional**
&#x20;**string**

Passphrase for encrypted private keys.

### sources.\<id>.tls.ca\_file

**optional**
&#x20;**string**

Additional CA certificate bundle.

- Used for client certificate verification&#x20;

### sources.\<id>.tls.verify\_certificate

**optional**
&#x20;**bool**

Enables certificate chain validation.

- Ensures certificates are trusted and not expired&#x20;
- Strongly recommended for production&#x20;

### sources.\<id>.tls.verify\_hostname

**optional**
&#x20;**bool**

Enables hostname verification.

- Ensures the certificate matches the expected hostname&#x20;

### sources.\<id>.tls.alpn\_protocols

**optional**
&#x20;**array\[string]**

Defines supported ALPN protocols in priority order.

## Reliability Characteristics

- At-least-once delivery semantics&#x20;
- Batch-oriented processing&#x20;
- Backpressure-aware ingestion&#x20;
- Prometheus-compatible retry behavior&#x20;
- Stateless processing model&#x20;

## Common Use Cases

- Replacing Prometheus long-term storage&#x20;
- Centralizing metrics ingestion&#x20;
- Multi-cluster Prometheus federation&#x20;
- Secure metric ingestion endpoints&#x20;
- Unified logs–metrics–traces pipelines
