Documentation ¶
Index ¶
- Constants
- func InsertField(bucket, fieldName string) string
- func SerializeBucketName(measurement string, tags map[string]string, template string, prefix string) string
- func SerializeBucketNameWithTags(measurement string, tags map[string]string, prefix string, field string) string
- type GraphiteSerializer
Constants ¶
const DEFAULT_TEMPLATE = "host.tags.measurement.field"
Variables ¶
This section is empty.
Functions ¶
func InsertField ¶
InsertField takes the bucket string from SerializeBucketName and replaces the FIELDNAME portion. If fieldName == "value", it will simply delete the FIELDNAME portion.
func SerializeBucketName ¶
func SerializeBucketName( measurement string, tags map[string]string, template string, prefix string, ) string
SerializeBucketName will take the given measurement name and tags and produce a graphite bucket. It will use the GraphiteSerializer.Template to generate this, or DEFAULT_TEMPLATE.
NOTE: SerializeBucketName replaces the "field" portion of the template with FIELDNAME. It is up to the user to replace this. This is so that SerializeBucketName can be called just once per measurement, rather than once per field. See GraphiteSerializer.InsertField() function.
func SerializeBucketNameWithTags ¶
func SerializeBucketNameWithTags( measurement string, tags map[string]string, prefix string, field string, ) string
SerializeBucketNameWithTags will take the given measurement name and tags and produce a graphite bucket. It will use the Graphite11Serializer. http://graphite.readthedocs.io/en/latest/tags.html
Types ¶
type GraphiteSerializer ¶
func (*GraphiteSerializer) Serialize ¶
func (s *GraphiteSerializer) Serialize(metric telegraf.Metric) ([]byte, error)
func (*GraphiteSerializer) SerializeBatch ¶
func (s *GraphiteSerializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)