otelcol

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesAPIConfig_AuthType_None           = "none"
	KubernetesAPIConfig_AuthType_ServiceAccount = "serviceAccount"
	KubernetesAPIConfig_AuthType_KubeConfig     = "kubeConfig"
	KubernetesAPIConfig_AuthType_TLS            = "tls"
)
View Source
const DefaultBalancerName = "pick_first"

Variables

View Source
var DefaultScraperControllerArguments = ScraperControllerArguments{
	CollectionInterval: time.Minute,
	InitialDelay:       time.Second,
	Timeout:            0 * time.Second,
}

DefaultScraperControllerArguments holds default settings for ScraperControllerArguments.

View Source
var DefaultTimeout = 5 * time.Second

DefaultTimeout holds the default timeout used for components which can time out from requests.

Functions

This section is empty.

Types

type AttrActionKeyValue

type AttrActionKeyValue struct {
	// Key specifies the attribute to act upon.
	// This is a required field.
	Key string `river:"key,attr"`

	// Value specifies the value to populate for the key.
	// The type of the value is inferred from the configuration.
	Value interface{} `river:"value,attr,optional"`

	// A regex pattern  must be specified for the action EXTRACT.
	// It uses the attribute specified by `key' to extract values from
	// The target keys are inferred based on the names of the matcher groups
	// provided and the names will be inferred based on the values of the
	// matcher group.
	// Note: All subexpressions must have a name.
	// Note: The value type of the source key must be a string. If it isn't,
	// no extraction will occur.
	RegexPattern string `river:"pattern,attr,optional"`

	// FromAttribute specifies the attribute to use to populate
	// the value. If the attribute doesn't exist, no action is performed.
	FromAttribute string `river:"from_attribute,attr,optional"`

	// FromContext specifies the context value to use to populate
	// the value. The values would be searched in client.Info.Metadata.
	// If the key doesn't exist, no action is performed.
	// If the key has multiple values the values will be joined with `;` separator.
	FromContext string `river:"from_context,attr,optional"`

	// ConvertedType specifies the target type of an attribute to be converted
	// If the key doesn't exist, no action is performed.
	// If the value cannot be converted, the original value will be left as-is
	ConvertedType string `river:"converted_type,attr,optional"`

	// Action specifies the type of action to perform.
	// The set of values are {INSERT, UPDATE, UPSERT, DELETE, HASH}.
	// Both lower case and upper case are supported.
	// INSERT -  Inserts the key/value to attributes when the key does not exist.
	//           No action is applied to attributes where the key already exists.
	//           Either Value, FromAttribute or FromContext must be set.
	// UPDATE -  Updates an existing key with a value. No action is applied
	//           to attributes where the key does not exist.
	//           Either Value, FromAttribute or FromContext must be set.
	// UPSERT -  Performs insert or update action depending on the attributes
	//           containing the key. The key/value is inserted to attributes
	//           that did not originally have the key. The key/value is updated
	//           for attributes where the key already existed.
	//           Either Value, FromAttribute or FromContext must be set.
	// DELETE  - Deletes the attribute. If the key doesn't exist,
	//           no action is performed.
	// HASH    - Calculates the SHA-1 hash of an existing value and overwrites the
	//           value with it's SHA-1 hash result.
	// EXTRACT - Extracts values using a regular expression rule from the input
	//           'key' to target keys specified in the 'rule'. If a target key
	//           already exists, it will be overridden.
	// CONVERT  - converts the type of an existing attribute, if convertable
	// This is a required field.
	Action string `river:"action,attr"`
}

type AttrActionKeyValueSlice

type AttrActionKeyValueSlice []AttrActionKeyValue

func (AttrActionKeyValueSlice) Convert

func (actions AttrActionKeyValueSlice) Convert() []interface{}

type Attribute

type Attribute struct {
	// Key specifies the attribute key.
	Key string `river:"key,attr"`

	// Values specifies the value to match against.
	// If it is not set, any value will match.
	Value interface{} `river:"value,attr,optional"`
}

Attribute specifies the attribute key and optional value to match against.

type CORSArguments

