You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "David Smiley (Jira)" <ji...@apache.org> on 2021/01/25 20:49:00 UTC

[jira] [Updated] (SOLR-15083) prometheus-exporter metric solr_metrics_jvm_os_cpu_time_seconds is misnamed

     [ https://issues.apache.org/jira/browse/SOLR-15083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley updated SOLR-15083:
--------------------------------
    Labels: monitoring newdev prometheus  (was: monitoring prometheus)

> 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
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: contrib - prometheus-exporter
>    Affects Versions: 8.6, master (9.0)
>            Reporter: Mathieu Marie
>            Priority: Minor
>              Labels: monitoring, newdev, prometheus
>
> *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.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org