{"id":17483478,"url":"https://github.com/xandkar/beam_stats","last_synced_at":"2025-10-05T17:11:57.264Z","repository":{"id":41297330,"uuid":"40481276","full_name":"xandkar/beam_stats","owner":"xandkar","description":"Collect detailed Erlang VM metrics and send to arbitrary, pluggable backends (StatsD and Graphite backends included).","archived":false,"fork":false,"pushed_at":"2022-05-16T19:43:18.000Z","size":367,"stargazers_count":17,"open_issues_count":8,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T14:56:52.097Z","etag":null,"topics":["erlang","metrics"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/xandkar.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-08-10T12:27:01.000Z","updated_at":"2024-08-13T23:31:26.000Z","dependencies_parsed_at":"2022-08-10T01:53:45.409Z","dependency_job_id":null,"html_url":"https://github.com/xandkar/beam_stats","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/xandkar/beam_stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xandkar%2Fbeam_stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xandkar%2Fbeam_stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xandkar%2Fbeam_stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xandkar%2Fbeam_stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xandkar","download_url":"https://codeload.github.com/xandkar/beam_stats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xandkar%2Fbeam_stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278486308,"owners_count":25994945,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["erlang","metrics"],"created_at":"2024-10-19T00:05:34.545Z","updated_at":"2025-10-05T17:11:57.241Z","avatar_url":"https://github.com/xandkar.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/xandkar/beam_stats.svg?branch=master)](https://travis-ci.org/xandkar/beam_stats)\n\nbeam_stats\n==========\n\nPeriodically collects and pushes VM metrics to arbitrary consumer processes,\nwhich, in-turn, can do whatever they want with the given data (such as\nserialize and forward to some time series storage). Includes, off by default,\nexample implementations of consumers for:\n\n- StatsD (`beam_stats_consumer_statsd`)\n- Graphite (`beam_stats_consumer_graphite`)\n- CSV file (`beam_stats_consumer_csv`)\n\nEssentially like `folsomite`, but different. Different in the following ways:\n\n- More-general: consumers other than graphite can be defined\n- More-focused: only concerned with VM metrics, while `folsomite` ships off\n  _everything_ from `folsom` (in addition to VM metrics)\n- Easier-(for me!)-to-reason-about implementation:\n    + Well-defined metrics-to-binary conversions, as opposed to the\n      nearly-arbitrary term-to-string conversions used in `folsomite`\n    + Spec'd, tested and Dialyzed\n- More detailed stats:\n    - **per-process**. As much process ancestry is collected as possible, then\n      anonymous processes are aggregated to their youngest-known, named\n      predecessor - this aggregation keeps the useful breadcrumbs, while\n      reducing the number of unique names from exploding, which\n      **avoids the associated problems**:\n        1. not very useful when there're lots of short-lived processes\n        2. exploading disk space usage in Whisper\n    - per-ETS-table\n    - and more ... see records defined in `include` directory\n\nFor an example of using pre-process stats to track-down memory leaks, here's a\nscreenshot of the SSL connection process memory usage growth drop after upgrade\nfrom 17.5 to 18.1 (back in 2015):\n![SSL memory leak going away](screenshot--2015-10-05--18.41.30.jpg)\n\n### Adding consumers\n\n#### At app config time\n\n```erlang\n{env,\n  [ {production_interval , 30000}\n  , {consumers,\n      [ {beam_stats_consumer_statsd,\n          [ {consumption_interval , 60000}\n          , {dst_host             , \"localhost\"}\n          , {dst_port             , 8125}\n          , {src_port             , 8124}\n          , {num_msgs_per_packet  , 10}\n\n          % If you want to name your node something other than what\n          % erlang:node() returns:\n          , {static_node_name     , \u003c\u003c\"unicorn_at_rainbow\"\u003e\u003e}\n          ]}\n      , {beam_stats_consumer_graphite,\n          [ {consumption_interval , 60000}\n          , {host                 , \"localhost\"}\n          , {port                 , 2003}\n          , {timeout              , 5000}\n          ]}\n      , {beam_stats_consumer_csv,\n          [ {consumption_interval , 60000}\n          , {path                 , \"beam_stats.csv\"}\n          ]}\n      , {some_custom_consumer_module,\n          [ {some_custom_option_a, \"abc\"}\n          , {some_custom_option_b, 123}\n          ]}\n\n      ]}\n  ]}\n```\n\n#### Dynamically\n\n```erlang\nbeam_stats_consumer:add(consumer_module, ConsumerOptions).\n```\n\n### Removing consumers\n\nNot yet implemented.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxandkar%2Fbeam_stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxandkar%2Fbeam_stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxandkar%2Fbeam_stats/lists"}