resourcedetectionprocessor

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 13 Imported by: 23

README

Resource Detection Processor

Supported pipeline types: metrics, traces

The resource detection processor can be used to detect resource information from the host, in a format that conforms to the OpenTelemetry resource semantic conventions, and append or override the resource value in traces and metrics with this information.

Currently supported detectors include:

Configuration

# a list of resource detectors to run, valid options are: "env", "gce"
detectors: [ <string> ]
# determines if existing resource attributes should be overridden or preserved, defaults to true
override: <bool>

The full list of settings exposed for this extension are documented here with detailed sample configurations here.

Documentation

Overview

package resourcedetectionprocessor implements a processor for specifying resource labels to be added to OpenCensus trace data and metrics data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	configmodels.ProcessorSettings `mapstructure:",squash"`
	// Detectors is an ordered list of named detectors that should be
	// run to attempt to detect resource information.
	Detectors []string `mapstructure:"detectors"`
	// Timeout specifies the maximum amount of time that we will wait
	// before assuming a detector has failed. Defaults to 5s.
	Timeout time.Duration `mapstructure:"timeout"`
	// Override indicates whether any existing resource attributes
	// should be overridden or preserved. Defaults to true.
	Override bool `mapstructure:"override"`
}

Config defines configuration for Resource processor.

type Factory

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

Factory is the factory for resourcedetection processor.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new factory for resourcedetection processor.

func (*Factory) CreateDefaultConfig

func (*Factory) CreateDefaultConfig() configmodels.Processor

CreateDefaultConfig creates the default configuration for processor.

func (*Factory) CreateMetricsProcessor

func (f *Factory) CreateMetricsProcessor(
	ctx context.Context,
	params component.ProcessorCreateParams,
	nextConsumer consumer.MetricsConsumer,
	cfg configmodels.Processor,
) (component.MetricsProcessor, error)

CreateMetricsProcessor creates a metrics processor based on this config.

func (*Factory) CreateTraceProcessor

func (f *Factory) CreateTraceProcessor(
	ctx context.Context,
	params component.ProcessorCreateParams,
	nextConsumer consumer.TraceConsumer,
	cfg configmodels.Processor,
) (component.TraceProcessor, error)

CreateTraceProcessor creates a trace processor based on this config.

func (*Factory) Type

func (*Factory) Type() configmodels.Type

Type gets the type of the Option config created by this factory.

Directories

Path Synopsis
Package internal contains an interface for detecting resource information, and a provider to merge the resources returned by a slice of custom detectors.
Package internal contains an interface for detecting resource information, and a provider to merge the resources returned by a slice of custom detectors.
env
Package env provides a detector that loads resource information from the OTEL_RESOURCE environment variable.
Package env provides a detector that loads resource information from the OTEL_RESOURCE environment variable.
gcp/gce
Package gce provides a detector that loads resource information from the GCE metatdata
Package gce provides a detector that loads resource information from the GCE metatdata

Jump to

Keyboard shortcuts

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