Documentation ¶
Index ¶
- func TelegrafToSFXMetricType(m telegraf.Metric) (datapoint.MetricType, string)
- type BaseEmitter
- func (b *BaseEmitter) AddDebug(deb string, args ...interface{})
- func (b *BaseEmitter) AddError(err error)
- func (b *BaseEmitter) AddMeasurementTransformation(f func(telegraf.Metric) error)
- func (b *BaseEmitter) AddMeasurementTransformations(fns []func(telegraf.Metric) error)
- func (b *BaseEmitter) AddMetric(m telegraf.Metric)
- func (b *BaseEmitter) AddMetricNameTransformation(f func(string) string)
- func (b *BaseEmitter) AddMetricNameTransformations(fns []func(string) string)
- func (b *BaseEmitter) AddTag(key string, val string)
- func (b *BaseEmitter) AddTags(tags map[string]string)
- func (b *BaseEmitter) ExcludeData(names []string)
- func (b *BaseEmitter) ExcludeDatum(name string)
- func (b *BaseEmitter) FilterTags(key string, value string) bool
- func (b *BaseEmitter) GetMetricName(metricName string, field string) string
- func (b *BaseEmitter) IncludeEvent(name string)
- func (b *BaseEmitter) IncludeEvents(names []string)
- func (b *BaseEmitter) Included(name string) bool
- func (b *BaseEmitter) IsExcluded(name string) bool
- func (b *BaseEmitter) OmitTag(tag string)
- func (b *BaseEmitter) OmitTags(tags []string)
- func (b *BaseEmitter) RenameMetric(original string, override string)
- func (b *BaseEmitter) RenameMetrics(mappings map[string]string)
- func (b *BaseEmitter) SetOmitOrignalMetricType(in bool)
- func (b *BaseEmitter) TransformMeasurement(m telegraf.Metric)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TelegrafToSFXMetricType ¶
func TelegrafToSFXMetricType(m telegraf.Metric) (datapoint.MetricType, string)
TelegrafToSFXMetricType returns the signalfx metric type for a telegraf metric
Types ¶
type BaseEmitter ¶
type BaseEmitter struct { Output types.Output Logger log.FieldLogger // contains filtered or unexported fields }
BaseEmitter immediately converts a telegraf measurement into datapoints and sends them through Output
func NewEmitter ¶
func NewEmitter(Output types.Output, Logger log.FieldLogger) *BaseEmitter
NewEmitter returns a new BaseEmitter
func (*BaseEmitter) AddDebug ¶
func (b *BaseEmitter) AddDebug(deb string, args ...interface{})
AddDebug logs a debug statement
func (*BaseEmitter) AddError ¶
func (b *BaseEmitter) AddError(err error)
AddError handles errors reported to a telegraf accumulator
func (*BaseEmitter) AddMeasurementTransformation ¶
func (b *BaseEmitter) AddMeasurementTransformation(f func(telegraf.Metric) error)
AddMeasurementTransformation adds a function to the list of functions the emitter will pass an incoming measurement through. This is useful for manipulating tags and fields before the measurement is converted to a SignalFx datapoint.
func (*BaseEmitter) AddMeasurementTransformations ¶
func (b *BaseEmitter) AddMeasurementTransformations(fns []func(telegraf.Metric) error)
AddMeasurementTransformations a list of functions to the list of functions the emitter will pass an incoming measurement through. This is useful for manipulating tags and fields before the measurement is converted to a SignalFx datapoint.
func (*BaseEmitter) AddMetric ¶
func (b *BaseEmitter) AddMetric(m telegraf.Metric)
AddMetric parses metrics from telegraf and emits them through Output
func (*BaseEmitter) AddMetricNameTransformation ¶
func (b *BaseEmitter) AddMetricNameTransformation(f func(string) string)
AddMetricNameTransformation adds a function for mutating metric names. GetMetricNames() will invoke each of the transformation functions after the metric name is parsed from the incoming measurement.
func (*BaseEmitter) AddMetricNameTransformations ¶
func (b *BaseEmitter) AddMetricNameTransformations(fns []func(string) string)
AddMetricNameTransformations adds a list of functions for mutating metric names. GetMetricNames() will invoke each of the transformation functions after the metric name is parsed from the incoming measurement.
func (*BaseEmitter) AddTag ¶
func (b *BaseEmitter) AddTag(key string, val string)
AddTag adds a key/value pair to all measurement tags. If a key conflicts the key value pair in AddTag will override the original key on the measurement
func (*BaseEmitter) AddTags ¶
func (b *BaseEmitter) AddTags(tags map[string]string)
AddTags adds a map of key value pairs to all measurement tags. If a key conflicts the key value pair in AddTags will override the original key on the measurement.
func (*BaseEmitter) ExcludeData ¶
func (b *BaseEmitter) ExcludeData(names []string)
ExcludeData adds a list of names the list of metrics and events to exclude
func (*BaseEmitter) ExcludeDatum ¶
func (b *BaseEmitter) ExcludeDatum(name string)
ExcludeDatum adds a name to the list of metrics and events to exclude
func (*BaseEmitter) FilterTags ¶
func (b *BaseEmitter) FilterTags(key string, value string) bool
FilterTags - filter function for util.CloneAndFilterStringMapWithFunc() it returns true if the supplied key is not in the omittedTags map
func (*BaseEmitter) GetMetricName ¶
func (b *BaseEmitter) GetMetricName(metricName string, field string) string
GetMetricName parses the metric name and takes name overrides into account if a name is overridden it will not have transformations applied to it
func (*BaseEmitter) IncludeEvent ¶
func (b *BaseEmitter) IncludeEvent(name string)
IncludeEvent registers an event name to include during emission. We disable all events by default because Telegraf has some junk events.
func (*BaseEmitter) IncludeEvents ¶
func (b *BaseEmitter) IncludeEvents(names []string)
IncludeEvents registers a list of event names to include during emission. We disable all events by default because Telegraf has some junk events.
func (*BaseEmitter) Included ¶
func (b *BaseEmitter) Included(name string) bool
Included - checks if events should be included during emission. We disable all events by default because Telegraf has some junk events.
func (*BaseEmitter) IsExcluded ¶
func (b *BaseEmitter) IsExcluded(name string) bool
IsExcluded - checks if events or metrics should be excluded from emission
func (*BaseEmitter) OmitTag ¶
func (b *BaseEmitter) OmitTag(tag string)
OmitTag adds a tag to the list of tags to remove from measurements
func (*BaseEmitter) OmitTags ¶
func (b *BaseEmitter) OmitTags(tags []string)
OmitTags adds a list of tags the list of tags to remove from measurements
func (*BaseEmitter) RenameMetric ¶
func (b *BaseEmitter) RenameMetric(original string, override string)
RenameMetric adds a mapping to rename a metric by it's name
func (*BaseEmitter) RenameMetrics ¶
func (b *BaseEmitter) RenameMetrics(mappings map[string]string)
RenameMetrics takes a map of metric name overrides map[original]override
func (*BaseEmitter) SetOmitOrignalMetricType ¶
func (b *BaseEmitter) SetOmitOrignalMetricType(in bool)
SetOmitOrignalMetricType accepts a boolean to indicate whether the emitter should add the original metric type or not to each metric
func (*BaseEmitter) TransformMeasurement ¶
func (b *BaseEmitter) TransformMeasurement(m telegraf.Metric)
TransformMeasurement applies all measurementTransformations to the supplied measurement