graphitesend
raw JSON → 0.10.0 verified Mon Apr 27 auth: no python maintenance
A simple interface for sending metrics to Graphite. Provides an easy-to-use Python client for Graphite's plaintext protocol. Current version 0.10.0, released 2016, in maintenance mode.
pip install graphitesend Common errors
error AttributeError: module 'graphitesend' has no attribute 'graphite' ↓
cause Using wrong import or outdated API referencing 'graphite' object.
fix
Use
from graphitesend import GraphiteClient instead of import graphitesend and accessing graphitesend.graphite. error socket.gaierror: [Errno -2] Name or service not known ↓
cause The graphite_server hostname cannot be resolved.
fix
Check the hostname and network connectivity. Use an IP address if DNS is unavailable.
error ValueError: too many values to unpack (expected 2) ↓
cause Misconfigured tuple format when using non-standard settings.
fix
Ensure all arguments are passed as keyword arguments to GraphiteClient.
Warnings
gotcha By default, graphitesend sends metrics over UDP, which has no delivery guarantee. Use `send_type='tcp'` for reliable delivery. ↓
fix Initialize with `GraphiteClient(..., send_type='tcp')`
gotcha The library does not validate the metric name or value format; invalid characters may cause Graphite to reject the metric. ↓
fix Sanitize metric names (replace spaces, special characters) before sending.
deprecated Graphite's plaintext protocol is being phased out; consider using Graphite's pickle protocol or HTTP API. ↓
fix Use `graphitesend` with Graphite's pickle format via `format='pickle'` or migrate to newer libraries like `graphiteclient` or `datadog`.
Imports
- GraphiteClient
from graphitesend import GraphiteClient
Quickstart
from graphitesend import GraphiteClient
g = GraphiteClient(graphite_server='localhost', prefix='test')
g.send('metric.name', 42)