leaderonlyreceiver

package
v1.4.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 13 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 {
	// Type of the wrapped receiver
	InnerType component.Type `mapstructure:"type"`
	// Config for the wrapped receiver
	Inner map[string]any `mapstructure:"config"`
	// 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