k8sprocessor

package
v0.0.0-...-51da36d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8sMetadata = "k8smetadataprocessor"
)

Variables

This section is empty.

Functions

func NewKubernetesProcessor

func NewKubernetesProcessor(cfg interface{}, telemetry *component.TelemetryTools, nextConsumer consumer.Consumer) processor.Processor

Types

type Config

type Config struct {
	KubeAuthType  kubernetes.AuthType `mapstructure:"kube_auth_type"`
	KubeConfigDir string              `mapstructure:"kube_config_dir"`
	// GraceDeletePeriod controls the delay interval after receiving delete event.
	// The unit is seconds, and the default value is 60 seconds.
	// Should not be lower than 30 seconds.
	GraceDeletePeriod int `mapstructure:"grace_delete_period"`
	// EnableFetchReplicaSet controls whether to fetch ReplicaSet information.
	// The default value is false. It should be enabled if the ReplicaSet
	// is used to control pods in the third-party CRD except for Deployment.
	EnableFetchReplicaSet bool `mapstructure:"enable_fetch_replicaset"`
	// Set "Enable" false if you want to run the agent in the non-Kubernetes environment.
	// Otherwise, the agent will panic if it can't connect to the API-server.
	Enable bool `mapstructure:"enable"`

	// MetaDataProviderConfig is optional config to use another source of K8sMetadata named metadata-provider
	// Used to reduce the stress caused by agent directly on APIServer
	// Set "metadata_provider_config.enable" true and "metadata_provider_config.endpoint" as target service to enable it
	MetaDataProviderConfig *kubernetes.MetaDataProviderConfig `mapstructure:"metadata_provider_config"`
}
var DefaultConfig Config = Config{
	KubeAuthType:           "serviceAccount",
	KubeConfigDir:          "/root/.kube/config",
	GraceDeletePeriod:      60,
	Enable:                 true,
	MetaDataProviderConfig: &kubernetes.MetaDataProviderConfig{Enable: false, EnableTrace: false, Endpoint: ""},
}

type K8sMetadataProcessor

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

func (*K8sMetadataProcessor) Consume

func (p *K8sMetadataProcessor) Consume(dataGroup *model.DataGroup) error

Jump to

Keyboard shortcuts

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