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"`
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"`
SubscriptionID string `envconfig:"firehose_subscription_id" required:"true"`
NewlineToken string `envconfig:"firehose_newline_token"`
// 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
}
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
Click to show internal directories.
Click to hide internal directories.