type CORSArguments struct {
	AllowedOrigins []string `river:"allowed_origins,attr,optional"`
	AllowedHeaders []string `river:"allowed_headers,attr,optional"`

	MaxAge int `river:"max_age,attr,optional"`
}

CORSArguments holds shared CORS settings for components which launch HTTP servers.

func (*CORSArguments) Convert

func (args *CORSArguments) Convert() *otelconfighttp.CORSConfig

Convert converts args into the upstream type.

type CompressionType

type CompressionType string

CompressionType represents a mechanism used to compress data.

const (
	CompressionTypeGzip    CompressionType = "gzip"
	CompressionTypeZlib    CompressionType = "zlib"
	CompressionTypeDeflate CompressionType = "deflate"
	CompressionTypeSnappy  CompressionType = "snappy"
	CompressionTypeZstd    CompressionType = "zstd"
	CompressionTypeNone    CompressionType = "none"
	CompressionTypeEmpty   CompressionType = ""
)

Supported values for compression

func (CompressionType) Convert

func (ct CompressionType) Convert() configcompression.Type

Convert converts ct into the upstream type.

func (*CompressionType) UnmarshalText

func (ct *CompressionType) UnmarshalText(in []byte) error

UnmarshalText converts a string into a CompressionType. Returns an error if the string is invalid.

type Consumer

type Consumer interface {
	otelconsumer.Traces
	otelconsumer.Metrics
	otelconsumer.Logs
}

Consumer is a combined OpenTelemetry Collector consumer which can consume any telemetry signal.

type ConsumerArguments

type ConsumerArguments struct {
	Metrics []Consumer `river:"metrics,attr,optional"`
	Logs    []Consumer `river:"logs,attr,optional"`
	Traces  []Consumer `river:"traces,attr,optional"`
}

ConsumerArguments is a common Arguments type for Flow components which can send data to otelcol consumers.

It is expected to use ConsumerArguments as a block within the top-level arguments block for a component.

type ConsumerExports

type ConsumerExports struct {
	Input Consumer `river:"input,attr"`
}

ConsumerExports is a common Exports type for Flow components which are otelcol processors or otelcol exporters.

type DebugMetricsArguments

type DebugMetricsArguments struct {
	DisableHighCardinalityMetrics bool `river:"disable_high_cardinality_metrics,attr,optional"`
}

DebugMetricsArguments configures internal metrics of the components

func (*DebugMetricsArguments) SetToDefault

func (args *DebugMetricsArguments) SetToDefault()

SetToDefault implements river.Defaulter.

type GRPCClientArguments

type GRPCClientArguments struct {
	Endpoint string `river:"endpoint,attr"`

	Compression CompressionType `river:"compression,attr,optional"`

	TLS       TLSClientArguments        `river:"tls,block,optional"`
	Keepalive *KeepaliveClientArguments `river:"keepalive,block,optional"`

	ReadBufferSize  units.Base2Bytes  `river:"read_buffer_size,attr,optional"`
	WriteBufferSize units.Base2Bytes  `river:"write_buffer_size,attr,optional"`
	WaitForReady    bool              `river:"wait_for_ready,attr,optional"`
	Headers         map[string]string `river:"headers,attr,optional"`
	BalancerName    string            `river:"balancer_name,attr,optional"`
	Authority       string            `river:"authority,attr,optional"`

	// Auth is a binding to an otelcol.auth.* component extension which handles
	// authentication.
	Auth *auth.Handler `river:"auth,attr,optional"`
}

GRPCClientArguments holds shared gRPC settings for components which launch gRPC clients. NOTE: When changing this structure, note that similar structures such as loadbalancing.GRPCClientArguments may also need to be changed.

func (*GRPCClientArguments) Convert

func (args *GRPCClientArguments) Convert() *otelconfiggrpc.ClientConfig

Convert converts args into the upstream type.

func (*GRPCClientArguments) Extensions

func (args *GRPCClientArguments) Extensions() map[otelcomponent.ID]otelextension.Extension

Extensions exposes extensions used by args.

type GRPCServerArguments

