jmxfetch

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JMXAlarmType = "JMXFETCH_ALARM"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name       string
	MetricType string
	Alias      string
}

type Cfg

type Cfg struct {
	// contains filtered or unexported fields
}

func NewCfg

func NewCfg(filters []*FilterInner) *Cfg

type Filter

type Filter struct {
	Domain    string
	BeanRegex string
	Type      string
	Name      string
	Attribute []*Attribute
}

type FilterInner

type FilterInner struct {
	Domain    string      `yaml:"domain,omitempty"`
	BeanRegex string      `yaml:"bean_regex,omitempty"`
	Type      string      `yaml:"type,omitempty"`
	Name      string      `yaml:"name,omitempty"`
	Attribute interface{} `yaml:"attribute,omitempty"`
}

func NewFilterInner

func NewFilterInner(filter *Filter) *FilterInner

type Instance

type Instance struct {
	Port     int32
	Host     string
	User     string
	Password string
	Tags     map[string]string
	Name     string
}

type InstanceInner

type InstanceInner struct {
	Port              int32    `yaml:"port,omitempty"`
	Host              string   `yaml:"host,omitempty"`
	User              string   `yaml:"user,omitempty"`
	Password          string   `yaml:"password,omitempty"`
	Tags              []string `yaml:"tags,omitempty"`
	Name              string   `yaml:"name"`
	DefaultJvmMetrics bool     `yaml:"collect_default_jvm_metrics"`
}

func NewInstanceInner

func NewInstanceInner(port int32, host, user, passowrd string, tags map[string]string, defaultJvmMetrics bool) *InstanceInner

func (*InstanceInner) Hash

func (i *InstanceInner) Hash() string

type Jmx

type Jmx struct {
	// dynamic discovery
	DiscoveryMode         bool // support container discovery
	DiscoveryUser         string
	DiscoveryPassword     string
	Cluster               string
	IncludeEnv            map[string]string
	ExcludeEnv            map[string]string
	IncludeContainerLabel map[string]string
	ExcludeContainerLabel map[string]string
	IncludeK8sLabel       map[string]string
	ExcludeK8sLabel       map[string]string
	ExternalEnvTag        map[string]string
	ExternalK8sLabelTag   map[string]string
	K8sNamespaceRegex     string
	K8sPodRegex           string
	K8sContainerRegex     string
	// static instances
	StaticInstances []*Instance
	// common config
	JDKPath           string
	Filters           []*Filter
	NewGcMetrics      bool
	DefaultJvmMetrics bool
	Tags              map[string]string
	// contains filtered or unexported fields
}

func (*Jmx) Description

func (m *Jmx) Description() string

func (*Jmx) Init

func (m *Jmx) Init(context pipeline.Context) (int, error)

func (*Jmx) Start

func (m *Jmx) Start(collector pipeline.Collector) error

func (*Jmx) Stop

func (m *Jmx) Stop() error

func (*Jmx) UpdateContainerCfg

func (m *Jmx) UpdateContainerCfg()

type LogCollector

type LogCollector struct {
	// contains filtered or unexported fields
}

func NewLogCollector

func NewLogCollector(agentDirPath string) *LogCollector

NewLogCollector create a log collector to read jmxfetch log.

func (*LogCollector) JmxfetchStart

func (l *LogCollector) JmxfetchStart()

func (*LogCollector) JmxfetchStop

func (l *LogCollector) JmxfetchStop()

func (*LogCollector) Run

func (l *LogCollector) Run()

type Manager

type Manager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func GetJmxFetchManager

func GetJmxFetchManager(agentDirPath string) *Manager

func (*Manager) ConfigJavaHome

func (m *Manager) ConfigJavaHome(javaHome string)

ConfigJavaHome would select the random jdk path if configured many diff paths.

func (*Manager) Register

func (m *Manager) Register(key string, configs map[string]*InstanceInner, newGcMetrics bool)

func (*Manager) RegisterCollector

func (m *Manager) RegisterCollector(ctx pipeline.Context, key string, collector pipeline.Collector, filters []*FilterInner)

func (*Manager) UnregisterCollector

func (m *Manager) UnregisterCollector(key string)

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor() *Processor

func (*Processor) Process

func (p *Processor) Process(fileBlock []byte, noChangeInterval time.Duration) int

Jump to

Keyboard shortcuts

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