dynataotlphttpexporter

package module
v0.0.0-...-0b06936 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

README

OTLP/HTTP Exporter

Status
Stability beta: logs
stable: traces, metrics
Distributions core, contrib
Issues Open issues Closed issues

Export traces and/or metrics via HTTP using OTLP format.

The following settings are required:

  • endpoint (no default): The target base URL to send data to (e.g.: https://example.com:4318). To send each signal a corresponding path will be added to this base URL, i.e. for traces "/v1/traces" will appended, for metrics "/v1/metrics" will be appended, for logs "/v1/logs" will be appended.

The following settings can be optionally configured:

  • traces_endpoint (no default): The target URL to send trace data to (e.g.: https://example.com:4318/v1/traces). If this setting is present the endpoint setting is ignored for traces.
  • metrics_endpoint (no default): The target URL to send metric data to (e.g.: https://example.com:4318/v1/metrics). If this setting is present the endpoint setting is ignored for metrics.
  • logs_endpoint (no default): The target URL to send log data to (e.g.: https://example.com:4318/v1/logs). If this setting is present the endpoint setting is ignored logs.
  • tls: see TLS Configuration Settings for the full set of available options.
  • timeout (default = 30s): HTTP request time limit. For details see https://golang.org/pkg/net/http/#Client
  • read_buffer_size (default = 0): ReadBufferSize for HTTP client.
  • write_buffer_size (default = 512 * 1024): WriteBufferSize for HTTP client.

Example:

exporters:
  otlphttp:
    endpoint: https://example.com:4318

By default gzip compression is enabled. See compression comparison for details benchmark information. To disable, configure as follows:

exporters:
  otlphttp:
    ...
    compression: none

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

Documentation

Overview

Package otlphttpexporter exports data by using the OTLP format to an HTTP endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableLocalAddress

func GetAvailableLocalAddress(t testing.TB) string

GetAvailableLocalAddress finds an available local port and returns an endpoint describing it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

func GetAvailableLocalAddressPrometheus

func GetAvailableLocalAddressPrometheus(t testing.TB) *config.Prometheus

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for OTLP exporter.

Types

type Config

type Config struct {
	confighttp.ClientConfig `mapstructure:",squash"`     // squash ensures fields are correctly decoded in embedded struct.
	QueueConfig             exporterhelper.QueueSettings `mapstructure:"sending_queue"`
	RetryConfig             configretry.BackOffConfig    `mapstructure:"retry_on_failure"`

	// The URL to send traces to. If omitted the Endpoint + "/v1/traces" will be used.
	TracesEndpoint string `mapstructure:"traces_endpoint"`

	// The URL to send metrics to. If omitted the Endpoint + "/v1/metrics" will be used.
	MetricsEndpoint string `mapstructure:"metrics_endpoint"`

	// The URL to send logs to. If omitted the Endpoint + "/v1/logs" will be used.
	LogsEndpoint string `mapstructure:"logs_endpoint"`

	// The encoding to export telemetry (default: "proto")
	Encoding EncodingType `mapstructure:"encoding"`
}

Config defines configuration for OTLP/HTTP exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

type EncodingType

type EncodingType string

EncodingType defines the type for content encoding

const (
	EncodingProto EncodingType = "proto"
	EncodingJSON  EncodingType = "json"
)

func (*EncodingType) UnmarshalText

func (e *EncodingType) UnmarshalText(text []byte) error

UnmarshalText unmarshalls text to an EncodingType.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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