resourceprocessor

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

Resource Processor

Supported pipeline types: metrics, traces

The resource processor can be used to override a resource. Please refer to config.go for the config spec.

The following configuration options are required:

  • type: Resource type to be applied. If specified, this value overrides the original resource type. Otherwise, the original resource type is kept.
  • labels: Map of key/value pairs that should be added to the resource.

Examples:

processors:
  resource:
    type: "host"
    labels: {
      "cloud.zone": "zone-1",
      "k8s.cluster.name": "k8s-cluster",
      "host.name": "k8s-node",
    }

Refer to config.yaml for detailed examples on using the processor.

Documentation

Overview

Package resourceprocessor 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"`
	// ResourceType overrides the original resource type.
	ResourceType string `mapstructure:"type"`
	// Labels specify static labels to be added to resource.
	// In case of a conflict the label will be overridden.
	Labels map[string]string `mapstructure:"labels"`
}

Config defines configuration for Resource processor.

type Factory

type Factory struct {
}

Factory is the factory for OpenCensus exporter.

func (Factory) CreateDefaultConfig

func (Factory) CreateDefaultConfig() configmodels.Processor

CreateDefaultConfig creates the default configuration for processor.

func (Factory) CreateMetricsProcessor

func (Factory) CreateMetricsProcessor(logger *zap.Logger, nextConsumer consumer.MetricsConsumerOld, cfg configmodels.Processor) (component.MetricsProcessorOld, error)

CreateMetricsProcessor creates a metrics processor based on this config.

func (Factory) CreateTraceProcessor

func (Factory) CreateTraceProcessor(logger *zap.Logger, nextConsumer consumer.TraceConsumerOld, cfg configmodels.Processor) (component.TraceProcessorOld, 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.

Jump to

Keyboard shortcuts

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