Documentation ¶
Index ¶
- Constants
- Variables
- type ClientUID
- type ComputationLocation
- type DeterministicSamplingConfig
- type Digest
- type DigestSt
- type DigestType
- type DigestUpdate
- type DigestUpdateOp
- type DigestValue
- type Digests
- type Event
- type EventUpdate
- type EventUpdateOp
- type Events
- type LimiterConfig
- type Rule
- type RuleLang
- type SampleType
- type Sampler
- type SamplerConfig
- type SamplerConfigUpdate
- type SamplerConfigUpdateReset
- type SamplerDigestUID
- type SamplerEventUID
- type SamplerSamplingStats
- type SamplerStreamRuleUID
- type SamplerStreamUID
- type SamplerUID
- type SamplingConfig
- type SamplingType
- type Stream
- type StreamUpdate
- type StreamUpdateOp
- type Streams
- type Tag
Constants ¶
const ( ProducerTag = "producer" ConsumerTag = "consumer" RequestTag = "request" ResponseTag = "response" DLQTag = "dlq" )
if updated, remember to update the exported tags in the public sampler API
Variables ¶
var ValidSampleTypes = []SampleType{UnknownSampleType, RawSampleType, StructDigestSampleType, EventSampleType}
Functions ¶
This section is empty.
Types ¶
type ComputationLocation ¶
type ComputationLocation uint8
const ( ComputationLocationUnknown ComputationLocation = iota ComputationLocationSampler ComputationLocationCollector )
func NewComputationLocationFromString ¶ added in v0.2.0
func NewComputationLocationFromString(t string) ComputationLocation
func (ComputationLocation) MarshalYAML ¶ added in v0.2.0
func (cl ComputationLocation) MarshalYAML() (interface{}, error)
func (ComputationLocation) String ¶
func (cl ComputationLocation) String() string
func (*ComputationLocation) UnmarshalYAML ¶ added in v0.2.0
func (cl *ComputationLocation) UnmarshalYAML(value *yaml.Node) error
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 `yaml:",omitempty"` Value *DigestValue `yaml:",omitempty"` }
func NewDigestFromProto ¶
type DigestType ¶
type DigestType uint8
const ( DigestTypeUnknown DigestType = iota DigestTypeSt DigestTypeValue )
func NewDigestTypeFromString ¶ added in v0.2.0
func NewDigestTypeFromString(t string) DigestType
func (DigestType) MarshalYAML ¶ added in v0.2.0
func (dt DigestType) MarshalYAML() (interface{}, error)
func (DigestType) String ¶ added in v0.2.0
func (dt DigestType) String() string
func (*DigestType) UnmarshalYAML ¶ added in v0.2.0
func (dt *DigestType) UnmarshalYAML(value *yaml.Node) error
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 Digests ¶ added in v0.2.0
type Digests map[SamplerDigestUID]Digest
func (Digests) MarshalYAML ¶ added in v0.2.0
MarshalYAML implements the yaml.Marshaler interface. Digests contains a map, but the data is marshaled into a list.
func (*Digests) UnmarshalYAML ¶ added in v0.2.0
UnmarshalYAML implements the yaml.Unmarshaler interface. Digests contains a list, but the data is unmarshaled into a map.
type Event ¶
type Event struct { UID SamplerEventUID Name string StreamUID SamplerStreamUID SampleType SampleType Rule Rule Limiter LimiterConfig ExportTemplate string }
func NewEventFromProto ¶
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 Events ¶ added in v0.2.0
type Events map[SamplerEventUID]Event
func (Events) MarshalYAML ¶ added in v0.2.0
MarshalYAML implements the yaml.Marshaler interface. Events contains a map, but the data is marshaled into a list.
func (*Events) UnmarshalYAML ¶ added in v0.2.0
UnmarshalYAML implements the yaml.Unmarshaler interface. Events contains a list, but the data is unmarshaled into a map.
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 ¶
func NewRuleFromProto ¶
type RuleLang ¶
type RuleLang int
func NewRuleLangFromProto ¶
func NewRuleLangFromProto(lang protos.Rule_Language) RuleLang
func NewRuleLangFromString ¶ added in v0.2.0
func (RuleLang) MarshalYAML ¶ added in v0.2.0
func (RuleLang) ToProto ¶
func (srl RuleLang) ToProto() protos.Rule_Language
func (*RuleLang) UnmarshalYAML ¶ added in v0.2.0
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 Tags []Tag UID SamplerUID Config SamplerConfig SamplingStats SamplerSamplingStats }
func NewSampler ¶
func NewSampler(name, resource string, uid SamplerUID) *Sampler
func NewSamplerFromProto ¶
type SamplerConfig ¶
type SamplerConfig struct { Streams Streams LimiterIn *LimiterConfig SamplingIn *SamplingConfig LimiterOut *LimiterConfig Digests Digests Events Events }
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 ¶
func (scu SamplerConfigUpdate) ToProto() *protos.ClientSamplerConfigUpdate
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 ¶
func (scr SamplerConfigUpdateReset) ToProto() *protos.ClientSamplerConfigUpdate_Reset
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 ¶
func (s SamplerSamplingStats) ToProto() *protos.SamplerSamplingStats
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 ¶
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 )
type Streams ¶ added in v0.2.0
type Streams map[SamplerStreamUID]Stream
func (Streams) MarshalYAML ¶ added in v0.2.0
MarshalYAML implements the yaml.Marshaler interface. Streams contains a map, but the data is marshaled into a list.
func (*Streams) UnmarshalYAML ¶ added in v0.2.0
UnmarshalYAML implements the yaml.Unmarshaler interface. Streams contains a list, but the data is unmarshaled into a map.
type Tag ¶ added in v0.3.0
func NewTagFromProto ¶ added in v0.3.0
func NewTagFromProto(tag *protos.Sampler_Tag) Tag
func NewTagsFromProto ¶ added in v0.3.0
func NewTagsFromProto(protoTags []*protos.Sampler_Tag) []Tag
func (Tag) ToProto ¶ added in v0.3.0
func (t Tag) ToProto() *protos.Sampler_Tag