$ account obfuscurity
Backstop is a Ruby Sinatra web application that acts as a proxy for submitting metrics to Graphite/Carbon. It accepts JSON data via HTTP POST from various sources (Collectd, GitHub webhooks, PagerDuty, and custom endpoints) and forwards the metrics to one or more Carbon/Graphite listeners. The application is structured with separate components for configuration, publishing metrics, handling authentication, and parsing Collectd data using a plugin system. The Publisher class manages a pool of TCP connections to Carbon servers, randomly selecting a connection for each metric to achieve basic load balancing. It handles reconnection by resetting the connection pool on socket errors. The Collectd parser uses a dynamic plugin system to handle different Collectd plugin types, making it easy to extend for new plugin formats.