procsync

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(globalConfig define.Config, taskConfig define.TaskConfig) define.Task

Types

type DstConf

type DstConf struct {
	Name                 string              `yaml:"name"`
	Version              string              `yaml:"version"`
	Type                 string              `yaml:"type"`
	Period               time.Duration       `yaml:"period"`
	DataID               int32               `yaml:"dataid"`
	TaskID               int32               `yaml:"task_id"`
	PortDataID           int32               `yaml:"port_dataid"`
	MatchPattern         string              `yaml:"match_pattern"`
	ProcessName          string              `yaml:"process_name"`
	DimPattern           string              `yaml:"extract_pattern"`
	ExcludePattern       string              `yaml:"exclude_pattern"`
	PIDPath              string              `yaml:"pid_path"`
	ProcMetric           []string            `yaml:"proc_metric"`
	PortDetect           bool                `yaml:"port_detect"`
	Ports                []string            `yaml:"ports"`
	ListenPortOnly       bool                `yaml:"listen_port_only"`
	ReportUnexpectedPort bool                `yaml:"report_unexpected_port"`
	DisableMapping       bool                `yaml:"disable_mapping"`
	Labels               []map[string]string `yaml:"labels"`
	Tags                 map[string]string   `yaml:"tags,omitempty"`
}

DstConf 新版采集配置

type File

type File struct {
	Name string

	Conf ProcRawConfig
	// contains filtered or unexported fields
}

func (*File) Hash

func (f *File) Hash() int32

Hash 生成配置内容哈希

type Gather

type Gather struct {
	tasks.BaseTask
	// contains filtered or unexported fields
}

func (*Gather) IsModify

func (g *Gather) IsModify(src, dst []ProcCustomConf) bool

IsModify 对比配置二进制是否有变化

func (*Gather) Run

func (g *Gather) Run(_ context.Context, _ chan<- define.Event)

Run 主入口,同步旧版采集器配置到自定义采集

type ProcCustomConf

type ProcCustomConf struct {
	Name    string
	Content []byte
}

ProcCustomConf 采集配置二进制

type ProcRawCommonConfig

type ProcRawCommonConfig struct {
	MatchPattern         string   `yaml:"match_pattern"`
	ProcessName          string   `yaml:"process_name"`
	ExtractPattern       string   `yaml:"extract_pattern"`
	ExcludePattern       string   `yaml:"exclude_pattern"`
	PIDPath              string   `yaml:"pid_path"`
	ProcMetric           []string `yaml:"proc_metric"`
	PortDetect           bool     `yaml:"port_detect"`
	Ports                []string `yaml:"ports"`
	ListenPortOnly       bool     `yaml:"listen_port_only"`
	ReportUnexpectedPort bool     `yaml:"report_unexpected_port"`
	DisableMapping       bool     `yaml:"disable_mapping"`
}

ProcRawCommonConfig 旧版进程采集配置进程部分

type ProcRawConfig

type ProcRawConfig struct {
	Type       string              `yaml:"type"`
	Config     ProcRawCommonConfig `yaml:"config"`
	DataID     int32               `yaml:"dataid"`
	PortDataID int32               `yaml:"port_dataid"`
	Labels     []map[string]string `yaml:"labels"`
	Tags       map[string]string   `yaml:"tags"`
	Period     string              `yaml:"period"`
}

ProcRawConfig 旧版进程采集配置

Jump to

Keyboard shortcuts

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