type GRPCServerArguments struct {
	Endpoint  string `river:"endpoint,attr,optional"`
	Transport string `river:"transport,attr,optional"`

	TLS *TLSServerArguments `river:"tls,block,optional"`

	MaxRecvMsgSize       units.Base2Bytes `river:"max_recv_msg_size,attr,optional"`
	MaxConcurrentStreams uint32           `river:"max_concurrent_streams,attr,optional"`
	ReadBufferSize       units.Base2Bytes `river:"read_buffer_size,attr,optional"`
	WriteBufferSize      units.Base2Bytes `river:"write_buffer_size,attr,optional"`

	Keepalive *KeepaliveServerArguments `river:"keepalive,block,optional"`

	IncludeMetadata bool `river:"include_metadata,attr,optional"`
}

GRPCServerArguments holds shared gRPC settings for components which launch gRPC servers.

func (*GRPCServerArguments) Convert

func (args *GRPCServerArguments) Convert() *otelconfiggrpc.ServerConfig

Convert converts args into the upstream type.

type HTTPClientArguments

type HTTPClientArguments struct {
	Endpoint string `river:"endpoint,attr"`

	Compression CompressionType `river:"compression,attr,optional"`

	TLS TLSClientArguments `river:"tls,block,optional"`

	ReadBufferSize  units.Base2Bytes  `river:"read_buffer_size,attr,optional"`
	WriteBufferSize units.Base2Bytes  `river:"write_buffer_size,attr,optional"`
	Timeout         time.Duration     `river:"timeout,attr,optional"`
	Headers         map[string]string `river:"headers,attr,optional"`
	// CustomRoundTripper  func(next http.RoundTripper) (http.RoundTripper, error) TODO (@tpaschalis)
	MaxIdleConns         *int           `river:"max_idle_conns,attr,optional"`
	MaxIdleConnsPerHost  *int           `river:"max_idle_conns_per_host,attr,optional"`
	MaxConnsPerHost      *int           `river:"max_conns_per_host,attr,optional"`
	IdleConnTimeout      *time.Duration `river:"idle_conn_timeout,attr,optional"`
	DisableKeepAlives    bool           `river:"disable_keep_alives,attr,optional"`
	HTTP2ReadIdleTimeout time.Duration  `river:"http2_read_idle_timeout,attr,optional"`
	HTTP2PingTimeout     time.Duration  `river:"http2_ping_timeout,attr,optional"`

	// Auth is a binding to an otelcol.auth.* component extension which handles
	// authentication.
	Auth *auth.Handler `river:"auth,attr,optional"`
}

HTTPClientArguments holds shared HTTP settings for components which launch HTTP clients.

func (*HTTPClientArguments) Convert

func (args *HTTPClientArguments) Convert() *otelconfighttp.ClientConfig

Convert converts args into the upstream type.

func (*HTTPClientArguments) Extensions

func (args *HTTPClientArguments) Extensions() map[otelcomponent.ID]otelextension.Extension

Extensions exposes extensions used by args.

type HTTPServerArguments

type HTTPServerArguments struct {
	Endpoint string `river:"endpoint,attr,optional"`

	TLS *TLSServerArguments `river:"tls,block,optional"`

	CORS *CORSArguments `river:"cors,block,optional"`

	MaxRequestBodySize units.Base2Bytes `river:"max_request_body_size,attr,optional"`
	IncludeMetadata    bool             `river:"include_metadata,attr,optional"`
}

HTTPServerArguments holds shared settings for components which launch HTTP servers.

func (*HTTPServerArguments) Convert

func (args *HTTPServerArguments) Convert() *otelconfighttp.ServerConfig

Convert converts args into the upstream type.

type InstrumentationLibrary

type InstrumentationLibrary struct {
	Name string `river:"name,attr"`
	// version match
	//  expected actual  match
	//  nil      <blank> yes
	//  nil      1       yes
	//  <blank>  <blank> yes
	//  <blank>  1       no
	//  1        <blank> no
	//  1        1       yes
	Version *string `river:"version,attr,optional"`
}

InstrumentationLibrary specifies the instrumentation library and optional version to match against.

type KeepaliveClientArguments

type KeepaliveClientArguments struct {
	PingWait            time.Duration `river:"ping_wait,attr,optional"`
	PingResponseTimeout time.Duration `river:"ping_response_timeout,attr,optional"`
	PingWithoutStream   bool          `river:"ping_without_stream,attr,optional"`
}

