otelconf

package module
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0, BSD-3-Clause Imports: 41 Imported by: 2

Documentation

Overview

Package otelconf provides an OpenTelemetry declarative configuration SDK.

Package otelconf can be used to parse a configuration file that follows the JSON Schema defined by the OpenTelemetry Configuration schema. Different versions of the schema are supported by the code in the directory that matches the version number of the schema. For example, the import go.opentelemetry.io/contrib/otelconf/v0.3.0 includes code that supports the v0.3.0 release of the configuration schema.

Example
package main

import (
	"context"
	"log"
	"os"
	"path/filepath"

	"go.opentelemetry.io/otel"
	"go.opentelemetry.io/otel/log/global"

	"go.opentelemetry.io/contrib/otelconf"
)

func main() {
	b, err := os.ReadFile(filepath.Join("testdata", "v1.0.0.yaml"))
	if err != nil {
		log.Fatal(err)
	}

	// Parse a configuration file into an OpenTelemetryConfiguration model.
	c, err := otelconf.ParseYAML(b)
	if err != nil {
		log.Fatal(err)
	}

	// Create SDK components with the parsed configuration.
	s, err := otelconf.NewSDK(otelconf.WithOpenTelemetryConfiguration(*c))
	if err != nil {
		log.Fatal(err)
	}

	// Ensure shutdown is eventually called for all components of the SDK.
	defer func() {
		if err := s.Shutdown(context.Background()); err != nil {
			log.Fatal(err)
		}
	}()

	// Set the global providers.
	otel.SetTracerProvider(s.TracerProvider())
	otel.SetMeterProvider(s.MeterProvider())
	global.SetLoggerProvider(s.LoggerProvider())
	// Set the global propagator.
	otel.SetTextMapPropagator(s.Propagator())
}

Index

Examples

Constants

View Source
const Version = "0.23.0"

Version is the current release version of the otelconf module.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation struct {
	// Configures the stream to collect data for the exponential histogram metric
	// point, which uses a base-2 exponential formula to determine bucket boundaries
	// and an integer scale parameter to control resolution. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation
	// for details.
	// If omitted, ignore.
	//
	Base2ExponentialBucketHistogram *Base2ExponentialBucketHistogramAggregation `` /* 172-byte string literal not displayed */

	// Configures the stream to use the instrument kind to select an aggregation and
	// advisory parameters to influence aggregation configuration parameters. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation
	// for details.
	// If omitted, ignore.
	//
	Default DefaultAggregation `json:"default,omitempty,omitzero" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Configures the stream to ignore/drop all instrument measurements. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#drop-aggregation
	// for details.
	// If omitted, ignore.
	//
	Drop DropAggregation `json:"drop,omitempty,omitzero" yaml:"drop,omitempty" mapstructure:"drop,omitempty"`

	// Configures the stream to collect data for the histogram metric point using a
	// set of explicit boundary values for histogram bucketing. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation
	// for details
	// If omitted, ignore.
	//
	ExplicitBucketHistogram *ExplicitBucketHistogramAggregation `` /* 145-byte string literal not displayed */

	// Configures the stream to collect data using the last measurement. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#last-value-aggregation
	// for details.
	// If omitted, ignore.
	//
	LastValue LastValueAggregation `json:"last_value,omitempty,omitzero" yaml:"last_value,omitempty" mapstructure:"last_value,omitempty"`

	// Configures the stream to collect the arithmetic sum of measurement values. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#sum-aggregation
	// for details.
	// If omitted, ignore.
	//
	Sum SumAggregation `json:"sum,omitempty,omitzero" yaml:"sum,omitempty" mapstructure:"sum,omitempty"`
}

type AlwaysOffSampler

type AlwaysOffSampler map[string]interface{}

type AlwaysOnSampler

type AlwaysOnSampler map[string]interface{}

type AttributeLimits

type AttributeLimits struct {
	// Configure max attribute count.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	AttributeCountLimit AttributeLimitsAttributeCountLimit `` /* 133-byte string literal not displayed */

	// Configure max attribute value size.
	// Value must be non-negative.
	// If omitted or null, there is no limit.
	//
	AttributeValueLengthLimit AttributeLimitsAttributeValueLengthLimit `` /* 154-byte string literal not displayed */
}

type AttributeLimitsAttributeCountLimit added in v0.21.0

type AttributeLimitsAttributeCountLimit *int

Configure max attribute count. Value must be non-negative. If omitted or null, 128 is used.

type AttributeLimitsAttributeValueLengthLimit added in v0.21.0

type AttributeLimitsAttributeValueLengthLimit *int

Configure max attribute value size. Value must be non-negative. If omitted or null, there is no limit.

type AttributeNameValue

type AttributeNameValue struct {
	// The attribute name.
	// Property is required and must be non-null.
	//
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// The attribute type.
	// Values include:
	// * bool: Boolean attribute value.
	// * bool_array: Boolean array attribute value.
	// * double: Double attribute value.
	// * double_array: Double array attribute value.
	// * int: Integer attribute value.
	// * int_array: Integer array attribute value.
	// * string: String attribute value.
	// * string_array: String array attribute value.
	// If omitted, string is used.
	//
	Type *AttributeType `json:"type,omitempty,omitzero" yaml:"type,omitempty" mapstructure:"type,omitempty"`

	// The attribute value.
	// The type of value must match .type.
	// Property is required and must be non-null.
	//
	Value interface{} `json:"value" yaml:"value" mapstructure:"value"`
}

func (*AttributeNameValue) UnmarshalJSON

func (j *AttributeNameValue) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*AttributeNameValue) UnmarshalYAML

func (j *AttributeNameValue) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type AttributeType

type AttributeType string
const AttributeTypeBool AttributeType = "bool"
const AttributeTypeBoolArray AttributeType = "bool_array"
const AttributeTypeDouble AttributeType = "double"
const AttributeTypeDoubleArray AttributeType = "double_array"
const AttributeTypeInt AttributeType = "int"
const AttributeTypeIntArray AttributeType = "int_array"
const AttributeTypeString AttributeType = "string"
const AttributeTypeStringArray AttributeType = "string_array"

func (*AttributeType) UnmarshalJSON

func (j *AttributeType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*AttributeType) UnmarshalYAML

func (j *AttributeType) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type B3MultiPropagator

type B3MultiPropagator map[string]interface{}

func (*B3MultiPropagator) UnmarshalJSON

func (j *B3MultiPropagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type B3Propagator

type B3Propagator map[string]interface{}

func (*B3Propagator) UnmarshalJSON

func (j *B3Propagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type BaggagePropagator

type BaggagePropagator map[string]interface{}

func (*BaggagePropagator) UnmarshalJSON

func (j *BaggagePropagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Base2ExponentialBucketHistogramAggregation

type Base2ExponentialBucketHistogramAggregation struct {
	// Configure the max scale factor.
	// If omitted or null, 20 is used.
	//
	MaxScale Base2ExponentialBucketHistogramAggregationMaxScale `json:"max_scale,omitempty,omitzero" yaml:"max_scale,omitempty" mapstructure:"max_scale,omitempty"`

	// Configure the maximum number of buckets in each of the positive and negative
	// ranges, not counting the special zero bucket.
	// If omitted or null, 160 is used.
	//
	MaxSize Base2ExponentialBucketHistogramAggregationMaxSize `json:"max_size,omitempty,omitzero" yaml:"max_size,omitempty" mapstructure:"max_size,omitempty"`

	// Configure whether or not to record min and max.
	// If omitted or null, true is used.
	//
	RecordMinMax Base2ExponentialBucketHistogramAggregationRecordMinMax `json:"record_min_max,omitempty,omitzero" yaml:"record_min_max,omitempty" mapstructure:"record_min_max,omitempty"`
}

type Base2ExponentialBucketHistogramAggregationMaxScale added in v0.21.0

type Base2ExponentialBucketHistogramAggregationMaxScale *int

Configure the max scale factor. If omitted or null, 20 is used.

type Base2ExponentialBucketHistogramAggregationMaxSize added in v0.21.0

type Base2ExponentialBucketHistogramAggregationMaxSize *int

Configure the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket. If omitted or null, 160 is used.

type Base2ExponentialBucketHistogramAggregationRecordMinMax added in v0.21.0

type Base2ExponentialBucketHistogramAggregationRecordMinMax *bool

Configure whether or not to record min and max. If omitted or null, true is used.

type BatchLogRecordProcessor

type BatchLogRecordProcessor struct {
	// Configure maximum allowed time (in milliseconds) to export data.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 30000 is used.
	//
	ExportTimeout BatchLogRecordProcessorExportTimeout `json:"export_timeout,omitempty,omitzero" yaml:"export_timeout,omitempty" mapstructure:"export_timeout,omitempty"`

	// Configure exporter.
	// Property is required and must be non-null.
	//
	Exporter LogRecordExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`

	// Configure maximum batch size. Value must be positive.
	// If omitted or null, 512 is used.
	//
	MaxExportBatchSize BatchLogRecordProcessorMaxExportBatchSize `` /* 133-byte string literal not displayed */

	// Configure maximum queue size. Value must be positive.
	// If omitted or null, 2048 is used.
	//
	MaxQueueSize BatchLogRecordProcessorMaxQueueSize `json:"max_queue_size,omitempty,omitzero" yaml:"max_queue_size,omitempty" mapstructure:"max_queue_size,omitempty"`

	// Configure delay interval (in milliseconds) between two consecutive exports.
	// Value must be non-negative.
	// If omitted or null, 1000 is used.
	//
	ScheduleDelay BatchLogRecordProcessorScheduleDelay `json:"schedule_delay,omitempty,omitzero" yaml:"schedule_delay,omitempty" mapstructure:"schedule_delay,omitempty"`
}

func (*BatchLogRecordProcessor) UnmarshalJSON

func (j *BatchLogRecordProcessor) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*BatchLogRecordProcessor) UnmarshalYAML

