remotesampling

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

README

Remote Sampling

Placeholder

flowchart LR
    Receiver --> AdaptiveSamplingProcessor --> BatchProcessor --> Exporter
    Exporter -->|"(1) get storage"| JaegerStorageExension
    Exporter -->|"(2) write trace"| TraceStorage
    AdaptiveSamplingProcessor -->|"getStorage()"| StorageConfig

    OTEL_SDK[OTEL
             SDK]
    OTEL_SDK -->|"(1) GET /sampling"| HTTP_endpoint
    HTTP_endpoint -->|"(2) getStrategy()"| StrategiesProvider
    style HTTP_endpoint fill:blue,color:white

    subgraph Jaeger Collector
        Receiver
        BatchProcessor[Batch
                       Processor]
        Exporter
        TraceStorage[(Trace
                      Storage)]
        AdaptiveSamplingProcessor[Adaptive
                                  Sampling
                                  Processor]
        AdaptiveSamplingProcessorV1[Adaptive
                                    Sampling
                                    Processor_v1]
        style AdaptiveSamplingProcessorV1 fill:blue,color:white
        AdaptiveSamplingProcessor -->|"[]*model.Span"| AdaptiveSamplingProcessorV1
        AdaptiveSamplingProcessorV1 ---|use| SamplingStorage

        subgraph JaegerStorageExension[Jaeger Storage Exension]
            Storage[[Storage
                     Config]]
        end
        subgraph RemoteSamplingExtension[Remote Sampling Extension]
            StrategiesProvider -->|"(3b) getStrategy()"| AdaptiveProvider
            StrategiesProvider -->|"(3a) getStrategy()"| FileProvider
            FileProvider --> FileConfig
            AdaptiveProvider --> StorageConfig

            HTTP_endpoint[HTTP
                          endpoint]
            StrategiesProvider[Strategies
                               Provider]
            FileProvider[File
                         Provider]
            AdaptiveProvider[Adaptive
                             Provider]
            style StrategiesProvider fill:blue,color:white
            style FileProvider fill:blue,color:white
            style AdaptiveProvider fill:blue,color:white
            subgraph Config
                FileConfig[[File Config]]
                StorageConfig[[Storage Config]]
            end
            StorageConfig --- SamplingStorage
            SamplingStorage[(Sampling
                             Storage)]
            style SamplingStorage fill:blue,color:white
        end
    end

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ComponentType = component.MustNewType("remote_sampling")

ComponentType is the name of this extension in configuration.

Functions

func NewFactory

func NewFactory() extension.Factory

NewFactory creates a factory for the jaeger remote sampling extension.

Types

type AdaptiveConfig

type AdaptiveConfig struct {
	// SamplingStore is the name of the storage defined in the jaegerstorage extension.
	SamplingStore string `valid:"required" mapstructure:"sampling_store"`

	adaptive.Options `mapstructure:",squash"`
}

type AdaptiveSamplingComponents

type AdaptiveSamplingComponents struct {
	SamplingStore samplingstore.Store
	DistLock      *leaderelection.DistributedElectionParticipant
	Options       *adaptive.Options
}

AdaptiveSamplingComponents is a struct that holds the components needed for adaptive sampling.

func GetAdaptiveSamplingComponents

func GetAdaptiveSamplingComponents(host component.Host) (*AdaptiveSamplingComponents, error)

GetAdaptiveSamplingComponents locates the `remotesampling` extension in Host and returns the sampling store and a loader/follower implementation, provided that the extension is configured with adaptive sampling (vs. file-based config).

type Config

type Config struct {
	File     *FileConfig              `mapstructure:"file"`
	Adaptive *AdaptiveConfig          `mapstructure:"adaptive"`
	HTTP     *confighttp.ServerConfig `mapstructure:"http"`
	GRPC     *configgrpc.ServerConfig `mapstructure:"grpc"`
}

func (*Config) Unmarshal

func (cfg *Config) Unmarshal(conf *confmap.Conf) error

Unmarshal is a custom unmarshaler that allows the factory to provide default values for nested configs (like GRPC endpoint) yes still reset the pointers to nil if the config did not contain the corresponding sections. This is a workaround for the lack of opional fields support in OTEL confmap. Issue: https://github.com/open-telemetry/opentelemetry-collector/issues/10266

func (*Config) Validate

func (cfg *Config) Validate() error

type FileConfig

type FileConfig struct {
	// File specifies a local file as the source of sampling strategies.
	Path string `valid:"required" mapstructure:"path"`
}

Jump to

Keyboard shortcuts

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