KeepaliveClientArguments holds shared keepalive settings for components which launch clients.

func (*KeepaliveClientArguments) Convert

func (args *KeepaliveClientArguments) Convert() *otelconfiggrpc.KeepaliveClientConfig

Convert converts args into the upstream type.

type KeepaliveEnforcementPolicy

type KeepaliveEnforcementPolicy struct {
	MinTime             time.Duration `river:"min_time,attr,optional"`
	PermitWithoutStream bool          `river:"permit_without_stream,attr,optional"`
}

KeepaliveEnforcementPolicy holds shared keepalive settings for components which launch servers.

func (*KeepaliveEnforcementPolicy) Convert

func (args *KeepaliveEnforcementPolicy) Convert() *otelconfiggrpc.KeepaliveEnforcementPolicy

Convert converts args into the upstream type.

type KeepaliveServerArguments

type KeepaliveServerArguments struct {
	ServerParameters  *KeepaliveServerParamaters  `river:"server_parameters,block,optional"`
	EnforcementPolicy *KeepaliveEnforcementPolicy `river:"enforcement_policy,block,optional"`
}

KeepaliveServerArguments holds shared keepalive settings for components which launch servers.

func (*KeepaliveServerArguments) Convert

func (args *KeepaliveServerArguments) Convert() *otelconfiggrpc.KeepaliveServerConfig

Convert converts args into the upstream type.

type KeepaliveServerParamaters

type KeepaliveServerParamaters struct {
	MaxConnectionIdle     time.Duration `river:"max_connection_idle,attr,optional"`
	MaxConnectionAge      time.Duration `river:"max_connection_age,attr,optional"`
	MaxConnectionAgeGrace time.Duration `river:"max_connection_age_grace,attr,optional"`
	Time                  time.Duration `river:"time,attr,optional"`
	Timeout               time.Duration `river:"timeout,attr,optional"`
}

KeepaliveServerParamaters holds shared keepalive settings for components which launch servers.

func (*KeepaliveServerParamaters) Convert

func (args *KeepaliveServerParamaters) Convert() *otelconfiggrpc.KeepaliveServerParameters

Convert converts args into the upstream type.

type KubernetesAPIConfig

type KubernetesAPIConfig struct {
	// How to authenticate to the K8s API server.  This can be one of `none`
	// (for no auth), `serviceAccount` (to use the standard service account
	// token provided to the agent pod), or `kubeConfig` to use credentials
	// from `~/.kube/config`.
	AuthType string `river:"auth_type,attr,optional"`

	// When using auth_type `kubeConfig`, override the current context.
	Context string `river:"context,attr,optional"`
}

KubernetesAPIConfig contains options relevant to connecting to the K8s API

func (*KubernetesAPIConfig) Validate

func (c *KubernetesAPIConfig) Validate() error

Validate returns an error if the config is invalid.

type LogSeverityNumberMatchProperties

type LogSeverityNumberMatchProperties struct {
	// Min is the lowest severity that may be matched.
	// e.g. if this is plog.SeverityNumberInfo, INFO, WARN, ERROR, and FATAL logs will match.
	Min SeverityLevel `river:"min,attr"`

	// MatchUndefined controls whether logs with "undefined" severity matches.
	// If this is true, entries with undefined severity will match.
	MatchUndefined bool `river:"match_undefined,attr"`
}

LogSeverityNumberMatchProperties defines how to match based on a log record's SeverityNumber field.

type MatchConfig

type MatchConfig struct {
	Include *MatchProperties `river:"include,block,optional"`
	Exclude *MatchProperties `river:"exclude,block,optional"`
}

MatchConfig has two optional MatchProperties:

  1. 'include': to define what is processed by the processor.
  2. 'exclude': to define what is excluded from the processor.

If both 'include' and 'exclude' are specified, the 'include' properties are checked before the 'exclude' properties.

type MatchProperties

