Documentation ¶
Index ¶
- Constants
- func InsertField(bucket, fieldName string) string
- func SerializeBucketName(measurement string, tags map[string]string, template string, prefix string) string
- type GraphiteSerializer
- func (s *GraphiteSerializer) Serialize(metric telegraf.Metric) ([]byte, error)
- func (s *GraphiteSerializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)
- func (s *GraphiteSerializer) SerializeBucketNameWithTags(measurement string, tags map[string]string, prefix string, separator string, ...) string
- 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.
Types ¶
type GraphiteSerializer ¶
type GraphiteSerializer struct { Prefix string `json:"prefix"` Template string `json:"template"` StrictAllowedChars *regexp.Regexp `json:"graphite_strict_sanitize_regex"` TagSupport bool `json:"graphite_tag_support"` TagSanitizeMode string `json:"graphite_tag_sanitize_mode"` Separator string `json:"graphite_separator"` Templates []*GraphiteTemplate `json:"templates"` }
func (*GraphiteSerializer) Serialize ¶
func (s *GraphiteSerializer) Serialize(metric telegraf.Metric) ([]byte, error)
func (*GraphiteSerializer) SerializeBatch ¶
func (s *GraphiteSerializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)
func (*GraphiteSerializer) SerializeBucketNameWithTags ¶ added in v1.26.1
func (s *GraphiteSerializer) 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
type GraphiteTemplate ¶ added in v1.15.0
func InitGraphiteTemplates ¶ added in v1.15.0
func InitGraphiteTemplates(templates []string) ([]*GraphiteTemplate, string, error)