{"id":21397,"library":"graphyte","title":"Graphyte","description":"A simple Python 3 compatible library to send metrics to a Graphite Carbon server (plaintext or pickle protocol, TCP or UDP). Current version: 1.7.1. Low release cadence (last update 2020).","status":"maintenance","version":"1.7.1","language":"python","source_language":"en","source_url":"https://github.com/benhoyt/graphyte","tags":["graphite","metrics","monitoring","carbon","plaintext","udp","tcp"],"install":[{"cmd":"pip install graphyte","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"init","correct":"from graphyte import init"},{"note":"","wrong":null,"symbol":"Sender","correct":"from graphyte import Sender"}],"quickstart":{"code":"import os\nfrom graphyte import init, send\n\n# Initialize with default sender (uses GRAPHITE_HOST env var or 'localhost')\ninit(\n    host=os.environ.get('GRAPHITE_HOST', 'localhost'),\n    port=int(os.environ.get('GRAPHITE_PORT', 2003)),\n    prefix=os.environ.get('GRAPHITE_PREFIX', 'test')\n)\n\n# Send a metric\nsend('cpu.load', 0.5, timestamp=1234567890)","lang":"python","description":"Initialize a default sender and send a metric. Uses environment variables for configuration."},"warnings":[{"fix":"Use Python 3.6+.","message":"Python 2 is not supported. Graphyte requires Python 3. Using it with Python 2 will fail.","severity":"breaking","affected_versions":">=1.0"},{"fix":"For UDP metrics: init('localhost', protocol='udp') or Sender('localhost', protocol='udp').","message":"The default protocol is TCP. To use UDP, you must pass protocol='udp' when initializing the sender.","severity":"gotcha","affected_versions":">=1.1"},{"fix":"Ensure tag keys and values do not contain spaces. Use underscores or other separators.","message":"Tags with whitespace in keys or values will be rejected (since v1.6.0). Metric paths with spaces may also cause issues.","severity":"gotcha","affected_versions":">=1.6.0"},{"fix":"Use 'from graphyte import init'.","message":"The old import path 'graphyte.init' is still supported but using 'from graphyte import init' is preferred.","severity":"deprecated","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install graphyte' and verify you're using Python 3.","cause":"Package not installed or installed for wrong Python version.","error":"ModuleNotFoundError: No module named 'graphyte'"},{"fix":"Use 'from graphyte import init' instead.","cause":"Common mistake: import graphyte; graphyte.init() but init is not a top-level attribute of the package.","error":"AttributeError: module 'graphyte' has no attribute 'init'"},{"fix":"Remove illegal characters from metric name. For example, 'test.load' is fine, but 'test load' is not.","cause":"Metric names must match Graphite's allowed characters (alphanumeric, underscores, hyphens, dots).","error":"graphyte.exceptions.InvalidMetric: name 'test.load' contains non-graphite-compatible characters"},{"fix":"Verify Carbon is running: check host/port, ensure firewall allows traffic, test with 'nc -v <host> <port>'.","cause":"Graphite Carbon server is not running on the specified host/port or network issues.","error":"Connection refused or timeout when sending metrics"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}