Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DynamicExporterReconfigurations = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: api.DefaultPrometheusNamespace, Subsystem: "dynamic_exporter", Name: "reconfigurations_total", Help: "Number of dynamic exporters reconfigurations", }, []string{labelReconfigurationOperation}) DynamicExporterConfigHash = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: api.DefaultPrometheusNamespace, Subsystem: "dynamic_exporter", Name: "config_hash", Help: "Hash of last applied config", }, []string{}) DynamicExporterConfigLastApplied = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: api.DefaultPrometheusNamespace, Subsystem: "dynamic_exporter", Name: "config_last_applied", Help: "Timestamp of last applied config", }, []string{}) )
Functions ¶
func NewConfigWatcher ¶ added in v1.15.0
func NewConfigWatcher( configFilePath string, callback func(ctx context.Context, hash uint64, config DynamicExportersConfig), ) *configWatcher
NewConfigWatcher creates a config watcher instance. Config watcher notifies dynamic exporter when config file changes and dynamic exporter should be reconciled.
func NewExporter ¶
func NewExporter( ctx context.Context, logger logrus.FieldLogger, options ...exporteroption.Option) (*exporter, error)
NewExporter initializes an exporter.
Types ¶
type DynamicExporter ¶ added in v1.15.0
type DynamicExporter struct { FlowLogExporter // contains filtered or unexported fields }
DynamicExporter represents instance of hubble exporter with dynamic configuration reload.
func NewDynamicExporter ¶ added in v1.15.0
func NewDynamicExporter(logger logrus.FieldLogger, configFilePath string, maxFileSizeMB, maxBackups int) *DynamicExporter
NewDynamicExporter creates instance of dynamic hubble flow exporter.
func (*DynamicExporter) OnDecodedEvent ¶ added in v1.15.0
OnDecodedEvent distributes events across all managed exporters.
func (*DynamicExporter) Stop ¶ added in v1.15.0
func (d *DynamicExporter) Stop() error
Stop stops configuration watcher and all managed flow log exporters.
type DynamicExportersConfig ¶ added in v1.15.0
type DynamicExportersConfig struct {
FlowLogs []*FlowLogConfig `json:"flowLogs,omitempty" yaml:"flowLogs,omitempty"`
}
DynamicExportersConfig represents structure of dynamic hubble exporters configuration file.
type FieldMask ¶ added in v1.15.0
type FieldMask []string
FieldMask is a slice of fields that are included in output.
type FlowFilters ¶ added in v1.15.0
type FlowFilters []*flowpb.FlowFilter
FlowFilters is a slice of filters to include or exclude flows.
type FlowLogConfig ¶ added in v1.15.0
type FlowLogConfig struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` FilePath string `json:"filePath,omitempty" yaml:"filePath,omitempty"` FieldMask FieldMask `json:"fieldMask,omitempty" yaml:"fieldMask,omitempty"` IncludeFilters FlowFilters `json:"includeFilters,omitempty" yaml:"includeFilters,omitempty"` ExcludeFilters FlowFilters `json:"excludeFilters,omitempty" yaml:"excludeFilters,omitempty"` End *time.Time `json:"end,omitempty" yaml:"end,omitempty"` }
FlowLogConfig represents configuration of single dynamic exporter.
type FlowLogExporter ¶ added in v1.15.0
type FlowLogExporter interface { observeroption.OnDecodedEvent // Stop stops this exporter instance from further events processing. Stop() error }
FlowLogExporter exports hubble events to configured target file.