{"id":16021041,"url":"https://github.com/joshdevins/metrics-statsd","last_synced_at":"2025-05-14T05:13:32.940Z","repository":{"id":3720713,"uuid":"4793419","full_name":"joshdevins/metrics-statsd","owner":"joshdevins","description":"An extension to joshdevins/metrics (fork of codahale/metrics) providing the ability to send realtime metrics to StatsD.","archived":false,"fork":false,"pushed_at":"2013-10-23T14:11:53.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T00:20:42.285Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/joshdevins.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":"2012-06-26T09:54:33.000Z","updated_at":"2023-05-06T10:20:45.000Z","dependencies_parsed_at":"2022-07-28T21:19:07.906Z","dependency_job_id":null,"html_url":"https://github.com/joshdevins/metrics-statsd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdevins%2Fmetrics-statsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdevins%2Fmetrics-statsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdevins%2Fmetrics-statsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdevins%2Fmetrics-statsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdevins","download_url":"https://codeload.github.com/joshdevins/metrics-statsd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076851,"owners_count":22010611,"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":[],"created_at":"2024-10-08T18:01:33.226Z","updated_at":"2025-05-14T05:13:32.910Z","avatar_url":"https://github.com/joshdevins.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nAn extension to [joshdevins/metrics](https://github.com/joshdevins/metrics) (fork of [codahale/metrics](https://github.com/codahale/metrics)) providing the ability to send realtime metrics to StatsD.\n\n# Usage\n\n```java\n// create a StatsD client with the host:port of your choosing (or port 8125 by default)\nclient = new DefaultStatsDClient(\"localhost\");\n\n// use Metric to access the default MetricListenersRegistry\nlistenersRegistry = Metrics.defaultListenersRegistry();\n\n// create listeners for the things you care about\n// by default, all the listeners will listen to all Metrics of their class\nlistenersRegistry.addListener(new StatsDCounterListener(client));\n\n// override some default functionality\nspecialCounterListener = new StatsDCounterListener(client);\n\n// override the MetricPredicate for fine-grained control of which metrics the listener\n//  should be called for, but do so BEFORE registering the listener with the registry\nmetricPredicate = new MetricPredicate() {\n    public boolean matches(final MetricName name, final Metric metric) {\n        // I only care about \"foo.bar.*\" metrics\n        return name.getGroup().startsWith(\"foo.bar.*\");\n    }\n};\nspecialCounterListener.setMetricPredicate(metricPredicate);\n\n// also override the BucketNameFormatter to send different bucket names to StatsD\n// the default bucket names are: group.type.[scope].name\nspecialCounterListener.setBucketNameFormatter(formatter);\n\nlistenersRegistry.addListener(specialCounterListener);\n\n// for convenience, if you just want to use all the defaults, use the StatsD helper class\n// this sets up all available listeners and returns a client (so you can shut it down later)\nclient = StatsD.setupWithDefaults(\"localhost\")\n\n```\n\n# TODO\n\nAdd a Metrics reporter that can push non-realtime stats from metrics into StatsD. See other metrics-statsd projects as well.\n\n# Installation\n\nSince this currently relies on the fork [joshdevins/metrics](https://github.com/joshdevins/metrics), the prerequisite is that you head over there, clone the repo and `mvn install` to build the forked `metrics-core`.\n\nOnce you have `metrics-core` installed locally, you can simply clone this repo and do a `mvn install`.\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 SoundCloud, Josh Devins\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdevins%2Fmetrics-statsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdevins%2Fmetrics-statsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdevins%2Fmetrics-statsd/lists"}