proxy

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package proxy provides a client for communicating with the FODC Proxy.

Package proxy provides connection management for the FODC Proxy client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client manages connection and communication with the FODC Proxy.

func NewClient

func NewClient(
	proxyAddr string,
	nodeRole string,
	podName string,
	containerNames []string,
	labels map[string]string,
	heartbeatInterval time.Duration,
	reconnectInterval time.Duration,
	flightRecorder *flightrecorder.FlightRecorder,
	clusterCollector *cluster.Collector,
	lifecycleCollector *lifecycle.Collector,
	collectionLister crashcollector.CollectionLister,
	profileSource ProfileSource,
	logger *logger.Logger,
) *Client

NewClient creates a new Client instance.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

Connect establishes a gRPC connection to Proxy.

func (*Client) Disconnect

func (c *Client) Disconnect() error

Disconnect closes connection to Proxy.

func (*Client) RetrieveAndSendMetrics

func (c *Client) RetrieveAndSendMetrics(_ context.Context, filter *MetricsRequestFilter) error

RetrieveAndSendMetrics retrieves metrics from Flight Recorder when requested by Proxy.

func (*Client) SendHeartbeat

func (c *Client) SendHeartbeat(ctx context.Context) error

SendHeartbeat sends heartbeat to Proxy. The provided context bounds the wait so that a stream whose Send is wedged (for example, after the proxy entered graceful_stop and the underlying TCP write queue is no longer being drained) cannot pin the heartbeat goroutine indefinitely.

func (*Client) SetNodeRoleProvider added in v0.11.0

func (c *Client) SetNodeRoleProvider(provider func() (string, map[string]string))

SetNodeRoleProvider wires a live source of the node's resolved role (and labels), typically the cluster collector's GetNodeInfo. Heartbeats then carry the current role so the proxy can upgrade a registration made before the role resolved.

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

Start starts the proxy client with automatic reconnection.

func (*Client) StartClusterStateStream

func (c *Client) StartClusterStateStream(ctx context.Context) error

StartClusterStateStream establishes bi-directional cluster state stream with Proxy.

func (*Client) StartConnManager

func (c *Client) StartConnManager(ctx context.Context)

StartConnManager is useful for tests or scenarios where you want to manually control connection lifecycle.

func (*Client) StartCrashStream added in v0.11.0

func (c *Client) StartCrashStream(ctx context.Context) error

StartCrashStream establishes bi-directional crash diagnostics stream with Proxy.

func (*Client) StartLifecycleStream added in v0.10.1

func (c *Client) StartLifecycleStream(ctx context.Context) error

StartLifecycleStream establishes bi-directional lifecycle stream with Proxy.

func (*Client) StartMetricsStream

func (c *Client) StartMetricsStream(ctx context.Context) error

StartMetricsStream establishes bi-directional metrics stream with Proxy.

func (*Client) StartPressureProfilesStream added in v0.11.0

func (c *Client) StartPressureProfilesStream(ctx context.Context) error

StartPressureProfilesStream establishes the bi-directional pressure-profiles stream with Proxy.

func (*Client) StartRegistrationStream

func (c *Client) StartRegistrationStream(ctx context.Context) error

StartRegistrationStream establishes bi-directional registration stream with Proxy.

func (*Client) StartSchemaRegistryStream added in v0.11.0

func (c *Client) StartSchemaRegistryStream(ctx context.Context) error

StartSchemaRegistryStream establishes the bi-directional schema registry stream with Proxy. Every agent opens it, but the Proxy only ever drives the one schema-serving agent it selects by role, so all other agents' streams sit idle.

type MetricsRequestFilter

type MetricsRequestFilter struct {
	StartTime *time.Time
	EndTime   *time.Time
}

MetricsRequestFilter defines filters for metrics requests.

type ProfileSource added in v0.11.0

type ProfileSource interface {
	ListProfileRecords() []pressureprofiler.ProfileRecord
	OpenProfile(path string) (io.ReadCloser, error)
}

ProfileSource is the read side of the pressure profiler the proxy client serves: it lists capture-event metadata and opens a profile file for chunked download.

Jump to

Keyboard shortcuts

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