func (j *BatchLogRecordProcessor) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type BatchLogRecordProcessorExportTimeout added in v0.21.0

type BatchLogRecordProcessorExportTimeout *int

Configure maximum allowed time (in milliseconds) to export data. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 30000 is used.

type BatchLogRecordProcessorMaxExportBatchSize added in v0.21.0

type BatchLogRecordProcessorMaxExportBatchSize *int

Configure maximum batch size. Value must be positive. If omitted or null, 512 is used.

type BatchLogRecordProcessorMaxQueueSize added in v0.21.0

type BatchLogRecordProcessorMaxQueueSize *int

Configure maximum queue size. Value must be positive. If omitted or null, 2048 is used.

type BatchLogRecordProcessorScheduleDelay added in v0.21.0

type BatchLogRecordProcessorScheduleDelay *int

Configure delay interval (in milliseconds) between two consecutive exports. Value must be non-negative. If omitted or null, 1000 is used.

type BatchSpanProcessor

type BatchSpanProcessor struct {
	// Configure maximum allowed time (in milliseconds) to export data.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 30000 is used.
	//
	ExportTimeout BatchSpanProcessorExportTimeout `json:"export_timeout,omitempty,omitzero" yaml:"export_timeout,omitempty" mapstructure:"export_timeout,omitempty"`

	// Configure exporter.
	// Property is required and must be non-null.
	//
	Exporter SpanExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`

	// Configure maximum batch size. Value must be positive.
	// If omitted or null, 512 is used.
	//
	MaxExportBatchSize BatchSpanProcessorMaxExportBatchSize `` /* 133-byte string literal not displayed */

	// Configure maximum queue size. Value must be positive.
	// If omitted or null, 2048 is used.
	//
	MaxQueueSize BatchSpanProcessorMaxQueueSize `json:"max_queue_size,omitempty,omitzero" yaml:"max_queue_size,omitempty" mapstructure:"max_queue_size,omitempty"`

	// Configure delay interval (in milliseconds) between two consecutive exports.
	// Value must be non-negative.
	// If omitted or null, 5000 is used.
	//
	ScheduleDelay BatchSpanProcessorScheduleDelay `json:"schedule_delay,omitempty,omitzero" yaml:"schedule_delay,omitempty" mapstructure:"schedule_delay,omitempty"`
}

func (*BatchSpanProcessor) UnmarshalJSON

func (j *BatchSpanProcessor) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*BatchSpanProcessor) UnmarshalYAML

func (j *BatchSpanProcessor) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type BatchSpanProcessorExportTimeout added in v0.21.0

type BatchSpanProcessorExportTimeout *int

Configure maximum allowed time (in milliseconds) to export data. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 30000 is used.

type BatchSpanProcessorMaxExportBatchSize added in v0.21.0

type BatchSpanProcessorMaxExportBatchSize *int

Configure maximum batch size. Value must be positive. If omitted or null, 512 is used.

type BatchSpanProcessorMaxQueueSize added in v0.21.0

type BatchSpanProcessorMaxQueueSize *int

Configure maximum queue size. Value must be positive. If omitted or null, 2048 is used.

type BatchSpanProcessorScheduleDelay added in v0.21.0

type BatchSpanProcessorScheduleDelay *int

Configure delay interval (in milliseconds) between two consecutive exports. Value must be non-negative. If omitted or null, 5000 is used.

type CardinalityLimits

type CardinalityLimits struct {
	// Configure default cardinality limit for counter instruments.
	// If omitted or null, the value from .default is used.
	//
	Counter CardinalityLimitsCounter `json:"counter,omitempty,omitzero" yaml:"counter,omitempty" mapstructure:"counter,omitempty"`

	// Configure default cardinality limit for all instrument types.
	// Instrument-specific cardinality limits take priority.
	// If omitted or null, 2000 is used.
	//
	Default CardinalityLimitsDefault `json:"default,omitempty,omitzero" yaml:"default,omitempty" mapstructure:"default,omitempty"`

	// Configure default cardinality limit for gauge instruments.
	// If omitted or null, the value from .default is used.
	//
	Gauge CardinalityLimitsGauge `json:"gauge,omitempty,omitzero" yaml:"gauge,omitempty" mapstructure:"gauge,omitempty"`

	// Configure default cardinality limit for histogram instruments.
	// If omitted or null, the value from .default is used.
	//
	Histogram CardinalityLimitsHistogram `json:"histogram,omitempty,omitzero" yaml:"histogram,omitempty" mapstructure:"histogram,omitempty"`

	// Configure default cardinality limit for observable_counter instruments.
	// If omitted or null, the value from .default is used.
	//
	ObservableCounter CardinalityLimitsObservableCounter `json:"observable_counter,omitempty,omitzero" yaml:"observable_counter,omitempty" mapstructure:"observable_counter,omitempty"`

	// Configure default cardinality limit for observable_gauge instruments.
	// If omitted or null, the value from .default is used.
	//
	ObservableGauge CardinalityLimitsObservableGauge `json:"observable_gauge,omitempty,omitzero" yaml:"observable_gauge,omitempty" mapstructure:"observable_gauge,omitempty"`

	// Configure default cardinality limit for observable_up_down_counter instruments.
	// If omitted or null, the value from .default is used.
	//
	ObservableUpDownCounter CardinalityLimitsObservableUpDownCounter `` /* 148-byte string literal not displayed */

	// Configure default cardinality limit for up_down_counter instruments.
	// If omitted or null, the value from .default is used.
	//
	UpDownCounter CardinalityLimitsUpDownCounter `json:"up_down_counter,omitempty,omitzero" yaml:"up_down_counter,omitempty" mapstructure:"up_down_counter,omitempty"`
}

func (*CardinalityLimits) UnmarshalJSON

func (j *CardinalityLimits) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*CardinalityLimits) UnmarshalYAML

func (j *CardinalityLimits) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type CardinalityLimitsCounter added in v0.21.0

type CardinalityLimitsCounter *int

Configure default cardinality limit for counter instruments. If omitted or null, the value from .default is used.

type CardinalityLimitsDefault added in v0.21.0

type CardinalityLimitsDefault *int

Configure default cardinality limit for all instrument types. Instrument-specific cardinality limits take priority. If omitted or null, 2000 is used.

type CardinalityLimitsGauge added in v0.21.0

type CardinalityLimitsGauge *int

Configure default cardinality limit for gauge instruments. If omitted or null, the value from .default is used.

type CardinalityLimitsHistogram added in v0.21.0

type CardinalityLimitsHistogram *int

Configure default cardinality limit for histogram instruments. If omitted or null, the value from .default is used.

type CardinalityLimitsObservableCounter added in v0.21.0

type CardinalityLimitsObservableCounter *int

Configure default cardinality limit for observable_counter instruments. If omitted or null, the value from .default is used.

type CardinalityLimitsObservableGauge added in v0.21.0

type CardinalityLimitsObservableGauge *int

Configure default cardinality limit for observable_gauge instruments. If omitted or null, the value from .default is used.

type CardinalityLimitsObservableUpDownCounter added in v0.21.0

type CardinalityLimitsObservableUpDownCounter *int

Configure default cardinality limit for observable_up_down_counter instruments. If omitted or null, the value from .default is used.

type CardinalityLimitsUpDownCounter added in v0.21.0

type CardinalityLimitsUpDownCounter *int

Configure default cardinality limit for up_down_counter instruments. If omitted or null, the value from .default is used.

type ConfigurationOption

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

ConfigurationOption configures options for providers.

func WithContext

func WithContext(ctx context.Context) ConfigurationOption

WithContext sets the context.Context for the SDK.

func WithLoggerProviderOptions

func WithLoggerProviderOptions(opts ...sdklog.LoggerProviderOption) ConfigurationOption

WithLoggerProviderOptions appends LoggerProviderOptions used for constructing the LoggerProvider. OpenTelemetryConfiguration takes precedence over these options.

func WithMeterProviderOptions

func WithMeterProviderOptions(opts ...sdkmetric.Option) ConfigurationOption

WithMeterProviderOptions appends metric.Options used for constructing the MeterProvider. OpenTelemetryConfiguration takes precedence over these options.

func WithOpenTelemetryConfiguration

func WithOpenTelemetryConfiguration(cfg OpenTelemetryConfiguration) ConfigurationOption

WithOpenTelemetryConfiguration sets the OpenTelemetryConfiguration used to produce the SDK.

func WithTracerProviderOptions

func WithTracerProviderOptions(opts ...sdktrace.TracerProviderOption) ConfigurationOption

WithTracerProviderOptions appends TracerProviderOptions used for constructing the TracerProvider. OpenTelemetryConfiguration takes precedence over these options.

type ConsoleExporter

type ConsoleExporter map[string]interface{}

func (*ConsoleExporter) UnmarshalJSON

func (j *ConsoleExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ConsoleMetricExporter added in v0.21.0

type ConsoleMetricExporter struct {
	// Configure default histogram aggregation.
	// Values include:
	// * base2_exponential_bucket_histogram: Use base2 exponential histogram as the
	// default aggregation for histogram instruments.
	// * explicit_bucket_histogram: Use explicit bucket histogram as the default
	// aggregation for histogram instruments.
	// If omitted, explicit_bucket_histogram is used.
	//
	DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `` /* 157-byte string literal not displayed */

	// Configure temporality preference.
	// Values include:
	// * cumulative: Use cumulative aggregation temporality for all instrument types.
	// * delta: Use delta aggregation for all instrument types except up down counter
	// and asynchronous up down counter.
	// * low_memory: Use delta aggregation temporality for counter and histogram
	// instrument types. Use cumulative aggregation temporality for all other
	// instrument types.
	// If omitted, cumulative is used.
	//
	TemporalityPreference *ExporterTemporalityPreference `` /* 136-byte string literal not displayed */
}

type DefaultAggregation

type DefaultAggregation map[string]interface{}

type Distribution added in v0.21.0

type Distribution map[string]map[string]interface{}

type DropAggregation

type DropAggregation map[string]interface{}

type ExemplarFilter

type ExemplarFilter string
const ExemplarFilterAlwaysOff ExemplarFilter = "always_off"
const ExemplarFilterAlwaysOn ExemplarFilter = "always_on"
const ExemplarFilterTraceBased ExemplarFilter = "trace_based"

type ExplicitBucketHistogramAggregation

type ExplicitBucketHistogramAggregation struct {
	// Configure bucket boundaries.
	// If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500,
	// 10000] is used.
	//
	Boundaries []float64 `json:"boundaries,omitempty,omitzero" yaml:"boundaries,omitempty" mapstructure:"boundaries,omitempty"`

	// Configure record min and max.
	// If omitted or null, true is used.
	//
	RecordMinMax ExplicitBucketHistogramAggregationRecordMinMax `json:"record_min_max,omitempty,omitzero" yaml:"record_min_max,omitempty" mapstructure:"record_min_max,omitempty"`
}

type ExplicitBucketHistogramAggregationRecordMinMax added in v0.21.0

type ExplicitBucketHistogramAggregationRecordMinMax *bool

Configure record min and max. If omitted or null, true is used.

type ExporterDefaultHistogramAggregation

type ExporterDefaultHistogramAggregation string
const ExporterDefaultHistogramAggregationBase2ExponentialBucketHistogram ExporterDefaultHistogramAggregation = "base2_exponential_bucket_histogram"
const ExporterDefaultHistogramAggregationExplicitBucketHistogram ExporterDefaultHistogramAggregation = "explicit_bucket_histogram"

func (*ExporterDefaultHistogramAggregation) UnmarshalJSON

func (j *ExporterDefaultHistogramAggregation) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*ExporterDefaultHistogramAggregation) UnmarshalYAML

func (j *ExporterDefaultHistogramAggregation) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type ExporterTemporalityPreference

type ExporterTemporalityPreference string
const ExporterTemporalityPreferenceCumulative ExporterTemporalityPreference = "cumulative"
const ExporterTemporalityPreferenceDelta ExporterTemporalityPreference = "delta"
const ExporterTemporalityPreferenceLowMemory ExporterTemporalityPreference = "low_memory"

type GrpcTls added in v0.21.0

type GrpcTls struct {
	// Configure certificate used to verify a server's TLS credentials.
	// Absolute path to certificate file in PEM format.
	// If omitted or null, system default certificate verification is used for secure
	// connections.
	//
	CaFile GrpcTlsCaFile `json:"ca_file,omitempty,omitzero" yaml:"ca_file,omitempty" mapstructure:"ca_file,omitempty"`

	// Configure mTLS client certificate.
	// Absolute path to client certificate file in PEM format. If set, .client_key
	// must also be set.
	// If omitted or null, mTLS is not used.
	//
	CertFile GrpcTlsCertFile `json:"cert_file,omitempty,omitzero" yaml:"cert_file,omitempty" mapstructure:"cert_file,omitempty"`

	// Configure client transport security for the exporter's connection.
	// Only applicable when .endpoint is provided without http or https scheme.
	// Implementations may choose to ignore .insecure.
	// If omitted or null, false is used.
	//
	Insecure GrpcTlsInsecure `json:"insecure,omitempty,omitzero" yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"`

	// Configure mTLS private client key.
	// Absolute path to client key file in PEM format. If set, .client_certificate
	// must also be set.
	// If omitted or null, mTLS is not used.
	//
	KeyFile GrpcTlsKeyFile `json:"key_file,omitempty,omitzero" yaml:"key_file,omitempty" mapstructure:"key_file,omitempty"`
}

