Documentation ¶
Index ¶
- Variables
- type Option
- func WithDebug() Option
- func WithDialTimeout(t time.Duration) Option
- func WithErrorAggregationWindow(d time.Duration) Option
- func WithHubbleTarget(t string) Option
- func WithListenAddress(a string) Option
- func WithRetryTimeout(t time.Duration) Option
- func WithSortBufferDrainTimeout(d time.Duration) Option
- func WithSortBufferMaxLen(i int) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
var Default = Options{ HubbleTarget: "unix://" + defaults.HubbleSockPath, DialTimeout: 5 * time.Second, RetryTimeout: 30 * time.Second, ListenAddress: fmt.Sprintf(":%d", hubbledefaults.RelayPort), Debug: false, SortBufferMaxLen: 100, SortBufferDrainTimeout: 1 * time.Second, ErrorAggregationWindow: 10 * time.Second, }
Default is the reference point for default values.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option customizes the configuration of the hubble-relay server.
func WithDialTimeout ¶
WithDialTimeout sets the dial timeout that is used when establishing a connection to a hubble peer.
func WithErrorAggregationWindow ¶
WithErrorAggregationWindow sets a time window during which errors with the same error message are coalesced. The aggregated error is forwarded to the downstream consumer either when the window expires or when a new, different error occurs (whichever happens first)
func WithHubbleTarget ¶
WithHubbleTarget sets the URL of the local hubble instance to connect to. This target MUST implement the Peer service.
func WithListenAddress ¶
WithListenAddress sets the listen address for the hubble-relay server.
func WithRetryTimeout ¶
WithRetryTimeout sets the duration to wait before attempting to re-connect to a hubble peer when the connection is lost.
func WithSortBufferDrainTimeout ¶ added in v1.8.2
WithSortBufferDrainTimeout sets the sort buffer drain timeout value. For flows requests where the total number of flows cannot be determined (typically for flows requests in follow mode), a flow is taken out of the buffer and sent to the client after duration d if the buffer is not full. This value must be greater than 0. Setting this value too low would render the flows sorting operation ineffective. A value between 500 milliseconds and 3 seconds should be constitute a good choice in most cases.
func WithSortBufferMaxLen ¶ added in v1.8.2
WithSortBufferMaxLen sets the maximum number of flows that can be buffered for sorting before being sent to the client. The provided value must be greater than 0 and is to be understood per client request. Therefore, it is advised to keep the value moderate (a value between 30 and 100 should constitute a good choice in most cases).
type Options ¶
type Options struct { HubbleTarget string DialTimeout time.Duration RetryTimeout time.Duration ListenAddress string Debug bool SortBufferMaxLen int SortBufferDrainTimeout time.Duration ErrorAggregationWindow time.Duration }
Options stores all the configuration values for the hubble-relay server.