-
Notifications
You must be signed in to change notification settings - Fork 36
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
TagsCache returns wrong tags #185
Comments
Thanks for reporting @AlexMisha , I'll look into this |
tsegismont
added a commit
to tsegismont/vertx-micrometer-metrics
that referenced
this issue
Jul 19, 2023
See vert-x3#185 Use flyweight and cache only when running on standard context in event loop. Otherwise, the cache might return wrong tags (e.g. when invoked inside executeBlocking on standard context). Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont
added a commit
to tsegismont/vertx-micrometer-metrics
that referenced
this issue
Jul 19, 2023
Fixes vert-x3#185 Use flyweight and cache only when running on standard context in event loop. Otherwise, the cache might return wrong tags (e.g. when invoked inside executeBlocking on standard context). Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont
added a commit
that referenced
this issue
Jul 19, 2023
See #185 Use flyweight and cache only when running on standard context in event loop. Otherwise, the cache might return wrong tags (e.g. when invoked inside executeBlocking on standard context). Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont
added a commit
that referenced
this issue
Jul 19, 2023
Fixes #185 Use flyweight and cache only when running on standard context in event loop. Otherwise, the cache might return wrong tags (e.g. when invoked inside executeBlocking on standard context). Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
Closed in #189 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
4.3.8, 4.4.0
Context
I use Prometheus for metrics collection.
Worker pool in unordered mode is widely used in my project.
I encountered an exception after upgrade my project to vert.x 4.3.8:
It seems like VertxEventBusMetrics sometimes tries to pass tags from pool meter instead of [address].
After some debugging I found incorrect tags come from TagsCache.
I've made a simple concurrency test for TagsCache. It submits lots of tasks to worker pool via Vertx#executeBlocking in unordered mode. Every task consists of 3 steps:
io.vertx.micrometer.Label
and transform it to Tags viaLabels#toTags
. It is 'expected' tags.Test catches tens of such inconsistencies, i.e. cache can return tags which differ from requested. I think this is the root cause of original exception.
Do you have a reproducer?
https://github.com/AlexMisha/vertx-metrics-reproducer
Steps to reproduce
It will print found inconsistencies in the following form:
Extra
JDK 17
micrometer-registry-prometheus 1.1.0
The text was updated successfully, but these errors were encountered: