Documentation ¶
Index ¶
- type Attributes
- type BatchLogRecordProcessor
- type BatchSpanProcessor
- type CommonJson
- type Config
- type Console
- type Headers
- type LogRecordExporter
- type LogRecordLimits
- type LogRecordProcessor
- type LoggerProviderJson
- type LogsConfig
- type LogsSamplingConfig
- type MeterProviderJson
- type MetricExporter
- type MetricReader
- type MetricsConfig
- type Otlp
- type OtlpMetric
- type PeriodicMetricReader
- type Prometheus
- type PullMetricReader
- type ResourceJson
- type Sampler
- type SamplerAlwaysOff
- type SamplerAlwaysOn
- type SamplerJaegerRemote
- type SamplerParentBased
- type SamplerTraceIdRatioBased
- type Settings
- type SimpleLogRecordProcessor
- type SimpleSpanProcessor
- type SpanExporter
- type SpanLimits
- type SpanProcessor
- type Telemetry
- type TracerProviderJson
- type TracesConfig
- type View
- type ViewSelector
- type ViewStream
- type ViewStreamAggregation
- type ViewStreamAggregationExplicitBucketHistogram
- type ViewStreamAggregationExponentialBucketHistogram
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶ added in v0.81.0
type Attributes struct { // ServiceName corresponds to the JSON schema field "service.name". ServiceName *string `mapstructure:"service.name,omitempty"` }
type BatchLogRecordProcessor ¶ added in v0.82.0
type BatchLogRecordProcessor struct { // ExportTimeout corresponds to the JSON schema field "export_timeout". ExportTimeout *int `mapstructure:"export_timeout,omitempty"` // Exporter corresponds to the JSON schema field "exporter". Exporter LogRecordExporter `mapstructure:"exporter"` // MaxExportBatchSize corresponds to the JSON schema field // "max_export_batch_size". MaxExportBatchSize *int `mapstructure:"max_export_batch_size,omitempty"` // MaxQueueSize corresponds to the JSON schema field "max_queue_size". MaxQueueSize *int `mapstructure:"max_queue_size,omitempty"` // ScheduleDelay corresponds to the JSON schema field "schedule_delay". ScheduleDelay *int `mapstructure:"schedule_delay,omitempty"` }
func (*BatchLogRecordProcessor) UnmarshalJSON ¶ added in v0.82.0
func (j *BatchLogRecordProcessor) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type BatchSpanProcessor ¶ added in v0.82.0
type BatchSpanProcessor struct { // ExportTimeout corresponds to the JSON schema field "export_timeout". ExportTimeout *int `mapstructure:"export_timeout,omitempty"` // Exporter corresponds to the JSON schema field "exporter". Exporter SpanExporter `mapstructure:"exporter"` // MaxExportBatchSize corresponds to the JSON schema field // "max_export_batch_size". MaxExportBatchSize *int `mapstructure:"max_export_batch_size,omitempty"` // MaxQueueSize corresponds to the JSON schema field "max_queue_size". MaxQueueSize *int `mapstructure:"max_queue_size,omitempty"` // ScheduleDelay corresponds to the JSON schema field "schedule_delay". ScheduleDelay *int `mapstructure:"schedule_delay,omitempty"` }
func (*BatchSpanProcessor) UnmarshalJSON ¶ added in v0.82.0
func (j *BatchSpanProcessor) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type CommonJson ¶ added in v0.81.0
type CommonJson map[string]interface{}
type Config ¶
type Config struct { Logs LogsConfig `mapstructure:"logs"` Metrics MetricsConfig `mapstructure:"metrics"` Traces TracesConfig `mapstructure:"traces"` // Resource specifies user-defined attributes to include with all emitted telemetry. // Note that some attributes are added automatically (e.g. service.version) even // if they are not specified here. In order to suppress such attributes the // attribute must be specified in this map with null YAML value (nil string pointer). Resource map[string]*string `mapstructure:"resource"` }
Config defines the configurable settings for service telemetry.
type LogRecordExporter ¶ added in v0.82.0
type LogRecordExporter struct { // Otlp corresponds to the JSON schema field "otlp". Otlp *Otlp `mapstructure:"otlp,omitempty"` }
type LogRecordLimits ¶ added in v0.82.0
type LogRecordLimits struct { // AttributeCountLimit corresponds to the JSON schema field // "attribute_count_limit". AttributeCountLimit *int `mapstructure:"attribute_count_limit,omitempty"` // AttributeValueLengthLimit corresponds to the JSON schema field // "attribute_value_length_limit". AttributeValueLengthLimit *int `mapstructure:"attribute_value_length_limit,omitempty"` }
type LogRecordProcessor ¶ added in v0.82.0
type LogRecordProcessor struct { // Batch corresponds to the JSON schema field "batch". Batch *BatchLogRecordProcessor `mapstructure:"batch,omitempty"` // Simple corresponds to the JSON schema field "simple". Simple *SimpleLogRecordProcessor `mapstructure:"simple,omitempty"` }
type LoggerProviderJson ¶ added in v0.81.0
type LoggerProviderJson struct { // Limits corresponds to the JSON schema field "limits". Limits *LogRecordLimits `mapstructure:"limits,omitempty"` // Processors corresponds to the JSON schema field "processors". Processors []LogRecordProcessor `mapstructure:"processors,omitempty"` }
type LogsConfig ¶
type LogsConfig struct { // Level is the minimum enabled logging level. // (default = "INFO") Level zapcore.Level `mapstructure:"level"` // Development puts the logger in development mode, which changes the // behavior of DPanicLevel and takes stacktraces more liberally. // (default = false) Development bool `mapstructure:"development"` // Encoding sets the logger's encoding. // Example values are "json", "console". Encoding string `mapstructure:"encoding"` // DisableCaller stops annotating logs with the calling function's file // name and line number. By default, all logs are annotated. // (default = false) DisableCaller bool `mapstructure:"disable_caller"` // DisableStacktrace completely disables automatic stacktrace capturing. By // default, stacktraces are captured for WarnLevel and above logs in // development and ErrorLevel and above in production. // (default = false) DisableStacktrace bool `mapstructure:"disable_stacktrace"` // Sampling sets a sampling policy. A nil SamplingConfig disables sampling. Sampling *LogsSamplingConfig `mapstructure:"sampling"` // OutputPaths is a list of URLs or file paths to write logging output to. // The URLs could only be with "file" schema or without schema. // The URLs with "file" schema must be an absolute path. // The URLs without schema are treated as local file paths. // "stdout" and "stderr" are interpreted as os.Stdout and os.Stderr. // see details at Open in zap/writer.go. // (default = ["stderr"]) OutputPaths []string `mapstructure:"output_paths"` // ErrorOutputPaths is a list of URLs or file paths to write zap internal logger errors to. // The URLs could only be with "file" schema or without schema. // The URLs with "file" schema must use absolute paths. // The URLs without schema are treated as local file paths. // "stdout" and "stderr" are interpreted as os.Stdout and os.Stderr. // see details at Open in zap/writer.go. // // Note that this setting only affects the zap internal logger errors. // (default = ["stderr"]) ErrorOutputPaths []string `mapstructure:"error_output_paths"` // InitialFields is a collection of fields to add to the root logger. // Example: // // initial_fields: // foo: "bar" // // By default, there is no initial field. InitialFields map[string]any `mapstructure:"initial_fields"` }
LogsConfig defines the configurable settings for service telemetry logs. This MUST be compatible with zap.Config. Cannot use directly zap.Config because the collector uses mapstructure and not yaml tags.
type LogsSamplingConfig ¶ added in v0.64.0
type LogsSamplingConfig struct { Initial int `mapstructure:"initial"` Thereafter int `mapstructure:"thereafter"` }
LogsSamplingConfig sets a sampling strategy for the logger. Sampling caps the global CPU and I/O load that logging puts on your process while attempting to preserve a representative subset of your logs.
type MeterProviderJson ¶ added in v0.81.0
type MeterProviderJson struct { // Readers corresponds to the JSON schema field "readers". Readers []MetricReader `mapstructure:"readers,omitempty"` // Views corresponds to the JSON schema field "views". Views []View `mapstructure:"views,omitempty"` }
type MetricExporter ¶ added in v0.81.0
type MetricExporter struct { // Console corresponds to the JSON schema field "console". Console Console `mapstructure:"console,omitempty"` // Otlp corresponds to the JSON schema field "otlp". Otlp *OtlpMetric `mapstructure:"otlp,omitempty"` // Prometheus corresponds to the JSON schema field "prometheus". Prometheus *Prometheus `mapstructure:"prometheus,omitempty"` }
type MetricReader ¶ added in v0.78.0
type MetricReader struct { // Periodic corresponds to the JSON schema field "periodic". Periodic *PeriodicMetricReader `mapstructure:"periodic,omitempty"` // Pull corresponds to the JSON schema field "pull". Pull *PullMetricReader `mapstructure:"pull,omitempty"` }
type MetricsConfig ¶
type MetricsConfig struct { // Level is the level of telemetry metrics, the possible values are: // - "none" indicates that no telemetry data should be collected; // - "basic" is the recommended and covers the basics of the service telemetry. // - "normal" adds some other indicators on top of basic. // - "detailed" adds dimensions and views to the previous levels. Level configtelemetry.Level `mapstructure:"level"` // Address is the [address]:port that metrics exposition should be bound to. Address string `mapstructure:"address"` // Readers allow configuration of metric readers to emit metrics to // any number of supported backends. Readers []MetricReader `mapstructure:"readers"` }
MetricsConfig exposes the common Telemetry configuration for one component. Experimental: *NOTE* this structure is subject to change or removal in the future.
type Otlp ¶ added in v0.81.0
type Otlp struct { // Certificate corresponds to the JSON schema field "certificate". Certificate *string `mapstructure:"certificate,omitempty"` // ClientCertificate corresponds to the JSON schema field "client_certificate". ClientCertificate *string `mapstructure:"client_certificate,omitempty"` // ClientKey corresponds to the JSON schema field "client_key". ClientKey *string `mapstructure:"client_key,omitempty"` // Compression corresponds to the JSON schema field "compression". Compression *string `mapstructure:"compression,omitempty"` // Endpoint corresponds to the JSON schema field "endpoint". Endpoint string `mapstructure:"endpoint"` // Headers corresponds to the JSON schema field "headers". Headers Headers `mapstructure:"headers,omitempty"` // Protocol corresponds to the JSON schema field "protocol". Protocol string `mapstructure:"protocol"` // Timeout corresponds to the JSON schema field "timeout". Timeout *int `mapstructure:"timeout,omitempty"` }
func (*Otlp) UnmarshalJSON ¶ added in v0.81.0
UnmarshalJSON implements json.Unmarshaler.
type OtlpMetric ¶ added in v0.82.0
type OtlpMetric struct { // Certificate corresponds to the JSON schema field "certificate". Certificate *string `mapstructure:"certificate,omitempty"` // ClientCertificate corresponds to the JSON schema field "client_certificate". ClientCertificate *string `mapstructure:"client_certificate,omitempty"` // ClientKey corresponds to the JSON schema field "client_key". ClientKey *string `mapstructure:"client_key,omitempty"` // Compression corresponds to the JSON schema field "compression". Compression *string `mapstructure:"compression,omitempty"` // DefaultHistogramAggregation corresponds to the JSON schema field // "default_histogram_aggregation". DefaultHistogramAggregation *string `mapstructure:"default_histogram_aggregation,omitempty"` // Endpoint corresponds to the JSON schema field "endpoint". Endpoint string `mapstructure:"endpoint"` // Headers corresponds to the JSON schema field "headers". Headers Headers `mapstructure:"headers,omitempty"` // Protocol corresponds to the JSON schema field "protocol". Protocol string `mapstructure:"protocol"` // TemporalityPreference corresponds to the JSON schema field // "temporality_preference". TemporalityPreference *string `mapstructure:"temporality_preference,omitempty"` // Timeout corresponds to the JSON schema field "timeout". Timeout *int `mapstructure:"timeout,omitempty"` }
func (*OtlpMetric) UnmarshalJSON ¶ added in v0.82.0
func (j *OtlpMetric) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type PeriodicMetricReader ¶ added in v0.81.0
type PeriodicMetricReader struct { // Exporter corresponds to the JSON schema field "exporter". Exporter MetricExporter `mapstructure:"exporter"` // Interval corresponds to the JSON schema field "interval". Interval *int `mapstructure:"interval,omitempty"` // Timeout corresponds to the JSON schema field "timeout". Timeout *int `mapstructure:"timeout,omitempty"` }
func (*PeriodicMetricReader) UnmarshalJSON ¶ added in v0.81.0
func (j *PeriodicMetricReader) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*PeriodicMetricReader) Validate ¶ added in v0.84.0
func (pmr *PeriodicMetricReader) Validate() error
Validate checks for valid exporters to be configured for the PeriodicMetricReader
type Prometheus ¶ added in v0.81.0
type PullMetricReader ¶ added in v0.81.0
type PullMetricReader struct { // Exporter corresponds to the JSON schema field "exporter". Exporter MetricExporter `mapstructure:"exporter"` }
func (*PullMetricReader) UnmarshalJSON ¶ added in v0.81.0
func (j *PullMetricReader) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*PullMetricReader) Validate ¶ added in v0.84.0
func (pmr *PullMetricReader) Validate() error
Validate checks for valid exporters to be configured for the PullMetricReader
type ResourceJson ¶ added in v0.81.0
type ResourceJson struct { // Attributes corresponds to the JSON schema field "attributes". Attributes *Attributes `mapstructure:"attributes,omitempty"` }
type Sampler ¶ added in v0.82.0
type Sampler struct { // AlwaysOff corresponds to the JSON schema field "always_off". AlwaysOff SamplerAlwaysOff `mapstructure:"always_off,omitempty"` // AlwaysOn corresponds to the JSON schema field "always_on". AlwaysOn SamplerAlwaysOn `mapstructure:"always_on,omitempty"` // JaegerRemote corresponds to the JSON schema field "jaeger_remote". JaegerRemote *SamplerJaegerRemote `mapstructure:"jaeger_remote,omitempty"` // ParentBased corresponds to the JSON schema field "parent_based". ParentBased *SamplerParentBased `mapstructure:"parent_based,omitempty"` // TraceIdRatioBased corresponds to the JSON schema field "trace_id_ratio_based". TraceIdRatioBased *SamplerTraceIdRatioBased `mapstructure:"trace_id_ratio_based,omitempty"` }
type SamplerAlwaysOff ¶ added in v0.82.0
type SamplerAlwaysOff map[string]interface{}
type SamplerAlwaysOn ¶ added in v0.82.0
type SamplerAlwaysOn map[string]interface{}
type SamplerJaegerRemote ¶ added in v0.82.0
type SamplerJaegerRemote struct { // Endpoint corresponds to the JSON schema field "endpoint". Endpoint *string `mapstructure:"endpoint,omitempty"` // InitialSampler corresponds to the JSON schema field "initial_sampler". InitialSampler *Sampler `mapstructure:"initial_sampler,omitempty"` // Interval corresponds to the JSON schema field "interval". Interval *int `mapstructure:"interval,omitempty"` }
type SamplerParentBased ¶ added in v0.82.0
type SamplerParentBased struct { // LocalParentNotSampled corresponds to the JSON schema field // "local_parent_not_sampled". LocalParentNotSampled *Sampler `mapstructure:"local_parent_not_sampled,omitempty"` // LocalParentSampled corresponds to the JSON schema field "local_parent_sampled". LocalParentSampled *Sampler `mapstructure:"local_parent_sampled,omitempty"` // RemoteParentNotSampled corresponds to the JSON schema field // "remote_parent_not_sampled". RemoteParentNotSampled *Sampler `mapstructure:"remote_parent_not_sampled,omitempty"` // RemoteParentSampled corresponds to the JSON schema field // "remote_parent_sampled". RemoteParentSampled *Sampler `mapstructure:"remote_parent_sampled,omitempty"` // Root corresponds to the JSON schema field "root". Root *Sampler `mapstructure:"root,omitempty"` }
type SamplerTraceIdRatioBased ¶ added in v0.82.0
type SamplerTraceIdRatioBased struct { // Ratio corresponds to the JSON schema field "ratio". Ratio *float64 `mapstructure:"ratio,omitempty"` }
type SimpleLogRecordProcessor ¶ added in v0.82.0
type SimpleLogRecordProcessor struct { // Exporter corresponds to the JSON schema field "exporter". Exporter LogRecordExporter `mapstructure:"exporter"` }
func (*SimpleLogRecordProcessor) UnmarshalJSON ¶ added in v0.82.0
func (j *SimpleLogRecordProcessor) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SimpleSpanProcessor ¶ added in v0.82.0
type SimpleSpanProcessor struct { // Exporter corresponds to the JSON schema field "exporter". Exporter SpanExporter `mapstructure:"exporter"` }
func (*SimpleSpanProcessor) UnmarshalJSON ¶ added in v0.82.0
func (j *SimpleSpanProcessor) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type SpanExporter ¶ added in v0.82.0
type SpanExporter struct { // Console corresponds to the JSON schema field "console". Console Console `mapstructure:"console,omitempty"` // Otlp corresponds to the JSON schema field "otlp". Otlp *Otlp `mapstructure:"otlp,omitempty"` }
func (*SpanExporter) Validate ¶ added in v0.84.0
func (se *SpanExporter) Validate() error
Validate checks for valid exporters to be configured for the SpanExporter
type SpanLimits ¶ added in v0.82.0
type SpanLimits struct { // AttributeCountLimit corresponds to the JSON schema field // "attribute_count_limit". AttributeCountLimit *int `mapstructure:"attribute_count_limit,omitempty"` // AttributeValueLengthLimit corresponds to the JSON schema field // "attribute_value_length_limit". AttributeValueLengthLimit *int `mapstructure:"attribute_value_length_limit,omitempty"` // EventAttributeCountLimit corresponds to the JSON schema field // "event_attribute_count_limit". EventAttributeCountLimit *int `mapstructure:"event_attribute_count_limit,omitempty"` // EventCountLimit corresponds to the JSON schema field "event_count_limit". EventCountLimit *int `mapstructure:"event_count_limit,omitempty"` // LinkAttributeCountLimit corresponds to the JSON schema field // "link_attribute_count_limit". LinkAttributeCountLimit *int `mapstructure:"link_attribute_count_limit,omitempty"` // LinkCountLimit corresponds to the JSON schema field "link_count_limit". LinkCountLimit *int `mapstructure:"link_count_limit,omitempty"` }
type SpanProcessor ¶ added in v0.82.0
type SpanProcessor struct { // Batch corresponds to the JSON schema field "batch". Batch *BatchSpanProcessor `mapstructure:"batch,omitempty"` // Simple corresponds to the JSON schema field "simple". Simple *SimpleSpanProcessor `mapstructure:"simple,omitempty"` }
type Telemetry ¶ added in v0.63.0
type Telemetry struct {
// contains filtered or unexported fields
}
func (*Telemetry) TracerProvider ¶ added in v0.63.0
func (t *Telemetry) TracerProvider() trace.TracerProvider
type TracerProviderJson ¶ added in v0.81.0
type TracerProviderJson struct { // Limits corresponds to the JSON schema field "limits". Limits *SpanLimits `mapstructure:"limits,omitempty"` // Processors corresponds to the JSON schema field "processors". Processors []SpanProcessor `mapstructure:"processors,omitempty"` // Sampler corresponds to the JSON schema field "sampler". Sampler *Sampler `mapstructure:"sampler,omitempty"` }
type TracesConfig ¶ added in v0.59.0
type TracesConfig struct { // Propagators is a list of TextMapPropagators from the supported propagators list. Currently, // tracecontext and b3 are supported. By default, the value is set to empty list and // context propagation is disabled. Propagators []string `mapstructure:"propagators"` // Processors allow configuration of span processors to emit spans to // any number of suported backends. Processors []SpanProcessor `mapstructure:"processors"` }
TracesConfig exposes the common Telemetry configuration for collector's internal spans. Experimental: *NOTE* this structure is subject to change or removal in the future.
type View ¶ added in v0.82.0
type View struct { // Selector corresponds to the JSON schema field "selector". Selector *ViewSelector `mapstructure:"selector,omitempty"` // Stream corresponds to the JSON schema field "stream". Stream *ViewStream `mapstructure:"stream,omitempty"` }
type ViewSelector ¶ added in v0.82.0
type ViewSelector struct { // InstrumentName corresponds to the JSON schema field "instrument_name". InstrumentName *string `mapstructure:"instrument_name,omitempty"` // InstrumentType corresponds to the JSON schema field "instrument_type". InstrumentType *string `mapstructure:"instrument_type,omitempty"` // MeterName corresponds to the JSON schema field "meter_name". MeterName *string `mapstructure:"meter_name,omitempty"` // MeterSchemaUrl corresponds to the JSON schema field "meter_schema_url". MeterSchemaUrl *string `mapstructure:"meter_schema_url,omitempty"` // MeterVersion corresponds to the JSON schema field "meter_version". MeterVersion *string `mapstructure:"meter_version,omitempty"` }
type ViewStream ¶ added in v0.82.0
type ViewStream struct { // Aggregation corresponds to the JSON schema field "aggregation". Aggregation *ViewStreamAggregation `mapstructure:"aggregation,omitempty"` // AttributeKeys corresponds to the JSON schema field "attribute_keys". AttributeKeys []string `mapstructure:"attribute_keys,omitempty"` // Description corresponds to the JSON schema field "description". Description *string `mapstructure:"description,omitempty"` // Name corresponds to the JSON schema field "name". Name *string `mapstructure:"name,omitempty"` }
type ViewStreamAggregation ¶ added in v0.82.0
type ViewStreamAggregation struct { // Default corresponds to the JSON schema field "default". Default interface{} `mapstructure:"default,omitempty"` // Drop corresponds to the JSON schema field "drop". Drop interface{} `mapstructure:"drop,omitempty"` // ExplicitBucketHistogram corresponds to the JSON schema field // "explicit_bucket_histogram". ExplicitBucketHistogram *ViewStreamAggregationExplicitBucketHistogram `mapstructure:"explicit_bucket_histogram,omitempty"` // ExponentialBucketHistogram corresponds to the JSON schema field // "exponential_bucket_histogram". ExponentialBucketHistogram *ViewStreamAggregationExponentialBucketHistogram `mapstructure:"exponential_bucket_histogram,omitempty"` // LastValue corresponds to the JSON schema field "last_value". LastValue interface{} `mapstructure:"last_value,omitempty"` // Sum corresponds to the JSON schema field "sum". Sum interface{} `mapstructure:"sum,omitempty"` }
func (*ViewStreamAggregation) UnmarshalJSON ¶ added in v0.82.0
func (j *ViewStreamAggregation) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler.
type ViewStreamAggregationExplicitBucketHistogram ¶ added in v0.82.0
type ViewStreamAggregationExplicitBucketHistogram struct { // Boundaries corresponds to the JSON schema field "boundaries". Boundaries []float64 `mapstructure:"boundaries,omitempty"` // RecordMinMax corresponds to the JSON schema field "record_min_max". RecordMinMax *bool `mapstructure:"record_min_max,omitempty"` }
type ViewStreamAggregationExponentialBucketHistogram ¶ added in v0.82.0
type ViewStreamAggregationExponentialBucketHistogram struct { // MaxScale corresponds to the JSON schema field "max_scale". MaxScale *int `mapstructure:"max_scale,omitempty"` // MaxSize corresponds to the JSON schema field "max_size". MaxSize *int `mapstructure:"max_size,omitempty"` // RecordMinMax corresponds to the JSON schema field "record_min_max". RecordMinMax *bool `mapstructure:"record_min_max,omitempty"` }