platypush.plugins.graphite

class platypush.plugins.graphite.GraphitePlugin(host: str = 'localhost', port: int = 2003, timeout: int = 5, **kwargs)[source]

Plugin for sending data to a Graphite instance.

__init__(host: str = 'localhost', port: int = 2003, timeout: int = 5, **kwargs)[source]
Parameters:
  • host – Default Graphite host (default: ‘localhost’).
  • port – Default Graphite port (default: 2003).
  • timeout – Communication timeout in seconds (default: 5).
send(metric: str, value, host: Optional[str] = None, port: Optional[int] = None, timeout: Optional[int] = None, tags: Optional[Dict[str, str]] = None, prefix: str = '', protocol: str = 'tcp')[source]

Send data to a Graphite instance.

Parameters:
  • metric – Metric name.
  • value – Value to be sent.
  • host – Graphite host (default: default configured host).
  • port – Graphite port (default: default configured port).
  • tags – Map of tags for the metric.
  • prefix – Metric prefix name (default: empty string).
  • protocol – Communication protocol - possible values: ‘tcp’, ‘udp’ (default: ‘tcp’).