Documentation ¶
Index ¶
- Constants
- Variables
- func CreateParserContainerDFormat(config configuration.ParserConfig) func(line []byte) (common.EntryMap, error)
- func CreateParserDockerFormat(config configuration.ParserConfig) func(line []byte) (common.EntryMap, error)
- func CreateParserPlain(config configuration.ParserConfig) func(line []byte) common.EntryMap
- type MetricsCollector
- type SLI
- type SLIMessage
- type SLIStub
- type ServiceProvider
Constants ¶
View Source
const ( LogKeyUpstreamResponseTime = "upstream_response_time" LogKeyUpstreamResponseTimeReplacement = "upstream_response_time_float" LogKeyUpstreamResponseTimeTotal = "upstream_response_time_total" LogKeyHost = "host" LogKeyRequestMethod = "request_method" LogKeyRequestURI = "request_uri" LogKeyRequestTime = "request_time" LogKeyStatus = "status" LogKeyUpstreamPodName = "upstream_pod_name" )
Nginx related particular log keys
View Source
const ( LogKeySLA = "sla" LogKeyLogging = "logging" )
Processing control related fields
View Source
const ( LogKeyTime = "time" LogKeyStream = "stream" )
ContainerD related constants
View Source
const LogKeyLog = "log"
LogKeyLog field that contains actual user log in log line.
Variables ¶
View Source
var ( ErrLogFieldMissing = errors.New("line does not contain user log field") ErrLogFieldNotString = errors.New("user log field does not contain string") )
View Source
var ErrConstructSLI = errors.New(
"Empty or incorrect field 'request' in message, " +
"field 'request' should contain method and path",
)
ErrConstructSLI signals about failed SLA Message construction
Functions ¶
func CreateParserContainerDFormat ¶
func CreateParserContainerDFormat(config configuration.ParserConfig) func(line []byte) (common.EntryMap, error)
CreateParserContainerDFormat returns containerd parser
func CreateParserDockerFormat ¶
func CreateParserDockerFormat(config configuration.ParserConfig) func(line []byte) (common.EntryMap, error)
func CreateParserPlain ¶
func CreateParserPlain(config configuration.ParserConfig) func(line []byte) common.EntryMap
Types ¶
type MetricsCollector ¶
type MetricsCollector interface { IncrementHTTPRequestCount(podName, method, service, path string, status int) IncrementHTTPRequestsTotalCount(service string) ObserveHTTPRequestTime(podName, method, service, path string, value float64) ObserveHTTPUpstreamResponseTimeTotal(podName, method, service, path string, value float64) }
type SLI ¶
type SLI struct {
// contains filtered or unexported fields
}
SLI parser modifies metrics according to data received from serviceProvider
func NewParserSLI ¶
func NewParserSLI(provider ServiceProvider, collector MetricsCollector) *SLI
NewParserSLI is a constructor for ParserSLI
type SLIMessage ¶
type SLIMessage struct { Host string PodName string // HTTP request related fields Method string URI string Status int RequestTime float64 UpstreamResponseTimeTotal *float64 }
SLIMessage is a structure for storage the parsed message from MQ
type SLIStub ¶
type SLIStub struct{}
SLIStub is stub for testing purposes
func NewParserSliStub ¶
func NewParserSliStub() *SLIStub
NewParserSliStub is a constructor for SLIStub
type ServiceProvider ¶
Click to show internal directories.
Click to hide internal directories.