Documentation ¶
Overview ¶
Package collectdreceiver implements a receiver that can be used by the Opentelemetry collector to receive traces from CollectD http_write plugin in JSON format.
Index ¶
- func LabelsFromName(val *string) (metricName string, labels map[string]string)
- func New(logger *zap.Logger, addr string, timeout time.Duration, ...) (component.MetricsReceiver, error)
- type Config
- type Factory
- func (f *Factory) CreateDefaultConfig() configmodels.Receiver
- func (f *Factory) CreateMetricsReceiver(ctx context.Context, logger *zap.Logger, cfg configmodels.Receiver, ...) (component.MetricsReceiver, error)
- func (f *Factory) CreateTraceReceiver(ctx context.Context, logger *zap.Logger, cfg configmodels.Receiver, ...) (component.TraceReceiver, error)
- func (f *Factory) CustomUnmarshaler() component.CustomUnmarshaler
- func (f *Factory) Type() configmodels.Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LabelsFromName ¶
LabelsFromName tries to pull out dimensions out of name in the format "name[k=v,f=x]-more_name". For the example above it would return "name-more_name" and extract dimensions (k,v) and (f,x). If something unexpected is encountered it returns the original metric name.
The code tries to avoid allocation by using local slices and avoiding calls to functions like strings.Slice.
Types ¶
type Config ¶
type Config struct { configmodels.ReceiverSettings `mapstructure:",squash"` confignet.TCPAddr `mapstructure:",squash"` Timeout time.Duration `mapstructure:"timeout"` AttributesPrefix string `mapstructure:"attributes_prefix"` Encoding string `mapstructure:"encoding"` }
Config defines configuration for Collectd receiver.
type Factory ¶
type Factory struct { }
Factory is the factory for collectd receiver.
func (*Factory) CreateDefaultConfig ¶
func (f *Factory) CreateDefaultConfig() configmodels.Receiver
CreateDefaultConfig creates the default configuration for CollectD receiver.
func (*Factory) CreateMetricsReceiver ¶
func (f *Factory) CreateMetricsReceiver( ctx context.Context, logger *zap.Logger, cfg configmodels.Receiver, nextConsumer consumer.MetricsConsumerOld, ) (component.MetricsReceiver, error)
CreateMetricsReceiver creates a metrics receiver based on provided config.
func (*Factory) CreateTraceReceiver ¶
func (f *Factory) CreateTraceReceiver( ctx context.Context, logger *zap.Logger, cfg configmodels.Receiver, nextConsumer consumer.TraceConsumerOld, ) (component.TraceReceiver, error)
CreateTraceReceiver creates a trace receiver based on provided config.
func (*Factory) CustomUnmarshaler ¶
func (f *Factory) CustomUnmarshaler() component.CustomUnmarshaler
CustomUnmarshaler returns nil because we don't need custom unmarshaling for this config.
func (*Factory) Type ¶
func (f *Factory) Type() configmodels.Type
Type gets the type of the Receiver config created by this factory.