A blazingly fast, ergonomic Rust client for sending metrics to Graphite Carbon daemons.
- 🎯 Simple API - Intuitive builder pattern for easy configuration
- 🔄 Auto-reconnection - Automatic retry logic with configurable attempts
- ⚡ Zero-copy writes - Efficient metric transmission with minimal overhead
- 🛡️ Type-safe - Leverages Rust's type system for compile-time guarantees
- ⏱️ Configurable timeouts - Fine-grained control over connection behavior
- 📊 Real-time metrics - Unix timestamp generation for accurate time-series data
Add Graphyne to your project:
cargo add graphyneuse graphyne::{GraphiteClient, GraphiteMessage};
// Create a client with default settings
let mut client = GraphiteClient::builder()
.address("127.0.0.1")
.port(2003)
.build()?;
// Send a metric
let message = GraphiteMessage::new("app.requests.count", "42");
client.send_message(&message)?;use graphyne::GraphiteClient;
use std::time::Duration;
let mut client = GraphiteClient::builder()
.address("127.0.0.1")
.port(2003)
.retries(5) // Optional
.timeout(Duration::from_secs(10)) // Optional
.build()?;use graphyne::{GraphiteClient, GraphiteMessage};
let mut client = GraphiteClient::builder()
.address("127.0.0.1")
.port(2003)
.build()?;
// Send various application metrics
let metrics = vec![
GraphiteMessage::new("app.cpu.usage", "45.2"),
GraphiteMessage::new("app.memory.bytes", "1048576"),
GraphiteMessage::new("app.requests.latency", "125"),
];
for metric in &metrics {
client.send_message(metric)?;
}- Automatic reconnection: If a send fails, the client automatically attempts to reconnect
- Retry logic: Configurable number of retry attempts for both connection and send operations
- Graceful shutdown: Connections are properly closed when the client is dropped
- IP addresses only: Currently only supports IP addresses, not DNS hostnames
- TCP only: Uses TCP plaintext protocol (port 2003 by default)
- No UDP support: UDP protocol is not yet supported
- No batching: Each message is sent individually
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Run tests
cargo test
# Check formatting
cargo fmt --check
# Run clippy
cargo clippy -- -D warningsLicensed under the Apache License, Version 2.0. See LICENSE for details.
Built with ❤️ by the Vultr Core Cloud Engineering team.
Made with 🦀 Rust | Maintained by Vultr