exporter

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (d *DynamicExporter) OnDecodedEvent(ctx context.Context, event *v1.Event) (bool, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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