Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a factory for the routing processor.
Types ¶
type AttributeSource ¶ added in v0.38.0
type AttributeSource string
type Config ¶
type Config struct {
// DefaultExporters contains the list of exporters to use when a more specific record can't be found in the routing table.
// Optional.
DefaultExporters []string `mapstructure:"default_exporters"`
// AttributeSource defines where the attribute defined in `from_attribute` is searched for.
// The allowed values are:
// - "context" - the attribute must exist in the incoming context
// - "resource" - the attribute must exist in resource attributes
// The default value is "context".
// Optional.
AttributeSource AttributeSource `mapstructure:"attribute_source"`
// FromAttribute contains the attribute name to look up the route value. This attribute should be part of the context propagated
// down from the previous receivers and/or processors. If all the receivers and processors are propagating the entire context correctly,
// this could be the HTTP/gRPC header from the original request/RPC. Typically, aggregation processors (batch, groupbytrace)
// will create a new context, so, those should be avoided when using this processor.Although the HTTP spec allows headers to be repeated,
// this processor will only use the first value.
// Required.
FromAttribute string `mapstructure:"from_attribute"`
// DropRoutingResourceAttribute controls whether to remove the resource attribute used for routing.
// This is only relevant if AttributeSource is set to resource.
// Optional.
DropRoutingResourceAttribute bool `mapstructure:"drop_resource_routing_attribute"`
// ErrorMode determines how the processor reacts to errors that occur while processing an OTTL condition.
// Valid values are `ignore` and `propagate`.
// `ignore` means the processor ignores errors returned by conditions and continues on to the next condition. This is the recommended mode.
// If `ignored` is used and a statement's condition has an error then the payload will be routed to the default exporter.
// `propagate` means the processor returns the error up the pipeline. This will result in the payload being dropped from the collector.
// The default value is `propagate`.
ErrorMode ottl.ErrorMode `mapstructure:"error_mode"`
// Table contains the routing table for this processor.
// Required.
Table []RoutingTableItem `mapstructure:"table"`
}
Config defines configuration for the Routing processor.
type RoutingTableItem ¶
type RoutingTableItem struct {
// Value represents a possible value for the field specified under FromAttribute.
// Required when Statement isn't provided.
Value string `mapstructure:"value"`
// Statement is a OTTL statement used for making a routing decision.
// Required when 'Value' isn't provided.
Statement string `mapstructure:"statement"`
// Exporters contains the list of exporters to use when the value from the FromAttribute field matches this table item.
// When no exporters are specified, the ones specified under DefaultExporters are used, if any.
// The routing processor will fail upon the first failure from these exporters.
// Optional.
Exporters []string `mapstructure:"exporters"`
}
RoutingTableItem specifies how data should be routed to the different exporters
Source Files
¶
Click to show internal directories.
Click to hide internal directories.