config

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Firehose config
	APIEndpoint      string `envconfig:"firehose_endpoint" required:"true"`
	SubscriptionID   string `envconfig:"firehose_subscription_id" required:"false"`
	LoggingEvents    string `envconfig:"firehose_events_to_stackdriver_logging" required:"true"`
	MonitoringEvents string `envconfig:"firehose_events_to_stackdriver_monitoring" required:"false"`
	Username         string `envconfig:"firehose_username" default:"admin"`
	Password         string `envconfig:"firehose_password" default:"admin"`
	SkipSSL          bool   `envconfig:"firehose_skip_ssl" default:"false"`
	NewlineToken     string `envconfig:"firehose_newline_token"`

	// Reverse Log Proxy (Firehose alternative) config
	//TODO(evanbrown): Determine which flags should be required
	RLPAddress           string `envconfig:"rlp_address_colon_port" required:"false"`
	RLPCACertFile        string `envconfig:"rlp_ca_cert_file" required:"false"`
	RLPCertFile          string `envconfig:"rlp_cert_file" required:"false"`
	RLPKeyFile           string `envconfig:"rlp_key_file" required:"false"`
	RLPShardID           string `envconfig:"rlp_shard_id" default:"stackdriver-nozzle"`
	RLPDeterministicName string `envconfig:"rlp_deterministic_name"`

	// Stackdriver config
	ProjectID            string `envconfig:"gcp_project_id"`
	LoggingBatchCount    int    `envconfig:"logging_batch_count" default:"1000"`
	LoggingBatchDuration int    `envconfig:"logging_batch_duration" default:"30"`
	LoggingReqsInFlight  int    `envconfig:"logging_requests_in_flight" default:"16"`

	// Nozzle config
	HeartbeatRate         int    `envconfig:"heartbeat_rate" default:"30"`
	MetricsBufferDuration int    `envconfig:"metrics_buffer_duration" default:"30"`
	MetricsBatchSize      int    `envconfig:"metrics_batch_size" default:"200"`
	MetricPathPrefix      string `envconfig:"metric_path_prefix" default:"firehose"`
	FoundationName        string `envconfig:"foundation_name" default:"cf"`
	ResolveAppMetadata    bool   `envconfig:"resolve_app_metadata"`
	NozzleID              string `envconfig:"nozzle_id" default:"local-nozzle"`
	NozzleName            string `envconfig:"nozzle_name" default:"local-nozzle"`
	NozzleZone            string `envconfig:"nozzle_zone" default:"local-nozzle"`
	DebugNozzle           bool   `envconfig:"debug_nozzle"`
	// By default 'origin' label is prepended to metric name, however for runtime metrics (defined here) we add it as a metric label instead.
	RuntimeMetricRegex string `envconfig:"runtime_metric_regex" default:"^(numCPUS|numGoRoutines|memoryStats\\..*)$"`
	// If enabled, CounterEvents will be reported as cumulative Stackdriver metrics instead of two gauges (<metric>.delta
	// and <metric>.total). Reporting cumulative metrics involves nozzle keeping track of internal counter state, and
	// requires deterministic routing of CounterEvents to nozzles (i.e. CounterEvent messages for a particular metric MUST
	// always be routed to the same nozzle process); the easiest way to achieve that is to run a single copy of the nozzle.
	EnableCumulativeCounters bool `envconfig:"enable_cumulative_counters"`
	// If enabled, the Nozzle will derive per-application HTTP metrics from
	// HttpStartStop events and export them as counters to Stackdriver.
	EnableAppHTTPMetrics bool `envconfig:"enable_app_http_metrics"`
	// Expire internal counter state if a given counter has not been seen for this many seconds.
	CounterTrackerTTL int `envconfig:"counter_tracker_ttl" default:"130"`

	// Event blacklists / whitelists are too complex to stuff into environment
	// vars, so instead they are templated from the manifest YAML into a JSON
	// file which is loaded by the nozzle. Nil pointers are empty blacklists.
	EventFilterFile string `envconfig:"event_filter_file" default:""`
	EventFilterJSON *EventFilterJSON
}

func NewConfig

func NewConfig() (*Config, error)

func (*Config) ToData

func (c *Config) ToData() lager.Data

type EventFilterJSON

type EventFilterJSON struct {
	Blacklist []EventFilterRule `json:"blacklist,omitempty"`
	Whitelist []EventFilterRule `json:"whitelist,omitempty"`
}

type EventFilterRule

type EventFilterRule struct {
	// Must be one of the types from nozzle/event_filter.go.
	Type string `json:"type"`
	// Must be either "monitoring", "logging", or "all".
	Sink string `json:"sink"`
	// Must be a valid regular expression.
	Regexp string `json:"regexp"`
}

An EventFilterRule specifies a filtering rule for firehose event.

func (EventFilterRule) String

func (r EventFilterRule) String() string

Jump to

Keyboard shortcuts

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