elastic

package module
v0.0.0-...-217e745 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

README

Elastic Exporter for OpenTelemetry Collector

Documentation

Overview

Package elastic contains the core functionality for an OpenTelemetry Collector exporter for Elastic APM.

Package elastic contains an opentelemetry-collector exporter for Elastic APM.

Package elastic contains an opentelemetry-collector exporter for Elastic APM.

Package elastic contains an opentelemetry-collector exporter for Elastic APM.

Package elastic contains an opentelemetry-collector exporter for Elastic APM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// APMServerURLs holds the APM Server URL(s).
	//
	// This is required.
	APMServerURLs []string

	// APIKey holds an API Key for authorization.
	//
	// This is required if APM Server has API Key authorization enabled.
	//
	// https://www.elastic.co/guide/en/apm/server/7.7/api-key-settings.html
	APIKey string

	// HTTPClient holds an *http.Client to use for communicating with the
	// APM Server(s).
	//
	// This is optional, and a new http.Client will be constructed if
	// unspecified.
	HTTPClient *http.Client

	// Logger holds a logger for logging the exporter's internal behaviour.
	//
	// This is optional, and zap.NewNop() will be used if Logger is nil.
	Logger *zap.Logger

	// SecretToken holds the secret token for authorization.
	//
	// This is required if APM Server has secret token authorization enabled.
	//
	// https://www.elastic.co/guide/en/apm/server/7.7/secret-token.html
	SecretToken string
}

Config holds configuration for NewExporter.

func (Config) Validate

func (cfg Config) Validate() error

Validate validates the configuration.

type Exporter

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

Exporter is an Elastic APM exporter for OpenTelemetry Collector.

func NewExporter

func NewExporter(config Config) (*Exporter, error)

NewExporter creates a new Exporter with config.

func (*Exporter) PushMetricsData

func (e *Exporter) PushMetricsData(ctx context.Context, md MetricsData) (int, error)

PushMetricsData pushes metrics data to Elastic APM Server, returning the number of timeseries that were dropped along with any errors.

func (*Exporter) PushTraceData

func (e *Exporter) PushTraceData(ctx context.Context, td TraceData) (int, error)

PushTraceData pushes trace data to Elastic APM Server, returning the number of spans that were dropped along with any errors.

type MetricsData

type MetricsData struct {
	Node     *commonpb.Node
	Resource *resourcepb.Resource
	Metrics  []*metricspb.Metric
}

MetricsData is a struct that groups proto metrics with a unique node and a resource.

type TraceData

type TraceData struct {
	Node         *commonpb.Node
	Resource     *resourcepb.Resource
	Spans        []*tracepb.Span
	SourceFormat string
}

TraceData is a struct that groups proto spans with a unique node and a resource.

Notes

Bugs

  • apm-agent-go panics on marshalling if / status code is set but URL is not.

    c.model.HTTP = &c.http

Jump to

Keyboard shortcuts

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