Documentation
¶
Index ¶
- type Airbrake
- type Config
- func (c *Config) AirbrakeTLSConfig() (*tls.Config, error)
- func (c *Config) ConfigureProducers(airbrakeHandler *airbrake.Handler, logger *logrus.Logger, test bool) (map[telemetry.Dispatcher]telemetry.Producer, map[string][]telemetry.Producer, ...)
- func (c *Config) CreateAirbrakeNotifier(logger *logrus.Logger) (*githubairbrake.Notifier, *githubairbrake.NotifierOptions, error)
- func (c *Config) CreateKinesisStreamMapping(recordNames []string) map[string]string
- func (c *Config) ExtractServiceTLSConfig(logger *logrus.Logger) (*tls.Config, error)
- func (c *Config) VinsToTrack() map[string]struct{}
- type Kinesis
- type Pubsub
- type RateLimit
- type TLS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Airbrake ¶ added in v0.1.14
type Airbrake struct {
Host string `json:"host"`
ProjectKey string `json:"project_key"`
Environment string `json:"environment"`
ProjectID int64 `json:"project_id"`
TLS *TLS `json:"tls" yaml:"tls"`
}
Airbrake config
type Config ¶
type Config struct {
// Host is the telemetry server hostname
Host string `json:"host,omitempty"`
// Port is the telemetry server port
Port int `json:"port,omitempty"`
// Status Port is used to check whether service is live or not
StatusPort int `json:"status_port,omitempty"`
// TLS contains certificates & CA info for the webserver
TLS *TLS `json:"tls,omitempty"`
// UseDefaultEngCA overrides default CA to eng
UseDefaultEngCA bool `json:"use_default_eng_ca"`
// RateLimit is a configuration for the ratelimit
RateLimit *RateLimit `json:"rate_limit,omitempty"`
// ReliableAckSources is a mapping of record types to a dispatcher that will be used for reliable ack
ReliableAckSources map[string]telemetry.Dispatcher `json:"reliable_ack_sources,omitempty"`
// Kafka is a configuration for the standard librdkafka configuration properties
// seen here: https://raw.githubusercontent.com/confluentinc/librdkafka/master/CONFIGURATION.md
// we extract the "topic" key as the default topic for the producer
Kafka *confluent.ConfigMap `json:"kafka,omitempty"`
// Kinesis is a configuration for AWS Kinesis
Kinesis *Kinesis `json:"kinesis,omitempty"`
// Pubsub is a configuration for the Google Pubsub
Pubsub *Pubsub `json:"pubsub,omitempty"`
// ZMQ configures a zeromq socket
ZMQ *zmq.Config `json:"zmq,omitempty"`
// Namespace defines a prefix for the kafka/pubsub topic
Namespace string `json:"namespace,omitempty"`
// Monitoring defines information for metrics
Monitoring *metrics.MonitoringConfig `json:"monitoring,omitempty"`
// LoggerConfig configures the simple logger
LoggerConfig *simple.Config `json:"logger,omitempty"`
// LogLevel set the log-level
LogLevel string `json:"log_level,omitempty"`
// JSONLogEnable if true log in json format
JSONLogEnable bool `json:"json_log_enable,omitempty"`
// Records is a mapping of topics (records type) to a reference dispatch implementation (i,e: kafka)
Records map[string][]telemetry.Dispatcher `json:"records,omitempty"`
// TransmitDecodedRecords if true decodes proto message before dispatching it to supported datastores
// when vehicle configuration has prefer_typed set to true, enum fields will have a prefix
TransmitDecodedRecords bool `json:"transmit_decoded_records,omitempty"`
VinsSignalTrackingEnabled []string `json:"vins_signal_tracking_enabled"`
// MetricCollector collects metrics for the application
MetricCollector metrics.MetricCollector
// AckChan is a channel used to push acknowledgment from the datastore to connected clients
AckChan chan (*telemetry.Record)
// Airbrake config
Airbrake *Airbrake
// MQTT config
MQTT *mqtt.Config `json:"mqtt,omitempty"`
}
Config object for server
func LoadApplicationConfiguration ¶
LoadApplicationConfiguration loads the configuration from args and config files
func (*Config) AirbrakeTLSConfig ¶ added in v0.3.5
AirbrakeTLSConfig return the TLS config needed for connecting with airbrake server
func (*Config) ConfigureProducers ¶
func (c *Config) ConfigureProducers(airbrakeHandler *airbrake.Handler, logger *logrus.Logger, test bool) (map[telemetry.Dispatcher]telemetry.Producer, map[string][]telemetry.Producer, error)
ConfigureProducers validates and establishes connections to the producers (kafka/pubsub/logger)
func (*Config) CreateAirbrakeNotifier ¶ added in v0.1.14
func (c *Config) CreateAirbrakeNotifier(logger *logrus.Logger) (*githubairbrake.Notifier, *githubairbrake.NotifierOptions, error)
CreateAirbrakeNotifier intializes an airbrake notifier with standard configs
func (*Config) CreateKinesisStreamMapping ¶ added in v0.0.5
CreateKinesisStreamMapping uses the config, overrides with ENV variable names, and finally falls back to namespace based names
func (*Config) ExtractServiceTLSConfig ¶
ExtractServiceTLSConfig return the TLS config needed for stating the mTLS Server
func (*Config) VinsToTrack ¶ added in v0.6.2
VinsToTrack to track incoming signals in promemetheus
type Kinesis ¶
type Kinesis struct {
MaxRetries *int `json:"max_retries,omitempty"`
OverrideHost string `json:"override_host"`
Streams map[string]string `json:"streams,omitempty"`
}
Kinesis is a configuration for aws Kinesis.
type Pubsub ¶
type Pubsub struct {
// GCP Project ID
ProjectID string `json:"gcp_project_id,omitempty"`
Publisher *pubsub.Client
}
Pubsub config for the Google pubsub
type RateLimit ¶
type RateLimit struct {
// MessageRateLimiterEnabled skip messages if it exceeds the limit
Enabled bool `json:"enabled,omitempty"`
// MessageLimit is a rate limiting of the number of messages per client
MessageLimit int `json:"message_limit,omitempty"`
// MessageInterval is the rate limit time interval
MessageInterval int `json:"message_interval_time,omitempty"`
// MessageIntervalTimeSecond is the rate limit time interval as a duration in second
MessageIntervalTimeSecond time.Duration
}
RateLimit config for the service to handle ratelimiting incoming requests