Documentation ¶
Index ¶
- Constants
- Variables
- type ActionHandler
- type ErrorConfig
- type ErrorSamplerHandler
- func (h *ErrorSamplerHandler) GetActionReference(action metav1.Object) metav1.OwnerReference
- func (h *ErrorSamplerHandler) GetActionScope(action metav1.Object) string
- func (h *ErrorSamplerHandler) GetRuleConfig(action metav1.Object) []Rule
- func (h *ErrorSamplerHandler) IsActionDisabled(action metav1.Object) bool
- func (h *ErrorSamplerHandler) List(ctx context.Context, c client.Client, namespace string) ([]metav1.Object, error)
- func (h *ErrorSamplerHandler) ValidateRuleConfig(config []Rule) error
- type GroupByTraceConfig
- type LatencyConfig
- type LatencySamplerHandler
- func (h *LatencySamplerHandler) GetActionReference(action metav1.Object) metav1.OwnerReference
- func (h *LatencySamplerHandler) GetActionScope(action metav1.Object) string
- func (h *LatencySamplerHandler) GetRuleConfig(action metav1.Object) []Rule
- func (h *LatencySamplerHandler) IsActionDisabled(action metav1.Object) bool
- func (h *LatencySamplerHandler) List(ctx context.Context, c client.Client, namespace string) ([]metav1.Object, error)
- func (h *LatencySamplerHandler) ValidateRuleConfig(config []Rule) error
- type Rule
- type RuleDetails
- type RuleType
- type SamplingConfig
Constants ¶
View Source
const (
DefaultWaitDuraiton = "30s"
)
Variables ¶
View Source
var SamplingSupportedActions = map[reflect.Type]ActionHandler{ reflect.TypeOf(&actionv1.LatencySampler{}): &LatencySamplerHandler{}, reflect.TypeOf(&actionv1.ErrorSampler{}): &ErrorSamplerHandler{}, }
Functions ¶
This section is empty.
Types ¶
type ActionHandler ¶
type ActionHandler interface { // GetRuleConfig Returns rule configuration for a given action GetRuleConfig(action metav1.Object) []Rule // // Lists all actions of a specific type in a given namespace List(ctx context.Context, client client.Client, namespace string) ([]metav1.Object, error) // ValidateRuleConfig validates the rule configuration for the action ValidateRuleConfig([]Rule) error // GetActionReference returns the owner reference for the action GetActionReference(action metav1.Object) metav1.OwnerReference // IsActionDisabled returns whether the action is disabled [action.Spec.Disabled] IsActionDisabled(action metav1.Object) bool // GetActionScope returns the scope of the action [global/service/endpoint] GetActionScope(action metav1.Object) string }
ActionHandler defines methods for handling sampling actions using metav1.Objects for generic handling
type ErrorConfig ¶
type ErrorConfig struct {
FallbackSamplingRatio float64 `json:"fallback_sampling_ratio"`
}
func (*ErrorConfig) Validate ¶
func (ec *ErrorConfig) Validate() error
type ErrorSamplerHandler ¶
type ErrorSamplerHandler struct{}
func (*ErrorSamplerHandler) GetActionReference ¶
func (h *ErrorSamplerHandler) GetActionReference(action metav1.Object) metav1.OwnerReference
func (*ErrorSamplerHandler) GetActionScope ¶
func (h *ErrorSamplerHandler) GetActionScope(action metav1.Object) string
func (*ErrorSamplerHandler) GetRuleConfig ¶
func (h *ErrorSamplerHandler) GetRuleConfig(action metav1.Object) []Rule
func (*ErrorSamplerHandler) IsActionDisabled ¶
func (h *ErrorSamplerHandler) IsActionDisabled(action metav1.Object) bool
func (*ErrorSamplerHandler) ValidateRuleConfig ¶
func (h *ErrorSamplerHandler) ValidateRuleConfig(config []Rule) error
type GroupByTraceConfig ¶
type GroupByTraceConfig struct {
WaitDuration string `json:"wait_duration"`
}
type LatencyConfig ¶
type LatencyConfig struct { ThresholdMs int `json:"threshold"` HttpRoute string `json:"http_route"` ServiceName string `json:"service_name"` FallbackSamplingRatio float64 `json:"fallback_sampling_ratio"` }
func (*LatencyConfig) Validate ¶
func (lc *LatencyConfig) Validate() error
type LatencySamplerHandler ¶
type LatencySamplerHandler struct{}
func (*LatencySamplerHandler) GetActionReference ¶
func (h *LatencySamplerHandler) GetActionReference(action metav1.Object) metav1.OwnerReference
func (*LatencySamplerHandler) GetActionScope ¶
func (h *LatencySamplerHandler) GetActionScope(action metav1.Object) string
func (*LatencySamplerHandler) GetRuleConfig ¶
func (h *LatencySamplerHandler) GetRuleConfig(action metav1.Object) []Rule
func (*LatencySamplerHandler) IsActionDisabled ¶
func (h *LatencySamplerHandler) IsActionDisabled(action metav1.Object) bool
func (*LatencySamplerHandler) ValidateRuleConfig ¶
func (h *LatencySamplerHandler) ValidateRuleConfig(config []Rule) error
type Rule ¶
type Rule struct { Name string `json:"name"` RuleType RuleType `json:"type"` Details RuleDetails `json:"rule_details"` }
Rule representes a rule in odigossampling processor rule
type RuleDetails ¶
type RuleDetails interface {
Validate() error
}
type SamplingConfig ¶
Click to show internal directories.
Click to hide internal directories.