transform

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package transform provides some intermediate nodes that might filter/process/transform the events

Index

Constants

View Source
const (
	ResolverDNS = maps.Bits(1 << iota)
	ResolverK8s
)
View Source
const (
	// UnmatchUnset leaves the Route field as empty
	UnmatchUnset = UnmatchType("unset")
	// UnmatchPath sets the Route field to the same values as the Path
	UnmatchPath = UnmatchType("path")
	// UnmatchWildcard sets the route field to a generic asterisk symbol
	UnmatchWildcard = UnmatchType("wildcard")
	// UnmatchHeuristic detects the route field using a heuristic
	UnmatchHeuristic = UnmatchType("heuristic")

	UnmatchDefault = UnmatchWildcard
)
View Source
const (
	// IgnoreMetrics prevents sending metric events for ignored patterns
	IgnoreMetrics = IgnoreMode("metrics")
	// IgnoreTraces prevents sending trace events for ignored patterns
	IgnoreTraces = IgnoreMode("traces")
	// IgnoreAll prevents sending both metrics and traces for ignored patterns
	IgnoreAll = IgnoreMode("all")

	IgnoreDefault = IgnoreAll
)

Variables

This section is empty.

Functions

func KubeClusterName added in v1.7.0

func KubeClusterName(ctx context.Context, cfg *KubernetesDecorator) string

func KubeDecoratorProvider

func KubeDecoratorProvider(
	ctx context.Context,
	cfg *KubernetesDecorator,
	ctxInfo *global.ContextInfo,
) pipe.MiddleProvider[[]request.Span, []request.Span]

func OwnerLabelName added in v1.9.0

func OwnerLabelName(kind string) attr.Name

func RoutesProvider

func RoutesProvider(rc *RoutesConfig) pipe.MiddleProvider[[]request.Span, []request.Span]

Types

type IgnoreMode

type IgnoreMode string

type KubernetesDecorator

type KubernetesDecorator struct {
	Enable kubeflags.EnableFlag `yaml:"enable" env:"BEYLA_KUBE_METADATA_ENABLE"`

	// ClusterName overrides cluster name. If empty, the NetO11y module will try to retrieve
	// it from the Cloud Provider Metadata (EC2, GCP and Azure), and leave it empty if it fails to.
	ClusterName string `yaml:"cluster_name" env:"BEYLA_KUBE_CLUSTER_NAME"`

	// KubeconfigPath is optional. If unset, it will look in the usual location.
	KubeconfigPath string `yaml:"kubeconfig_path" env:"KUBECONFIG"`

	InformersSyncTimeout time.Duration `yaml:"informers_sync_timeout" env:"BEYLA_KUBE_INFORMERS_SYNC_TIMEOUT"`

	// InformersResyncPeriod defaults to 30m. Higher values will reduce the load on the Kube API.
	InformersResyncPeriod time.Duration `yaml:"informers_resync_period" env:"BEYLA_KUBE_INFORMERS_RESYNC_PERIOD"`

	// DropExternal will drop, in NetO11y component, any flow where the source or destination
	// IPs are not matched to any kubernetes entity, assuming they are cluster-external
	DropExternal bool `yaml:"drop_external" env:"BEYLA_NETWORK_DROP_EXTERNAL"`

	// DisableInformers allows selectively disabling some informers. Accepted value is a list
	// that might contain node or service. Disabling any of them
	// will cause metadata to be incomplete but will reduce the load of the Kube API.
	// Pods informer can't be disabled. For that purpose, you should disable the whole
	// kubernetes metadata decoration.
	DisableInformers []string `yaml:"disable_informers" env:"BEYLA_KUBE_DISABLE_INFORMERS"`

	// MetaCacheAddress is the host:port address of the beyla-k8s-cache service instance
	MetaCacheAddress string `yaml:"meta_cache_address" env:"BEYLA_KUBE_META_CACHE_ADDRESS"`

	// MetaSourceLabels allows Beyla overriding the service name and namespace of an application from
	// the given labels.
	// TODO Beyla 2.0. Consider defaulting to (and report as a breaking change):
	// 		Name:      "app.kubernetes.io/name",
	//		Namespace: "app.kubernetes.io/part-of",
	MetaSourceLabels kube.MetaSourceLabels `yaml:"meta_source_labels"`
}

type NameResolver

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

type NameResolverConfig

type NameResolverConfig struct {
	// Sources for name resolving. Accepted values: dns, k8s
	Sources []string `yaml:"sources" env:"BEYLA_NAME_RESOLVER_SOURCES" envSeparator:"," envDefault:"k8s"`
	// CacheLen specifies the max size of the LRU cache that is checked before
	// performing the name lookup. Default: 256
	CacheLen int `yaml:"cache_len" env:"BEYLA_NAME_RESOLVER_CACHE_LEN"`
	// CacheTTL specifies the time-to-live of a cached IP->hostname entry. After the
	// cached entry becomes older than this time, the IP->hostname entry will be looked
	// up again.
	CacheTTL time.Duration `yaml:"cache_expiry" env:"BEYLA_NAME_RESOLVER_CACHE_TTL"`
}

type RoutesConfig

type RoutesConfig struct {
	// Unmatch specifies what to do when a route pattern is not matched
	Unmatch UnmatchType `yaml:"unmatched"`
	// Patterns of the paths that will match to a route
	Patterns       []string   `yaml:"patterns"`
	IgnorePatterns []string   `yaml:"ignored_patterns"`
	IgnoredEvents  IgnoreMode `yaml:"ignore_mode"`
}

RoutesConfig allows grouping URLs sharing a given pattern.

type UnmatchType

type UnmatchType string

UnmatchType defines which actions to do when a route pattern is not recognized

Jump to

Keyboard shortcuts

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