nats_output

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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"`
	Format          string        `mapstructure:"format,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) Close

func (n *NatsOutput) Close() error

Close //

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 added in v0.7.0

func (n *NatsOutput) RegisterMetrics(reg *prometheus.Registry)

Metrics //

func (*NatsOutput) SetClusterName added in v0.8.0

func (n *NatsOutput) SetClusterName(name string)

func (*NatsOutput) SetEventProcessors added in v0.6.0

func (n *NatsOutput) SetEventProcessors(ps map[string]map[string]interface{}, logger *log.Logger)

func (*NatsOutput) SetLogger added in v0.5.2

func (n *NatsOutput) SetLogger(logger *log.Logger)

func (*NatsOutput) SetName added in v0.7.0

func (n *NatsOutput) SetName(name string)

func (*NatsOutput) String

func (n *NatsOutput) String() string

func (*NatsOutput) Write

func (n *NatsOutput) Write(ctx context.Context, rsp proto.Message, meta outputs.Meta)

Write //

func (*NatsOutput) WriteEvent added in v0.7.0

func (n *NatsOutput) WriteEvent(ctx context.Context, ev *formatters.EventMsg)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL