[
https://issues.apache.org/jira/browse/SOLR-15083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17717036#comment-17717036
]
ASF subversion and git services commented on SOLR-15083:
--------------------------------------------------------
Commit c5927d9c68dfaddce7690615b1a8f4f3d9277bb1 in solr's branch
refs/heads/branch_9x from Matthew Biscocho
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=c5927d9c68d ]
SOLR-15083: prometheus-exporter incorrect metric namings (#1588)
> prometheus-exporter metric solr_metrics_jvm_os_cpu_time_seconds is misnamed
> ---------------------------------------------------------------------------
>
> Key: SOLR-15083
> URL: https://issues.apache.org/jira/browse/SOLR-15083
> Project: Solr
> Issue Type: Bug
> Components: contrib - prometheus-exporter
> Affects Versions: 8.6, 9.0
> Reporter: Mathieu Marie
> Assignee: David Smiley
> Priority: Blocker
> Labels: monitoring, newdev, prometheus
> Fix For: 9.3
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> *solr_metrics_jvm_os_cpu_time_seconds* metric exported by prometheus-exporter
> has seconds in its name, however it appears that it is microseconds.
> This name can create confusion when one wants to report it in a dashboard.
> That metric is defined in
> [https://github.com/apache/lucene-solr/blob/branch_8_5/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml#L247]
> {code}
> <str>
> .metrics["solr.jvm"] | to_entries | .[] | select(.key ==
> "os.processCpuTime") as $object |
> ($object.value / 1000.0) as $value |
> {
> name : "solr_metrics_jvm_os_cpu_time_seconds",
> type : "COUNTER",
> help : "See following URL:
> https://lucene.apache.org/solr/guide/metrics-reporting.html",
> label_names : ["item"],
> label_values : ["processCpuTime"],
> value : $value
> }
> </str>
> {code}
> In the above config we see that the metric came from *os.processCpuTime*,
> which itself came from JMX call
> [getProcessCpuTime()|https://docs.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html#getProcessCpuTime()].
> That javadoc says
> {code}
> long getProcessCpuTime()
> Returns the CPU time used by the process on which the Java virtual machine is
> running in nanoseconds. The returned value is of nanoseconds precision but
> not necessarily nanoseconds accuracy. This method returns -1 if the the
> platform does not support this operation.
> Returns:
> the CPU time used by the process in nanoseconds, or -1 if this operation is
> not supported.
> {code}
> Nanoseconds / 1000 is microseconds.
> Either the name or the computation should be updated.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]