Registry / observability / graphyte

graphyte

JSON →
library1.7.1pypypi✓ verified 84d ago

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).

pip install graphyte
INSTALL
IMPORT
SIG · GRAPHYTE
G
graphyte
observabilitypythonv1.7.1
Install
2.4s avg
Import
26ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.028s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.024s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

init
from graphyte import init
Sender
from graphyte import Sender

Initialize a default sender and send a metric. Uses environment variables for configuration.

import os from graphyte import init, send # Initialize with default sender (uses GRAPHITE_HOST env var or 'localhost') init( host=os.environ.get('GRAPHITE_HOST', 'localhost'), port=int(os.environ.get('GRAPHITE_PORT', 2003)), prefix=os.environ.get('GRAPHITE_PREFIX', 'test') ) # Send a metric send('cpu.load', 0.5, timestamp=1234567890)
Debug
Known issues
breakingPython 2 is not supported. Graphyte requires Python 3. Using it with Python 2 will fail.
fix
Use Python 3.6+.
affects: >=1.0
gotchaThe default protocol is TCP. To use UDP, you must pass protocol='udp' when initializing the sender.
fix
For UDP metrics: init('localhost', protocol='udp') or Sender('localhost', protocol='udp').
affects: >=1.1
gotchaTags with whitespace in keys or values will be rejected (since v1.6.0). Metric paths with spaces may also cause issues.
fix
Ensure tag keys and values do not contain spaces. Use underscores or other separators.
affects: >=1.6.0
deprecatedThe old import path 'graphyte.init' is still supported but using 'from graphyte import init' is preferred.
fix
Use 'from graphyte import init'.
affects: >=1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'graphyte'
Package not installed or installed for wrong Python version.
fix
Run 'pip install graphyte' and verify you're using Python 3.
AttributeError: module 'graphyte' has no attribute 'init'
Common mistake: import graphyte; graphyte.init() but init is not a top-level attribute of the package.
fix
Use 'from graphyte import init' instead.
graphyte.exceptions.InvalidMetric: name 'test.load' contains non-graphite-compatible characters
Metric names must match Graphite's allowed characters (alphanumeric, underscores, hyphens, dots).
fix
Remove illegal characters from metric name. For example, 'test.load' is fine, but 'test load' is not.
Connection refused or timeout when sending metrics
Graphite Carbon server is not running on the specified host/port or network issues.
fix
Verify Carbon is running: check host/port, ensure firewall allows traffic, test with 'nc -v <host> <port>'.
Upgrade
Version history
1.7.1latest on PyPI · released Jan 23, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
2
Resources