Documentation
¶
Overview ¶
Package message defines the interface for the measurements and observations made by the "gomon" command. The package also implements the formatting of the output streamed by the "gomon" command.
The message package defines the following command line flags:
- -document: document the output that Gomon produces
- -pretty: format output in a manner that is human readable
- -rotate: an interval at which to rotate the output file
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LokiStreams counts the number of observations streamed to Loki. LokiStreams int )
View Source
var ( // MeasureEvents has only the single type "measure". MeasureEvents = gocore.ValidValue[MeasureEvent]{}.Define(measure) )
View Source
var ( // Messages contains a map of all message definitions. Messages = map[string][]field{} )
Functions ¶
func Document ¶
func Document()
Document the messages when the document flag specified on the command line.
func Measurements ¶
func Measurements(ms []Content) error
Measurements sends measurements to encode.
func Observations ¶
func Observations(ms []Content) error
Observations sends observations to encode.
Types ¶
type Header ¶
type Header[T ~string] struct { Timestamp time.Time `json:"timestamp" gomon:"property"` Host string `json:"host" gomon:"property"` Platform string `json:"platform" gomon:"property"` Source string `json:"source" gomon:"property"` Event T `json:"event" gomon:"property"` }
Header for a message.
func Measurement ¶
func Measurement() Header[MeasureEvent]
Measurement initializes the message header for measurement. Measurement types are distinguised by their source.
Click to show internal directories.
Click to hide internal directories.