Documentation
¶
Overview ¶
package metricsgenerationprocessor implements a processor which calculates a new metric from existing metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory() component.ProcessorFactory
NewFactory returns a new factory for the Metrics Generation processor.
Types ¶
type Config ¶
type Config struct {
config.ProcessorSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
// Set of rules for generating new metrics
Rules []Rule `mapstructure:"rules"`
}
Config defines the configuration for the processor.
type GenerationType ¶
type GenerationType string
type OperationType ¶
type OperationType string
type Rule ¶
type Rule struct {
// Name of the new metric being generated. This is a required field.
Name string `mapstructure:"name"`
// Unit for the new metric being generated.
Unit string `mapstructure:"unit"`
// The rule type following which the new metric will be generated. This is a required field.
Type GenerationType `mapstructure:"type"`
// First operand metric to use in the calculation. This is a required field.
Metric1 string `mapstructure:"metric1"`
// Second operand metric to use in the calculation. A required field if the type is calculate.
Metric2 string `mapstructure:"metric2"`
// The arithmetic operation to apply for the calculation. This is a required field.
Operation OperationType `mapstructure:"operation"`
// A constant number by which the first operand will be scaled. A required field if the type is scale.
ScaleBy float64 `mapstructure:"scale_by"`
}
Click to show internal directories.
Click to hide internal directories.