question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception Metrics cause IllegalArgumentException when using custom ErrorDecoders

See original GitHub issue

Seems like the MeteredInvocationHandleFactory in feign-micrometer 11.5 tries to create both a timer and counter with the same name when using a custom error decoder that does not return a subclass of FeignException. This results in the following exception:

Caused by: java.lang.IllegalArgumentException: There is already a registered meter of a different type with the same name
	at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:571)
	at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:561)
	at io.micrometer.core.instrument.MeterRegistry.counter(MeterRegistry.java:284)
	at io.micrometer.core.instrument.Counter$Builder.register(Counter.java:128)
	at io.micrometer.core.instrument.MeterRegistry.counter(MeterRegistry.java:391)
	at feign.micrometer.MeteredInvocationHandleFactory.createExceptionCounter(MeteredInvocationHandleFactory.java:108)
	at feign.micrometer.MeteredInvocationHandleFactory.lambda$create$0(MeteredInvocationHandleFactory.java:85)
	at com.sun.proxy.$Proxy128.getById(Unknown Source)

I have created this repo to demonstrate the issue (refer to the tests).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
velocommented, Jul 26, 2021

Fixed on 11.6

1reaction
velocommented, Jul 22, 2021

do you have any preferences for the metric name? right now both are named feign.exception if i recall correctly

If both express the same information, probably is safe to just eliminate one

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenFeign custom error decoder not catching ...
I created a custom error decoder which handles response errors as intended but connection refused errors seem to bypass my custom decoder. P.S. ......
Read more >
Spring Cloud OpenFeign
This project provides OpenFeign integrations for Spring Boot apps through ... related exceptions, and any RetryableException thrown from an ErrorDecoder.
Read more >
Error decoding percent encoded characters - Java Bug System
This one fails with: Caused by: java.lang.IllegalArgumentException: Error decoding percent encoded characters at java.base/sun.net.www.
Read more >
AWS Lambda function errors in Java
This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI.
Read more >
Lettuce Reference Guide
Synchronous methods will throw a RedisCommandExecutionException in case Redis responds with an error. Asynchronous connections do not throw ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found