jaegerremotesampling

package module
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 4

README

Jaeger's Remote Sampling extension

Status
Stability alpha
Distributions contrib
Issues Open issues Closed issues
Code Owners @yurishkuro, @frzifus

This extension allows serving sampling strategies following the Jaeger's remote sampling API. This extension can be configured to proxy requests to a backing remote sampling server, which could potentially be a Jaeger Collector down the pipeline, or a static JSON file from the local file system.

By default, two listeners are made available:

  • 0.0.0.0:5778, following the legacy remote sampling endpoint as defined by Jaeger
  • 0.0.0.0:14250, following the gRPC remote sampling endpoint, also defined by Jaeger

The component.UseLocalHostAsDefaultHost feature gate changes this to localhost:9943. This will become the default in a future release.

Note that the port 14250 will clash with the Jaeger Receiver. When both are used, it's recommended to change this extension to use another port.

Although this extension is derived from Jaeger, it can be used by any clients who can consume this standard, such as the OpenTelemetry Java SDK.

The reload_interval option is used to poll a file when using the file source. It is used to control a local cache for a remote source.

The file source can be used to load files from the local file system or from remote HTTP/S sources. The remote source must be used with a gRPC server that provides a Jaeger remote sampling service.

Configuration

extensions:
  jaegerremotesampling:
    source:
      reload_interval: 30s
      remote:
        endpoint: jaeger-collector:14250
  jaegerremotesampling/1:
    source:
      reload_interval: 1s
      file: /etc/otelcol/sampling_strategies.json
  jaegerremotesampling/2:
    source:
      reload_interval: 1s
      file: http://jaeger.example.com/sampling_strategies.json

A sampling strategy file could look like:

{
  "service_strategies": [
    {
      "service": "foo",
      "type": "probabilistic",
      "param": 0.8,
      "operation_strategies": [
        {
          "operation": "op1",
          "type": "probabilistic",
          "param": 0.2
        },
        {
          "operation": "op2",
          "type": "probabilistic",
          "param": 0.4
        }
      ]
    },
    {
      "service": "bar",
      "type": "ratelimiting",
      "param": 5
    }
  ],
  "default_strategy": {
    "type": "probabilistic",
    "param": 0.5,
    "operation_strategies": [
      {
        "operation": "/health",
        "type": "probabilistic",
        "param": 0.0
      },
      {
        "operation": "/metrics",
        "type": "probabilistic",
        "param": 0.0
      }
    ]
  }
}

Source: https://www.jaegertracing.io/docs/1.28/sampling/#collector-sampling-configuration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() extension.Factory

NewFactory creates a factory for the jaeger remote sampling extension.

Types

type Config

type Config struct {
	HTTPServerConfig *confighttp.ServerConfig `mapstructure:"http"`
	GRPCServerConfig *configgrpc.ServerConfig `mapstructure:"grpc"`

	// Source configures the source for the strategies file. One of `remote` or `file` has to be specified.
	Source Source `mapstructure:"source"`
}

Config has the configuration for the extension enabling the health check extension, used to report the health status of the service.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the extension configuration is valid

type Source added in v0.47.0

type Source struct {
	// Remote defines the remote location for the file
	Remote *configgrpc.ClientConfig `mapstructure:"remote"`

	// File specifies a local file as the strategies source
	File string `mapstructure:"file"`

	// ReloadInterval determines the periodicity to refresh the strategies
	ReloadInterval time.Duration `mapstructure:"reload_interval"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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