{"id":16729169,"url":"https://github.com/keithduncan/statsd-client","last_synced_at":"2025-04-10T11:11:51.293Z","repository":{"id":47557804,"uuid":"47186064","full_name":"keithduncan/statsd-client","owner":"keithduncan","description":"Statsd and dogstatsd network client in Haskell.","archived":false,"fork":false,"pushed_at":"2017-02-01T19:19:57.000Z","size":67,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:04:01.141Z","etag":null,"topics":["dogstatsd","haskell","metrics","statsd-client"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keithduncan.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}},"created_at":"2015-12-01T11:50:11.000Z","updated_at":"2022-06-09T12:40:11.000Z","dependencies_parsed_at":"2022-07-26T00:32:27.710Z","dependency_job_id":null,"html_url":"https://github.com/keithduncan/statsd-client","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithduncan%2Fstatsd-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithduncan%2Fstatsd-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithduncan%2Fstatsd-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithduncan%2Fstatsd-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keithduncan","download_url":"https://codeload.github.com/keithduncan/statsd-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994135,"owners_count":21030051,"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":["dogstatsd","haskell","metrics","statsd-client"],"created_at":"2024-10-12T23:27:21.165Z","updated_at":"2025-04-10T11:11:51.251Z","avatar_url":"https://github.com/keithduncan.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Statsd Client\n\nA port of [github/statsd-ruby](http://github.com/github/statsd-ruby) to Haskell.\n\n### Implements\n\n- IPv4 and IPv6 support\n- UDP statsd protocol\n- UDP dogstatsd protocol (support for Datadog features like tags)\n- Metric types\n  - Count\n  - Gauge\n  - Timing\n  - Histogram\n- Collector clustering, stats are consistently routed using CRC32\n- Packet signing using shared secret HMAC SHA256 signatures\n\n### Examples\n\nRun this helper script to listen to local UDP traffic:\n\n``` sh\nscript/listen\n```\n\nStart sending metrics\n\n``` haskell\nimport Network.Statsd\n\n-- error handling omitted\nclient \u003c- statsdClient \"statsd://127.0.0.1:8125/prefix\"\n\nincrement client \"requests\"\nhistogram client \"numOfFilesCreated\" 5\n\n-- error handling omitted\nclient' \u003c- statsdClient \"statsd://:mysecret@127.0.0.1:8125/prefix\"\n\nincrement client' \"requests\"\nhistogram client' \"numOfFilesCreated\" 5\n```\n\nWill result in these UDP packets being sent and received:\n\n```\n[#\u003cUDPSocket:fd 9\u003e, [\"prefix.requests:1|c\", #\u003cAddrinfo: 127.0.0.1:64257 UDP\u003e, 0]]\n[#\u003cUDPSocket:fd 9\u003e, [\"prefix.numOfFilesCreated:5|h\", #\u003cAddrinfo: 127.0.0.1:64257 UDP\u003e, 0]]\n\n[#\u003cUDPSocket:fd 9\u003e, [\"\\xD7\\x8D?a9\\xCB\\xD5H\\xFB\\xA2?\\xFE\\x18\\xFF9P\\xB3\\x9EY\\e\\xD9H\\x86H\\xEC\\x84(N7B\\xF7\\x85\\x04\\\\mV\\x00\\x00\\x00\\x00\\x17\\xFEq\\x90prefix.requests:1|c\", #\u003cAddrinfo: 127.0.0.1:56756 UDP\u003e, 0]]\n[#\u003cUDPSocket:fd 9\u003e, [\"A\\x94\\a\\xBD\\x8C9\\x00\\tU\\xD0\\x87\\x8F\\x9A\\xCD\\xC5\\xA2l\\xCA\u0026\\xA7T7\\xEFT8\\x9F\\\\b\\xF7\\xEB\\x10\\xD2\\x06\\\\mV\\x00\\x00\\x00\\x00j\\x86\\xCD\\xCBprefix.numOfFilesCreated:5|h\", #\u003cAddrinfo: 127.0.0.1:56756 UDP\u003e, 0]]\n```\n\n Send metrics to dogstatsd:\n\n ``` haskell\nimport Network.DogStatsd\n\n-- error handling omitted\nclient \u003c- dogStatsdClient \"statsd://127.0.0.1:8125/prefix\"\n\n-- Don't send any tags\nincrement client \"requests\" []\n-- Tags are key value pairs, omit the value to send a named tag\nhistogram client \"numOfFilesCreated\" 5 [(\"os\", \"mac\"), (\"tag2\",\"\")]\n```\n\n```\n[#\u003cUDPSocket:fd 9\u003e, [\"prefix.requests:1|c\", #\u003cAddrinfo: 127.0.0.1:64257 UDP\u003e, 0]]\n[#\u003cUDPSocket:fd 9\u003e, [\"prefix.numOfFilesCreated:5|h|#os:mac,tag2\", #\u003cAddrinfo: 127.0.0.1:64257 UDP\u003e, 0]]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeithduncan%2Fstatsd-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeithduncan%2Fstatsd-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeithduncan%2Fstatsd-client/lists"}