Skip to content
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

tomcat_jdbc_query_seconds always 0 on Tomcat 9.0.14 #12

Closed
billylamrealmatter opened this issue Jan 18, 2019 · 3 comments
Closed

tomcat_jdbc_query_seconds always 0 on Tomcat 9.0.14 #12

billylamrealmatter opened this issue Jan 18, 2019 · 3 comments

Comments

@billylamrealmatter
Copy link

billylamrealmatter commented Jan 18, 2019

Here is the sample -

# HELP tomcat_jdbc_query_seconds JDBC query duration
# TYPE tomcat_jdbc_query_seconds histogram
tomcat_jdbc_query_seconds_bucket{status="error",le="0.01",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="0.02",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="0.05",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="0.1",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="0.5",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="1.0",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="5.0",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="10.0",} 4.0
tomcat_jdbc_query_seconds_bucket{status="error",le="+Inf",} 4.0
tomcat_jdbc_query_seconds_count{status="error",} 4.0
tomcat_jdbc_query_seconds_sum{status="error",} 0.0
tomcat_jdbc_query_seconds_bucket{status="success",le="0.01",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="0.02",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="0.05",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="0.1",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="0.5",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="1.0",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="5.0",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="10.0",} 8342.0
tomcat_jdbc_query_seconds_bucket{status="success",le="+Inf",} 8342.0
tomcat_jdbc_query_seconds_count{status="success",} 8342.0
tomcat_jdbc_query_seconds_sum{status="success",} 0.0

Sample config
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" jdbcInterceptors="nl.nlighten.prometheus.tomcat.TomcatJdbcInterceptor(logFailed=true,logSlow=true,threshold=1000,buckets=.01|.02|0.05|.1|.5|1|5|10,slowQueryBuckets=1|2.5|5|10|30)"

@billylamrealmatter
Copy link
Author

billylamrealmatter commented Jan 21, 2019

I think there is a BUG in the following :
globalQueryStats.labels(SUCCESS_QUERY_STATUS).observe(delta/1000);

e.g. if delta = 500 ==> delta/1000 = 0

Proposed fix : (double)delta/100 = 0.5

@nlighten
Copy link
Owner

nlighten commented Jan 21, 2019

Thanks for reporting. Cannot believe I missed this.

Will release a bugfix soon.

nlighten added a commit that referenced this issue Jan 21, 2019
@nlighten
Copy link
Owner

Released version 0.0.9. Should be visible in Maven repo in a few hours or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants