metrics

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Combined = "access_log_combined"
	JSON     = "access_log_as_json"
)

Variables

View Source
var ApacheCombinedLogRegex = regexp.MustCompile(`^(?P<client_host>\S+)\s-\s+(?P<client_username>\S+\s+)+\[(?P<timestamp>[^]]+)\]\s"(?P<request_method>\S*)\s?(?P<request_path>(?:[^"]*(?:\\")?)*)\s(?P<request_protocol>[^"]*)"\s(?P<origin_status>\d+)\s(?P<origin_content_size>\d+)\s"(?P<request__referer>(?:[^"]*(?:\\")?)*)"\s"(?P<request__useragent>.*)"\s(?P<request_count>\d+)\s"(?P<frontend_name>[^"]*)"\s"(?P<backend_url>[^"]*)"\s(?P<duration>\d+)ms$`)

Functions

This section is empty.

Types

type ProcessRule

type ProcessRule struct {
	Id             string
	PathRegexp     *regexp.Regexp
	MethodRegexp   *regexp.Regexp
	FrontEndRegexp *regexp.Regexp
	Filter         RuleFilter
}

type RuleFilter

type RuleFilter func(model.LogEntry) bool

type TraefikMetricProcessor

type TraefikMetricProcessor struct {
	Rules []ProcessRule
	// contains filtered or unexported fields
}

func NewTraefikMetricProcessor

func NewTraefikMetricProcessor(config []common.RulesConfig, fields []string) (*TraefikMetricProcessor, error)

func (TraefikMetricProcessor) Process

func (mp TraefikMetricProcessor) Process(entry model.LogEntry, logFormat string, timestamp int64, measurement string) (client.BatchPoints, error)

Jump to

Keyboard shortcuts

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