consumer

package
v0.37.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OperationTypeInsert inserts a new k/v if it isn't already present
	OperationTypeInsert = "insert"
	// OperationTypeUpdate only modifies an existing k/v
	OperationTypeUpdate = "update"
	// OperationTypeUpsert does both of above
	OperationTypeUpsert = "upsert"

	//TODO: It'd be cleaner to get these from the otel semver package?
	//      Not all are in semver though. E.g. "k8s.pod.ip" is internal inside the k8sattributesprocessor.
	PodAssociationIPLabel       = "ip"
	PodAssociationOTelIPLabel   = "net.host.ip"
	PodAssociationk8sIPLabel    = "k8s.pod.ip"
	PodAssociationHostnameLabel = "hostname"
	PodAssociationConnectionIP  = "connection"
)

Variables

This section is empty.

Functions

func GetHostFromLabels

func GetHostFromLabels(labels discovery.Target) (string, error)

func NewTargetsWithNonInternalLabels added in v0.36.2

func NewTargetsWithNonInternalLabels(labels discovery.Target) discovery.Target

func ValidateOperationType

func ValidateOperationType(operationType string) error

func ValidatePodAssociations

func ValidatePodAssociations(podAssociations []string) error

Types

type Consumer

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

TODO: Put a private member so that this can't be created without calling NewConsumer?

func NewConsumer

func NewConsumer(opts Options, logger log.Logger) (*Consumer, error)

func (*Consumer) Capabilities

func (c *Consumer) Capabilities() otelconsumer.Capabilities

func (*Consumer) ConsumeTraces

func (c *Consumer) ConsumeTraces(ctx context.Context, td ptrace.Traces) error

func (*Consumer) UpdateOptions

func (c *Consumer) UpdateOptions(opts Options) error

UpdateOptions is used in flow mode, where all options need to be updated.

func (*Consumer) UpdateOptionsHostLabels

func (c *Consumer) UpdateOptionsHostLabels(hostLabels map[string]discovery.Target)

UpdateOptionsHostLabels is used in static mode, where only the host labels need to be updated.

type Options

type Options struct {
	HostLabels      map[string]discovery.Target
	OperationType   string
	PodAssociations []string
	NextConsumer    otelconsumer.Traces
}

Options configure a Consumer

Jump to

Keyboard shortcuts

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