package x

import "github.com/uber/jaeger-client-go/x"

Package x contains experimental functionality with no guarantees of stable APIs.

Index

Types

type PrioritySampler

type PrioritySampler struct {
	jaeger.SamplerV2Base
	// contains filtered or unexported fields
}

PrioritySampler contains a list of samplers that it interrogates in order. Sampling methods return as soon as one of the samplers returns sample=true. The retryable state for each underlying sampler is stored in the extended context and once retryable=false is returned by one of the delegates it will never be called again.

func NewPrioritySampler

func NewPrioritySampler(delegates ...jaeger.SamplerV2) *PrioritySampler

NewPrioritySampler creates a new PrioritySampler with given delegates.

func (*PrioritySampler) Close

func (s *PrioritySampler) Close()

Close calls Close on all delegate samplers.

func (*PrioritySampler) OnCreateSpan

func (s *PrioritySampler) OnCreateSpan(span *jaeger.Span) jaeger.SamplingDecision

OnCreateSpan implements SamplerV2 API.

func (*PrioritySampler) OnFinishSpan

func (s *PrioritySampler) OnFinishSpan(span *jaeger.Span) jaeger.SamplingDecision

OnFinishSpan implements SamplerV2 API.

func (*PrioritySampler) OnSetOperationName

func (s *PrioritySampler) OnSetOperationName(span *jaeger.Span, operationName string) jaeger.SamplingDecision

OnSetOperationName implements SamplerV2 API.

func (*PrioritySampler) OnSetTag

func (s *PrioritySampler) OnSetTag(span *jaeger.Span, key string, value interface{}) jaeger.SamplingDecision

OnSetTag implements SamplerV2 API.

type TagMatcher

type TagMatcher struct {
	TagValue interface{} `json:"value"`
	Firehose bool        `json:"firehose"`
}

TagMatcher describes which values TagMatchingSampler will match.

type TagMatchingSampler

type TagMatchingSampler struct {
	jaeger.SamplerV2Base
	// contains filtered or unexported fields
}

TagMatchingSampler samples traces that have spans with a particular tag value(s).

func NewTagMatchingSampler

func NewTagMatchingSampler(tagKey string, matchers []TagMatcher) *TagMatchingSampler

NewTagMatchingSampler creates TagMatchingSampler with given tag key and matchers.

func NewTagMatchingSamplerFromStrategy

func NewTagMatchingSamplerFromStrategy(strategy TagMatchingSamplingStrategy) *TagMatchingSampler

NewTagMatchingSamplerFromStrategy instantiates TagMatchingSampler from a strategy.

func NewTagMatchingSamplerFromStrategyJSON

func NewTagMatchingSamplerFromStrategyJSON(jsonString []byte) (*TagMatchingSampler, error)

NewTagMatchingSamplerFromStrategyJSON creates the sampler from a JSON configuration of the following form:

{
  "key": "tagKey",
  "matchers": [
    {
      "value": "tagValue1",
      "firehose": true
    },
    {
      "value": 42,
      "firehose": false
    }
  ],
  "values": {
    "tagValue1": {
      "firehose": true
    },
    "tagValue2": {
      "firehose": false
    }
  }
}

Note that matchers can be specified either via "matchers" array (preferred), or via "values" dictionary (legacy, only supports string values).

When a given tag value appears multiple time, then last one in "matchers" wins, and the one in "values" wins overall.

func (*TagMatchingSampler) OnCreateSpan

func (s *TagMatchingSampler) OnCreateSpan(span *jaeger.Span) jaeger.SamplingDecision

OnCreateSpan never samples.

func (*TagMatchingSampler) OnFinishSpan

func (s *TagMatchingSampler) OnFinishSpan(span *jaeger.Span) jaeger.SamplingDecision

OnFinishSpan never samples.

func (*TagMatchingSampler) OnSetOperationName

func (s *TagMatchingSampler) OnSetOperationName(span *jaeger.Span, operationName string) jaeger.SamplingDecision

OnSetOperationName never samples.

func (*TagMatchingSampler) OnSetTag

func (s *TagMatchingSampler) OnSetTag(span *jaeger.Span, key string, value interface{}) jaeger.SamplingDecision

OnSetTag samples if the tag matches key and one of the allowed value(s).

type TagMatchingSamplingStrategy

type TagMatchingSamplingStrategy struct {
	Key      string       `json:"key"`
	Matchers []TagMatcher `json:"matchers"`
	// legacy format as map
	Values map[string]TagMatcher `json:"values"`
}

TagMatchingSamplingStrategy defines JSON format for TagMatchingSampler strategy.

Source Files

doc.go priority_sampler.go tag_sampler.go

Version
v2.30.0+incompatible (latest)
Published
Dec 7, 2021
Platform
linux/amd64
Imports
4 packages
Last checked
7 hours ago

Tools for package owners.