metricsservice

package
v2.0.0-...-1d558e1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SDKMetricsStream is the name of the stream read replica proxy's write metrics to
	SDKMetricsStream = "stream:sdk_metrics"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a type for interacting with the Feature Flag Metric Service

func NewClient

func NewClient(l log.Logger, addr string, token func() string, reg *prometheus.Registry) (Client, error)

NewClient creates a MetricStore

func (Client) PostMetrics

func (c Client) PostMetrics(ctx context.Context, envID string, metric domain.MetricsRequest, clusterIdentifier string) (err error)

type Queue

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

Queue is an in memory queue storing metrics requests. It flushes its contents whenever the max queue size in MB has been reached or the ticker expires, whichever occurs first. It exposes a channel via the Listen() method where it writes metrics to before flushing. This allows other processes to receive the metrics once the queue is full.

func NewQueue

func NewQueue(ctx context.Context, l log.Logger, duration time.Duration) Queue

NewQueue creates a Queue

func (Queue) Listen

func (q Queue) Listen(ctx context.Context) <-chan map[string]domain.MetricsRequest

Listen returns a channel that the queue flushes metrics requests to

func (Queue) StoreMetrics

func (q Queue) StoreMetrics(ctx context.Context, m domain.MetricsRequest) error

StoreMetrics adds a metrics request to the queue

type Stream

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

Stream is a type for publishing metrics to a stream and implements the MetricStore interface

func NewStream

func NewStream(s domain.Publisher) Stream

NewStream creates a metrics stream

func (Stream) StoreMetrics

func (m Stream) StoreMetrics(ctx context.Context, req domain.MetricsRequest) error

StoreMetrics pushes metrics onto a stream

type Worker

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

Worker is a type that is used by the Primary Proxy to consume metrics from ReadReplicas and forward them on to Harness Saas.

func NewWorker

func NewWorker(l log.Logger, store metricStore, metricSvc metricService, sub domain.Subscriber, readConn int, clusterIdentifer string) Worker

NewWorker creates a Worker

func (Worker) Start

func (w Worker) Start(ctx context.Context)

Start starts the process whereby the Worker consumes metrics from read replicas and forwards them on to Harness Saas.

Jump to

Keyboard shortcuts

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