How to use the k6/x/tracing.Http function in k6

To help you get started, we’ve selected a few k6 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github k6io / xk6-distributed-tracing / examples / test-config.js View on Github external
export default function() {
  const http = new Http({
    exporter: "jaeger",
    propagator: "w3c",
    endpoint: "http://localhost:14268/api/traces"
  });
  const r = http.get('https://test-api.k6.io');
  
  console.log(`trace-id=${r.trace_id}`);
  sleep(1);
}