Skip to content

Latest commit

 

History

History

jaegerremotesampling

Jaeger's Remote Sampling extension

Status
Stability alpha
Distributions contrib, grafana, redhat, sumo
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:

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

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:https://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