Description
Hi,
I'm using a tool that utilizes gRPC-Java for communication between the client and server. The server is located in an AWS EKS cluster and is accessible externally via NGINX ingress.
To configure it, I followed this guide: https://kubernetes.github.io/ingress-nginx/examples/grpc/
After deploying all components, I tested it with grpcurl and received a successful response.
Then, I configured communication between the agent and the server, and it also worked. However, I encountered an issue when the agent lost its connection for a period of time during communication
Below is a log message
Agent log
Feb 03 14:24:11 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:11.811 INFO [AgentGrpcService.kt:132] - Creating gRPC stubs [Agent test-agent-1]
Feb 03 14:24:11 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:11.812 INFO [GrpcDsl.kt:75] - Creating connection for gRPC server at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:24:11 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:11.813 INFO [Agent.kt:153] - Resetting agentId [Agent test-agent-1]
Feb 03 14:24:11 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:11.813 INFO [AgentGrpcService.kt:163] - Connecting to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth)... [Agent test-agent-1]
Feb 03 14:24:12 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:12.534 INFO [AgentClientInterceptor.kt:58] - Assigned agentId: 2488 to Agent{agentId=2488, agentName=test-agent-1, proxyHost=prometheus-proxy.service.net:443, adminService=Disabled, metricsService=Disabled} [grpc-default-executor-5]
Feb 03 14:24:12 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:12.535 INFO [AgentGrpcService.kt:169] - Connected to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:24:12 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:12.900 INFO [AgentPathManager.kt:78] - Registered http://127.0.0.1:9273/metrics as /test-agent-1 with labels {} [Agent test-agent-1]
Feb 03 14:24:12 test-agent-1 prometheus_proxy_agent[1042983]: 14:24:12.901 INFO [Agent.kt:244] - Heartbeat scheduled to fire after 5s of inactivity [DefaultDispatcher-worker-9]
Feb 03 14:25:16 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:16.865 WARN [Agent.kt:209] - Cannot connect to proxy at prometheus-proxy.service.net:443 StatusException INTERNAL: RST_STREAM closed stream. HTTP/2 error code: PROTOCOL_ERROR [Agent test-agent-1]
Feb 03 14:25:16 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:16.866 INFO [Agent.kt:216] - Waited 0s to reconnect [Agent test-agent-1]
Feb 03 14:25:16 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:16.866 INFO [AgentGrpcService.kt:132] - Creating gRPC stubs [Agent test-agent-1]
Feb 03 14:25:16 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:16.867 INFO [GrpcDsl.kt:75] - Creating connection for gRPC server at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:25:16 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:16.868 INFO [Agent.kt:153] - Resetting agentId [Agent test-agent-1]
Feb 03 14:25:16 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:16.868 INFO [AgentGrpcService.kt:163] - Connecting to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth)... [Agent test-agent-1]
Feb 03 14:25:17 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:17.699 INFO [AgentClientInterceptor.kt:58] - Assigned agentId: 2492 to Agent{agentId=2492, agentName=test-agent-1, proxyHost=prometheus-proxy.service.net:443, adminService=Disabled, metricsService=Disabled} [grpc-default-executor-6]
Feb 03 14:25:17 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:17.700 INFO [AgentGrpcService.kt:169] - Connected to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:25:18 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:18.039 INFO [AgentPathManager.kt:78] - Registered http://127.0.0.1:9273/metrics as /test-agent-1 with labels {} [Agent test-agent-1]
Feb 03 14:25:18 test-agent-1 prometheus_proxy_agent[1042983]: 14:25:18.040 INFO [Agent.kt:244] - Heartbeat scheduled to fire after 5s of inactivity [DefaultDispatcher-worker-6]
Feb 03 14:26:21 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:21.936 WARN [Agent.kt:209] - Cannot connect to proxy at prometheus-proxy.service.net:443 StatusException INTERNAL: RST_STREAM closed stream. HTTP/2 error code: PROTOCOL_ERROR [Agent test-agent-1]
Feb 03 14:26:21 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:21.937 INFO [Agent.kt:216] - Waited 0s to reconnect [Agent test-agent-1]
Feb 03 14:26:21 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:21.937 INFO [AgentGrpcService.kt:132] - Creating gRPC stubs [Agent test-agent-1]
Feb 03 14:26:21 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:21.938 INFO [GrpcDsl.kt:75] - Creating connection for gRPC server at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:26:21 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:21.939 INFO [Agent.kt:153] - Resetting agentId [Agent test-agent-1]
Feb 03 14:26:21 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:21.940 INFO [AgentGrpcService.kt:163] - Connecting to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth)... [Agent test-agent-1]
Feb 03 14:26:22 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:22.664 INFO [AgentClientInterceptor.kt:58] - Assigned agentId: 2495 to Agent{agentId=2495, agentName=test-agent-1, proxyHost=prometheus-proxy.service.net:443, adminService=Disabled, metricsService=Disabled} [grpc-default-executor-7]
Feb 03 14:26:22 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:22.665 INFO [AgentGrpcService.kt:169] - Connected to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:26:23 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:23.107 INFO [AgentPathManager.kt:78] - Registered http://127.0.0.1:9273/metrics as /test-agent-1 with labels {} [Agent test-agent-1]
Feb 03 14:26:23 test-agent-1 prometheus_proxy_agent[1042983]: 14:26:23.108 INFO [Agent.kt:244] - Heartbeat scheduled to fire after 5s of inactivity [DefaultDispatcher-worker-12]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.801 WARN [ScrapeResults.kt:120] - fetchScrapeUrl() java.util.concurrent.CancellationException: Parent job is Cancelling - http://127.0.0.1:9273/metrics [DefaultDispatcher-worker-11]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: java.util.concurrent.CancellationException: Parent job is Cancelling
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.UtilsKt$attachToUserJob$cleanupHandler$1.invoke(Utils.kt:99)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.UtilsKt$attachToUserJob$cleanupHandler$1.invoke(Utils.kt:97)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.InvokeOnCancelling.invoke(JobSupport.kt:1571)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.JobSupport.invokeOnCompletionInternal$kotlinx_coroutines_core(JobSupport.kt:500)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.JobSupport.invokeOnCompletion(JobSupport.kt:452)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.Job$DefaultImpls.invokeOnCompletion$default(Job.kt:313)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.HttpClientEngineKt.createCallContext(HttpClientEngine.kt:166)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.HttpClientEngine$DefaultImpls.executeWithinCallContext(HttpClientEngine.kt:91)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.HttpClientEngine$DefaultImpls.access$executeWithinCallContext(HttpClientEngine.kt:24)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.HttpClientEngine$install$1.invokeSuspend(HttpClientEngine.kt:70)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.HttpClientEngine$install$1.invoke(HttpClientEngine.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.engine.HttpClientEngine$install$1.invoke(HttpClientEngine.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.execute$ktor_utils(DebugPipelineContext.kt:63)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:86)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$DefaultSender.execute(HttpSend.kt:118)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$Sender.proceed(CommonHooks.kt:41)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.auth.AuthKt$Auth$2$2.invokeSuspend(Auth.kt:130)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.auth.AuthKt$Auth$2$2.invoke(Auth.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.auth.AuthKt$Auth$2$2.invoke(Auth.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invokeSuspend(CommonHooks.kt:46)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$InterceptedSender.execute(HttpSend.kt:96)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$Sender.proceed(CommonHooks.kt:41)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRequestRetryKt$HttpRequestRetry$2$1.invokeSuspend(HttpRequestRetry.kt:296)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRequestRetryKt$HttpRequestRetry$2$1.invoke(HttpRequestRetry.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRequestRetryKt$HttpRequestRetry$2$1.invoke(HttpRequestRetry.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invokeSuspend(CommonHooks.kt:46)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$InterceptedSender.execute(HttpSend.kt:96)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$Sender.proceed(CommonHooks.kt:41)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpTimeoutKt$HttpTimeout$2$1.invokeSuspend(HttpTimeout.kt:175)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpTimeoutKt$HttpTimeout$2$1.invoke(HttpTimeout.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpTimeoutKt$HttpTimeout$2$1.invoke(HttpTimeout.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invokeSuspend(CommonHooks.kt:46)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$InterceptedSender.execute(HttpSend.kt:96)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$Sender.proceed(CommonHooks.kt:41)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRedirectKt$HttpRedirect$2$1.invokeSuspend(HttpRedirect.kt:97)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRedirectKt$HttpRedirect$2$1.invoke(HttpRedirect.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRedirectKt$HttpRedirect$2$1.invoke(HttpRedirect.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invokeSuspend(CommonHooks.kt:46)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$InterceptedSender.execute(HttpSend.kt:96)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$Sender.proceed(CommonHooks.kt:41)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpCallValidatorKt$HttpCallValidator$2$2.invokeSuspend(HttpCallValidator.kt:112)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpCallValidatorKt$HttpCallValidator$2$2.invoke(HttpCallValidator.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpCallValidatorKt$HttpCallValidator$2$2.invoke(HttpCallValidator.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invokeSuspend(CommonHooks.kt:46)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.api.Send$install$1.invoke(CommonHooks.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$InterceptedSender.execute(HttpSend.kt:96)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$Plugin$install$1.invokeSuspend(HttpSend.kt:84)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$Plugin$install$1.invoke(HttpSend.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpSend$Plugin$install$1.invoke(HttpSend.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.RequestError$install$1.invokeSuspend(HttpCallValidator.kt:134)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.RequestError$install$1.invoke(HttpCallValidator.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.RequestError$install$1.invoke(HttpCallValidator.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1.invokeSuspend$proceed(HttpRequestLifecycle.kt:40)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1.access$invokeSuspend$proceed(HttpRequestLifecycle.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1$1.invoke(HttpRequestLifecycle.kt:40)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1$1.invoke(HttpRequestLifecycle.kt:40)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRequestLifecycleKt$HttpRequestLifecycle$1$1.invokeSuspend(HttpRequestLifecycle.kt:27)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRequestLifecycleKt$HttpRequestLifecycle$1$1.invoke(HttpRequestLifecycle.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.HttpRequestLifecycleKt$HttpRequestLifecycle$1$1.invoke(HttpRequestLifecycle.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1.invokeSuspend(HttpRequestLifecycle.kt:40)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1.invoke(HttpRequestLifecycle.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.plugins.SetupRequestContext$install$1.invoke(HttpRequestLifecycle.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceedLoop(DebugPipelineContext.kt:79)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.proceed(DebugPipelineContext.kt:57)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.DebugPipelineContext.execute$ktor_utils(DebugPipelineContext.kt:63)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:86)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.HttpClient.execute$ktor_client_core(HttpClient.kt:1393)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.statement.HttpStatement.fetchResponse(HttpStatement.kt:147)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.ktor.client.statement.HttpStatement.execute(HttpStatement.kt:68)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at com.github.pambrose.common.dsl.KtorDsl.get(KtorDsl.kt:85)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.agent.AgentHttpService.fetchContent(AgentHttpService.kt:90)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.agent.AgentHttpService.fetchContentFromUrl(AgentHttpService.kt:76)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.agent.AgentHttpService.fetchScrapeUrl(AgentHttpService.kt:61)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.agent.AgentGrpcService$readRequestsFromProxy$2$1$2.invokeSuspend(AgentGrpcService.kt:298)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.agent.AgentGrpcService$readRequestsFromProxy$2$1$2.invoke(AgentGrpcService.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.agent.AgentGrpcService$readRequestsFromProxy$2$1$2.invoke(AgentGrpcService.kt)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at io.prometheus.Agent$run$connectToProxy$3$4.invokeSuspend(Agent.kt:186)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:832)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.808 WARN [Agent.kt:209] - Cannot connect to proxy at prometheus-proxy.service.net:443 StatusException INTERNAL: RST_STREAM closed stream. HTTP/2 error code: PROTOCOL_ERROR [Agent test-agent-1]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.808 INFO [Agent.kt:216] - Waited 0s to reconnect [Agent test-agent-1]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.808 INFO [AgentGrpcService.kt:132] - Creating gRPC stubs [Agent test-agent-1]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.809 INFO [GrpcDsl.kt:75] - Creating connection for gRPC server at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.810 INFO [Agent.kt:153] - Resetting agentId [Agent test-agent-1]
Feb 03 14:27:25 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:25.810 INFO [AgentGrpcService.kt:163] - Connecting to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth)... [Agent test-agent-1]
Feb 03 14:27:26 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:26.526 INFO [AgentClientInterceptor.kt:58] - Assigned agentId: 2499 to Agent{agentId=2499, agentName=test-agent-1, proxyHost=prometheus-proxy.service.net:443, adminService=Disabled, metricsService=Disabled} [grpc-default-executor-8]
Feb 03 14:27:26 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:26.527 INFO [AgentGrpcService.kt:169] - Connected to proxy at prometheus-proxy.service.net:443 using TLS (no mutual auth) [Agent test-agent-1]
Feb 03 14:27:26 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:26.892 INFO [AgentPathManager.kt:78] - Registered http://127.0.0.1:9273/metrics as /test-agent-1 with labels {} [Agent test-agent-1]
Feb 03 14:27:26 test-agent-1 prometheus_proxy_agent[1042983]: 14:27:26.893 INFO [Agent.kt:244] - Heartbeat scheduled to fire after 5s of inactivity [DefaultDispatcher-worker-1]
To rule out any potential errors with the app, I also tested it with a simpler configuration, where the server was deployed on a standard EC2 instance and made available to the web. In this setup, I didn’t encounter any problems; everything worked as expected. So, it seems that the issue lies somewhere in the configuration of the NLB used by NGINX ingress or with NGINX ingress itself
Below is a visualization of how often the connection is dropped