scalable-syslog: code.cloudfoundry.org/scalable-syslog/adapter/app Index | Files

package app

import "code.cloudfoundry.org/scalable-syslog/adapter/app"

Index

Package Files

adapter.go config.go

type Adapter Uses

type Adapter struct {
    // contains filtered or unexported fields
}

Adapter receives bindings from the scheduler, connects to the RLP for log data, and streams it out to a syslog endpoint.

func NewAdapter Uses

func NewAdapter(
    logsEgressAPIAddr string,
    logsEgressAPIAddrWithAZ string,
    logsEgressAPITLSConfig *tls.Config,
    adapterServerTLSConfig *tls.Config,
    metricClient MetricClient,
    logClient LogClient,
    sourceIndex string,
    opts ...AdapterOption,
) *Adapter

NewAdapter returns an Adapter

func (*Adapter) HealthAddr Uses

func (a *Adapter) HealthAddr() string

func (*Adapter) ServerAddr Uses

func (a *Adapter) ServerAddr() string

func (*Adapter) Start Uses

func (a *Adapter) Start() error

Start starts the adapter health endpoint and gRPC service.

func (*Adapter) Stop Uses

func (a *Adapter) Stop()

type AdapterOption Uses

type AdapterOption func(*Adapter)

AdapterOption is a type that will manipulate a config

func WithAdapterServerAddr Uses

func WithAdapterServerAddr(addr string) AdapterOption

WithAdapterServerAddr sets the address for the gRPC server to bind to.

func WithHealthAddr Uses

func WithHealthAddr(addr string) AdapterOption

WithHealthAddr sets the address for the health endpoint to bind to.

func WithLogsEgressAPIConnCount Uses

func WithLogsEgressAPIConnCount(m int) AdapterOption

WithLogsEgressAPIConnCount sets the maximum number of connections to the Loggregator API

func WithLogsEgressAPIConnTTL Uses

func WithLogsEgressAPIConnTTL(d int) AdapterOption

WithLogsEgressAPIConnTTL sets the number of seconds for a connection to the Loggregator API to live

func WithMaxBindings Uses

func WithMaxBindings(i int) AdapterOption

WithMaxBindings sets the maximum bindings allowed per adapter.

func WithMetricsToSyslogEnabled Uses

func WithMetricsToSyslogEnabled(enabled bool) AdapterOption

WithEnableMetricsToSyslog returns a AdapterOption to override the default setting for writing metrics to syslog. By default this feature is disabled.

func WithSyslogDialTimeout Uses

func WithSyslogDialTimeout(d time.Duration) AdapterOption

WithSyslogDialTimeout sets the TCP dial timeout for connecting to a syslog drain

func WithSyslogIOTimeout Uses

func WithSyslogIOTimeout(d time.Duration) AdapterOption

WithSyslogIOTimeout sets the TCP IO timeout for writing to a syslog drain

func WithSyslogKeepalive Uses

func WithSyslogKeepalive(d time.Duration) AdapterOption

WithSyslogKeepalive configures the keepalive interval for HTTPS, TCP, and TLS syslog drains.

func WithSyslogSkipCertVerify Uses

func WithSyslogSkipCertVerify(b bool) AdapterOption

WithSyslogSkipCertVerify sets the TCP InsecureSkipVerify property for syslog

type Config Uses

type Config struct {
    SourceIndex            string        `env:"ADAPTER_INSTANCE_INDEX,  required"`
    CAFile                 string        `env:"CA_FILE_PATH,            required"`
    CertFile               string        `env:"CERT_FILE_PATH,          required"`
    KeyFile                string        `env:"KEY_FILE_PATH,           required"`
    CommonName             string        `env:"TLS_COMMON_NAME,         required"`
    RLPCAFile              string        `env:"LOGS_API_CA_FILE,        required"`
    RLPCertFile            string        `env:"LOGS_API_CERT_FILE_PATH, required"`
    RLPKeyFile             string        `env:"LOGS_API_KEY_FILE_PATH,  required"`
    RLPCommonName          string        `env:"LOGS_API_COMMON_NAME,    required"`
    LogsAPIAddr            string        `env:"LOGS_API_ADDR,           required"`
    LogsAPIAddrWithAZ      string        `env:"LOGS_API_ADDR_WITH_AZ,   required"`
    HealthHostport         string        `env:"HEALTH_HOSTPORT"`
    AdapterHostport        string        `env:"HOSTPORT"`
    PprofHostport          string        `env:"PPROF_HOSTPORT"`
    SyslogKeepalive        time.Duration `env:"SYSLOG_KEEPALIVE"`
    SyslogDialTimeout      time.Duration `env:"SYSLOG_DIAL_TIMEOUT"`
    SyslogIOTimeout        time.Duration `env:"SYSLOG_IO_TIMEOUT"`
    SyslogSkipCertVerify   bool          `env:"SYSLOG_SKIP_CERT_VERIFY"`
    MetricsToSyslogEnabled bool          `env:"METRICS_TO_SYSLOG_ENABLED"`
    MaxBindings            int           `env:"MAX_BINDINGS"`

    MetricIngressAddr     string        `env:"METRIC_INGRESS_ADDR,     required"`
    MetricIngressCN       string        `env:"METRIC_INGRESS_CN,       required"`
    MetricEmitterInterval time.Duration `env:"METRIC_EMITTER_INTERVAL"`
}

Config stores configuration settings for the adapter.

func LoadConfig Uses

func LoadConfig() *Config

LoadConfig will load and validate the config from the current environment. If validation fails LoadConfig will log the error and exit the process with status code 1.

type LogClient Uses

type LogClient interface {
    EmitLog(message string, opts ...loggregator.EmitLogOption)
}

LogClient is used to emit logs.

type MetricClient Uses

type MetricClient interface {
    NewCounterMetric(string, ...pulseemitter.MetricOption) pulseemitter.CounterMetric
    NewGaugeMetric(string, string, ...pulseemitter.MetricOption) pulseemitter.GaugeMetric
}

MetricClient is used to emit metrics.

Package app imports 20 packages (graph) and is imported by 2 packages. Updated 2019-04-16. Refresh now. Tools for package owners.