k6

Supported OS Linux Mac OS Windows

Présentation

k6 est un outil de test de charge open source qui vous permet d’identifier les problèmes de performance et les ralentissements plus rapidement.

Grâce à l’intégration k6, vous pouvez surveiller les métriques de performance liées à vos tests k6 pour :

  • Corréler les performances de votre application avec les métriques d’évaluation de la charge système
  • Créer des alertes en fonction des métriques d’évaluation des performances
  • Analyser et visualiser les métriques k6 à l’aide du dashboard k6 de Datadog ou depuis le Metrics Explorer

Dashboard k6 dans Datadog

Configuration

Pour obtenir des instructions détaillées, consultez la documentation de k6.

Installation

  1. Dans Datadog, accédez à Integrations > API et copiez votre clé d’API.

  2. Exécutez l’Agent Datadog :

    k6 envoie ses métriques à l’Agent Datadog, qui se charge ensuite de les recueillir, les agréger et les transmettre à la plateforme Datadog.

    Exécutez l’Agent Datadog en tant que conteneur Docker avec la commande suivante :

    DOCKER_CONTENT_TRUST=1 \
    docker run -d \
        --name datadog \
        -v /var/run/docker.sock:/var/run/docker.sock:ro \
        -v /proc/:/host/proc/:ro \
        -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
        -e DD_SITE="datadoghq.com" \
        -e DD_API_KEY=<YOUR_DATADOG_API_KEY> \
        -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=1 \
        -p 8125:8125/udp \
        datadog/agent:latest
    

    Remarque : remplacez <YOUR_DATADOG_API_KEY> par votre clé d’API. Si votre compte utilise le site européen de Datadog, définissez DD_SITE sur datadoghq.eu.

  3. Exécutez le test k6, puis envoyez les résultats à Datadog.

    Après avoir lancé l’Agent Datadog, exécutez le test k6 et envoyez les métriques à l’Agent avec la commande suivante :

    K6_STATSD_ENABLE_TAGS=true k6 run --out statsd script.js
    
  4. Visualisez les métriques k6 dans Datadog.

    Pendant l’exécution du test, k6 envoie les métriques de façon périodique à Datadog. Par défaut, le nom de ces métriques commence par k6..

    Pour visualiser les métriques k6 en temps réel, utilisez le Metrics Explorer, les monitors ou un dashboard personnalisé.

    Métriques k6 dans le Metrics Explorer Datadog

    La première fois que Datadog détecte la métrique k6.http_reqs, le carré d’intégration k6 est automatiquement installé et le dashboard k6 par défaut est ajouté à votre liste de dashboards.

    Dashboard k6 dans Datadog

Données collectées

Métriques

