-
Notifications
You must be signed in to change notification settings - Fork 870
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
Attempt to align and cleanup some jmx metrics #11621
base: main
Are you sure you want to change the base?
Conversation
metricAttribute: | ||
state: const(used) | ||
db.client.connection.state: const(used) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm missing something, the metric will have a metric attribute which will always have the same constant value. What is really the point of having such an attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct here, having a constant metric attribute only makes sense to provide breakdown of the same metric, occurences of wildfly.db.client.connection.usage
should be renamed to wildfly.db.client.connection.count
. I am currently trying to validate with the implementation if there is an overlap between the connection states or if it's an effective partition (in which case we can provide a breakdown).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When looking at the implementation and the wildfly test cases it seems that we have:
- "available" seems close to the definition of "idle"
- "in use" seems close to the definition of "busy"
- "active" seems to mostly be the sum of "available" + "in use"
- for "wait count", I haven't found any proper definition besides the docs
Given that both InUseCount
and IdleCount
refer to physical connection states in documentation, they effectively form a partition and then using a common metric with a constant attribute for idle
| used
makes sense.
For WaitCount
this is about the number of logical connections that are waiting for a physical connection, so it would also make sense to use the same metric with a custom wait
constant attribute.
When aggregating and removing attributes this would return the total number of logical connections to the database pool, and only a subset with either idle
or used
attribute value would be the physical connections.
I have updated this PR to match this in fb71fa1
Originally, |
I completely understand the duplication strategy here, but it's probably time to remove the duplication and simplify things:
Until we have such duplication removed, we will have to backport such changes in the contrib repo. Implementation-wise, a common implementation would likely reside in the contrib repo and be included in the instrumentation agent (there are already similar dependencies for the aws and gcp resource providers). Regarding compatibility, I really don't know what should be the best approach here, all the JMX metrics are very dependent on implementation details, having any formal definition in semconv and stability status for them is not possible. Maybe keeping previous iterations of the yaml files could provide this. |
Status following June 20th SIG meeting:
|
This is an attempt to fix a few errors and inconsistencies that I've found in the JMX metrics captured with the JMX Metric Insight feature.
I have intentionally limited the scope to
tomcat
,jetty
andwildfly
, but similar changes might be applied to other systems as a follow-up.tomcat.
for consistency withjetty
,wildfly
, ...tomcat.request.*
namespace for consistency withwildfly.request.*
system.network.io
withtomcat.network.io
for transferred bytessystem.network.io
with:wildfly.network.io
for transferred bytes (only direction attribute had to be changed).For the overall strategy, I agree that covering every metric of every platform is not possible nor something we aim to. For example, with Wildfly the db pool exposes more than 50 attributes that could be captured as metrics.
I think one of the important things that could make this type of mapping somehow manageable over time is to use the following strategy for metric names and their attributes:
Checklist & follow-ups
wildfly.db.client.connection
check with impl. that state can be a partition active/idle/wait (in which case using a single metric + attribute would make sense), but the wildfly documentation seems to imply it's not the case.wildfly.db.client.connection
should use thedb.client.connections.state
from semconv for the connectíon state.db.client.connections.*
attributes todb.client.connection.*
semantic-conventions#1125, to be released in 1.27.wildfly.db.client.transaction.NumberOfTransactions
should probably be using MBean attribute sonumberOfTransactions
db.client.connections.pool.name
should probably be renamed todb.client.connections.pool.name
db.client.connections.*
attributes todb.client.connection.*
semantic-conventions#1125