collector

package
v1.0.0-alpha-100 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Debug mode
	Debug bool

	// Backend for the collector
	Backend string

	// Index for the collection
	Index = "we-cli"

	// Type for the collection
	Type = "metrics"

	// BulkSize tells how many objects the bulk collects
	BulkSize = 50

	// BackendTimeout for backend requests
	BackendTimeout = 5 * time.Second
)

Functions

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler for the collector requests

Types

type BulkCollector

type BulkCollector struct {
	RequestID     string
	IP            string
	XForwardedFor string
	Feedback      BulkCollectorFeedback
	// contains filtered or unexported fields
}

BulkCollector is used for collecting the lines and posting to the backend

func (*BulkCollector) GetFeedback

func (b *BulkCollector) GetFeedback() string

GetFeedback for a bulk collection

func (*BulkCollector) Run

func (b *BulkCollector) Run() (err error)

Run bulk collector

type BulkCollectorFeedback

type BulkCollectorFeedback struct {
	Errors           bool        `json:"errors"`
	Objects          int         `json:"objects"`
	JSONFailureLines []int       `json:"json_failure_lines"`
	Insertions       []Insertion `json:"insertions"`
}

BulkCollectorFeedback is used for printing the statistics of the request

type Event

type Event struct {
	ID            string            `json:"id"`
	Type          string            `json:"event_type,omitempty"`
	Text          string            `json:"text,omitempty"`
	PID           string            `json:"pid,omitempty"`
	SID           string            `json:"sid,omitempty"`
	Time          string            `json:"time,omitempty"`
	Tags          []string          `json:"tags,omitempty"`
	Extra         map[string]string `json:"extra,omitempty"`
	Scope         string            `json:"scope,omitempty"`
	Version       string            `json:"version,omitempty"`
	OS            string            `json:"os,omitempty"`
	Arch          string            `json:"arch,omitempty"`
	RequestID     string            `json:"request_id,omitempty"`
	IP            string            `json:"ip,omitempty"`
	XForwardedFor string            `json:"x_forwarded_for,omitempty"`
	Raw           string            `json:"raw"`
}

Event entry for collector see also metrics.Event

type Insertion

type Insertion struct {
	ID     string `json:"id"`
	Error  bool   `json:"error"`
	Line   int    `json:"line"`
	Status int    `json:"status"`
}

Insertion for insertion response

Jump to

Keyboard shortcuts

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