stan_output

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StanNumberOfFailSendMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "stan_output",
	Name:      "number_of_stan_msgs_sent_fail_total",
	Help:      "Number of failed msgs sent by gnmic stan output",
}, []string{"publisher_id", "reason"})
View Source
var StanNumberOfSentBytes = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "stan_output",
	Name:      "number_of_written_stan_bytes_total",
	Help:      "Number of bytes written by gnmic stan output",
}, []string{"publisher_id", "subject"})
View Source
var StanNumberOfSentMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "stan_output",
	Name:      "number_of_stan_msgs_sent_success_total",
	Help:      "Number of msgs successfully sent by gnmic stan output",
}, []string{"publisher_id", "subject"})
View Source
var StanSendDuration = prometheus.NewGaugeVec(prometheus.GaugeOpts{
	Namespace: "gnmic",
	Subsystem: "stan_output",
	Name:      "msg_send_duration_ns",
	Help:      "gnmic stan 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"`
	ClusterName        string        `mapstructure:"cluster-name,omitempty"`
	PingInterval       int           `mapstructure:"ping-interval,omitempty"`
	PingRetry          int           `mapstructure:"ping-retry,omitempty"`
	Format             string        `mapstructure:"format,omitempty"`
	AddTarget          string        `mapstructure:"add-target,omitempty"`
	TargetTemplate     string        `mapstructure:"target-template,omitempty"`
	OverrideTimestamps bool          `mapstructure:"override-timestamps,omitempty"`
	RecoveryWaitTime   time.Duration `mapstructure:"recovery-wait-time,omitempty"`
	NumWorkers         int           `mapstructure:"num-workers,omitempty"`
	Debug              bool          `mapstructure:"debug,omitempty"`
	WriteTimeout       time.Duration `mapstructure:"write-timeout,omitempty"`
	EnableMetrics      bool          `mapstructure:"enable-metrics,omitempty"`
	EventProcessors    []string      `mapstructure:"event-processors,omitempty"`
}

Config //

type StanOutput

type StanOutput struct {
	Cfg *Config
	// contains filtered or unexported fields
}

StanOutput //

func (*StanOutput) Close

func (s *StanOutput) Close() error

Close //

func (*StanOutput) Init

func (s *StanOutput) Init(ctx context.Context, name string, cfg map[string]interface{}, opts ...outputs.Option) error

Init //

func (*StanOutput) RegisterMetrics

func (s *StanOutput) RegisterMetrics(reg *prometheus.Registry)

Metrics //

func (*StanOutput) SetClusterName

func (s *StanOutput) SetClusterName(name string)

func (*StanOutput) SetEventProcessors

func (s *StanOutput) SetEventProcessors(ps map[string]map[string]interface{},
	logger *log.Logger,
	tcs map[string]*types.TargetConfig,
	acts map[string]map[string]interface{})

func (*StanOutput) SetLogger

func (s *StanOutput) SetLogger(logger *log.Logger)

func (*StanOutput) SetName

func (s *StanOutput) SetName(name string)

func (*StanOutput) SetTargetsConfig

func (s *StanOutput) SetTargetsConfig(map[string]*types.TargetConfig)

func (*StanOutput) String

func (s *StanOutput) String() string

func (*StanOutput) Write

func (s *StanOutput) Write(ctx context.Context, rsp protoreflect.ProtoMessage, meta outputs.Meta)

Write //

func (*StanOutput) WriteEvent

func (s *StanOutput) 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