-
Notifications
You must be signed in to change notification settings - Fork 946
Jmx unit semconv alignment - Tomcat #13650
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
base: main
Are you sure you want to change the base?
Jmx unit semconv alignment - Tomcat #13650
Conversation
…nstrumentation into yaml-jmx-metrics-test
instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/tomcat.yaml
Show resolved
Hide resolved
instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/tomcat.yaml
Outdated
Show resolved
Hide resolved
instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/tomcat.yaml
Outdated
Show resolved
Hide resolved
Tomcat metrics description md file moved to library Code review followup
@@ -32,7 +38,6 @@ class JmxMetricInsightInstallerTest { | |||
"hadoop.yaml", | |||
"jetty.yaml", | |||
"kafka-broker.yaml", | |||
"tomcat.yaml", |
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.
[for reviewer] Tomcat metrics definition is tested in a much better way in TomcatIntegrationTest.java
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.
By "much better way" here it means being tested against a real tomcat instance rather than trying to parse the yaml file to see if there are any errors.
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.
Moreover, it can now be easily tested with multiple tomcat versions
instrumentation/jmx-metrics/library/src/main/resources/jmx/rules/tomcat.yaml
Show resolved
Hide resolved
@robsunday #13597 has been merged, so you can update with current state of |
sourceUnit: ms | ||
unit: s | ||
desc: The longest request processing time. | ||
processingTime: |
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.
I think that processingTime
and maxTime
mbean attributes are related, so we should probably make sure their name reflect that, for example:
tomcat.request.max.time
formaxTime
+tomcat.request.total.time
forprocessingTime
- having the
total
ormax
not at the end of the metric name helps to avoid the "do not use total" rule in semconv - alternatively, we could argue that the "do not use total" rule in semconv refers only to the
_total
and nottotal
suffix and then usetomcat.request.time.max
andtomcat.request.time.total
but this might be harder to make people agree on this.
tomcat.context: param(context) | ||
mapping: | ||
activeSessions: | ||
metric: active_session.count |
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.
metric: active_session.count | |
metric: session.active.count |
In addition to renaming I would suggest to add tomcat.session.active.limit
updowncounter as it provides the configured limit if there is any or -1
if none is set, so using the negative value filtering would be appropriate for it.
As a side note, there are also the expiredSessions
and rejectedSessions
mbeans attributes that would be tempting to use for a tomcat.session.count
with a metric attribute to provide breakdown per state on the total number of sessions but we would be making assumptions on the implementation, so I would not recommend that, also it prevents us from having tomcat.session.active.count
and tomcat.session.active.limit
.
prefix: tomcat.thread. | ||
type: updowncounter | ||
metricAttribute: | ||
tomcat.thread_pool.name: param(name) |
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.
tomcat.thread_pool.name: param(name) | |
tomcat.thread.pool.name: param(name) |
This would be consistent with db.client.connection.pool.name
defined in DB semconv.
currentThreadsBusy: | ||
metric: busy.count | ||
desc: Number of busy threads in the thread pool. | ||
|
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.
Here we could also capture maxThreads
as tomcat.thread.limit
(updowncounter), but this could be done in another PR as an improvement.
Changes:
agent
tolibrary
folder to make it reusable in alllibrary
dependants