Documentation ¶
Index ¶
- func BindAddress(address, port string) func(*Server) error
- func CompileOnly(m *Server) error
- func DumpAst(m *Server) error
- func DumpAstTypes(m *Server) error
- func DumpBytecode(m *Server) error
- func EmitMetricTimestamp(m *Server) error
- func ExpiredMetricGcTickInterval(interval time.Duration) func(*Server) error
- func FaviconHandler(w http.ResponseWriter, r *http.Request)
- func LogPathPatterns(patterns ...string) func(*Server) error
- func OmitMetricSource(m *Server) error
- func OmitProgLabel(m *Server) error
- func OneShot(m *Server) error
- func OverrideLocation(loc *time.Location) func(*Server) error
- func ProgramPath(path string) func(*Server) error
- func SetBuildInfo(info BuildInfo) func(*Server) error
- func StaleLogGcTickInterval(interval time.Duration) func(*Server) error
- func SyslogUseCurrentYear(m *Server) error
- type BuildInfo
- type Server
- func (m *Server) Addr() string
- func (m *Server) Close() error
- func (m *Server) Run() error
- func (m *Server) Serve() error
- func (m *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Server) SetOption(options ...func(*Server) error) error
- func (m *Server) StartTailing() error
- func (m *Server) WaitForShutdown()
- func (m *Server) WriteMetrics(w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindAddress ¶
BindAddress sets the HTTP server address in Server.
func CompileOnly ¶
CompileOnly sets compile-only mode in the Server.
func DumpAstTypes ¶
DumpAstTypes instructs the Server's copmiler to print the AST after type checking.
func DumpBytecode ¶
DumpBytecode instructs the Server's compiuler to print the program bytecode after code generation.
func EmitMetricTimestamp ¶
EmitMetricTimestamp tells the Server to export the metric's timestamp.
func ExpiredMetricGcTickInterval ¶
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 ¶
LogPathPatterns sets the patterns to find log paths in the Server.
func OmitMetricSource ¶
OmitMetricSource sets the Server to not link created metrics to their source program.
func OmitProgLabel ¶
OmitProgLabel sets the Server to not put the program name as a label in exported metrics.
func OverrideLocation ¶
OverrideLocation sets the timezone location for log timestamps without any such information.
func ProgramPath ¶
ProgramPath sets the path to find mtail programs in the Server.
func SetBuildInfo ¶
SetBuildInfo sets the mtail program build information in the Server.
func StaleLogGcTickInterval ¶
StaleLogGcTickInterval sets the interval to run ticker to remove stale log handles.
func SyslogUseCurrentYear ¶
SyslogUseCurrentYear instructs the Server to use the current year for year-less log timestamp during parsing.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server contains the state of the main mtail program.
func (*Server) Close ¶
Close handles the graceful shutdown of this mtail instance, ensuring that it only occurs once.
func (*Server) Run ¶
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) SetOption ¶
SetOption takes one or more option functions and applies them in order to MtailServer.
func (*Server) StartTailing ¶
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.