type MatchProperties struct {
	MatchType    string        `river:"match_type,attr"`
	RegexpConfig *RegexpConfig `river:"regexp,block,optional"`

	// Services specify the list of items to match service name against.
	// A match occurs if the span's service name matches at least one item in this list.
	Services []string `river:"services,attr,optional"`

	// SpanNames specify the list of items to match span name against.
	// A match occurs if the span name matches at least one item in this list.
	SpanNames []string `river:"span_names,attr,optional"`

	// LogBodies is a list of strings that the LogRecord's body field must match against.
	LogBodies []string `river:"log_bodies,attr,optional"`

	// LogSeverityTexts is a list of strings that the LogRecord's severity text field must match against.
	LogSeverityTexts []string `river:"log_severity_texts,attr,optional"`

	// LogSeverity defines how to match against a log record's SeverityNumber, if defined.
	LogSeverity *LogSeverityNumberMatchProperties `river:"log_severity,block,optional"`

	// MetricNames is a list of strings to match metric name against.
	// A match occurs if metric name matches at least one item in the list.
	MetricNames []string `river:"metric_names,attr,optional"`

	// Attributes specifies the list of attributes to match against.
	// All of these attributes must match exactly for a match to occur.
	// Only match_type=strict is allowed if "attributes" are specified.
	Attributes []Attribute `river:"attribute,block,optional"`

	// Resources specify the list of items to match the resources against.
	// A match occurs if the data's resources match at least one item in this list.
	Resources []Attribute `river:"resource,block,optional"`

	// Libraries specify the list of items to match the implementation library against.
	// A match occurs if the span's implementation library matches at least one item in this list.
	Libraries []InstrumentationLibrary `river:"library,block,optional"`

	// SpanKinds specify the list of items to match the span kind against.
	// A match occurs if the span's span kind matches at least one item in this list.
	SpanKinds []string `river:"span_kinds,attr,optional"`
}

MatchProperties specifies the set of properties in a spans/log/metric to match against and if the input data should be included or excluded from the processor.

func (*MatchProperties) Convert

func (args *MatchProperties) Convert() (map[string]interface{}, error)

Convert converts args into the upstream type.

type QueueArguments

type QueueArguments struct {
	Enabled      bool `river:"enabled,attr,optional"`
	NumConsumers int  `river:"num_consumers,attr,optional"`
	QueueSize    int  `river:"queue_size,attr,optional"`
}

QueueArguments holds shared settings for components which can queue requests.

func (*QueueArguments) Convert

func (args *QueueArguments) Convert() *otelexporterhelper.QueueSettings

Convert converts args into the upstream type.

func (*QueueArguments) SetToDefault

func (args *QueueArguments) SetToDefault()

SetToDefault implements river.Defaulter.

func (*QueueArguments) Validate

func (args *QueueArguments) Validate() error

Validate returns an error if args is invalid.

type RegexpConfig

type RegexpConfig struct {
	// CacheEnabled determines whether match results are LRU cached to make subsequent matches faster.
	// Cache size is unlimited unless CacheMaxNumEntries is also specified.
	CacheEnabled bool `river:"cache_enabled,attr,optional"`
	// CacheMaxNumEntries is the max number of entries of the LRU cache that stores match results.
	// CacheMaxNumEntries is ignored if CacheEnabled is false.
	CacheMaxNumEntries int `river:"cache_max_num_entries,attr,optional"`
}

type RetryArguments

type RetryArguments struct {
	Enabled             bool          `river:"enabled,attr,optional"`
	InitialInterval     time.Duration `river:"initial_interval,attr,optional"`
	RandomizationFactor float64       `river:"randomization_factor,attr,optional"`
	Multiplier          float64       `river:"multiplier,attr,optional"`
	MaxInterval         time.Duration `river:"max_interval,attr,optional"`
	MaxElapsedTime      time.Duration `river:"max_elapsed_time,attr,optional"`
}

RetryArguments holds shared settings for components which can retry requests.

func (*RetryArguments) Convert

func (args *RetryArguments) Convert() *configretry.BackOffConfig

Convert converts args into the upstream type.

func (*RetryArguments) SetToDefault

func (args *RetryArguments) SetToDefault()

SetToDefault implements river.Defaulter.

func (*RetryArguments) Validate

func (args *RetryArguments) Validate() error

Validate returns an error if args is invalid.

type ScraperControllerArguments

