exporter

package module
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 307

README

General Information

An exporter defines how the pipeline data leaves the collector.

This repository hosts the following exporters available in traces, metrics and logs pipelines (sorted alphabetically):

The contrib repository has more exporters available in its builds.

Configuring Exporters

Exporters are configured via YAML under the top-level exporters tag.

The following is a sample configuration for the exampleexporter.

exporters:
  # Exporter 1.
  # <exporter type>:
  exampleexporter:
    # <setting one>: <value one>
    endpoint: 1.2.3.4:8080
    # ...
  # Exporter 2.
  # <exporter type>/<name>:
  exampleexporter/settings:
    # <setting two>: <value two>
    endpoint: 0.0.0.0:9211

An exporter instance is referenced by its full name in other parts of the config, such as in pipelines. A full name consists of the exporter type, '/' and the name appended to the exporter type in the configuration. All exporter full names must be unique.

For the example above:

  • Exporter 1 has full name exampleexporter.
  • Exporter 2 has full name exampleexporter/settings.

Exporters are enabled upon being added to a pipeline. For example:

service:
  pipelines:
    # Valid pipelines are: traces, metrics or logs
    # Trace pipeline 1.
    traces:
      receivers: [examplereceiver]
      processors: []
      exporters: [exampleexporter, exampleexporter/settings]
    # Trace pipeline 2.
    traces/another:
      receivers: [examplereceiver]
      processors: []
      exporters: [exampleexporter, exampleexporter/settings]

Data Ownership

When multiple exporters are configured to send the same data (e.g. by configuring multiple exporters for the same pipeline):

  • exporters not configured to mutate the data will have shared access to the data
  • exporters with the Capabilities to mutate the data will receive a copy of the data

Exporters access export data when ConsumeTraces/ConsumeMetrics/ConsumeLogs function is called. Unless exporter's capabalities include mutation, the exporter MUST NOT modify the pdata.Traces/pdata.Metrics/pdata.Logs argument of these functions. Any approach that does not mutate the original pdata.Traces/pdata.Metrics/pdata.Logs is allowed without the mutation capability.

Proxy Support

Beyond standard YAML configuration as outlined in the individual READMEs above, exporters that leverage the net/http package (all do today) also respect the following proxy environment variables:

  • HTTP_PROXY
  • HTTPS_PROXY
  • NO_PROXY

If set at Collector start time then exporters, regardless of protocol, will or will not proxy traffic as defined by these environment variables.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFactoryMap

func MakeFactoryMap(factories ...Factory) (map[component.Type]Factory, error)

MakeFactoryMap takes a list of factories and returns a map with Factory type as keys. It returns a non-nil error when there are factories with duplicate type.

Types

type CreateLogsFunc

type CreateLogsFunc func(context.Context, Settings, component.Config) (Logs, error)

CreateLogsFunc is the equivalent of Factory.CreateLogs.

func (CreateLogsFunc) CreateLogs added in v0.112.0

func (f CreateLogsFunc) CreateLogs(ctx context.Context, set Settings, cfg component.Config) (Logs, error)

CreateLogs implements Factory.CreateLogs.

type CreateMetricsFunc

type CreateMetricsFunc func(context.Context, Settings, component.Config) (Metrics, error)

CreateMetricsFunc is the equivalent of Factory.CreateMetrics.

func (CreateMetricsFunc) CreateMetrics added in v0.112.0

func (f CreateMetricsFunc) CreateMetrics(ctx context.Context, set Settings, cfg component.Config) (Metrics, error)

CreateMetrics implements Factory.CreateMetrics.

type CreateTracesFunc

type CreateTracesFunc func(context.Context, Settings, component.Config) (Traces, error)

CreateTracesFunc is the equivalent of Factory.CreateTraces.

func (CreateTracesFunc) CreateTraces added in v0.112.0

func (f CreateTracesFunc) CreateTraces(ctx context.Context, set Settings, cfg component.Config) (Traces, error)

CreateTraces implements Factory.CreateTraces.

type Factory

type Factory interface {
	component.Factory

	// CreateTraces creates a Traces exporter based on this config.
	// If the exporter type does not support tracing,
	// this function returns the error [pipeline.ErrSignalNotSupported].
	CreateTraces(ctx context.Context, set Settings, cfg component.Config) (Traces, error)

	// TracesStability gets the stability level of the Traces exporter.
	TracesStability() component.StabilityLevel

	// CreateMetrics creates a Metrics exporter based on this config.
	// If the exporter type does not support metrics,
	// this function returns the error [pipeline.ErrSignalNotSupported].
	CreateMetrics(ctx context.Context, set Settings, cfg component.Config) (Metrics, error)

	// MetricsStability gets the stability level of the Metrics exporter.
	MetricsStability() component.StabilityLevel

	// CreateLogs creates a Logs exporter based on the config.
	// If the exporter type does not support logs,
	// this function returns the error [pipeline.ErrSignalNotSupported].
	CreateLogs(ctx context.Context, set Settings, cfg component.Config) (Logs, error)

	// LogsStability gets the stability level of the Logs exporter.
	LogsStability() component.StabilityLevel
	// contains filtered or unexported methods
}

Factory is factory interface for exporters.

This interface cannot be directly implemented. Implementations must use the NewFactory to implement it.

func NewFactory

func NewFactory(cfgType component.Type, createDefaultConfig component.CreateDefaultConfigFunc, options ...FactoryOption) Factory

NewFactory returns a Factory.

type FactoryOption

type FactoryOption interface {
	// contains filtered or unexported methods
}

FactoryOption apply changes to Factory.

func WithLogs

func WithLogs(createLogs CreateLogsFunc, sl component.StabilityLevel) FactoryOption

WithLogs overrides the default "error not supported" implementation for Factory.CreateLogs and the default "undefined" stability level.

func WithMetrics

func WithMetrics(createMetrics CreateMetricsFunc, sl component.StabilityLevel) FactoryOption

WithMetrics overrides the default "error not supported" implementation for Factory.CreateMetrics and the default "undefined" stability level.

func WithTraces

func WithTraces(createTraces CreateTracesFunc, sl component.StabilityLevel) FactoryOption

WithTraces overrides the default "error not supported" implementation for Factory.CreateTraces and the default "undefined" stability level.

type Logs

type Logs interface {
	component.Component
	consumer.Logs
}

Logs is an exporter that can consume logs.

type Metrics

type Metrics interface {
	component.Component
	consumer.Metrics
}

Metrics is an exporter that can consume metrics.

type Settings added in v0.103.0

type Settings struct {
	// ID returns the ID of the component that will be created.
	ID component.ID

	component.TelemetrySettings

	// BuildInfo can be used by components for informational purposes
	BuildInfo component.BuildInfo
}

Settings configures exporter creators.

type Traces

type Traces interface {
	component.Component
	consumer.Traces
}

Traces is an exporter that can consume traces.

Directories

Path Synopsis
Package exporterhelper provides helper functions for exporters.
Package exporterhelper provides helper functions for exporters.
exportertest module
nopexporter module
otlpexporter module
xexporter module

Jump to

Keyboard shortcuts

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