control

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SrlCel = iota + 1
)

Variables

Functions

This section is empty.

Types

type CapabilitiesConfig

type CapabilitiesConfig struct {
	StructDigest bool
	ValueDigest  bool
}

func NewCapabilitiesFromProto

func NewCapabilitiesFromProto(c *protos.Capabilities) CapabilitiesConfig

func (CapabilitiesConfig) ToProto

func (cc CapabilitiesConfig) ToProto() *protos.Capabilities

type ClientUID

type ClientUID string

type ComputationLocation

type ComputationLocation uint8
const (
	ComputationLocationUnknown ComputationLocation = iota
	ComputationLocationSampler
	ComputationLocationCollector
)

func ParseComputationLocation

func ParseComputationLocation(t string) ComputationLocation

func (ComputationLocation) String

func (s ComputationLocation) String() string

type DeterministicSamplingConfig

type DeterministicSamplingConfig struct {
	SampleRate             int32
	SampleEmptyDeterminant bool
}

type Digest

type Digest struct {
	UID                 SamplerDigestUID
	Name                string
	StreamUID           SamplerStreamUID
	FlushPeriod         time.Duration
	BufferSize          int
	ComputationLocation ComputationLocation

	// digest specific config
	Type  DigestType
	St    DigestSt
	Value DigestValue
}

func NewDigestFromProto

func NewDigestFromProto(protoDigest *protos.Digest) Digest

func (Digest) GetName

func (d Digest) GetName() string

func (*Digest) ToProto

func (d *Digest) ToProto() *protos.Digest

type DigestSt

type DigestSt struct {
	MaxProcessedFields int
}

func NewDigestStFromProto

func NewDigestStFromProto(protoDigestSt *protos.Digest_St) DigestSt

func (*DigestSt) ToProto

func (ds *DigestSt) ToProto() *protos.Digest_St

type DigestType

type DigestType uint8
const (
	DigestTypeUnknown DigestType = iota
	DigestTypeSt
	DigestTypeValue
)

type DigestUpdate

type DigestUpdate struct {
	Op     DigestUpdateOp
	Digest Digest
}

func NewDigestUpdateFromProto

func NewDigestUpdateFromProto(digestUpdate *protos.ClientDigestUpdate) DigestUpdate

func (*DigestUpdate) IsValid

func (du *DigestUpdate) IsValid() error

func (*DigestUpdate) ToProto

func (du *DigestUpdate) ToProto() *protos.ClientDigestUpdate

type DigestUpdateOp

type DigestUpdateOp int
const (
	DigestUpsert DigestUpdateOp = iota + 1
	DigestDelete
)

type DigestValue

type DigestValue struct {
	MaxProcessedFields int
}

func NewDigestValueFromProto

func NewDigestValueFromProto(protoDigestValue *protos.Digest_Value) DigestValue

func (*DigestValue) ToProto

func (dv *DigestValue) ToProto() *protos.Digest_Value

type Event

type Event struct {
	UID        SamplerEventUID
	Name       string
	StreamUID  SamplerStreamUID
	SampleType SampleType
	Rule       Rule
	Limiter    LimiterConfig
}

func NewEventFromProto

func NewEventFromProto(protoEvent *protos.Event) Event

func (Event) GetName

func (e Event) GetName() string

func (*Event) ToProto

func (e *Event) ToProto() *protos.Event

type EventUpdate

type EventUpdate struct {
	Op    EventUpdateOp
	Event Event
}

func NewEventUpdateFromProto

func NewEventUpdateFromProto(eventUpdate *protos.ClientEventUpdate) EventUpdate

func (*EventUpdate) IsValid

func (eu *EventUpdate) IsValid() error

func (*EventUpdate) ToProto

func (eu *EventUpdate) ToProto() *protos.ClientEventUpdate

type EventUpdateOp

type EventUpdateOp int
const (
	EventUpsert EventUpdateOp = iota + 1
	EventDelete
)

type LimiterConfig

type LimiterConfig struct {
	Limit int32
}

func NewLimiterFromProto

func NewLimiterFromProto(sr *protos.Limiter) LimiterConfig

func (LimiterConfig) ToProto

func (sr LimiterConfig) ToProto() *protos.Limiter

type Rule

type Rule struct {
	Lang       RuleLang
	Expression string
}

func NewRuleFromProto

func NewRuleFromProto(sr *protos.Rule) Rule

func (Rule) String

func (r Rule) String() string

func (Rule) ToProto

func (r Rule) ToProto() *protos.Rule

type RuleLang

type RuleLang int

func NewRuleLangFromProto

func NewRuleLangFromProto(lang protos.Rule_Language) RuleLang

func (RuleLang) String

func (srl RuleLang) String() string

func (RuleLang) ToProto

func (srl RuleLang) ToProto() protos.Rule_Language

type SampleType

type SampleType uint8
const (
	UnknownSampleType SampleType = iota
	RawSampleType
	StructDigestSampleType
	ValueDigestSampleType
	EventSampleType
	ConfigSampleType
)

func NewSampleTypeFromProto

func NewSampleTypeFromProto(sampleType protos.SampleType) SampleType

func ParseSampleType

func ParseSampleType(t string) SampleType

func (SampleType) String

func (s SampleType) String() string

func (SampleType) ToProto

func (s SampleType) ToProto() protos.SampleType

