{"id":13342880,"url":"https://github.com/grafana/xk6-distributed-tracing","last_synced_at":"2025-10-01T18:32:12.969Z","repository":{"id":44776322,"uuid":"348338877","full_name":"grafana/xk6-distributed-tracing","owner":"grafana","description":"A k6 extension for distributed tracing.","archived":true,"fork":false,"pushed_at":"2024-01-09T12:57:00.000Z","size":31220,"stargazers_count":62,"open_issues_count":0,"forks_count":9,"subscribers_count":145,"default_branch":"master","last_synced_at":"2024-11-14T22:36:05.092Z","etag":null,"topics":["distributed-tracing","jaeger","opentelemetry","xk6"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-16T12:28:11.000Z","updated_at":"2024-11-02T12:26:14.000Z","dependencies_parsed_at":"2024-06-19T00:23:22.759Z","dependency_job_id":"ee13a4c8-1331-46d5-b246-f99ff65f2acf","html_url":"https://github.com/grafana/xk6-distributed-tracing","commit_stats":null,"previous_names":["simskij/xk6-distributed-tracing","k6io/xk6-distributed-tracing"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-distributed-tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-distributed-tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-distributed-tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-distributed-tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/xk6-distributed-tracing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234892715,"owners_count":18902907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed-tracing","jaeger","opentelemetry","xk6"],"created_at":"2024-07-29T19:30:06.529Z","updated_at":"2025-10-01T18:32:07.682Z","avatar_url":"https://github.com/grafana.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ### ⚠️ Archived ⚠️\n\u003e\n\u003e This extension has been archived and is no longer maintained by the Grafana team.\n\u003e \n\u003e At this time, the tracing feature is now available in the as part of the\n\u003e [k6/experimental/tracing](https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/tracing/)\n\u003e module in [k6 OSS](https://grafana.com/docs/k6/latest/).\n\u003e \n\u003e Furthermore, [Distributed Tracing in Grafana Cloud k6](https://grafana.com/docs/cloud/k6/distributed-tracing/)\n\u003e is now generally available in Grafana Cloud.\n\u003e\n\u003e USE AT YOUR OWN RISK!\n\n# xk6-distributed-tracing\n\nThis extension adds distributed tracing support to [k6](https://github.com/grafana/k6)! \n\nThat means that if you're testing an instrumented system, you can use this extension to start the traces on k6. \n\nCurrently, it supports HTTP requests and the following propagation formats: `w3c`, `b3`, and `jaeger`.\n\nIt is implemented using the [xk6](https://github.com/grafana/xk6) extension system.\n\n## Build\n\nTo build a `k6` binary with this extension, first ensure you have the prerequisites:\n\n- [Go toolchain](https://go101.org/article/go-toolchain.html)\n- Git\n\nThen:\n\n1. Download `xk6`:\n\n```bash\n$ go install go.k6.io/xk6/cmd/xk6@latest\n```\n\n2. Build the binary:\n\n```bash\n$ xk6 build --with github.com/grafana/xk6-distributed-tracing@latest\n```\n\n## Example\n\n```javascript\nimport tracing, { Http } from 'k6/x/tracing';\nimport { sleep } from 'k6';\n\nexport let options = {\n  vus: 1,\n  iterations: 10,\n};\n\nexport function setup() {\n  console.log(`Running xk6-distributed-tracing v${tracing.version}`, tracing);\n}\n\nexport default function() {\n  const http = new Http({\n    propagator: \"w3c\",\n  });\n  const r = http.get('https://test-api.k6.io');\n  console.log(`trace_id=${r.trace_id}`);\n  sleep(1);\n}\n```\n\nResult output:\n\n```bash\n$ ./k6 run script.js\n\n          /\\      |‾‾| /‾‾/   /‾‾/\n     /\\  /  \\     |  |/  /   /  /\n    /  \\/    \\    |     (   /   ‾‾\\\n   /          \\   |  |\\  \\ |  (‾)  |\n  / __________ \\  |__| \\__\\ \\_____/ .io\n\n  execution: local\n     script: script.js\n     output: -\n\n  scenarios: (100.00%) 1 scenario, 1 max VUs, 40s max duration (incl. graceful stop):\n           * default: 1 looping VUs for 10s (gracefulStop: 30s)\n\nINFO[0000] Running xk6-distributed-tracing v0.2.0  source=console\nINFO[0000] trace_id=743fff0b96778539acb7139e72ea1e33\nINFO[0001] trace_id=365f4637a52526db1de2d30a5568ca3a\nINFO[0002] trace_id=c49e1df945049c5c3c8b59acc84d7d3b\nINFO[0003] trace_id=53e1937d56aa172b46d2310e3380dfe9\nINFO[0004] trace_id=d61e8757d35c9ca1780b88977ac56d72\nINFO[0005] trace_id=358e794ed636d268a918dcd2f3f9db0a\nINFO[0006] trace_id=992a959e09ee84f3905a215bec8b53a0\nINFO[0007] trace_id=aee11c64de11744ab5b66d5dd8ed361b\nINFO[0008] trace_id=c4dc45d857e99ede2bb902666457239d\nINFO[0009] trace_id=7623d10293d9f03c15deb8055935664e\n\nrunning (10.1s), 0/1 VUs, 10 complete and 0 interrupted iterations\ndefault ✓ [======================================] 1 VUs  10s\n\n     █ setup\n\n     data_received..............: 1.6 kB 156 B/s\n     data_sent..................: 1.7 kB 165 B/s\n     http_req_blocked...........: avg=223.43µs min=146.53µs med=217.39µs max=314.54µs p(90)=276.68µs p(95)=295.61µs\n     http_req_connecting........: avg=137.18µs min=87.22µs  med=130.17µs max=196.38µs p(90)=184.38µs p(95)=190.38µs\n     http_req_duration..........: avg=6.58ms   min=5.07ms   med=6.45ms   max=7.91ms   p(90)=7.83ms   p(95)=7.87ms\n     http_req_receiving.........: avg=187.27µs min=94.29µs  med=171.7µs  max=295.67µs p(90)=293.28µs p(95)=294.48µs\n     http_req_sending...........: avg=128.07µs min=94.64µs  med=121.77µs max=175.65µs p(90)=160.41µs p(95)=168.03µs\n     http_req_tls_handshaking...: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s\n     http_req_waiting...........: avg=6.27ms   min=4.83ms   med=6.13ms   max=7.64ms   p(90)=7.56ms   p(95)=7.6ms\n     http_reqs..................: 10     0.991797/s\n     iteration_duration.........: avg=916.48ms min=65.67µs  med=1s       max=1s       p(90)=1s       p(95)=1s\n     iterations.................: 10     0.991797/s\n     vus........................: 1      min=1 max=1\n     vus_max....................: 1      min=1 max=1\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-distributed-tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fxk6-distributed-tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-distributed-tracing/lists"}