exporter

package
v0.2.6-test Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

General Information

An exporter is how data gets sent to different systems/back-ends. Generally, an exporter translates the internal format into another defined format.

Supported trace exporters (sorted alphabetically):

Supported metric exporters (sorted alphabetically):

Supported local exporters (sorted alphabetically):

The contributors repository has more exporters that can be added to custom builds of the Collector.

Proxy Support

Beyond standard YAML configuration as outlined in the sections that follow, 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.

Data Ownership

When multiple exporters are configured to send the same data (e.g. by configuring multiple exporters for the same pipeline) the exporters will have a shared access to the data. Exporters get access to this shared data when ConsumeTraceData/ConsumeMetricsData function is called. Exporters MUST NOT modify the TraceData/MetricsData argument of these functions. If the exporter needs to modify the data while performing the exporting the exporter can clone the data and perform the modification on the clone or use a copy-on-write approach for individual sub-parts of TraceData/MetricsData argument. Any approach that does not mutate the original TraceData/MetricsData argument (including referenced data, such as Node, Resource, Spans, etc) is allowed.

Trace Exporters

Jaeger Exporter

Exports trace data to Jaeger collectors accepting one of the following protocols:

Each different supported protocol has its own configuration settings.

gRPC

The following settings are required:

The following settings can be optionally configured:

  • cert_pem_file: certificate file for TLS credentials of gRPC client. Should only be used if secure is set to true.
  • keepalive: keepalive parameters for client gRPC. See grpc.WithKeepaliveParams().
  • secure: whether to enable client transport security for the exporter's gRPC connection. See grpc.WithInsecure().
  • server_name_override: If set to a non empty string, it will override the virtual host name of authority (e.g. :authority header field) in requests (typically used for testing).

Example:

exporters:
  jaeger_grpc:
    endpoint: jaeger-all-in-one:14250
    cert_pem_file: /my-cert.pem
    server_name_override: opentelemetry.io

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

Thrift HTTP

The following settings are required:

  • url (no default): target to which the exporter is going to send Jaeger trace data, using the Thrift HTTP protocol.

The following settings can be optionally configured:

  • timeout (default = 5s): the maximum time to wait for a HTTP request to complete
  • headers (no default): headers to be added to the HTTP request

Example:

exporters:
  jaeger:
    url: "http://some.other.location/api/traces"
    timeout: 2s
    headers:
      added-entry: "added value"
      dot.test: test

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

OpenCensus Exporter

Exports traces and/or metrics to another Collector via gRPC using OpenCensus format.

The following settings are required:

The following settings can be optionally configured:

  • cert_pem_file: certificate file for TLS credentials of gRPC client. Should only be used if secure is set to true.
  • compression: compression key for supported compression types within collector. Currently the only supported mode is gzip.
  • headers: the headers associated with gRPC requests.
  • keepalive: keepalive parameters for client gRPC. See grpc.WithKeepaliveParams().
  • num_workers (default = 2): number of workers that send the gRPC requests. Optional.
  • reconnection_delay: time period between each reconnection performed by the exporter.
  • secure: whether to enable client transport security for the exporter's gRPC connection. See grpc.WithInsecure().

Example:

exporters:
  opencensus:
    endpoint: localhost:14250
    reconnection_delay: 60s
    secure: false

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

Zipkin Exporter

Exports trace data to a Zipkin back-end.

The following settings are required:

  • format (default = JSON): The format to sent events in. Can be set to JSON or proto.
  • url (no default): URL to which the exporter is going to send Zipkin trace data.

The following settings can be optionally configured:

  • defaultservicename (no default): What to name services missing this information

Example:

exporters:
  zipkin:
    url: "http://some.url:9411/api/v2/spans"

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

OpenCensus Exporter

The OpenCensus exporter supports both traces and metrics. Configuration information can be found under the trace section here.

Prometheus Exporter

Exports metric data to a Prometheus back-end.

The following settings are required:

  • endpoint (no default): Where to send metric data

The following settings can be optionally configured:

  • constlabels (no default): key/values that are applied for every exported metric.
  • namespace (no default): if set, exports metrics under the provided value.

