Documentation ¶
Index ¶
- Variables
- type Config
- type NatsOutput
- func (n *NatsOutput) Close() error
- func (n *NatsOutput) Dial(network, address string) (net.Conn, error)
- func (n *NatsOutput) Init(ctx context.Context, name string, cfg map[string]interface{}, ...) error
- func (n *NatsOutput) RegisterMetrics(reg *prometheus.Registry)
- func (n *NatsOutput) SetClusterName(name string)
- func (n *NatsOutput) SetEventProcessors(ps map[string]map[string]interface{}, logger *log.Logger, ...) error
- func (n *NatsOutput) SetLogger(logger *log.Logger)
- func (n *NatsOutput) SetName(name string)
- func (n *NatsOutput) SetTargetsConfig(map[string]*types.TargetConfig)
- func (n *NatsOutput) String() string
- func (n *NatsOutput) Write(ctx context.Context, rsp proto.Message, meta outputs.Meta)
- func (n *NatsOutput) WriteEvent(ctx context.Context, ev *formatters.EventMsg)
Constants ¶
This section is empty.
Variables ¶
View Source
var NatsNumberOfFailSendMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "gnmic", Subsystem: "nats_output", Name: "number_of_nats_msgs_sent_fail_total", Help: "Number of failed msgs sent by gnmic nats output", }, []string{"publisher_id", "reason"})
View Source
var NatsNumberOfSentBytes = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "gnmic", Subsystem: "nats_output", Name: "number_of_written_nats_bytes_total", Help: "Number of bytes written by gnmic nats output", }, []string{"publisher_id", "subject"})
View Source
var NatsNumberOfSentMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: "gnmic", Subsystem: "nats_output", Name: "number_of_nats_msgs_sent_success_total", Help: "Number of msgs successfully sent by gnmic nats output", }, []string{"publisher_id", "subject"})
View Source
var NatsSendDuration = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "gnmic", Subsystem: "nats_output", Name: "msg_send_duration_ns", Help: "gnmic nats output send duration in ns", }, []string{"publisher_id"})
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `mapstructure:"name,omitempty"` Address string `mapstructure:"address,omitempty"` SubjectPrefix string `mapstructure:"subject-prefix,omitempty"` Subject string `mapstructure:"subject,omitempty"` Username string `mapstructure:"username,omitempty"` Password string `mapstructure:"password,omitempty"` ConnectTimeWait time.Duration `mapstructure:"connect-time-wait,omitempty"` TLS *types.TLSConfig `mapstructure:"tls,omitempty" json:"tls,omitempty"` Format string `mapstructure:"format,omitempty"` SplitEvents bool `mapstructure:"split-events,omitempty"` AddTarget string `mapstructure:"add-target,omitempty"` TargetTemplate string `mapstructure:"target-template,omitempty"` MsgTemplate string `mapstructure:"msg-template,omitempty"` OverrideTimestamps bool `mapstructure:"override-timestamps,omitempty"` NumWorkers int `mapstructure:"num-workers,omitempty"` WriteTimeout time.Duration `mapstructure:"write-timeout,omitempty"` Debug bool `mapstructure:"debug,omitempty"` EnableMetrics bool `mapstructure:"enable-metrics,omitempty"` EventProcessors []string `mapstructure:"event-processors,omitempty"` }
Config //
type NatsOutput ¶
type NatsOutput struct { Cfg *Config // contains filtered or unexported fields }
NatsOutput //
func (*NatsOutput) Dial ¶
func (n *NatsOutput) Dial(network, address string) (net.Conn, error)
Dial //
func (*NatsOutput) Init ¶
func (n *NatsOutput) Init(ctx context.Context, name string, cfg map[string]interface{}, opts ...outputs.Option) error
Init //
func (*NatsOutput) RegisterMetrics ¶
func (n *NatsOutput) RegisterMetrics(reg *prometheus.Registry)
Metrics //
func (*NatsOutput) SetClusterName ¶
func (n *NatsOutput) SetClusterName(name string)
func (*NatsOutput) SetEventProcessors ¶
func (*NatsOutput) SetLogger ¶
func (n *NatsOutput) SetLogger(logger *log.Logger)
func (*NatsOutput) SetName ¶
func (n *NatsOutput) SetName(name string)
func (*NatsOutput) SetTargetsConfig ¶
func (n *NatsOutput) SetTargetsConfig(map[string]*types.TargetConfig)
func (*NatsOutput) String ¶
func (n *NatsOutput) String() string
func (*NatsOutput) WriteEvent ¶
func (n *NatsOutput) WriteEvent(ctx context.Context, ev *formatters.EventMsg)
Click to show internal directories.
Click to hide internal directories.