{"id":15048297,"url":"https://github.com/github/backstop","last_synced_at":"2025-10-04T08:31:20.658Z","repository":{"id":16705834,"uuid":"19462601","full_name":"github/backstop","owner":"github","description":"HTTP service for submitting metrics to Graphite","archived":true,"fork":true,"pushed_at":"2014-01-09T16:45:19.000Z","size":4010,"stargazers_count":13,"open_issues_count":0,"forks_count":11,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-09-29T00:21:26.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"obfuscurity/backstop","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.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":"2014-05-05T16:27:46.000Z","updated_at":"2024-07-31T03:23:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/github/backstop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fbackstop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fbackstop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fbackstop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fbackstop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/backstop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235232495,"owners_count":18957057,"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-09-24T21:10:25.563Z","updated_at":"2025-10-04T08:31:15.293Z","avatar_url":"https://github.com/github.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backstop\n\n[![Build Status](https://secure.travis-ci.org/obfuscurity/backstop.png?branch=master)](http://travis-ci.org/obfuscurity/backstop)\n\nBackstop is a simple endpoint for submitting metrics to Graphite. It accepts JSON data via HTTP POST and proxies the data to one or more Carbon/Graphite listeners.\n\n## Usage\n\n### Collectd Metrics\n\nBackstop supports submission of metrics via the Collectd [write_http](http://collectd.org/wiki/index.php/Plugin:Write_HTTP) output plugin. A sample client configuration:\n\n```\n\u003cPlugin write_http\u003e\n  \u003cURL \"https://backstop.example.com/collectd\"\u003e\n    Format \"JSON\"\n    User \"\"\n    Password \"\"\n  \u003c/URL\u003e\n\u003c/Plugin\u003e\n```\n\n### GitHub Post-Receive Hooks\n\nBackstop can receive commit data from GitHub [post-receive webhooks](https://help.github.com/articles/post-receive-hooks). Your WebHook URL should consist of the Backstop service URL with the `/github` endpoint. For example, `https://backstop.example.com/github`.\n\nAll GitHub commit metrics contain the project name, branch information, author email and commit identifier, and are stored with a value of `1`. These can then be visualized as annotation-style metrics using Graphite's `drawAsInfinite()` function. Sample metric:\n\n```\ngithub.project.refs.heads.master.bob-example-com.10af2cb02eadd4cb1a3e43aa9cae47ef2cd07016 1 1203116237\n```\n\n### PagerDuty Incident Webhooks\n\nBackstop can also receive PagerDuty incidents courtesy of Jesse Newland's [pagerduty-incident-webhooks](https://github.com/github/pagerduty-incident-webhooks) project. When deploying `pagerduty-incident-webhooks` make sure to set `PAGERDUTY_WEBHOOK_ENDPOINT` to your Backstop service URL with the `/pagerduty` endpoint. For example, `https://backstop.example.com/pagerduty`.\n\nMetrics will be stored under the `alerts` prefix with a value of `1`. These can then be visualized as annotation-style metrics using Graphite's `drawAsInfinite()` function. Sample metric:\n\n```\nalerts.nagios.web1.diskspace 1 1365206103\n```\n\n### Custom Metrics\n\nUse the `/publish` endpoint in conjunction with one of the approved `PREFIXES` for submitting metrics to Backstop. In most environments it makes sense to use distinct prefixes for normal (e.g. gauge, counters, etc) metrics vs annotation (event-style) metrics. `PREFIXES` is defined as a comma-delimited list of prefix strings. For example:\n\n```bash\nexport PREFIXES='test,app1,app2'\n```\n\n#### Sending Metrics\n\nHere is a basic example for posting an application metric to the `custom` prefix.\n\n```ruby\nRestClient.post(\"https://backstop.example.com/publish/custom\",\n   [{:metric =\u003e key, :value =\u003e value, :measure_time =\u003e Time.now.to_i}].to_json)\n```\n\n#### Sending Annotations\n\nHere is an example for posting a software release announcement to the `note` prefix.\n\n```ruby\nRestClient.post(\"https://backstop.example.com/publish/note\",\n   [{:metric =\u003e \"foobar.release\", :value =\u003e \"v214\", :measure_time =\u003e Time.now.to_i}].to_json)\n```\n\n#### Using with Hosted Graphite\n\nGraphite hosting service [Hosted Graphite](https://www.hostedgraphite.com) requires metrics to be submitted with an API key prepended to the metric.  To use their service, just define the `API_KEY` environment variable.\n\n## Deployment\n\nBackstop supports optional Basic Authentication through Rack::Auth::Basic. Simply set BACKSTOP_AUTH to your colon-delimited credentials (e.g. `user:pass`).\n\nThe `CARBON_URLS` variable must be set to one or more valid destinations. Examples:\n\n```\nexport CARBON_URLS=\"carbon://10.10.10.10:2003,carbon://10.10.20.10:2003\"\n```\n\n### Local\n\nThe following instructions assume a working Ruby installation with the bundler gem already installed on your system.\n\n```bash\n$ git clone https://github.com/obfuscurity/backstop.git\n$ cd backstop\n$ bundle install\n$ export CARBON_URLS=...\n$ export PREFIXES=...\n$ export BACKSTOP_AUTH=... (optional)\n$ foreman start\n```\n\n### Heroku\n\n```bash\n$ heroku create\n$ heroku config:add CARBON_URLS=...\n$ heroku config:add PREFIXES=...\n$ heroku config:add BACKSTOP_AUTH=... (optional)\n$ git push heroku master\n```\n\n## License\n\nBackstop is distributed under a 3-clause BSD license.\n\n## Thanks\n\nThanks to Michael Gorsuch (@gorsuch) for his work on the collectd parser and the \"Mitt\" application that preceded Backstop.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fbackstop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fbackstop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fbackstop/lists"}