{"id":14371227,"url":"https://github.com/LeonAdato/xk6-output-statsd","last_synced_at":"2025-08-22T14:32:03.091Z","repository":{"id":185149160,"uuid":"672949580","full_name":"LeonAdato/xk6-output-statsd","owner":"LeonAdato","description":"k6 extension to output real-time test metrics using StatsD.","archived":false,"fork":false,"pushed_at":"2024-08-28T15:23:39.000Z","size":249,"stargazers_count":24,"open_issues_count":13,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-14T22:36:13.279Z","etag":null,"topics":["k6-extension","k6-out","statsd-metrics","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/LeonAdato.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":"2023-07-31T14:25:21.000Z","updated_at":"2024-11-11T07:09:38.000Z","dependencies_parsed_at":"2024-05-22T15:02:52.551Z","dependency_job_id":"c3d8e345-c1cc-40ec-aea0-9f1dce0180f2","html_url":"https://github.com/LeonAdato/xk6-output-statsd","commit_stats":null,"previous_names":["javaducky/xk6-output-statsd","leonadato/xk6-output-statsd"],"tags_count":4,"template":false,"template_full_name":"grafana/xk6-output-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonAdato%2Fxk6-output-statsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonAdato%2Fxk6-output-statsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonAdato%2Fxk6-output-statsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeonAdato%2Fxk6-output-statsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeonAdato","download_url":"https://codeload.github.com/LeonAdato/xk6-output-statsd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230605907,"owners_count":18252342,"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":["k6-extension","k6-out","statsd-metrics","xk6"],"created_at":"2024-08-27T23:00:56.689Z","updated_at":"2024-12-20T15:30:31.542Z","avatar_url":"https://github.com/LeonAdato.png","language":"Go","funding_links":[],"categories":["Extensions"],"sub_categories":["Community"],"readme":"# xk6-output-statsd\nProvides support for real-time output of k6 test metrics to a [StatsD](https://github.com/statsd/statsd) service.\n\nDirect support for the _StatsD_ metrics collector will be removed from k6 in a future release.\nFor those seeking to continue using StatsD, the functionality may be compiled into custom k6 binaries as an [xk6 extension](https://k6.io/docs/extensions/).\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- [xk6](https://github.com/grafana/xk6)\n\n1. Build with `xk6`:\n\n```bash\nxk6 build --with github.com/LeonAdato/xk6-output-statsd\n```\n\nThis will result in a `k6` binary in the current directory.\n\n2. Run with the just build `k6:\n\n```bash\n./k6 run -o output-statsd \u003cscript.js\u003e\n```\n\n## Options\nThe `xk6-output-statsd` extension supports the following configuration options:\n\n| Environment Variable | Default         | Description                                                                           |\n|----------------------|-----------------|---------------------------------------------------------------------------------------|\n| K6_STATSD_ADDR       | `localhost:8125` | Address of the statsd service, currently only UDP is supported.                       |\n| K6_STATSD_NAMESPACE  | `k6.`           | The namespace used as a prefix for all the metric names.                              |\n| K6_STATSD_PUSH_INTERVAL | `1s`            | Configure how often data batches are sent.                                            |\n| K6_STATSD_BUFFER_SIZE | `20`            | The buffer size.                                                                      |\n| K6_STATSD_ENABLE_TAGS | `false`         | If `true` enables sending tags. Versions prior to statsd v0.9.0 did not support tags. |\n| K6_STATSD_TAG_BLOCKLIST | `vu,iter,url`   | Comma-separated list of tags that should not be sent to statsd.                       |\n\nOptions may be specified as system environment variables as with the following:\n\n```bash\nK6_STATSD_ADDR=localhost:8125 K6_STATSD_ENABLE_TAGS=true ./k6 run -o output-statsd examples/simple.js\n```\n\n# Testing Locally\n\nThis repository includes a [docker-compose.yml](./docker-compose.yml) file that starts Graphite backed by StatsD which can be used for testing the `xk6-output-statsd` extension. \n\n\u003e :warning: This environment is intended for testing only and should not be used for production purposes.\n\n1. Start the docker compose environment.\n   ```bash\n   docker compose up -d\n   ```\n   Output should appear similar to the following:\n   ```shell\n   ✔ Network xk6-output-statsd_default       Created               ...    0.0s\n   ✔ Container xk6-output-statsd-graphite-1  Started               ...    0.3s\n   ```\n2. Use your [custom k6 binary](#build) to run a k6 test script sending metrics to your StatsD service started ing the previous step. \n   ```bash\n   ./k6 run -o output-statsd examples/ramping-vus.js\n   ```\n3. Open the Graphite application by accessing [http://localhost:80/](http://localhost/?showTarget=stats.timers.k6.http_req_duration.count\u0026showTarget=stats.timers.k6.http_req_duration.count\u0026from=-5minutes\u0026target=stats.gauges.k6.vus\u0026target=stats.k6.http_reqs\u0026target=stats.timers.k6.iteration_duration.upper_90) to view metrics from your test similar to the following:\n   ![Graphite Dashboard](docs/images/graphite-ramping-example.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeonAdato%2Fxk6-output-statsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeonAdato%2Fxk6-output-statsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeonAdato%2Fxk6-output-statsd/lists"}