AgentGrpcService

internal class AgentGrpcService(val agent: Agent, options: AgentOptions, inProcessServerName: String)(source)

gRPC client that manages the agent's connection to the proxy.

Handles the full gRPC lifecycle: channel and stub creation, TLS configuration, agent registration, path registration/unregistration, heartbeat sending, and bidirectional scrape request/response streaming (including chunked transfers for large payloads). Supports reconnection by resetting stubs and channels on demand.

Parameters

agent

the parent Agent instance

options

agent configuration options (proxy hostname, keepalive, TLS, etc.)

inProcessServerName

the in-process server name (empty for Netty mode)

See also

Constructors

Link copied to clipboard
constructor(agent: Agent, options: AgentOptions, inProcessServerName: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
internal val agent: Agent
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
lateinit var channel: ManagedChannel
Link copied to clipboard
internal lateinit var grpcStub: ProxyServiceGrpcKt.ProxyServiceCoroutineStub
Link copied to clipboard
internal var unaryDeadlineSecs: Long

Functions

Link copied to clipboard
suspend fun connectAgent(transportFilterDisabled: Boolean): Boolean
Link copied to clipboard
suspend fun pathMapSize(): Int
Link copied to clipboard
suspend fun readRequestsFromProxy(agentHttpService: AgentHttpService, connectionContext: AgentConnectionContext)
Link copied to clipboard
suspend fun registerAgent(initialConnectionLatch: CountDownLatch)
Link copied to clipboard
suspend fun registerPathOnProxy(pathVal: String, labelsJson: String): RegisterPathResponse
Link copied to clipboard
Link copied to clipboard
suspend fun sendHeartBeat()
Link copied to clipboard
fun shutDown()
Link copied to clipboard
suspend fun unregisterPathOnProxy(pathVal: String): UnregisterPathResponse
Link copied to clipboard