mtail

package
v0.0.0-...-93548a8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAddress

func BindAddress(address, port string) func(*Server) error

BindAddress sets the HTTP server address in Server.

func CompileOnly

func CompileOnly(m *Server) error

CompileOnly sets compile-only mode in the Server.

func DumpAst

func DumpAst(m *Server) error

DumpAst instructs the Server's compiler to print the AST after parsing.

func DumpAstTypes

func DumpAstTypes(m *Server) error

DumpAstTypes instructs the Server's copmiler to print the AST after type checking.

func DumpBytecode

func DumpBytecode(m *Server) error

DumpBytecode instructs the Server's compiuler to print the program bytecode after code generation.

func EmitMetricTimestamp

func EmitMetricTimestamp(m *Server) error

EmitMetricTimestamp tells the Server to export the metric's timestamp.

func ExpiredMetricGcTickInterval

func ExpiredMetricGcTickInterval(interval time.Duration) func(*Server) error

ExpiredMetricGcTickInterval sets the interval to run ticker to delete expired metrics from store.

func FaviconHandler

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

func LogPathPatterns

func LogPathPatterns(patterns ...string) func(*Server) error

LogPathPatterns sets the patterns to find log paths in the Server.

func OmitMetricSource

func OmitMetricSource(m *Server) error

OmitMetricSource sets the Server to not link created metrics to their source program.

func OmitProgLabel

func OmitProgLabel(m *Server) error

OmitProgLabel sets the Server to not put the program name as a label in exported metrics.

func OneShot

func OneShot(m *Server) error

OneShot sets one-shot mode in the Server.

func OverrideLocation

func OverrideLocation(loc *time.Location) func(*Server) error

OverrideLocation sets the timezone location for log timestamps without any such information.

func ProgramPath

func ProgramPath(path string) func(*Server) error

ProgramPath sets the path to find mtail programs in the Server.

func SetBuildInfo

func SetBuildInfo(info BuildInfo) func(*Server) error

SetBuildInfo sets the mtail program build information in the Server.

func StaleLogGcTickInterval

func StaleLogGcTickInterval(interval time.Duration) func(*Server) error

StaleLogGcTickInterval sets the interval to run ticker to remove stale log handles.

func SyslogUseCurrentYear

func SyslogUseCurrentYear(m *Server) error

SyslogUseCurrentYear instructs the Server to use the current year for year-less log timestamp during parsing.

Types

type BuildInfo

type BuildInfo struct {
	Branch   string
	Version  string
	Revision string
}

func (BuildInfo) String

func (b BuildInfo) String() string

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server contains the state of the main mtail program.

func New

func New(store *metrics.Store, w watcher.Watcher, options ...func(*Server) error) (*Server, error)

New creates a MtailServer from the supplied Options.

func (*Server) Addr

func (m *Server) Addr() string

func (*Server) Close

func (m *Server) Close() error

Close handles the graceful shutdown of this mtail instance, ensuring that it only occurs once.

func (*Server) Run

func (m *Server) Run() error

Run starts MtailServer's primary function, in which it watches the log files for changes and sends any new lines found into the lines channel for pick up by the virtual machines. If OneShot mode is enabled, it will exit.

func (*Server) Serve

func (m *Server) Serve() error

Serve begins the webserver and awaits a shutdown instruction.

func (*Server) ServeHTTP

func (m *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) SetOption

func (m *Server) SetOption(options ...func(*Server) error) error

SetOption takes one or more option functions and applies them in order to MtailServer.

func (*Server) StartTailing

func (m *Server) StartTailing() error

StartTailing adds each log path pattern to the tailer.

func (*Server) WaitForShutdown

func (m *Server) WaitForShutdown()

WaitForShutdown handles shutdown requests from the system or the UI.

func (*Server) WriteMetrics

func (m *Server) WriteMetrics(w io.Writer) error

WriteMetrics dumps the current state of the metrics store in JSON format to the io.Writer.

Jump to

Keyboard shortcuts

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