Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NotLabelValueRE = regexp.MustCompile(`[^a-zA-Z0-9_/+:@{}&%<>*\\.,\(\)\[\]-]`)
NotLabelValueRE - any chars in label values not matching this will be converted to underscores. We exclude chars such as: <space>;!="^' Allowed values must be valid for node_exporter and also the graphite text protocol for labels/tags https://graphite.readthedocs.io/en/latest/tags.html In addition any backslashes must be double quoted for node_exporter.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Debug int `yaml:"debug"` ServerID string `yaml:"server_id"` SDPInstance string `yaml:"sdp_instance"` UpdateInterval time.Duration `yaml:"update_interval"` OutputCmdsByUser bool `yaml:"output_cmds_by_user"` OutputCmdsByUserRegex string `yaml:"output_cmds_by_user_regex"` OutputCmdsByIP bool `yaml:"output_cmds_by_ip"` CaseSensitiveServer bool `yaml:"case_sensitive_server"` }
Config for metrics
type P4DMetrics ¶
type P4DMetrics struct {
// contains filtered or unexported fields
}
P4DMetrics structure
func NewP4DMetricsLogParser ¶
func NewP4DMetricsLogParser(config *Config, version *P4DMetricsVersion, logger *logrus.Logger, historical bool) *P4DMetrics
NewP4DMetricsLogParser - wraps P4dFileParser
func (*P4DMetrics) ProcessEvents ¶
func (p4m *P4DMetrics) ProcessEvents(ctx context.Context, linesInChan <-chan string, needCmdChan bool) ( chan interface{}, chan string)
ProcessEvents - main event loop for P4Prometheus - reads lines and outputs metrics Wraps p4dlog.LogParser event loop
func (*P4DMetrics) SetDebugMode ¶ added in v0.8.0
func (p4m *P4DMetrics) SetDebugMode(level int)
SetDebugMode - for debug purposes
func (*P4DMetrics) SetDebugPID ¶ added in v0.8.0
func (p4m *P4DMetrics) SetDebugPID(pid int64, cmdName string)
SetDebugPID - for debug purposes
func (*P4DMetrics) SetNoCompletionRecords ¶ added in v0.12.3
func (p4m *P4DMetrics) SetNoCompletionRecords()
SetNoCompletionRecords() - can be set if log was generated with server=1
type P4DMetricsVersion ¶ added in v0.12.9
P4DMetricsVersion - for version info