k6.data_sent
(count)
The amount of data sent
Shown as byte
k6.data_received
(count)
The amount of received data
Shown as byte
k6.http_req_blocked.avg
(gauge)
Average time spent blocked before initiating the request
Shown as millisecond
k6.http_req_blocked.max
(gauge)
Max time spent blocked before initiating the request
Shown as millisecond
k6.http_req_blocked.median
(gauge)
Median time spent blocked before initiating the request
Shown as millisecond
k6.http_req_blocked.95percentile
(gauge)
95th time spent blocked before initiating the request
Shown as millisecond
k6.http_req_blocked.99percentile
(gauge)
99th time spent blocked before initiating the request
Shown as millisecond
k6.http_req_blocked.count
(rate)
The number of httpreqblocked values submitted during the interval
Shown as unit
k6.http_req_connecting.avg
(gauge)
Average time spent establishing TCP connection
Shown as millisecond
k6.http_req_connecting.max
(gauge)
Max time spent establishing TCP connection
Shown as millisecond
k6.http_req_connecting.median
(gauge)
Median time spent establishing TCP connection
Shown as millisecond
k6.http_req_connecting.95percentile
(gauge)
95th time spent blocked before initiating the request
Shown as millisecond
k6.http_req_connecting.99percentile
(gauge)
99th time spent blocked before initiating the request
Shown as millisecond
k6.http_req_connecting.count
(rate)
The number of httpreqconnecting values submitted during the interval
Shown as unit
k6.http_req_duration.avg
(gauge)
Average request time
Shown as millisecond
k6.http_req_duration.max
(gauge)
Max request time
Shown as millisecond
k6.http_req_duration.median
(gauge)
Median request time
Shown as millisecond
k6.http_req_duration.95percentile
(gauge)
95th request time
Shown as millisecond
k6.http_req_duration.99percentile
(gauge)
99th request time
Shown as millisecond
k6.http_req_duration.count
(rate)
The number of httpreqduration values submitted during the interval
Shown as unit
k6.http_reqs
(count)
Total number of HTTP requests
Shown as request
k6.http_req_receiving.avg
(gauge)
Average time spent receiving response data
Shown as millisecond
k6.http_req_receiving.max
(gauge)
Max time spent receiving response data
Shown as millisecond
k6.http_req_receiving.median
(gauge)
Median time spent receiving response data
Shown as millisecond
k6.http_req_receiving.95percentile
(gauge)
95th time spent receiving response data
Shown as millisecond
k6.http_req_receiving.99percentile
(gauge)
99th time spent receiving response data
Shown as millisecond
k6.http_req_receiving.count
(rate)
The number of httpreqreceiving values submitted during the interval
Shown as unit
k6.http_req_sending.avg
(gauge)
Average time spent sending data
Shown as millisecond
k6.http_req_sending.max
(gauge)
Max time spent sending data
Shown as millisecond
k6.http_req_sending.median
(gauge)
Median time spent sending data
Shown as millisecond
k6.http_req_sending.95percentile
(gauge)
95th time spent sending data
Shown as millisecond
k6.http_req_sending.99percentile
(gauge)
99th time spent sending data
Shown as millisecond
k6.http_req_sending.count
(rate)
The number of httpreqsending values submitted during the interval
Shown as unit
k6.http_req_tls_handshaking.avg
(gauge)
Average time spent handshaking TLS session
Shown as millisecond
k6.http_req_tls_handshaking.max
(gauge)
Max time spent handshaking TLS session
Shown as millisecond
k6.http_req_tls_handshaking.median
(gauge)
Median time spent handshaking TLS session
Shown as millisecond
k6.http_req_tls_handshaking.95percentile
(gauge)
95th time spent handshaking TLS session
Shown as millisecond
k6.http_req_tls_handshaking.99percentile
(gauge)
99th time spent handshaking TLS session
Shown as millisecond
k6.http_req_tls_handshaking.count
(rate)
The number of httpreqtls_handshaking values submitted during the interval
Shown as unit
k6.http_req_waiting.avg
(gauge)
Average time spent waiting for response (TTFB)
Shown as millisecond
k6.http_req_waiting.max
(gauge)
Max time spent waiting for response (TTFB)
Shown as millisecond
k6.http_req_waiting.median
(gauge)
Median time spent waiting for response (TTFB)
Shown as millisecond
k6.http_req_waiting.95percentile
(gauge)
95th time spent waiting for response (TTFB)
Shown as millisecond
k6.http_req_waiting.99percentile
(gauge)
99th time spent waiting for response (TTFB)
Shown as millisecond
k6.http_req_waiting.count
(rate)
The number of httpreqwaiting values submitted during the interval
Shown as unit
k6.iteration_duration.avg
(gauge)
Average time spent for a VU iteration
Shown as millisecond
k6.iteration_duration.max
(gauge)
Max time spent for a VU iteration
Shown as millisecond
k6.iteration_duration.median
(gauge)
Median time spent for a VU iteration
Shown as millisecond
k6.iteration_duration.95percentile
(gauge)
95th time spent for a VU iteration
Shown as millisecond
k6.iteration_duration.99percentile
(gauge)
99th time spent for a VU iteration
Shown as millisecond
k6.iteration_duration.count
(rate)
The number of iteration_duration values submitted during the interval
Shown as unit
k6.iterations
(count)
Aggregated number of VU iterations
Shown as unit
k6.vus
(gauge)
Current number of active virtual users
Shown as user
k6.vus_max
(gauge)
Max possible number of virtual users
Shown as user

Checks de service

L’intégration k6 n’inclut aucun check de service.

Événements

L’intégration k6 n’inclut aucun événement.

Dépannage

Besoin d’aide ? Consultez la documentation de k6 sur Datadog ou contactez l’assistance k6.