type ScraperControllerArguments struct {
	CollectionInterval time.Duration `river:"collection_interval,attr,optional"`
	InitialDelay       time.Duration `river:"initial_delay,attr,optional"`
	Timeout            time.Duration `river:"timeout,attr,optional"`
}

ScraperControllerArguments defines common settings for a scraper controller configuration.

func (*ScraperControllerArguments) Convert

func (args *ScraperControllerArguments) Convert() *scraperhelper.ScraperControllerSettings

Convert converts args into the upstream type.

func (*ScraperControllerArguments) SetToDefault

func (args *ScraperControllerArguments) SetToDefault()

SetToDefault implements river.Defaulter.

func (*ScraperControllerArguments) Validate

func (args *ScraperControllerArguments) Validate() error

Validate returns an error if args is invalid.

type SeverityLevel

type SeverityLevel string

func LookupSeverityNumber

func LookupSeverityNumber(num plog.SeverityNumber) (SeverityLevel, error)

func (*SeverityLevel) UnmarshalText

func (sl *SeverityLevel) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler for SeverityLevel.

type TLSClientArguments

type TLSClientArguments struct {
	TLSSetting TLSSetting `river:",squash"`

	Insecure           bool   `river:"insecure,attr,optional"`
	InsecureSkipVerify bool   `river:"insecure_skip_verify,attr,optional"`
	ServerName         string `river:"server_name,attr,optional"`
}

TLSClientArguments holds shared TLS settings for components which launch TLS clients.

func (*TLSClientArguments) Convert

func (args *TLSClientArguments) Convert() *otelconfigtls.TLSClientSetting

Convert converts args into the upstream type.

type TLSServerArguments

type TLSServerArguments struct {
	TLSSetting TLSSetting `river:",squash"`

	ClientCAFile string `river:"client_ca_file,attr,optional"`
}

TLSServerArguments holds shared TLS settings for components which launch servers with TLS.

func (*TLSServerArguments) Convert

func (args *TLSServerArguments) Convert() *otelconfigtls.TLSServerSetting

Convert converts args into the upstream type.

type TLSSetting

type TLSSetting struct {
	CA                       string            `river:"ca_pem,attr,optional"`
	CAFile                   string            `river:"ca_file,attr,optional"`
	Cert                     string            `river:"cert_pem,attr,optional"`
	CertFile                 string            `river:"cert_file,attr,optional"`
	Key                      rivertypes.Secret `river:"key_pem,attr,optional"`
	KeyFile                  string            `river:"key_file,attr,optional"`
	MinVersion               string            `river:"min_version,attr,optional"`
	MaxVersion               string            `river:"max_version,attr,optional"`
	ReloadInterval           time.Duration     `river:"reload_interval,attr,optional"`
	CipherSuites             []string          `river:"cipher_suites,attr,optional"`
	IncludeSystemCACertsPool bool              `river:"include_system_ca_certs_pool,attr,optional"`
}

func (*TLSSetting) Convert

func (args *TLSSetting) Convert() *otelconfigtls.TLSSetting

func (*TLSSetting) Validate

func (t *TLSSetting) Validate() error

Validate implements river.Validator.

Directories

Path Synopsis
Package auth provides utilities to create a Flow component from OpenTelemetry Collector authentication extensions.
Package auth provides utilities to create a Flow component from OpenTelemetry Collector authentication extensions.
Package connector exposes utilities to create a Flow component from OpenTelemetry Collector connectors.
Package connector exposes utilities to create a Flow component from OpenTelemetry Collector connectors.
Package exporter exposes utilities to create a Flow component from OpenTelemetry Collector exporters.
Package exporter exposes utilities to create a Flow component from OpenTelemetry Collector exporters.
Package extension provides utilities to create a Flow component from OpenTelemetry Collector extensions.
Package extension provides utilities to create a Flow component from OpenTelemetry Collector extensions.
internal
Package processor exposes utilities to create a Flow component from OpenTelemetry Collector processors.
Package processor exposes utilities to create a Flow component from OpenTelemetry Collector processors.
Package receiver utilities to create a Flow component from OpenTelemetry Collector receivers.
Package receiver utilities to create a Flow component from OpenTelemetry Collector receivers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