analytics

package
v1.53.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsSinkSpanExporter

type AnalyticsSinkSpanExporter struct {
	// contains filtered or unexported fields
}

AnalyticsSinkSpanExporter implements SpanExporter.

func NewAnalyticsSinkSpanExporter

func NewAnalyticsSinkSpanExporter(logger *zap.Logger, analyticsStoreMutator AnalyticsStoreMutator) *AnalyticsSinkSpanExporter

NewAnalyticsSinkSpanExporter is the constructor function for an AnalyticsSpanExporter.

func (*AnalyticsSinkSpanExporter) ExportSpans

func (a *AnalyticsSinkSpanExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error

ExportSpans transforms the spans into []*EvaluationResponse which the mutator takes to store into an analytics store.

func (*AnalyticsSinkSpanExporter) Shutdown

Shutdown closes resources for an AnalyticsStoreMutator.

type AnalyticsStoreMutator

type AnalyticsStoreMutator interface {
	IncrementFlagEvaluationCounts(ctx context.Context, responses []*EvaluationResponse) error
	Close() error
}

type Client

type Client interface {
	GetFlagEvaluationsCount(ctx context.Context, req *FlagEvaluationsCountRequest) ([]string, []float32, error)
	fmt.Stringer
}

Client is a contract that each analytics store needs to conform to for getting analytics from the implemented store.

type EvaluationResponse

type EvaluationResponse struct {
	FlagKey         string    `json:"flagKey,omitempty"`
	FlagType        string    `json:"flagType,omitempty"`
	NamespaceKey    string    `json:"namespaceKey,omitempty"`
	Reason          string    `json:"reason,omitempty"`
	Match           *bool     `json:"match,omitempty"`
	EvaluationValue *string   `json:"evaluationValue,omitempty"`
	Timestamp       time.Time `json:"timestamp,omitempty"`
	EntityId        string    `json:"entityId,omitempty"`
}

type FlagEvaluationsCountRequest added in v1.52.0

type FlagEvaluationsCountRequest struct {
	NamespaceKey string
	FlagKey      string
	From         time.Time
	To           time.Time
	StepMinutes  int
}

type Server

type Server struct {
	analytics.UnimplementedAnalyticsServiceServer
	// contains filtered or unexported fields
}

Server is a grpc server for Flipt analytics.

func New

func New(logger *zap.Logger, client Client) *Server

New constructs a new server for Flipt analytics.

func (*Server) GetFlagEvaluationsCount

GetFlagEvaluationsCount is the implemented RPC method that will return aggregated flag evaluation counts.

func (*Server) RegisterGRPC

func (s *Server) RegisterGRPC(server *grpc.Server)

func (*Server) SkipsAuthorization added in v1.50.1

func (s *Server) SkipsAuthorization(ctx context.Context) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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