type GrpcTlsCaFile added in v0.21.0

type GrpcTlsCaFile *string

Configure certificate used to verify a server's TLS credentials. Absolute path to certificate file in PEM format. If omitted or null, system default certificate verification is used for secure connections.

type GrpcTlsCertFile added in v0.21.0

type GrpcTlsCertFile *string

Configure mTLS client certificate. Absolute path to client certificate file in PEM format. If set, .client_key must also be set. If omitted or null, mTLS is not used.

type GrpcTlsInsecure added in v0.21.0

type GrpcTlsInsecure *bool

Configure client transport security for the exporter's connection. Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. If omitted or null, false is used.

type GrpcTlsKeyFile added in v0.21.0

type GrpcTlsKeyFile *string

Configure mTLS private client key. Absolute path to client key file in PEM format. If set, .client_certificate must also be set. If omitted or null, mTLS is not used.

type HttpTls added in v0.21.0

type HttpTls struct {
	// Configure certificate used to verify a server's TLS credentials.
	// Absolute path to certificate file in PEM format.
	// If omitted or null, system default certificate verification is used for secure
	// connections.
	//
	CaFile HttpTlsCaFile `json:"ca_file,omitempty,omitzero" yaml:"ca_file,omitempty" mapstructure:"ca_file,omitempty"`

	// Configure mTLS client certificate.
	// Absolute path to client certificate file in PEM format. If set, .client_key
	// must also be set.
	// If omitted or null, mTLS is not used.
	//
	CertFile HttpTlsCertFile `json:"cert_file,omitempty,omitzero" yaml:"cert_file,omitempty" mapstructure:"cert_file,omitempty"`

	// Configure mTLS private client key.
	// Absolute path to client key file in PEM format. If set, .client_certificate
	// must also be set.
	// If omitted or null, mTLS is not used.
	//
	KeyFile HttpTlsKeyFile `json:"key_file,omitempty,omitzero" yaml:"key_file,omitempty" mapstructure:"key_file,omitempty"`
}

type HttpTlsCaFile added in v0.21.0

type HttpTlsCaFile *string

Configure certificate used to verify a server's TLS credentials. Absolute path to certificate file in PEM format. If omitted or null, system default certificate verification is used for secure connections.

type HttpTlsCertFile added in v0.21.0

type HttpTlsCertFile *string

Configure mTLS client certificate. Absolute path to client certificate file in PEM format. If set, .client_key must also be set. If omitted or null, mTLS is not used.

type HttpTlsKeyFile added in v0.21.0

type HttpTlsKeyFile *string

Configure mTLS private client key. Absolute path to client key file in PEM format. If set, .client_certificate must also be set. If omitted or null, mTLS is not used.

type IncludeExclude

type IncludeExclude struct {
	// Configure list of value patterns to exclude. Applies after .included (i.e.
	// excluded has higher priority than included).
	// Values are evaluated to match as follows:
	//  * If the value exactly matches.
	//  * If the value matches the wildcard pattern, where '?' matches any single
	// character and '*' matches any number of characters including none.
	// If omitted, .included attributes are included.
	//
	Excluded []string `json:"excluded,omitempty,omitzero" yaml:"excluded,omitempty" mapstructure:"excluded,omitempty"`

	// Configure list of value patterns to include.
	// Values are evaluated to match as follows:
	//  * If the value exactly matches.
	//  * If the value matches the wildcard pattern, where '?' matches any single
	// character and '*' matches any number of characters including none.
	// If omitted, all values are included.
	//
	Included []string `json:"included,omitempty,omitzero" yaml:"included,omitempty" mapstructure:"included,omitempty"`
}

type InstrumentType

type InstrumentType string
const InstrumentTypeCounter InstrumentType = "counter"
const InstrumentTypeGauge InstrumentType = "gauge"
const InstrumentTypeHistogram InstrumentType = "histogram"
const InstrumentTypeObservableCounter InstrumentType = "observable_counter"
const InstrumentTypeObservableGauge InstrumentType = "observable_gauge"
const InstrumentTypeObservableUpDownCounter InstrumentType = "observable_up_down_counter"
const InstrumentTypeUpDownCounter InstrumentType = "up_down_counter"

func (*InstrumentType) UnmarshalJSON

func (j *InstrumentType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*InstrumentType) UnmarshalYAML

func (j *InstrumentType) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type JaegerPropagator

type JaegerPropagator map[string]interface{}

func (*JaegerPropagator) UnmarshalJSON