type Sampler

type Sampler struct {
	Name          string
	Resource      string
	UID           SamplerUID
	Config        SamplerConfig
	SamplingStats SamplerSamplingStats
}

func NewSampler

func NewSampler(name, resource string, uid SamplerUID) *Sampler

func NewSamplerFromProto

func NewSamplerFromProto(sampler *protos.Sampler) *Sampler

func (Sampler) ToProto

func (p Sampler) ToProto() *protos.Sampler

type SamplerConfig

type SamplerConfig struct {
	Streams    map[SamplerStreamUID]Stream
	LimiterIn  *LimiterConfig
	SamplingIn *SamplingConfig
	LimiterOut *LimiterConfig
	Digests    map[SamplerDigestUID]Digest
	Events     map[SamplerEventUID]Event
}

Used to get and update the sampler configuration.

When sent by the server to update a sampler, only the fields that are present are updated. If a field is present, the previous value is replaced with the new one.

func NewSamplerConfig

func NewSamplerConfig() *SamplerConfig

func NewSamplerConfigFromProto

func NewSamplerConfigFromProto(config *protos.SamplerConfig) SamplerConfig

func (*SamplerConfig) DigestTypesByLocation

func (pc *SamplerConfig) DigestTypesByLocation(location ComputationLocation) []DigestType

func (SamplerConfig) IsEmpty

func (pc SamplerConfig) IsEmpty() bool

func (*SamplerConfig) Merge

func (pc *SamplerConfig) Merge(update SamplerConfigUpdate)

func (SamplerConfig) ToProto

func (pc SamplerConfig) ToProto() *protos.SamplerConfig

type SamplerConfigUpdate

type SamplerConfigUpdate struct {
	// If a field is set to true, it means that the field is reset to its default.
	// If a configuration option is reset and set in the same request, it will be
	// first resetted and then set to its new value.
	Reset SamplerConfigUpdateReset

	// All fields are optional. If a field is nil, it means that the field is not updated.
	StreamUpdates []StreamUpdate
	LimiterIn     *LimiterConfig
	SamplingIn    *SamplingConfig
	LimiterOut    *LimiterConfig
	DigestUpdates []DigestUpdate
	EventUpdates  []EventUpdate
}

func NewSamplerConfigUpdate

func NewSamplerConfigUpdate() SamplerConfigUpdate

func NewSamplerConfigUpdateFromProto

func NewSamplerConfigUpdateFromProto(protoUpdate *protos.ClientSamplerConfigUpdate) SamplerConfigUpdate

func (SamplerConfigUpdate) IsValid

func (scu SamplerConfigUpdate) IsValid() error

func (SamplerConfigUpdate) ToProto

type SamplerConfigUpdateReset

type SamplerConfigUpdateReset struct {
	LimiterIn  bool
	SamplingIn bool
	Streams    bool
	LimiterOut bool
	Digests    bool
	Events     bool
}

func NewSamplerConfigUpdateResetFromProto

func NewSamplerConfigUpdateResetFromProto(protoReset *protos.ClientSamplerConfigUpdate_Reset) SamplerConfigUpdateReset

func (SamplerConfigUpdateReset) ToProto

type SamplerDigestUID

type SamplerDigestUID string

type SamplerEventUID

type SamplerEventUID string

type SamplerSamplingStats

type SamplerSamplingStats struct {
	SamplesEvaluated uint64
	SamplesExported  uint64
	SamplesDigested  uint64
}

func NewSamplerSamplingStatsFromProto

func NewSamplerSamplingStatsFromProto(stats *protos.SamplerSamplingStats) SamplerSamplingStats

func (SamplerSamplingStats) ToProto

type SamplerStreamRuleUID

type SamplerStreamRuleUID string

type SamplerStreamUID

type SamplerStreamUID string

type SamplerUID

type SamplerUID string

type SamplingConfig

type SamplingConfig struct {
	SamplingType          SamplingType
	DeterministicSampling DeterministicSamplingConfig
}

func NewSamplingConfigFromProto

func NewSamplingConfigFromProto(sr *protos.Sampling) SamplingConfig

func (SamplingConfig) ToProto

func (sc SamplingConfig) ToProto() *protos.Sampling

type SamplingType

type SamplingType int
const (
	UnknownSamplingType SamplingType = iota
	DeterministicSamplingType
)

type Stream

type Stream struct {
	UID              SamplerStreamUID
	Name             string
	StreamRule       Rule
	ExportRawSamples bool
}

func NewStreamFromProto

func NewStreamFromProto(s *protos.Stream) Stream

func (Stream) GetName

func (s Stream) GetName() string

func (Stream) ToProto

func (s Stream) ToProto() *protos.Stream

type StreamUpdate

type StreamUpdate struct {
	Op     StreamUpdateOp
	Stream Stream
}

func NewStreamUpdateFromProto

func NewStreamUpdateFromProto(streamUpdate *protos.ClientStreamUpdate) StreamUpdate

func (*StreamUpdate) IsValid

func (su *StreamUpdate) IsValid() error

func (*StreamUpdate) ToProto

func (su *StreamUpdate) ToProto() *protos.ClientStreamUpdate

type StreamUpdateOp

type StreamUpdateOp int
const (
	StreamUpsert StreamUpdateOp = iota + 1
	StreamDelete
)

Jump to

Keyboard shortcuts

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