Documentation ¶
Index ¶
- func Create(server *veneur.Server, name string, logger *logrus.Entry, config veneur.Config, ...) (sinks.SpanSink, error)
- func MigrateConfig(conf *veneur.Config) error
- func ParseConfig(name string, config interface{}) (veneur.SpanSinkConfig, error)
- func String(str string) *string
- type Event
- type Response
- type SerializedSSF
- type SplunkSinkConfig
- type TestableSplunkSpanSink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶ added in v14.2.0
func Create( server *veneur.Server, name string, logger *logrus.Entry, config veneur.Config, sinkConfig veneur.SpanSinkConfig, ) (sinks.SpanSink, error)
Create constructs a new splunk span sink from the server name and token provided, using the local hostname configured for veneur. An optional argument, validateServerName is used (if non-empty) to instruct go to validate a different hostname than the one on the server URL. The spanSampleRate is an integer. For any given trace ID, the probability that all spans in the trace will be chosen for the sample is 1/spanSampleRate. Sampling is performed on the trace ID, so either all spans within a given trace will be chosen, or none will.
func MigrateConfig ¶ added in v14.2.0
func MigrateConfig(conf *veneur.Config) error
func ParseConfig ¶ added in v14.2.0
ParseConfig decodes the map config for a Splunk sink into a SplunkSinkConfig struct.
Types ¶
type Event ¶
type Event struct { Host *string `json:"host,omitempty"` Index *string `json:"index,omitempty"` Source *string `json:"source,omitempty"` SourceType *string `json:"sourcetype,omitempty"` Time *string `json:"time,omitempty"` Event interface{} `json:"event"` }
func (*Event) SetSourceType ¶
type Response ¶
type Response struct { Text string `json:"text,omitempty"` Code int `json:"code"` InvalidEventNumber *int `json:"invalid-event-number,omitempty"` }
Response represents the JSON-parseable response from a splunk HEC server.
type SerializedSSF ¶
type SerializedSSF struct { TraceId string `json:"trace_id"` Id string `json:"id"` ParentId string `json:"parent_id"` StartTimestamp float64 `json:"start_timestamp"` EndTimestamp float64 `json:"end_timestamp"` Duration int64 `json:"duration_ns"` Error bool `json:"error"` Service string `json:"service"` Tags map[string]string `json:"tags"` Indicator bool `json:"indicator"` Name string `json:"name"` Partial *bool `json:"partial,omitempty"` }
SerializedSSF holds a set of fields in a format that Splunk can handle (it can't handle int64s, and we don't want to round our traceID to the thousands place). This is mildly redundant, but oh well.
type SplunkSinkConfig ¶ added in v14.2.0
type SplunkSinkConfig struct { HecAddress string `yaml:"hec_address"` HecBatchSize int `yaml:"hec_batch_size"` HecConnectionLifetimeJitter time.Duration `yaml:"hec_connection_lifetime_jitter"` HecIngestTimeout time.Duration `yaml:"hec_ingest_timeout"` HecMaxConnectionLifetime time.Duration `yaml:"hec_max_connection_lifetime"` HecSendTimeout time.Duration `yaml:"hec_max_connection_lifetime"` HecSubmissionWorkers int `yaml:"hec_submission_workers"` HecTLSValidateHostname string `yaml:"hec_tls_validate_hostname"` HecToken string `yaml:"hec_token"` SpanSampleRate int `yaml:"span_sample_rate"` }
type TestableSplunkSpanSink ¶
type TestableSplunkSpanSink interface { sinks.SpanSink // Stop shuts down the sink's submission workers by finishing // each worker's last submission HTTP request. Stop() // Sync instructs all submission workers to finish submitting // their current request and start a new one. It returns when // the last worker's submission is done. Sync() }
TestableSplunkSpanSink provides methods that are useful for testing a splunk span sink.