GraphiteEncoder

aiographite library also provides GraphiteEncoder module, which helps users to send valid metric name to graphite.

Full API Reference

class aiographite.graphite_encoder.GraphiteEncoder[source]

Graphite expects everything to be just ASCII to split/processing them, and then make directories based on metric name. So any special name not allow to appear in directory/file name is not supported by Graphite.

GraphiteEncoder is designed to help users to send valid metric name to graphite.

Metrics: <section_name>.<section_name>.<section_name>.<section_name>

static decode(idna_str)[source]

This method helps to decode a valid metric name in graphite to its original metric name.

args: a valid metric name in graphite.

returns the original metric name.

static encode(section_name)[source]

This method helps to encode any input metric name to a valid graphite metric name.

args: section name(could include any character), a string

returns valid metric name for graphite