adapter

package
v0.0.0-...-38618e0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	GetStatus() *Status
	Run(ctx context.Context, updates <-chan []*targetgroup.Group)
	GetNumberOfTargetsFor(label string) int
	GetData() (string, error)
}

func NewPrometheus

func NewPrometheus(ctx context.Context, outputFileName string, w writer.Writer, logger log.Logger) Adapter

New creates a new instance of Adapter.

type AdapterFactory

type AdapterFactory func(ctx context.Context, m *promDiscovery.Manager, w writer.Writer, logger log.Logger) (Adapter, error)

type Prom

type Prom struct {
	Status *Status
	// contains filtered or unexported fields
}

Adapter runs service discovery implementation and converts its target groups to JSON and writes to a k8s configmap.

func (*Prom) GetData

func (p *Prom) GetData() (string, error)

func (*Prom) GetNumberOfTargetsFor

func (p *Prom) GetNumberOfTargetsFor(label string) (targets int)

func (*Prom) GetStatus

func (p *Prom) GetStatus() *Status

func (*Prom) Run

func (p *Prom) Run(ctx context.Context, updates <-chan []*targetgroup.Group)

type Status

type Status struct {
	sync.Mutex
	Up bool
}

Jump to

Keyboard shortcuts

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