func (j *JaegerPropagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LastValueAggregation

type LastValueAggregation map[string]interface{}

type LogRecordExporter

type LogRecordExporter struct {
	// Configure exporter to be console.
	// If omitted, ignore.
	//
	Console ConsoleExporter `json:"console,omitempty,omitzero" yaml:"console,omitempty" mapstructure:"console,omitempty"`

	// Configure exporter to be OTLP with gRPC transport.
	// If omitted, ignore.
	//
	OTLPGrpc *OTLPGrpcExporter `json:"otlp_grpc,omitempty,omitzero" yaml:"otlp_grpc,omitempty" mapstructure:"otlp_grpc,omitempty"`

	// Configure exporter to be OTLP with HTTP transport.
	// If omitted, ignore.
	//
	OTLPHttp *OTLPHttpExporter `json:"otlp_http,omitempty,omitzero" yaml:"otlp_http,omitempty" mapstructure:"otlp_http,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func (*LogRecordExporter) UnmarshalJSON

func (j *LogRecordExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*LogRecordExporter) UnmarshalYAML

func (j *LogRecordExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type LogRecordLimits

type LogRecordLimits struct {
	// Configure max attribute count. Overrides
	// .attribute_limits.attribute_count_limit.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	AttributeCountLimit LogRecordLimitsAttributeCountLimit `` /* 133-byte string literal not displayed */

	// Configure max attribute value size. Overrides
	// .attribute_limits.attribute_value_length_limit.
	// Value must be non-negative.
	// If omitted or null, there is no limit.
	//
	AttributeValueLengthLimit LogRecordLimitsAttributeValueLengthLimit `` /* 154-byte string literal not displayed */
}

type LogRecordLimitsAttributeCountLimit added in v0.21.0

type LogRecordLimitsAttributeCountLimit *int

Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. Value must be non-negative. If omitted or null, 128 is used.

type LogRecordLimitsAttributeValueLengthLimit added in v0.21.0

type LogRecordLimitsAttributeValueLengthLimit *int

Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. Value must be non-negative. If omitted or null, there is no limit.

type LogRecordProcessor

type LogRecordProcessor struct {
	// Configure a batch log record processor.
	// If omitted, ignore.
	//
	Batch *BatchLogRecordProcessor `json:"batch,omitempty,omitzero" yaml:"batch,omitempty" mapstructure:"batch,omitempty"`

	// Configure a simple log record processor.
	// If omitted, ignore.
	//
	Simple *SimpleLogRecordProcessor `json:"simple,omitempty,omitzero" yaml:"simple,omitempty" mapstructure:"simple,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

type LoggerProvider added in v0.21.0

type LoggerProvider struct {
	// Configure log record limits. See also attribute_limits.
	// If omitted, default values as described in LogRecordLimits are used.
	//
	Limits *LogRecordLimits `json:"limits,omitempty,omitzero" yaml:"limits,omitempty" mapstructure:"limits,omitempty"`

	// Configure log record processors.
	// Property is required and must be non-null.
	//
	Processors []LogRecordProcessor `json:"processors" yaml:"processors" mapstructure:"processors"`
}

type MeterProvider added in v0.21.0

type MeterProvider struct {
	// Configure the exemplar filter.
	// Values include:
	// * always_off: ExemplarFilter which makes no measurements eligible for being an
	// Exemplar.
	// * always_on: ExemplarFilter which makes all measurements eligible for being an
	// Exemplar.
	// * trace_based: ExemplarFilter which makes measurements recorded in the context
	// of a sampled parent span eligible for being an Exemplar.
	// If omitted, trace_based is used.
	//
	ExemplarFilter *ExemplarFilter `json:"exemplar_filter,omitempty,omitzero" yaml:"exemplar_filter,omitempty" mapstructure:"exemplar_filter,omitempty"`

	// Configure metric readers.
	// Property is required and must be non-null.
	//
	Readers []MetricReader `json:"readers" yaml:"readers" mapstructure:"readers"`

	// Configure views.
	// Each view has a selector which determines the instrument(s) it applies to, and
	// a configuration for the resulting stream(s).
	// If omitted, no views are registered.
	//
	Views []View `json:"views,omitempty,omitzero" yaml:"views,omitempty" mapstructure:"views,omitempty"`
}

type MetricProducer

type MetricProducer struct {
	// Configure metric producer to be opencensus.
	// If omitted, ignore.
	//
	Opencensus OpenCensusMetricProducer `json:"opencensus,omitempty,omitzero" yaml:"opencensus,omitempty" mapstructure:"opencensus,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func (*MetricProducer) UnmarshalJSON

func (j *MetricProducer) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*MetricProducer) UnmarshalYAML

func (j *MetricProducer) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type MetricReader

type MetricReader struct {
	// Configure a periodic metric reader.
	// If omitted, ignore.
	//
	Periodic *PeriodicMetricReader `json:"periodic,omitempty,omitzero" yaml:"periodic,omitempty" mapstructure:"periodic,omitempty"`

	// Configure a pull based metric reader.
	// If omitted, ignore.
	//
	Pull *PullMetricReader `json:"pull,omitempty,omitzero" yaml:"pull,omitempty" mapstructure:"pull,omitempty"`
}

type NameStringValuePair

type NameStringValuePair struct {
	// The name of the pair.
	// Property is required and must be non-null.
	//
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// The value of the pair.
	// Property must be present, but if null the behavior is dependent on usage
	// context.
	//
	Value NameStringValuePairValue `json:"value" yaml:"value" mapstructure:"value"`
}

func (*NameStringValuePair) UnmarshalJSON

func (j *NameStringValuePair) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*NameStringValuePair) UnmarshalYAML

func (j *NameStringValuePair) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type NameStringValuePairValue added in v0.21.0

type NameStringValuePairValue *string

The value of the pair. Property must be present, but if null the behavior is dependent on usage context.

type OTLPGrpcExporter

type OTLPGrpcExporter struct {
	// Configure compression.
	// Known values include: gzip, none. Implementations may support other compression
	// algorithms.
	// If omitted or null, none is used.
	//
	Compression OTLPGrpcExporterCompression `json:"compression,omitempty,omitzero" yaml:"compression,omitempty" mapstructure:"compression,omitempty"`

	// Configure endpoint.
	// If omitted or null, http://localhost:4317 is used.
	//
	Endpoint OTLPGrpcExporterEndpoint `json:"endpoint,omitempty,omitzero" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`

	// Configure headers. Entries have higher priority than entries from
	// .headers_list.
	// If an entry's .value is null, the entry is ignored.
	// If omitted, no headers are added.
	//
	Headers []NameStringValuePair `json:"headers,omitempty,omitzero" yaml:"headers,omitempty" mapstructure:"headers,omitempty"`

	// Configure headers. Entries have lower priority than entries from .headers.
	// The value is a list of comma separated key-value pairs matching the format of
	// OTEL_EXPORTER_OTLP_HEADERS. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options
	// for details.
	// If omitted or null, no headers are added.
	//
	HeadersList OTLPGrpcExporterHeadersList `json:"headers_list,omitempty,omitzero" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"`

	// Configure max time (in milliseconds) to wait for each export.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 10000 is used.
	//
	Timeout OTLPGrpcExporterTimeout `json:"timeout,omitempty,omitzero" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"`

	// Configure TLS settings for the exporter.
	// If omitted, system default TLS settings are used.
	//
	Tls *GrpcTls `json:"tls,omitempty,omitzero" yaml:"tls,omitempty" mapstructure:"tls,omitempty"`
}

func (*OTLPGrpcExporter) UnmarshalJSON

func (j *OTLPGrpcExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*OTLPGrpcExporter) UnmarshalYAML

func (j *OTLPGrpcExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type OTLPGrpcExporterCompression added in v0.21.0

type OTLPGrpcExporterCompression *string

Configure compression. Known values include: gzip, none. Implementations may support other compression algorithms. If omitted or null, none is used.

type OTLPGrpcExporterEndpoint added in v0.21.0

type OTLPGrpcExporterEndpoint *string

Configure endpoint. If omitted or null, http://localhost:4317 is used.

type OTLPGrpcExporterHeadersList added in v0.21.0

type OTLPGrpcExporterHeadersList *string

Configure headers. Entries have lower priority than entries from .headers. The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. If omitted or null, no headers are added.

type OTLPGrpcExporterTimeout added in v0.21.0

type OTLPGrpcExporterTimeout *int

Configure max time (in milliseconds) to wait for each export. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 10000 is used.

type OTLPGrpcMetricExporter

type OTLPGrpcMetricExporter struct {
	// Configure compression.
	// Known values include: gzip, none. Implementations may support other compression
	// algorithms.
	// If omitted or null, none is used.
	//
	Compression OTLPGrpcMetricExporterCompression `json:"compression,omitempty,omitzero" yaml:"compression,omitempty" mapstructure:"compression,omitempty"`

	// Configure default histogram aggregation.
	// Values include:
	// * base2_exponential_bucket_histogram: Use base2 exponential histogram as the
	// default aggregation for histogram instruments.
	// * explicit_bucket_histogram: Use explicit bucket histogram as the default
	// aggregation for histogram instruments.
	// If omitted, explicit_bucket_histogram is used.
	//
	DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `` /* 157-byte string literal not displayed */

	// Configure endpoint.
	// If omitted or null, http://localhost:4317 is used.
	//
	Endpoint OTLPGrpcMetricExporterEndpoint `json:"endpoint,omitempty,omitzero" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`

	// Configure headers. Entries have higher priority than entries from
	// .headers_list.
	// If an entry's .value is null, the entry is ignored.
	// If omitted, no headers are added.
	//
	Headers []NameStringValuePair `json:"headers,omitempty,omitzero" yaml:"headers,omitempty" mapstructure:"headers,omitempty"`

	// Configure headers. Entries have lower priority than entries from .headers.
	// The value is a list of comma separated key-value pairs matching the format of
	// OTEL_EXPORTER_OTLP_HEADERS. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options
	// for details.
	// If omitted or null, no headers are added.
	//
	HeadersList OTLPGrpcMetricExporterHeadersList `json:"headers_list,omitempty,omitzero" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"`

	// Configure temporality preference.
	// Values include:
	// * cumulative: Use cumulative aggregation temporality for all instrument types.
	// * delta: Use delta aggregation for all instrument types except up down counter
	// and asynchronous up down counter.
	// * low_memory: Use delta aggregation temporality for counter and histogram
	// instrument types. Use cumulative aggregation temporality for all other
	// instrument types.
	// If omitted, cumulative is used.
	//
	TemporalityPreference *ExporterTemporalityPreference `` /* 136-byte string literal not displayed */

	// Configure max time (in milliseconds) to wait for each export.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 10000 is used.
	//
	Timeout OTLPGrpcMetricExporterTimeout `json:"timeout,omitempty,omitzero" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"`

	// Configure TLS settings for the exporter.
	// If omitted, system default TLS settings are used.
	//
	Tls *GrpcTls `json:"tls,omitempty,omitzero" yaml:"tls,omitempty" mapstructure:"tls,omitempty"`
}

func (*OTLPGrpcMetricExporter) UnmarshalJSON

func (j *OTLPGrpcMetricExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*OTLPGrpcMetricExporter) UnmarshalYAML

func (j *OTLPGrpcMetricExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type OTLPGrpcMetricExporterCompression added in v0.21.0

type OTLPGrpcMetricExporterCompression *string

Configure compression. Known values include: gzip, none. Implementations may support other compression algorithms. If omitted or null, none is used.

type OTLPGrpcMetricExporterEndpoint added in v0.21.0

type OTLPGrpcMetricExporterEndpoint *string

Configure endpoint. If omitted or null, http://localhost:4317 is used.

type OTLPGrpcMetricExporterHeadersList added in v0.21.0

type OTLPGrpcMetricExporterHeadersList *string

Configure headers. Entries have lower priority than entries from .headers. The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. If omitted or null, no headers are added.

type OTLPGrpcMetricExporterTimeout added in v0.21.0

type OTLPGrpcMetricExporterTimeout *int

Configure max time (in milliseconds) to wait for each export. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 10000 is used.

type OTLPHttpEncoding

type OTLPHttpEncoding string
const OTLPHttpEncodingJson OTLPHttpEncoding = "json"
const OTLPHttpEncodingProtobuf OTLPHttpEncoding = "protobuf"

type OTLPHttpExporter

type OTLPHttpExporter struct {
	// Configure compression.
	// Known values include: gzip, none. Implementations may support other compression
	// algorithms.
	// If omitted or null, none is used.
	//
	Compression OTLPHttpExporterCompression `json:"compression,omitempty,omitzero" yaml:"compression,omitempty" mapstructure:"compression,omitempty"`

	// Configure the encoding used for messages.
	// Implementations may not support json.
	// Values include:
	// * json: Protobuf JSON encoding.
	// * protobuf: Protobuf binary encoding.
	// If omitted, protobuf is used.
	//
	Encoding *OTLPHttpEncoding `json:"encoding,omitempty,omitzero" yaml:"encoding,omitempty" mapstructure:"encoding,omitempty"`

	// Configure endpoint, including the signal specific path.
	// If omitted or null, the http://localhost:4318/v1/{signal} (where signal is
	// 'traces', 'logs', or 'metrics') is used.
	//
	Endpoint OTLPHttpExporterEndpoint `json:"endpoint,omitempty,omitzero" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`

	// Configure headers. Entries have higher priority than entries from
	// .headers_list.
	// If an entry's .value is null, the entry is ignored.
	// If omitted, no headers are added.
	//
	Headers []NameStringValuePair `json:"headers,omitempty,omitzero" yaml:"headers,omitempty" mapstructure:"headers,omitempty"`

	// Configure headers. Entries have lower priority than entries from .headers.
	// The value is a list of comma separated key-value pairs matching the format of
	// OTEL_EXPORTER_OTLP_HEADERS. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options
	// for details.
	// If omitted or null, no headers are added.
	//
	HeadersList OTLPHttpExporterHeadersList `json:"headers_list,omitempty,omitzero" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"`

	// Configure max time (in milliseconds) to wait for each export.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 10000 is used.
	//
	Timeout OTLPHttpExporterTimeout `json:"timeout,omitempty,omitzero" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"`

	// Configure TLS settings for the exporter.
	// If omitted, system default TLS settings are used.
	//
	Tls *HttpTls `json:"tls,omitempty,omitzero" yaml:"tls,omitempty" mapstructure:"tls,omitempty"`
}

func (*OTLPHttpExporter) UnmarshalJSON

func (j *OTLPHttpExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*OTLPHttpExporter) UnmarshalYAML

func (j *OTLPHttpExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type OTLPHttpExporterCompression added in v0.21.0

type OTLPHttpExporterCompression *string

Configure compression. Known values include: gzip, none. Implementations may support other compression algorithms. If omitted or null, none is used.

type OTLPHttpExporterEndpoint added in v0.21.0

type OTLPHttpExporterEndpoint *string

Configure endpoint, including the signal specific path. If omitted or null, the http://localhost:4318/v1/{signal} (where signal is 'traces', 'logs', or 'metrics') is used.

type OTLPHttpExporterHeadersList added in v0.21.0

type OTLPHttpExporterHeadersList *string

Configure headers. Entries have lower priority than entries from .headers. The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. If omitted or null, no headers are added.

type OTLPHttpExporterTimeout added in v0.21.0

type OTLPHttpExporterTimeout *int

Configure max time (in milliseconds) to wait for each export. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 10000 is used.

type OTLPHttpMetricExporter

type OTLPHttpMetricExporter struct {
	// Configure compression.
	// Known values include: gzip, none. Implementations may support other compression
	// algorithms.
	// If omitted or null, none is used.
	//
	Compression OTLPHttpMetricExporterCompression `json:"compression,omitempty,omitzero" yaml:"compression,omitempty" mapstructure:"compression,omitempty"`

	// Configure default histogram aggregation.
	// Values include:
	// * base2_exponential_bucket_histogram: Use base2 exponential histogram as the
	// default aggregation for histogram instruments.
	// * explicit_bucket_histogram: Use explicit bucket histogram as the default
	// aggregation for histogram instruments.
	// If omitted, explicit_bucket_histogram is used.
	//
	DefaultHistogramAggregation *ExporterDefaultHistogramAggregation `` /* 157-byte string literal not displayed */

	// Configure the encoding used for messages.
	// Implementations may not support json.
	// Values include:
	// * json: Protobuf JSON encoding.
	// * protobuf: Protobuf binary encoding.
	// If omitted, protobuf is used.
	//
	Encoding *OTLPHttpEncoding `json:"encoding,omitempty,omitzero" yaml:"encoding,omitempty" mapstructure:"encoding,omitempty"`

	// Configure endpoint.
	// If omitted or null, http://localhost:4318/v1/metrics is used.
	//
	Endpoint OTLPHttpMetricExporterEndpoint `json:"endpoint,omitempty,omitzero" yaml:"endpoint,omitempty" mapstructure:"endpoint,omitempty"`

	// Configure headers. Entries have higher priority than entries from
	// .headers_list.
	// If an entry's .value is null, the entry is ignored.
	// If omitted, no headers are added.
	//
	Headers []NameStringValuePair `json:"headers,omitempty,omitzero" yaml:"headers,omitempty" mapstructure:"headers,omitempty"`

	// Configure headers. Entries have lower priority than entries from .headers.
	// The value is a list of comma separated key-value pairs matching the format of
	// OTEL_EXPORTER_OTLP_HEADERS. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options
	// for details.
	// If omitted or null, no headers are added.
	//
	HeadersList OTLPHttpMetricExporterHeadersList `json:"headers_list,omitempty,omitzero" yaml:"headers_list,omitempty" mapstructure:"headers_list,omitempty"`

	// Configure temporality preference.
	// Values include:
	// * cumulative: Use cumulative aggregation temporality for all instrument types.
	// * delta: Use delta aggregation for all instrument types except up down counter
	// and asynchronous up down counter.
	// * low_memory: Use delta aggregation temporality for counter and histogram
	// instrument types. Use cumulative aggregation temporality for all other
	// instrument types.
	// If omitted, cumulative is used.
	//
	TemporalityPreference *ExporterTemporalityPreference `` /* 136-byte string literal not displayed */

	// Configure max time (in milliseconds) to wait for each export.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 10000 is used.
	//
	Timeout OTLPHttpMetricExporterTimeout `json:"timeout,omitempty,omitzero" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"`

	// Configure TLS settings for the exporter.
	// If omitted, system default TLS settings are used.
	//
	Tls *HttpTls `json:"tls,omitempty,omitzero" yaml:"tls,omitempty" mapstructure:"tls,omitempty"`
}

func (*OTLPHttpMetricExporter) UnmarshalJSON

func (j *OTLPHttpMetricExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*OTLPHttpMetricExporter) UnmarshalYAML

func (j *OTLPHttpMetricExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type OTLPHttpMetricExporterCompression added in v0.21.0

type OTLPHttpMetricExporterCompression *string

Configure compression. Known values include: gzip, none. Implementations may support other compression algorithms. If omitted or null, none is used.

type OTLPHttpMetricExporterEndpoint added in v0.21.0

type OTLPHttpMetricExporterEndpoint *string

Configure endpoint. If omitted or null, http://localhost:4318/v1/metrics is used.

type OTLPHttpMetricExporterHeadersList added in v0.21.0

type OTLPHttpMetricExporterHeadersList *string

Configure headers. Entries have lower priority than entries from .headers. The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. If omitted or null, no headers are added.

type OTLPHttpMetricExporterTimeout added in v0.21.0

type OTLPHttpMetricExporterTimeout *int

Configure max time (in milliseconds) to wait for each export. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 10000 is used.

type OpenCensusMetricProducer

type OpenCensusMetricProducer map[string]interface{}

type OpenTelemetryConfiguration

type OpenTelemetryConfiguration struct {
	// Configure general attribute limits. See also tracer_provider.limits,
	// logger_provider.limits.
	// If omitted, default values as described in AttributeLimits are used.
	//
	AttributeLimits *AttributeLimits `json:"attribute_limits,omitempty,omitzero" yaml:"attribute_limits,omitempty" mapstructure:"attribute_limits,omitempty"`

	// Configure if the SDK is disabled or not.
	// If omitted or null, false is used.
	//
	Disabled OpenTelemetryConfigurationDisabled `json:"disabled,omitempty,omitzero" yaml:"disabled,omitempty" mapstructure:"disabled,omitempty"`

	// Defines configuration parameters specific to a particular OpenTelemetry
	// distribution or vendor.
	// This section provides a standardized location for distribution-specific
	// settings
	// that are not part of the OpenTelemetry configuration model.
	// It allows vendors to expose their own extensions and general configuration
	// options.
	// If omitted, distribution defaults are used.
	//
	Distribution Distribution `json:"distribution,omitempty,omitzero" yaml:"distribution,omitempty" mapstructure:"distribution,omitempty"`

	// The file format version.
	// Represented as a string including the semver major, minor version numbers (and
	// optionally the meta tag). For example: "0.4", "1.0-rc.2", "1.0" (after stable
	// release).
	// See
	// https://github.com/open-telemetry/opentelemetry-configuration/blob/main/VERSIONING.md
	// for more details.
	// The yaml format is documented at
	// https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema
	// Property is required and must be non-null.
	//
	FileFormat string `json:"file_format" yaml:"file_format" mapstructure:"file_format"`

	// Configure the log level of the internal logger used by the SDK.
	// Values include:
	// * debug: debug, severity number 5.
	// * debug2: debug2, severity number 6.
	// * debug3: debug3, severity number 7.
	// * debug4: debug4, severity number 8.
	// * error: error, severity number 17.
	// * error2: error2, severity number 18.
	// * error3: error3, severity number 19.
	// * error4: error4, severity number 20.
	// * fatal: fatal, severity number 21.
	// * fatal2: fatal2, severity number 22.
	// * fatal3: fatal3, severity number 23.
	// * fatal4: fatal4, severity number 24.
	// * info: info, severity number 9.
	// * info2: info2, severity number 10.
	// * info3: info3, severity number 11.
	// * info4: info4, severity number 12.
	// * trace: trace, severity number 1.
	// * trace2: trace2, severity number 2.
	// * trace3: trace3, severity number 3.
	// * trace4: trace4, severity number 4.
	// * warn: warn, severity number 13.
	// * warn2: warn2, severity number 14.
	// * warn3: warn3, severity number 15.
	// * warn4: warn4, severity number 16.
	// If omitted, INFO is used.
	//
	LogLevel *SeverityNumber `json:"log_level,omitempty,omitzero" yaml:"log_level,omitempty" mapstructure:"log_level,omitempty"`

	// Configure logger provider.
	// If omitted, a noop logger provider is used.
	//
	LoggerProvider *LoggerProvider `json:"logger_provider,omitempty,omitzero" yaml:"logger_provider,omitempty" mapstructure:"logger_provider,omitempty"`

	// Configure meter provider.
	// If omitted, a noop meter provider is used.
	//
	MeterProvider *MeterProvider `json:"meter_provider,omitempty,omitzero" yaml:"meter_provider,omitempty" mapstructure:"meter_provider,omitempty"`

	// Configure text map context propagators.
	// If omitted, a noop propagator is used.
	//
	Propagator *Propagator `json:"propagator,omitempty,omitzero" yaml:"propagator,omitempty" mapstructure:"propagator,omitempty"`

	// Configure resource for all signals.
	// If omitted, the default resource is used.
	//
	Resource *Resource `json:"resource,omitempty,omitzero" yaml:"resource,omitempty" mapstructure:"resource,omitempty"`

	// Configure tracer provider.
	// If omitted, a noop tracer provider is used.
	//
	TracerProvider *TracerProvider `json:"tracer_provider,omitempty,omitzero" yaml:"tracer_provider,omitempty" mapstructure:"tracer_provider,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func ParseYAML

func ParseYAML(file []byte) (*OpenTelemetryConfiguration, error)

ParseYAML parses a YAML configuration file into an OpenTelemetryConfiguration.

func (*OpenTelemetryConfiguration) UnmarshalJSON

func (j *OpenTelemetryConfiguration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*OpenTelemetryConfiguration) UnmarshalYAML

func (j *OpenTelemetryConfiguration) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type OpenTelemetryConfigurationDisabled added in v0.21.0

type OpenTelemetryConfigurationDisabled *bool

Configure if the SDK is disabled or not. If omitted or null, false is used.

type OpenTracingPropagator

type OpenTracingPropagator map[string]interface{}

func (*OpenTracingPropagator) UnmarshalJSON

func (j *OpenTracingPropagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ParentBasedSampler

type ParentBasedSampler struct {
	// Configure local_parent_not_sampled sampler.
	// If omitted, always_off is used.
	//
	LocalParentNotSampled *Sampler `` /* 142-byte string literal not displayed */

	// Configure local_parent_sampled sampler.
	// If omitted, always_on is used.
	//
	LocalParentSampled *Sampler `` /* 130-byte string literal not displayed */

	// Configure remote_parent_not_sampled sampler.
	// If omitted, always_off is used.
	//
	RemoteParentNotSampled *Sampler `` /* 145-byte string literal not displayed */

	// Configure remote_parent_sampled sampler.
	// If omitted, always_on is used.
	//
	RemoteParentSampled *Sampler `` /* 133-byte string literal not displayed */

	// Configure root sampler.
	// If omitted, always_on is used.
	//
	Root *Sampler `json:"root,omitempty,omitzero" yaml:"root,omitempty" mapstructure:"root,omitempty"`
}

type PeriodicMetricReader

type PeriodicMetricReader struct {
	// Configure cardinality limits.
	// If omitted, default values as described in CardinalityLimits are used.
	//
	CardinalityLimits *CardinalityLimits `json:"cardinality_limits,omitempty,omitzero" yaml:"cardinality_limits,omitempty" mapstructure:"cardinality_limits,omitempty"`

	// Configure exporter.
	// Property is required and must be non-null.
	//
	Exporter PushMetricExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`

	// Configure delay interval (in milliseconds) between start of two consecutive
	// exports.
	// Value must be non-negative.
	// If omitted or null, 60000 is used.
	//
	Interval PeriodicMetricReaderInterval `json:"interval,omitempty,omitzero" yaml:"interval,omitempty" mapstructure:"interval,omitempty"`

	// Configure metric producers.
	// If omitted, no metric producers are added.
	//
	Producers []MetricProducer `json:"producers,omitempty,omitzero" yaml:"producers,omitempty" mapstructure:"producers,omitempty"`

	// Configure maximum allowed time (in milliseconds) to export data.
	// Value must be non-negative. A value of 0 indicates no limit (infinity).
	// If omitted or null, 30000 is used.
	//
	Timeout PeriodicMetricReaderTimeout `json:"timeout,omitempty,omitzero" yaml:"timeout,omitempty" mapstructure:"timeout,omitempty"`
}

func (*PeriodicMetricReader) UnmarshalJSON

func (j *PeriodicMetricReader) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*PeriodicMetricReader) UnmarshalYAML

func (j *PeriodicMetricReader) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type PeriodicMetricReaderInterval added in v0.21.0

type PeriodicMetricReaderInterval *int

Configure delay interval (in milliseconds) between start of two consecutive exports. Value must be non-negative. If omitted or null, 60000 is used.

type PeriodicMetricReaderTimeout added in v0.21.0

type PeriodicMetricReaderTimeout *int

Configure maximum allowed time (in milliseconds) to export data. Value must be non-negative. A value of 0 indicates no limit (infinity). If omitted or null, 30000 is used.

type Propagator added in v0.21.0

type Propagator struct {
	// Configure the propagators in the composite text map propagator. Entries from
	// .composite_list are appended to the list here with duplicates filtered out.
	// Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger,
	// ottrace. Known third party keys include: xray.
	// If omitted, and .composite_list is omitted or null, a noop propagator is used.
	//
	Composite []TextMapPropagator `json:"composite,omitempty,omitzero" yaml:"composite,omitempty" mapstructure:"composite,omitempty"`

	// Configure the propagators in the composite text map propagator. Entries are
	// appended to .composite with duplicates filtered out.
	// The value is a comma separated list of propagator identifiers matching the
	// format of OTEL_PROPAGATORS. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
	// for details.
	// Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi,
	// jaeger, ottrace. Known third party identifiers include: xray.
	// If omitted or null, and .composite is omitted or null, a noop propagator is
	// used.
	//
	CompositeList PropagatorCompositeList `json:"composite_list,omitempty,omitzero" yaml:"composite_list,omitempty" mapstructure:"composite_list,omitempty"`
}

type PropagatorCompositeList added in v0.21.0

type PropagatorCompositeList *string

Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out. The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray. If omitted or null, and .composite is omitted or null, a noop propagator is used.

type PullMetricExporter

type PullMetricExporter struct {
	AdditionalProperties interface{} `mapstructure:",remain"`
}

type PullMetricReader

type PullMetricReader struct {
	// Configure cardinality limits.
	// If omitted, default values as described in CardinalityLimits are used.
	//
	CardinalityLimits *CardinalityLimits `json:"cardinality_limits,omitempty,omitzero" yaml:"cardinality_limits,omitempty" mapstructure:"cardinality_limits,omitempty"`

	// Configure exporter.
	// Property is required and must be non-null.
	//
	Exporter PullMetricExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`

	// Configure metric producers.
	// If omitted, no metric producers are added.
	//
	Producers []MetricProducer `json:"producers,omitempty,omitzero" yaml:"producers,omitempty" mapstructure:"producers,omitempty"`
}

func (*PullMetricReader) UnmarshalJSON

func (j *PullMetricReader) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*PullMetricReader) UnmarshalYAML

func (j *PullMetricReader) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type PushMetricExporter

type PushMetricExporter struct {
	// Configure exporter to be console.
	// If omitted, ignore.
	//
	Console *ConsoleMetricExporter `json:"console,omitempty,omitzero" yaml:"console,omitempty" mapstructure:"console,omitempty"`

	// Configure exporter to be OTLP with gRPC transport.
	// If omitted, ignore.
	//
	OTLPGrpc *OTLPGrpcMetricExporter `json:"otlp_grpc,omitempty,omitzero" yaml:"otlp_grpc,omitempty" mapstructure:"otlp_grpc,omitempty"`

	// Configure exporter to be OTLP with HTTP transport.
	// If omitted, ignore.
	//
	OTLPHttp *OTLPHttpMetricExporter `json:"otlp_http,omitempty,omitzero" yaml:"otlp_http,omitempty" mapstructure:"otlp_http,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func (*PushMetricExporter) UnmarshalJSON

func (j *PushMetricExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*PushMetricExporter) UnmarshalYAML

func (j *PushMetricExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type Resource added in v0.21.0

type Resource struct {
	// Configure resource attributes. Entries have higher priority than entries from
	// .resource.attributes_list.
	// If omitted, no resource attributes are added.
	//
	Attributes []AttributeNameValue `json:"attributes,omitempty,omitzero" yaml:"attributes,omitempty" mapstructure:"attributes,omitempty"`

	// Configure resource attributes. Entries have lower priority than entries from
	// .resource.attributes.
	// The value is a list of comma separated key-value pairs matching the format of
	// OTEL_RESOURCE_ATTRIBUTES. See
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration
	// for details.
	// If omitted or null, no resource attributes are added.
	//
	AttributesList ResourceAttributesList `json:"attributes_list,omitempty,omitzero" yaml:"attributes_list,omitempty" mapstructure:"attributes_list,omitempty"`

	// Configure resource schema URL.
	// If omitted or null, no schema URL is used.
	//
	SchemaUrl ResourceSchemaUrl `json:"schema_url,omitempty,omitzero" yaml:"schema_url,omitempty" mapstructure:"schema_url,omitempty"`
}

type ResourceAttributesList added in v0.21.0

type ResourceAttributesList *string

Configure resource attributes. Entries have lower priority than entries from .resource.attributes. The value is a list of comma separated key-value pairs matching the format of OTEL_RESOURCE_ATTRIBUTES. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details. If omitted or null, no resource attributes are added.

type ResourceSchemaUrl added in v0.21.0

type ResourceSchemaUrl *string

Configure resource schema URL. If omitted or null, no schema URL is used.

type SDK

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

SDK is a struct that contains all the providers configured via the configuration model.

func NewSDK

func NewSDK(opts ...ConfigurationOption) (SDK, error)

NewSDK creates SDK providers based on the configuration model. It checks the local environment and uses the file set in the variable `OTEL_CONFIG_FILE` to configure the SDK automatically. Any file defined by `OTEL_CONFIG_FILE` will supersede all files passed with WithOpenTelemetryConfiguration.

func (*SDK) LoggerProvider

func (s *SDK) LoggerProvider() log.LoggerProvider

LoggerProvider returns a configured log.LoggerProvider.

func (*SDK) MeterProvider

func (s *SDK) MeterProvider() metric.MeterProvider

MeterProvider returns a configured metric.MeterProvider.

func (*SDK) Propagator added in v0.20.0

func (s *SDK) Propagator() propagation.TextMapPropagator

Propagator returns a configured propagation.TextMapPropagator.

func (*SDK) Shutdown

func (s *SDK) Shutdown(ctx context.Context) error

Shutdown calls shutdown on all configured providers.

func (*SDK) TracerProvider

func (s *SDK) TracerProvider() trace.TracerProvider

TracerProvider returns a configured trace.TracerProvider.

type Sampler

type Sampler struct {
	// Configure sampler to be always_off.
	// If omitted, ignore.
	//
	AlwaysOff AlwaysOffSampler `json:"always_off,omitempty,omitzero" yaml:"always_off,omitempty" mapstructure:"always_off,omitempty"`

	// Configure sampler to be always_on.
	// If omitted, ignore.
	//
	AlwaysOn AlwaysOnSampler `json:"always_on,omitempty,omitzero" yaml:"always_on,omitempty" mapstructure:"always_on,omitempty"`

	// Configure sampler to be parent_based.
	// If omitted, ignore.
	//
	ParentBased *ParentBasedSampler `json:"parent_based,omitempty,omitzero" yaml:"parent_based,omitempty" mapstructure:"parent_based,omitempty"`

	// Configure sampler to be trace_id_ratio_based.
	// If omitted, ignore.
	//
	TraceIDRatioBased *TraceIDRatioBasedSampler `` /* 130-byte string literal not displayed */

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func (*Sampler) UnmarshalJSON

func (j *Sampler) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Sampler) UnmarshalYAML

func (j *Sampler) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type SeverityNumber added in v0.21.0

type SeverityNumber string
const SeverityNumberDebug SeverityNumber = "debug"
const SeverityNumberDebug2 SeverityNumber = "debug2"
const SeverityNumberDebug3 SeverityNumber = "debug3"
const SeverityNumberDebug4 SeverityNumber = "debug4"
const SeverityNumberError SeverityNumber = "error"
const SeverityNumberError2 SeverityNumber = "error2"
const SeverityNumberError3 SeverityNumber = "error3"
const SeverityNumberError4 SeverityNumber = "error4"
const SeverityNumberFatal SeverityNumber = "fatal"
const SeverityNumberFatal2 SeverityNumber = "fatal2"
const SeverityNumberFatal3 SeverityNumber = "fatal3"
const SeverityNumberFatal4 SeverityNumber = "fatal4"
const SeverityNumberInfo SeverityNumber = "info"
const SeverityNumberInfo2 SeverityNumber = "info2"
const SeverityNumberInfo3 SeverityNumber = "info3"
const SeverityNumberInfo4 SeverityNumber = "info4"
const SeverityNumberTrace SeverityNumber = "trace"
const SeverityNumberTrace2 SeverityNumber = "trace2"
const SeverityNumberTrace3 SeverityNumber = "trace3"
const SeverityNumberTrace4 SeverityNumber = "trace4"
const SeverityNumberWarn SeverityNumber = "warn"
const SeverityNumberWarn2 SeverityNumber = "warn2"
const SeverityNumberWarn3 SeverityNumber = "warn3"
const SeverityNumberWarn4 SeverityNumber = "warn4"

type SimpleLogRecordProcessor

type SimpleLogRecordProcessor struct {
	// Configure exporter.
	// Property is required and must be non-null.
	//
	Exporter LogRecordExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`
}

func (*SimpleLogRecordProcessor) UnmarshalJSON

func (j *SimpleLogRecordProcessor) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SimpleLogRecordProcessor) UnmarshalYAML

func (j *SimpleLogRecordProcessor) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type SimpleSpanProcessor

type SimpleSpanProcessor struct {
	// Configure exporter.
	// Property is required and must be non-null.
	//
	Exporter SpanExporter `json:"exporter" yaml:"exporter" mapstructure:"exporter"`
}

func (*SimpleSpanProcessor) UnmarshalJSON

func (j *SimpleSpanProcessor) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SimpleSpanProcessor) UnmarshalYAML

func (j *SimpleSpanProcessor) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type SpanExporter

type SpanExporter struct {
	// Configure exporter to be console.
	// If omitted, ignore.
	//
	Console ConsoleExporter `json:"console,omitempty,omitzero" yaml:"console,omitempty" mapstructure:"console,omitempty"`

	// Configure exporter to be OTLP with gRPC transport.
	// If omitted, ignore.
	//
	OTLPGrpc *OTLPGrpcExporter `json:"otlp_grpc,omitempty,omitzero" yaml:"otlp_grpc,omitempty" mapstructure:"otlp_grpc,omitempty"`

	// Configure exporter to be OTLP with HTTP transport.
	// If omitted, ignore.
	//
	OTLPHttp *OTLPHttpExporter `json:"otlp_http,omitempty,omitzero" yaml:"otlp_http,omitempty" mapstructure:"otlp_http,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func (*SpanExporter) UnmarshalJSON

func (j *SpanExporter) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SpanExporter) UnmarshalYAML

func (j *SpanExporter) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type SpanKind added in v0.21.0

type SpanKind string
const SpanKindClient SpanKind = "client"
const SpanKindConsumer SpanKind = "consumer"
const SpanKindInternal SpanKind = "internal"
const SpanKindProducer SpanKind = "producer"
const SpanKindServer SpanKind = "server"

type SpanLimits

type SpanLimits struct {
	// Configure max attribute count. Overrides
	// .attribute_limits.attribute_count_limit.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	AttributeCountLimit SpanLimitsAttributeCountLimit `` /* 133-byte string literal not displayed */

	// Configure max attribute value size. Overrides
	// .attribute_limits.attribute_value_length_limit.
	// Value must be non-negative.
	// If omitted or null, there is no limit.
	//
	AttributeValueLengthLimit SpanLimitsAttributeValueLengthLimit `` /* 154-byte string literal not displayed */

	// Configure max attributes per span event.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	EventAttributeCountLimit SpanLimitsEventAttributeCountLimit `` /* 151-byte string literal not displayed */

	// Configure max span event count.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	EventCountLimit SpanLimitsEventCountLimit `json:"event_count_limit,omitempty,omitzero" yaml:"event_count_limit,omitempty" mapstructure:"event_count_limit,omitempty"`

	// Configure max attributes per span link.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	LinkAttributeCountLimit SpanLimitsLinkAttributeCountLimit `` /* 148-byte string literal not displayed */

	// Configure max span link count.
	// Value must be non-negative.
	// If omitted or null, 128 is used.
	//
	LinkCountLimit SpanLimitsLinkCountLimit `json:"link_count_limit,omitempty,omitzero" yaml:"link_count_limit,omitempty" mapstructure:"link_count_limit,omitempty"`
}

func (*SpanLimits) UnmarshalJSON

func (j *SpanLimits) UnmarshalJSON(value []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SpanLimits) UnmarshalYAML

func (j *SpanLimits) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type SpanLimitsAttributeCountLimit added in v0.21.0

type SpanLimitsAttributeCountLimit *int

Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. Value must be non-negative. If omitted or null, 128 is used.

type SpanLimitsAttributeValueLengthLimit added in v0.21.0

type SpanLimitsAttributeValueLengthLimit *int

Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. Value must be non-negative. If omitted or null, there is no limit.

type SpanLimitsEventAttributeCountLimit added in v0.21.0

type SpanLimitsEventAttributeCountLimit *int

Configure max attributes per span event. Value must be non-negative. If omitted or null, 128 is used.

type SpanLimitsEventCountLimit added in v0.21.0

type SpanLimitsEventCountLimit *int

Configure max span event count. Value must be non-negative. If omitted or null, 128 is used.

type SpanLimitsLinkAttributeCountLimit added in v0.21.0

type SpanLimitsLinkAttributeCountLimit *int

Configure max attributes per span link. Value must be non-negative. If omitted or null, 128 is used.

type SpanLimitsLinkCountLimit added in v0.21.0

type SpanLimitsLinkCountLimit *int

Configure max span link count. Value must be non-negative. If omitted or null, 128 is used.

type SpanProcessor

type SpanProcessor struct {
	// Configure a batch span processor.
	// If omitted, ignore.
	//
	Batch *BatchSpanProcessor `json:"batch,omitempty,omitzero" yaml:"batch,omitempty" mapstructure:"batch,omitempty"`

	// Configure a simple span processor.
	// If omitted, ignore.
	//
	Simple *SimpleSpanProcessor `json:"simple,omitempty,omitzero" yaml:"simple,omitempty" mapstructure:"simple,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

type SumAggregation

type SumAggregation map[string]interface{}

type TextMapPropagator

type TextMapPropagator struct {
	// Include the zipkin b3 propagator.
	// If omitted, ignore.
	//
	B3 B3Propagator `json:"b3,omitempty,omitzero" yaml:"b3,omitempty" mapstructure:"b3,omitempty"`

	// Include the zipkin b3 multi propagator.
	// If omitted, ignore.
	//
	B3Multi B3MultiPropagator `json:"b3multi,omitempty,omitzero" yaml:"b3multi,omitempty" mapstructure:"b3multi,omitempty"`

	// Include the w3c baggage propagator.
	// If omitted, ignore.
	//
	Baggage BaggagePropagator `json:"baggage,omitempty,omitzero" yaml:"baggage,omitempty" mapstructure:"baggage,omitempty"`

	// Include the jaeger propagator.
	// If omitted, ignore.
	//
	Jaeger JaegerPropagator `json:"jaeger,omitempty,omitzero" yaml:"jaeger,omitempty" mapstructure:"jaeger,omitempty"`

	// Include the opentracing propagator.
	// If omitted, ignore.
	//
	Ottrace OpenTracingPropagator `json:"ottrace,omitempty,omitzero" yaml:"ottrace,omitempty" mapstructure:"ottrace,omitempty"`

	// Include the w3c trace context propagator.
	// If omitted, ignore.
	//
	Tracecontext TraceContextPropagator `json:"tracecontext,omitempty,omitzero" yaml:"tracecontext,omitempty" mapstructure:"tracecontext,omitempty"`

	AdditionalProperties interface{} `mapstructure:",remain"`
}

func (*TextMapPropagator) UnmarshalJSON

func (j *TextMapPropagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*TextMapPropagator) UnmarshalYAML

func (j *TextMapPropagator) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type TraceContextPropagator

type TraceContextPropagator map[string]interface{}

func (*TraceContextPropagator) UnmarshalJSON

func (j *TraceContextPropagator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TraceIDRatioBasedSampler

type TraceIDRatioBasedSampler struct {
	// Configure trace_id_ratio.
	// If omitted or null, 1.0 is used.
	//
	Ratio TraceIDRatioBasedSamplerRatio `json:"ratio,omitempty,omitzero" yaml:"ratio,omitempty" mapstructure:"ratio,omitempty"`
}

type TraceIDRatioBasedSamplerRatio added in v0.21.0

type TraceIDRatioBasedSamplerRatio *float64

Configure trace_id_ratio. If omitted or null, 1.0 is used.

type TracerProvider added in v0.21.0

type TracerProvider struct {
	// Configure span limits. See also attribute_limits.
	// If omitted, default values as described in SpanLimits are used.
	//
	Limits *SpanLimits `json:"limits,omitempty,omitzero" yaml:"limits,omitempty" mapstructure:"limits,omitempty"`

	// Configure span processors.
	// Property is required and must be non-null.
	//
	Processors []SpanProcessor `json:"processors" yaml:"processors" mapstructure:"processors"`

	// Configure the sampler.
	// If omitted, parent based sampler with a root of always_on is used.
	//
	Sampler *Sampler `json:"sampler,omitempty,omitzero" yaml:"sampler,omitempty" mapstructure:"sampler,omitempty"`
}

type View

type View struct {
	// Configure view selector.
	// Selection criteria is additive as described in
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria.
	// Property is required and must be non-null.
	//
	Selector ViewSelector `json:"selector" yaml:"selector" mapstructure:"selector"`

	// Configure view stream.
	// Property is required and must be non-null.
	//
	Stream ViewStream `json:"stream" yaml:"stream" mapstructure:"stream"`
}

type ViewSelector

type ViewSelector struct {
	// Configure instrument name selection criteria.
	// If omitted or null, all instrument names match.
	//
	InstrumentName ViewSelectorInstrumentName `json:"instrument_name,omitempty,omitzero" yaml:"instrument_name,omitempty" mapstructure:"instrument_name,omitempty"`

	// Configure instrument type selection criteria.
	// Values include:
	// * counter: Synchronous counter instruments.
	// * gauge: Synchronous gauge instruments.
	// * histogram: Synchronous histogram instruments.
	// * observable_counter: Asynchronous counter instruments.
	// * observable_gauge: Asynchronous gauge instruments.
	// * observable_up_down_counter: Asynchronous up down counter instruments.
	// * up_down_counter: Synchronous up down counter instruments.
	// If omitted, all instrument types match.
	//
	InstrumentType *InstrumentType `json:"instrument_type,omitempty,omitzero" yaml:"instrument_type,omitempty" mapstructure:"instrument_type,omitempty"`

	// Configure meter name selection criteria.
	// If omitted or null, all meter names match.
	//
	MeterName ViewSelectorMeterName `json:"meter_name,omitempty,omitzero" yaml:"meter_name,omitempty" mapstructure:"meter_name,omitempty"`

	// Configure meter schema url selection criteria.
	// If omitted or null, all meter schema URLs match.
	//
	MeterSchemaUrl ViewSelectorMeterSchemaUrl `json:"meter_schema_url,omitempty,omitzero" yaml:"meter_schema_url,omitempty" mapstructure:"meter_schema_url,omitempty"`

	// Configure meter version selection criteria.
	// If omitted or null, all meter versions match.
	//
	MeterVersion ViewSelectorMeterVersion `json:"meter_version,omitempty,omitzero" yaml:"meter_version,omitempty" mapstructure:"meter_version,omitempty"`

	// Configure the instrument unit selection criteria.
	// If omitted or null, all instrument units match.
	//
	Unit ViewSelectorUnit `json:"unit,omitempty,omitzero" yaml:"unit,omitempty" mapstructure:"unit,omitempty"`
}

type ViewSelectorInstrumentName added in v0.21.0

type ViewSelectorInstrumentName *string

Configure instrument name selection criteria. If omitted or null, all instrument names match.

type ViewSelectorMeterName added in v0.21.0

type ViewSelectorMeterName *string

Configure meter name selection criteria. If omitted or null, all meter names match.

type ViewSelectorMeterSchemaUrl added in v0.21.0

type ViewSelectorMeterSchemaUrl *string

Configure meter schema url selection criteria. If omitted or null, all meter schema URLs match.

type ViewSelectorMeterVersion added in v0.21.0

type ViewSelectorMeterVersion *string

Configure meter version selection criteria. If omitted or null, all meter versions match.

type ViewSelectorUnit added in v0.21.0

type ViewSelectorUnit *string

Configure the instrument unit selection criteria. If omitted or null, all instrument units match.

type ViewStream

type ViewStream struct {
	// Configure aggregation of the resulting stream(s).
	// If omitted, default is used.
	//
	Aggregation *Aggregation `json:"aggregation,omitempty,omitzero" yaml:"aggregation,omitempty" mapstructure:"aggregation,omitempty"`

	// Configure the aggregation cardinality limit.
	// If omitted or null, the metric reader's default cardinality limit is used.
	//
	AggregationCardinalityLimit ViewStreamAggregationCardinalityLimit `` /* 157-byte string literal not displayed */

	// Configure attribute keys retained in the resulting stream(s).
	// If omitted, all attribute keys are retained.
	//
	AttributeKeys *IncludeExclude `json:"attribute_keys,omitempty,omitzero" yaml:"attribute_keys,omitempty" mapstructure:"attribute_keys,omitempty"`

	// Configure metric description of the resulting stream(s).
	// If omitted or null, the instrument's origin description is used.
	//
	Description ViewStreamDescription `json:"description,omitempty,omitzero" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Configure metric name of the resulting stream(s).
	// If omitted or null, the instrument's original name is used.
	//
	Name ViewStreamName `json:"name,omitempty,omitzero" yaml:"name,omitempty" mapstructure:"name,omitempty"`
}

type ViewStreamAggregationCardinalityLimit added in v0.21.0

type ViewStreamAggregationCardinalityLimit *int

Configure the aggregation cardinality limit. If omitted or null, the metric reader's default cardinality limit is used.

type ViewStreamDescription added in v0.21.0

type ViewStreamDescription *string

Configure metric description of the resulting stream(s). If omitted or null, the instrument's origin description is used.

type ViewStreamName added in v0.21.0

type ViewStreamName *string

Configure metric name of the resulting stream(s). If omitted or null, the instrument's original name is used.

Directories

Path Synopsis
internal
kv
Package kv contains function to translate name value pairs into attribute.KeyValue.
Package kv contains function to translate name value pairs into attribute.KeyValue.
provider
Package provider contains various providers used to replace variables in configuration files.
Package provider contains various providers used to replace variables in configuration files.
tls
Package tls provides functionality to translate configuration options into tls.Config.
Package tls provides functionality to translate configuration options into tls.Config.
Package otelconf provides an OpenTelemetry declarative configuration SDK.
Package otelconf provides an OpenTelemetry declarative configuration SDK.
Package otelconf provides an OpenTelemetry declarative configuration SDK.
Package otelconf provides an OpenTelemetry declarative configuration SDK.
x
Package x provides an OpenTelemetry declarative configuration SDK.
Package x provides an OpenTelemetry declarative configuration SDK.

Jump to

Keyboard shortcuts

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