Carbon is a Next.js web application for creating and sharing beautiful images of source code. It provides a CodeMirror-based editor with extensive customization: syntax themes (30+ built-in), fonts (13 options), background colors/images (including Unsplash integration), window themes, padding, shadows, and line numbers. Users can import code via paste, file drop, or GitHub Gist URLs. Export options include PNG/SVG at multiple resolutions, clipboard copy, Twitter sharing, Imgur upload, and embed codes. Saved snippets persist via Firebase authentication with automatic Twitter/Slack unfurling. The app runs as a PWA for offline use. Architecture is a Next.js 12 monolith with API routes for oEmbed and server-side image generation (Puppeteer/Chrome AWS Lambda). State is managed through URL parameters (with base64-encoded complex state), localStorage, and React state. The codebase demonstrates solid engineering with custom CodeMirror modes for 6 languages, a sophisticated theme builder, and well-encapsulated UI components.
carbon-clickhouse is a production-grade Graphite metrics receiver and storage gateway written in Go. It ingests time-series data over multiple protocols (plain text TCP, UDP, Pickle, gRPC, Prometheus Remote Write, Telegraf HTTP JSON) and persists it to ClickHouse using the efficient RowBinary format. The system is architecturally split into receivers, a writer that rotates and compresses data files, and uploaders that batch-insert data into ClickHouse tables. Receivers handle protocol-specific parsing and drop rules; the writer manages chunking, interval-based rotation, and optional LZ4 compression; uploaders support points, index (hierarchical metric trees), tagged metrics (sorting, dedup, and URL encoding), and points-reverse storage. External dependencies include ClickHouse (HTTP interface), Prometheus protobuf definitions, gRPC, and common Go libraries. The codebase is well-tested, includes end-to-end integration tests with actual ClickHouse containers, and is actively maintained with CI/CD pipelines producing DEB/RPM packages.
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.