{"id":18324035,"url":"https://github.com/dirk/metrics_distributor","last_synced_at":"2025-09-12T07:43:18.548Z","repository":{"id":57638296,"uuid":"51985611","full_name":"dirk/metrics_distributor","owner":"dirk","description":"Ingest logs and forward aggregated data to APIs/services","archived":false,"fork":false,"pushed_at":"2020-04-24T04:06:36.000Z","size":79,"stargazers_count":58,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T13:46:07.318Z","etag":null,"topics":["datadog","heroku","statsd"],"latest_commit_sha":null,"homepage":"https://docs.rs/metrics_distributor/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-02-18T06:40:18.000Z","updated_at":"2020-06-23T02:36:36.000Z","dependencies_parsed_at":"2022-09-26T20:21:16.480Z","dependency_job_id":null,"html_url":"https://github.com/dirk/metrics_distributor","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirk%2Fmetrics_distributor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirk%2Fmetrics_distributor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirk%2Fmetrics_distributor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirk%2Fmetrics_distributor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirk","download_url":"https://codeload.github.com/dirk/metrics_distributor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"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":["datadog","heroku","statsd"],"created_at":"2024-11-05T18:31:14.564Z","updated_at":"2025-04-06T00:30:52.829Z","avatar_url":"https://github.com/dirk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status][travis-image]][travis-url]\n\n# Metrics Distributor\n\nMetrics distributor is a Rust library for streamlining the creation and operation of metrics aggregation services. You can use it to build a simple, multi-protocol collection and forwarding service for your metrics.\n\nDistributors can **collect** over a number of protocols and formats:\n\n- HTTP POST requests: [`LogDrainHandler`][]\n  - Log drain (body is raw log lines)\n    - Heroku dyno performance metrics: [`HerokuLogLineReader`][]\n    - Standard metrics format: [`StandardLogLineReader`][]\n  - Batch submission of arrays of metrics (currently WIP)\n    - urlencoded form\n    - JSON\n    - Standard metrics format\n- [StatsD protocol][]:\n  - TCP connection: [`StatsdTcpListener`][]\n  - UDP datagrams: [`StatsdUdpListener`][]\n\n[StatsD protocol]: https://github.com/b/statsd_spec\n[`LogDrainHandler`]: https://dirk.github.io/metrics_distributor/metrics_distributor/collectors/http/struct.LogDrainHandler.html\n[`HerokuLogLineReader`]: https://dirk.github.io/metrics_distributor/metrics_distributor/parsers/log_line/struct.HerokuLogLineReader.html\n[`StandardLogLineReader`]: https://dirk.github.io/metrics_distributor/metrics_distributor/parsers/log_line/struct.StandardLogLineReader.html\n[`StatsdTcpListener`]: https://dirk.github.io/metrics_distributor/metrics_distributor/collectors/statsd/struct.StatsdTcpListener.html\n[`StatsdUdpListener`]: https://dirk.github.io/metrics_distributor/metrics_distributor/collectors/statsd/struct.StatsdUdpListener.html\n\nThey can then **forward** aggregated metrics over a number of protocols:\n\n- HTTP POST in simple metrics format\n- Datadog API: [`DatadogForwarder`][]\n- [Graphite] plaintext\n- StatsD\n\n[Graphite]: https://graphite.readthedocs.org/en/latest/feeding-carbon.html\n[`DatadogForwarder`]: https://dirk.github.io/metrics_distributor/metrics_distributor/forwarders/datadog/struct.DatadogForwarder.html\n\n## Building on macOS\n\nThe system OpenSSL on macOS is too outdated. To use the one installed by Homebrew, run the following commands before building:\n\n```sh\nexport OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include\nexport OPENSSL_LIB_DIR=`brew --prefix openssl`/lib\nexport LDFLAGS=-L`brew --prefix openssl`/lib\n```\n\n### Configuration\n\nDistributor uses code as configuration. Rather than parsing a configuration format, you configure your service by composing collectors and forwarders. This means you get the added advantage of the powerful Rust compiler checking your \"configuration\" for correctness and that it's very easy to customize or create entirely new collections/forwarders.\n\nSee the `examples/` folder for some common configurations:\n\n- [`http_server.rs`][]: Simple log drain\n- [`statsd_server.rs`][]: StatsD (UDP) server\n\n[`http_server.rs`]: examples/http_server.rs\n[`statsd_server.rs`]: examples/statsd_server.rs\n\nIt turns out that the number of lines needed to set up a few collectors and forwarders in code is almost exactly the same as you would need with YAML/TOML/etc.\n\n## License\n\nLicensed under the 3-clause BSD license. See [LICENSE](LICENSE) for details.\n\n[travis-image]: https://travis-ci.org/dirk/metrics_distributor.svg\n[travis-url]: https://travis-ci.org/dirk/metrics_distributor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirk%2Fmetrics_distributor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirk%2Fmetrics_distributor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirk%2Fmetrics_distributor/lists"}