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, separator string, ...) string
- type GraphiteSerializer
- type GraphiteTemplate
Constants ¶
const DefaultTemplate = "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 DefaultTemplate.
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, separator string, field string, tagSanitizeMode 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 ¶
type GraphiteSerializer struct { Prefix string Template string TagSupport bool TagSanitizeMode string Separator string Templates []*GraphiteTemplate }
func (*GraphiteSerializer) Serialize ¶
func (s *GraphiteSerializer) Serialize(metric telegraf.Metric) ([]byte, error)
func (*GraphiteSerializer) SerializeBatch ¶
func (s *GraphiteSerializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)
type GraphiteTemplate ¶ added in v1.15.0
func InitGraphiteTemplates ¶ added in v1.15.0
func InitGraphiteTemplates(templates []string) ([]*GraphiteTemplate, string, error)