leaderonlyreceiver

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Leader-only-receiver wraps any metrics receiver and starts it only when agent is a leader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

Module provides receiver factory.

func NewFactory

func NewFactory(election *election.Election) receiver.Factory

NewFactory creates a new aperture_leader_only receiver factory using given leader election.

func WrapConfig

func WrapConfig(id component.ID, cfg any) (component.ID, any)

WrapConfig returns configuration of leader-only receiver wrapping given receiver.

func WrapConfigIf

func WrapConfigIf(condition bool, id component.ID, cfg any) (component.ID, any)

WrapConfigIf returns configuration of leader-only receiver wrapping given receiver if condition is true. Otherwise, returns original id and config.

Types

type Config

type Config struct {
	Inner map[string]any `mapstructure:"config"`
	// Type of the wrapped receiver
	InnerType component.Type `mapstructure:"type"`
	// contains filtered or unexported fields
}

Config is a config for leader-only-receiver.

func (*Config) Validate

func (c *Config) Validate() error

Validate implements component.ConfigValidator.

Jump to

Keyboard shortcuts

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