Example:

exporters:
  prometheus:
    endpoint: "1.2.3.4:1234"
    namespace: test-space
    const_labels:
      label1: value1
      "another label": spaced value

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

Local Exporters

Local exporters send data to a local endpoint such as the console or a log file.

File Exporter

This exporter will write the pipeline data to a JSON file. The data is written in Protobuf JSON encoding (https://developers.google.com/protocol-buffers/docs/proto3#json). Note that there are no compatibility guarantees for this format, since it just a dump of internal structures which can be changed over time. This intended for primarily for debugging Collector without setting up backends.

The following settings are required:

  • path (no default): where to write information.

Example:

exporters:
  file:
    path: ./filename.json

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

Logging Exporter

Exports traces and/or metrics to the console via zap.Logger.

The following settings can be configured:

  • loglevel: the log level of the logging export (debug|info|warn|error). Default is info.

Example:

exporters:
  logging:

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

Documentation

Overview

Package exporter contains interfaces that wraps trace/metrics exporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(factories ...Factory) (map[string]Factory, error)

Build takes a list of exporter factories and returns a map of type map[string]Factory with factory type as keys. It returns a non-nil error when more than one factories have the same type.

Types

type BaseFactory

type BaseFactory interface {
	// Type gets the type of the Exporter created by this factory.
	Type() string

	// CreateDefaultConfig creates the default configuration for the Exporter.
	// This method can be called multiple times depending on the pipeline
	// configuration and should not cause side-effects that prevent the creation
	// of multiple instances of the Exporter.
	// The object returned by this method needs to pass the checks implemented by
	// 'conifgcheck.ValidateConfig'. It is recommended to have such check in the
	// tests of any implementation of the Factory interface.
	CreateDefaultConfig() configmodels.Exporter
}

BaseFactory defines the common functions for all exporter factories.

type Exporter

type Exporter interface {
	component.Component
}

Exporter defines functions that trace and metric exporters must implement.

type Factory

type Factory interface {
	BaseFactory

	// CreateTraceExporter creates a trace exporter based on this config.
	CreateTraceExporter(logger *zap.Logger, cfg configmodels.Exporter) (TraceExporter, error)

	// CreateMetricsExporter creates a metrics exporter based on this config.
	CreateMetricsExporter(logger *zap.Logger, cfg configmodels.Exporter) (MetricsExporter, error)
}

Factory can create TraceExporter and MetricsExporter.

type MetricsExporter

type MetricsExporter interface {
	consumer.MetricsConsumer
	Exporter
}

MetricsExporter is a MetricsConsumer that is also an Exporter.

type OTLPFactory

type OTLPFactory interface {
	BaseFactory

	// CreateOTLPTraceReceiver creates a trace receiver based on this config.
	// If the receiver type does not support tracing or if the config is not valid
	// error will be returned instead.
	CreateOTLPTraceExporter(logger *zap.Logger, cfg configmodels.Exporter) (OTLPTraceExporter, error)
}

OTLPFactory can create OTLPTraceExporter and OTLPMetricsExporter. This is the new factory type that can create OTLP-based exporters.

type OTLPTraceExporter

type OTLPTraceExporter interface {
	consumer.OTLPTraceConsumer
	Exporter
}

OTLPTraceExporter is an OTLPTraceConsumer that is also an Exporter.

type TraceExporter

type TraceExporter interface {
	consumer.TraceConsumer
	Exporter
}

TraceExporter is a TraceConsumer that is also an Exporter.

Directories

Path Synopsis
jaeger
jaegergrpcexporter
Package jaegergrpcexporter implements an exporter that sends trace data to a Jaeger collector gRPC endpoint.
Package jaegergrpcexporter implements an exporter that sends trace data to a Jaeger collector gRPC endpoint.
jaegerthrifthttpexporter
Package jaegerthrifthttpexporter implements an exporter that sends trace data to a Jaeger collector Thrift over HTTP endpoint.
Package jaegerthrifthttpexporter implements an exporter that sends trace data to a Jaeger collector Thrift over HTTP endpoint.

Jump to

Keyboard shortcuts

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