-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KamonMetric cast error #608
Comments
This is a bit strange, counter doesn't have a record method, histogram does, but even that one will take only longs. |
The exception is also throwed with histogram method.
The implementation we have for histogram and counter , that is invoking the Kamon apis is the next:
It is weird that just changing the name of the metric it works, but with the name we were using in the previous version is not working and throws that exception. It seems that the line it fails in MetricRegistry
So at some point, with that concrete name we used for the histogram or counter metric, it is taking an object that is not possible to cast to Metric.Counter . As I said before changing the name of metric fix the issue, anyway something is not working fine there. |
Seems like metric is already registered under different instrument type, that's why only certain name values end up exploding. This here will log an error if it happens. |
I was taking a look into this and indeed, this happens when the user attempts to redefine a metric. The behavior is expected, just the exception thrown was not the right one and I just got it fixed here: #618. Thanks for sharing this issue @mikelalvarezgo. |
We are upgrading Kamon in our application to version 2.0. We are using the histogram and counter metrics for monitoring our application. I have found this exception during execution:
This method is called using an internal name, depending on the action we watch, using an internal class for monitoring:
Kamon.counter(name).withoutTags().record("appname.actionName.responseName")
In one case is throwing this exception, but changing the name of the counter metric solves the issue. Has anyone had this issue before?
The text was updated successfully, but these errors were encountered: