xk6-client-prometheus-remote
    Preparing search index...

    xk6-client-prometheus-remote

    k6 extension for Prometheus Remote Write load testing.

    This module provides the ability to send metrics to any Prometheus Remote Write compatible endpoint, including Prometheus, Cortex, Thanos, Mimir, and other services that implement the remote_write API.

    • Send custom time series data to remote write endpoints
    • Generate metrics efficiently using templates to reduce JavaScript overhead
    • Support for custom headers, authentication, and multi-tenant configurations
    • Built-in support for high-cardinality testing scenarios
    import remote from 'k6/x/remotewrite';

    const client = new remote.Client({
    url: "https://prometheus.example.com/api/v1/write"
    });

    export default function () {
    let res = client.store([{
    labels: [
    { name: "__name__", value: "my_metric" },
    { name: "service", value: "api" }
    ],
    samples: [
    { value: 42.5 }
    ]
    }]);
    }

    Classes

    Client

    Interfaces

    ClientConfig
    Label
    MetricTemplate
    PrecompiledLabelTemplates
    RemoteWriteResponse
    Sample
    TimeSeries

    Variables

    default

    Functions

    precompileLabelTemplates
    Sample
    Timeseries