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) Init() error
- func (s *GraphiteSerializer) InitFromConfig(cfg *serializers.Config) error
- 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 `toml:"prefix"` Template string `toml:"template"` StrictRegex string `toml:"graphite_strict_sanitize_regex"` TagSupport bool `toml:"graphite_tag_support"` TagSanitizeMode string `toml:"graphite_tag_sanitize_mode"` Separator string `toml:"graphite_separator"` Templates []string `toml:"templates"` // contains filtered or unexported fields }
func (*GraphiteSerializer) Init ¶ added in v1.27.0
func (s *GraphiteSerializer) Init() error
func (*GraphiteSerializer) InitFromConfig ¶ added in v1.27.0
func (s *GraphiteSerializer) InitFromConfig(cfg *serializers.Config) error
InitFromConfig is a compatibility function to construct the parser the old way
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)