micrometer-metrics / micrometer-metrics/prometheus-rsocket-proxy
Exception when running sample code
- Dominant language
- Java
- Stars
- 77
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
New to the Prometheus RsocketProxy Client. When I attempt to run the example code provided on the site, I get an exception as shown below - please advise? (Can provide other details as needed.)
```
import io.micrometer.prometheus.rsocket.PrometheusRSocketClient;
import io.rsocket.transport.netty.client.TcpClientTransport;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.client.RestTemplate;
public class MLModelRSocketClient {
private static final Logger LOG = LoggerFactory.getLogger(MLModelRSocketClient.class);
public static void main(String[] args) {
try {
PrometheusMeterRegistry meterRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
LOG.info("Building RSocket client...");
PrometheusRSocketClient client = PrometheusRSocketClient
.build(meterRegistry,
TcpClientTransport.create("localhost", 7001))
.connect();
} catch (Exception ex) {
LOG.error("Error occurred...");
LOG.error(ExceptionUtils.getStackTrace(ex));
}
}
}
```
```
[INFO] --------------------------------------------------------[--r-e-a-c-t-o-r---t-c-p---n-i-o[2m]
WARN io.netty.channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at t[h[ 1t;a3i4lm IoNfF Ot[em ]p iTpoetlailn et.i mIet: u s2u.a6l0l9y sm
eans the last handler in the pipeline did not handle the exception.
io.netty.channel.ChannelPi[p[l1i;n3e4EmxIcNeFpOt[omn]: Frienaicsthoerd. naett:t y2.0r2e2s-o1u1r-c1e6sT.0D7e:f1a3u:l3t1P-o0o5l:e0d0Co
nnectio[n[r1o;v3i4dmeIrN$FPOo[lme]d C[n1nme-c-t-i-o-n-A-l-l-o-c-a-t-o-r-$-P-o-o-l-e-d-C-o-n-n--e-c-t-i-o-n-I-n-i-t-i-a-l-i-z-e-r-.-h-a-n-d-l-e-r-A-d-d-e-d-(-)- -h-a-s- -t-h-r-o-w-n- -a-nemx
ception; removed.
at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:624)
at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1463)
at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1115)
at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:650)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:502)
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:417)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:474)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at (base)
```
Contributor guide
Research direction
Start by running the PrometheusRSocketClient example from the issue against the documented sample setup and capture the complete exception, since the excerpt omits its cause. Compare the result with the site's example and record a reproducible failing case; done means the example runs or the issue has a confirmed, documented cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, prometheus
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100