diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..24b9cee --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Change Log + +## 0.3.0 + +### Breaking Changes + +* use seconds as unit for time based metrics - **includes metric renaming** ([#11](https://github.com/life-research/datomic-tx-metrics/pull/11)) +* use base units for metrics in general - **includes metric renaming** ([#13](https://github.com/life-research/datomic-tx-metrics/pull/13)) + +### Other Changes + +* improving metric documentation ([#15](https://github.com/life-research/datomic-tx-metrics/pull/15)) +* add license diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8f48f68 --- /dev/null +++ b/LICENSE @@ -0,0 +1,204 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or +anyone acting on such Contributor's behalf. Contributions do not include +additions to the Program which: (i) are separate modules of software +distributed in conjunction with the Program under their own license agreement, +and (ii) are not derivative works of the Program. +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly + perform, distribute and sublicense the Contribution of such Contributor, + if any, and such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of + the Contribution and the Program if, at the time the Contribution is + added by the Contributor, such addition of the Contribution causes such + combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Contribution. + No hardware per se is licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the patent + or other intellectual property rights of any other entity. Each + Contributor disclaims any liability to Recipient for claims brought by + any other entity based on infringement of intellectual property rights or + otherwise. As a condition to exercising the rights and licenses granted + hereunder, each Recipient hereby assumes sole responsibility to secure + any other intellectual property rights needed, if any. For example, if a + third party patent license is required to allow Recipient to distribute + the Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright + license set forth in this Agreement. + +3. REQUIREMENTS +A Contributor may choose to distribute the Program in object code form under +its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + i) effectively disclaims on behalf of all Contributors all + warranties and conditions, express and implied, including warranties + or conditions of title and non-infringement, and implied warranties + or conditions of merchantability and fitness for a particular + purpose; + ii) effectively excludes on behalf of all Contributors all liability + for damages, including direct, indirect, special, incidental and + consequential damages, such as lost profits; + iii) states that any provisions which differ from this Agreement are + offered by that Contributor alone and not by any other party; and + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable + manner on or through a medium customarily used for software + exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the + Program. +Contributors may not remove or alter any copyright notices contained within +the Program. + +Each Contributor must identify itself as the originator of its Contribution, +if any, in a manner that reasonably allows subsequent Recipients to identify +the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, +if a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, +damages and costs (collectively "Losses") arising from claims, lawsuits and +other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such Commercial +Contributor in connection with its distribution of the Program in a commercial +product offering. The obligations in this section do not apply to any claims +or Losses relating to any actual or alleged intellectual property +infringement. In order to qualify, an Indemnified Contributor must: a) +promptly notify the Commercial Contributor in writing of such claim, and b) +allow the Commercial Contributor to control, and cooperate with the Commercial +Contributor in, the defense and any related settlement negotiations. The +Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If +that Commercial Contributor then makes performance claims, or offers +warranties related to Product X, those performance claims and warranties are +such Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages. + +5. NO WARRANTY +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using +and distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to the +risks and costs of program errors, compliance with applicable laws, damage to +or loss of data, programs or equipment, and unavailability or interruption of +operations. + +6. DISCLAIMER OF LIABILITY +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION +LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of the +remainder of the terms of this Agreement, and without further action by the +parties hereto, such provision shall be reformed to the minimum extent +necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Program itself +(excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted +under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue +and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to +time. No one other than the Agreement Steward has the right to modify this +Agreement. The Eclipse Foundation is the initial Agreement Steward. The +Eclipse Foundation may assign the responsibility to serve as the Agreement +Steward to a suitable separate entity. Each new version of the Agreement will +be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version of the +Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly +stated in Sections 2(a) and 2(b) above, Recipient receives no rights or +licenses to the intellectual property of any Contributor under this Agreement, +whether expressly, by implication, estoppel or otherwise. All rights in the +Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial +in any resulting litigation. diff --git a/README.md b/README.md index f90ae91..799931e 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,8 @@ The following JVM metrics are covered as defined by [Prometheus Hotspot](https:/ |Metric|Type|Labels|Unit|Description| |------|----|------|----|-----------| -|process_cpu_seconds_total|counter||sec|Total user and system CPU time spent in seconds.| -|process_start_time_seconds|gauge||sec|Start time of the process since unix epoch in seconds.| +|process_cpu_seconds_total|counter||seconds|Total user and system CPU time spent in seconds.| +|process_start_time_seconds|gauge||seconds|Start time of the process since unix epoch in seconds.| |process_open_fds|gauge|||Number of open file descriptors.| |process_max_fds|gauge|||Maximum number of open file descriptors.| |process_virtual_memory_bytes|gauge||bytes|Virtual memory size in bytes.| @@ -85,8 +85,8 @@ The following JVM metrics are covered as defined by [Prometheus Hotspot](https:/ |jvm_memory_pool_bytes_committed|gauge|pool|bytes|Committed bytes of a given JVM memory pool.| |jvm_memory_pool_bytes_max|gauge|pool|bytes|Max bytes of a given JVM memory pool.| |jvm_memory_pool_bytes_init|gauge|pool|bytes|Initial bytes of a given JVM memory pool.| -|jvm_gc_collection_seconds_count|summary|gc|sec|Times a given JVM garbage collector ran.| -|jvm_gc_collection_seconds_sum|summary|gc|sec|Time spent in a given JVM garbage collector in seconds.| +|jvm_gc_collection_seconds_count|summary|gc|seconds|Times a given JVM garbage collector ran.| +|jvm_gc_collection_seconds_sum|summary|gc|seconds|Time spent in a given JVM garbage collector in seconds.| |jvm_threads_current|gauge|||Current thread count of a JVM.| |jvm_threads_daemon|gauge|||Daemon thread count of a JVM.| |jvm_threads_peak|gauge|||Peak thread count of a JVM.| @@ -166,28 +166,28 @@ The following additional metrics are calculated based on the metrics stated abov |datomic_transactions_total|counter|||Total number of transactions.| |datomic_transactions_batch|gauge|||Number of transactions batched into a single write to the log.| |datomic_transacted_bytes_total|counter||bytes|Total volume of transaction data to log, peers in bytes.| -|datomic_transactions_sec_total|counter||sec|Total time of transactions in sec.| -|datomic_transactions_add_fulltext_sec_total|counter||sec|Total time of transactions spent to add fulltext in seconds.| -|datomic_transactions_write_log_sec_total|counter||sec|Total time of transactions spent writing to log per transaction batch in seconds.| +|datomic_transactions_seconds_total|counter||seconds|Total time of transactions in seconds.| +|datomic_transactions_add_fulltext_seconds_total|counter||seconds|Total time of transactions spent to add fulltext in seconds.| +|datomic_transactions_write_log_seconds_total|counter||seconds|Total time of transactions spent writing to log per transaction batch in seconds.| |datomic_datoms|counter|||Number of unique datoms in the index.| |datomic_index_datoms|gauge|||Number of datoms stored by the index, all sorts.| |datomic_index_segments|gauge|||Number of segments in the index.| |datomic_index_writes|gauge|||Number of segments written by indexing job, reported at end.| -|datomic_index_writes_sec|gauge||sec|Time per index segment write in seconds.| -|datomic_index_creation_sec|gauge||sec|Time to create index in seconds, reported at end of indexing job.| -|datomic_index_fulltext_creation_sec|gauge||sec|Time to create fulltext portion of index in seconds.| +|datomic_index_writes_seconds|gauge||seconds|Time per index segment write in seconds.| +|datomic_index_creation_seconds|gauge||seconds|Time to create index in seconds, reported at end of indexing job.| +|datomic_index_fulltext_creation_seconds|gauge||seconds|Time to create fulltext portion of index in seconds.| |datomic_memory_index_consumed_bytes|gauge||bytes|RAM consumed by memory index in bytes.| -|datomic_memory_index_fill_sec|gauge||sec|Estimate of the time to fill the memory index in seconds, given the current write load.| +|datomic_memory_index_fill_seconds|gauge||seconds|Estimate of the time to fill the memory index in seconds, given the current write load.| |datomic_storage_write_operations_total|counter|||Total number of storage write operations.| |datomic_storage_write_bytes_total|counter||bytes|Total number of bytes written to storage.| -|datomic_storage_write_sec|gauge||sec|Time spent writing to storage in seconds.| +|datomic_storage_write_seconds|gauge||seconds|Time spent writing to storage in seconds.| |datomic_storage_read_operations_total|counter|||Total number of storage read operations.| |datomic_storage_read_bytes_total|counter||bytes|Total number of bytes read from storage.| -|datomic_storage_read_sec|gauge||sec|Time spent reading from storage in seconds.| -|datomic_storage_backoff_sec|gauge||sec|Time spent in backoff/retry around calls to storage in seconds.| +|datomic_storage_read_seconds|gauge||seconds|Time spent reading from storage in seconds.| +|datomic_storage_backoff_seconds|gauge||seconds|Time spent in backoff/retry around calls to storage in seconds.| |datomic_storage_backoff_retries_total|counter|||Total number of retried storage operations.| |datomic_garbage_segments|gauge|||Number of garbage segments created.| -|datomic_heartbeats_sec|gauge||sec|Time spent writing to storage in seconds as part of the heartbeat (transactor writes location).| +|datomic_heartbeats_seconds|gauge||seconds|Time spent writing to storage in seconds as part of the heartbeat (transactor writes location).| |datomic_heartbeats|gauge|||Number of heartbeats.| @@ -195,20 +195,98 @@ The following additional metrics are calculated based on the metrics stated abov ## Example Metrics ``` +# HELP datomic_storage_read_seconds Time spent reading from storage in seconds. +# TYPE datomic_storage_read_seconds gauge +datomic_storage_read_seconds 0.452 +# HELP datomic_heartbeats_seconds Time spent writing to storage in seconds as part of the heartbeat (transactor writes location). +# TYPE datomic_heartbeats_seconds gauge +datomic_heartbeats_seconds 60.001 +# HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds. +# TYPE jvm_gc_collection_seconds summary +jvm_gc_collection_seconds_count{gc="PS Scavenge",} 45.0 +jvm_gc_collection_seconds_sum{gc="PS Scavenge",} 1.42 +jvm_gc_collection_seconds_count{gc="PS MarkSweep",} 4.0 +jvm_gc_collection_seconds_sum{gc="PS MarkSweep",} 0.429 +# HELP datomic_transactions_batch Number of transactions batched into a single write to the log. +# TYPE datomic_transactions_batch gauge +datomic_transactions_batch 277.0 +# HELP datomic_garbage_segments Number of garbage segments created. +# TYPE datomic_garbage_segments gauge +datomic_garbage_segments 784.0 +# HELP jvm_classes_loaded The number of classes that are currently loaded in the JVM +# TYPE jvm_classes_loaded gauge +jvm_classes_loaded 19867.0 +# HELP jvm_classes_loaded_total The total number of classes that have been loaded since the JVM has started execution +# TYPE jvm_classes_loaded_total counter +jvm_classes_loaded_total 19867.0 +# HELP jvm_classes_unloaded_total The total number of classes that have been unloaded since the JVM has started execution +# TYPE jvm_classes_unloaded_total counter +jvm_classes_unloaded_total 0.0 +# HELP datomic_object_cache_size Number of segments in the Datomic object cache. +# TYPE datomic_object_cache_size gauge +datomic_object_cache_size 1352.0 +# HELP datomic_transactions_add_fulltext_seconds_total Total time of transactions spent to add fulltext in seconds. +# TYPE datomic_transactions_add_fulltext_seconds_total counter +datomic_transactions_add_fulltext_seconds_total 0.213 +# HELP datomic_transacted_datoms_total Number of transacted datoms. +# TYPE datomic_transacted_datoms_total counter +datomic_transacted_datoms_total 1145674.0 +# HELP datomic_storage_read_operations_total Total number of storage read operations. +# TYPE datomic_storage_read_operations_total counter +datomic_storage_read_operations_total 529.0 +# HELP jvm_info JVM version info +# TYPE jvm_info gauge +jvm_info{version="1.8.0_222-b10",vendor="Oracle Corporation",runtime="OpenJDK Runtime Environment",} 1.0 # HELP datomic_storage_backoff_retries_total Total number of retried storage operations. # TYPE datomic_storage_backoff_retries_total counter datomic_storage_backoff_retries_total 0.0 +# HELP datomic_index_segments Number of segments in the index. +# TYPE datomic_index_segments gauge +datomic_index_segments 1399.0 +# HELP datomic_transactions_total Total number of transactions. +# TYPE datomic_transactions_total counter +datomic_transactions_total 444.0 +# HELP datomic_transactions_write_log_seconds_total Total time of transactions spent writing to log per transaction batch in seconds. +# TYPE datomic_transactions_write_log_seconds_total counter +datomic_transactions_write_log_seconds_total 7.488999999999999 +# HELP datomic_index_writes Number of segments written by indexing job, reported at end. +# TYPE datomic_index_writes gauge +datomic_index_writes 636.0 +# HELP datomic_transacted_bytes_total Total volume of transaction data to log, peers in bytes. +# TYPE datomic_transacted_bytes_total counter +datomic_transacted_bytes_total 2.0042116E7 +# HELP datomic_storage_write_bytes_total Total number of bytes written to storage. +# TYPE datomic_storage_write_bytes_total counter +datomic_storage_write_bytes_total 2.0352381E7 +# HELP datomic_storage_write_operations_total Total number of storage write operations. +# TYPE datomic_storage_write_operations_total counter +datomic_storage_write_operations_total 1593.0 +# HELP datomic_datoms Number of unique datoms in the index. +# TYPE datomic_datoms gauge +datomic_datoms 2437759.0 +# HELP datomic_available_ram_bytes Unused RAM on transactor in bytes. +# TYPE datomic_available_ram_bytes gauge +datomic_available_ram_bytes 3.32E9 +# HELP datomic_successful_metric_reports Number of successful metric reports over a 1 min period. +# TYPE datomic_successful_metric_reports gauge +datomic_successful_metric_reports 1.0 +# HELP datomic_index_fulltext_creation_seconds Time to create fulltext portion of index in seconds. +# TYPE datomic_index_fulltext_creation_seconds gauge +datomic_index_fulltext_creation_seconds 0.0 +# HELP datomic_remote_peers Number of remote peers connected. +# TYPE datomic_remote_peers gauge +datomic_remote_peers 6.0 # HELP jvm_memory_bytes_used Used bytes of a given JVM memory area. # TYPE jvm_memory_bytes_used gauge -jvm_memory_bytes_used{area="heap",} 1.576059584E9 -jvm_memory_bytes_used{area="nonheap",} 1.54890304E8 +jvm_memory_bytes_used{area="heap",} 1.05045048E9 +jvm_memory_bytes_used{area="nonheap",} 1.56363984E8 # HELP jvm_memory_bytes_committed Committed (bytes) of a given JVM memory area. # TYPE jvm_memory_bytes_committed gauge -jvm_memory_bytes_committed{area="heap",} 4.294967296E9 -jvm_memory_bytes_committed{area="nonheap",} 1.77627136E8 +jvm_memory_bytes_committed{area="heap",} 4.178051072E9 +jvm_memory_bytes_committed{area="nonheap",} 1.78470912E8 # HELP jvm_memory_bytes_max Max (bytes) of a given JVM memory area. # TYPE jvm_memory_bytes_max gauge -jvm_memory_bytes_max{area="heap",} 4.294967296E9 +jvm_memory_bytes_max{area="heap",} 4.178051072E9 jvm_memory_bytes_max{area="nonheap",} -1.0 # HELP jvm_memory_bytes_init Initial bytes of a given JVM memory area. # TYPE jvm_memory_bytes_init gauge @@ -216,187 +294,109 @@ jvm_memory_bytes_init{area="heap",} 4.294967296E9 jvm_memory_bytes_init{area="nonheap",} 2555904.0 # HELP jvm_memory_pool_bytes_used Used bytes of a given JVM memory pool. # TYPE jvm_memory_pool_bytes_used gauge -jvm_memory_pool_bytes_used{pool="Code Cache",} 3.4133632E7 -jvm_memory_pool_bytes_used{pool="Metaspace",} 9.9906008E7 -jvm_memory_pool_bytes_used{pool="Compressed Class Space",} 2.0850664E7 -jvm_memory_pool_bytes_used{pool="G1 Eden Space",} 7.0254592E8 -jvm_memory_pool_bytes_used{pool="G1 Survivor Space",} 1.65675008E8 -jvm_memory_pool_bytes_used{pool="G1 Old Gen",} 7.07838656E8 +jvm_memory_pool_bytes_used{pool="Code Cache",} 3.4965248E7 +jvm_memory_pool_bytes_used{pool="Metaspace",} 1.00482128E8 +jvm_memory_pool_bytes_used{pool="Compressed Class Space",} 2.0916608E7 +jvm_memory_pool_bytes_used{pool="PS Eden Space",} 6.47085208E8 +jvm_memory_pool_bytes_used{pool="PS Survivor Space",} 9.269804E7 +jvm_memory_pool_bytes_used{pool="PS Old Gen",} 3.10671416E8 # HELP jvm_memory_pool_bytes_committed Committed bytes of a given JVM memory pool. # TYPE jvm_memory_pool_bytes_committed gauge -jvm_memory_pool_bytes_committed{pool="Code Cache",} 3.5127296E7 -jvm_memory_pool_bytes_committed{pool="Metaspace",} 1.16076544E8 -jvm_memory_pool_bytes_committed{pool="Compressed Class Space",} 2.6423296E7 -jvm_memory_pool_bytes_committed{pool="G1 Eden Space",} 1.74063616E9 -jvm_memory_pool_bytes_committed{pool="G1 Survivor Space",} 1.65675008E8 -jvm_memory_pool_bytes_committed{pool="G1 Old Gen",} 2.388656128E9 +jvm_memory_pool_bytes_committed{pool="Code Cache",} 3.5258368E7 +jvm_memory_pool_bytes_committed{pool="Metaspace",} 1.1669504E8 +jvm_memory_pool_bytes_committed{pool="Compressed Class Space",} 2.6517504E7 +jvm_memory_pool_bytes_committed{pool="PS Eden Space",} 1.199570944E9 +jvm_memory_pool_bytes_committed{pool="PS Survivor Space",} 1.14819072E8 +jvm_memory_pool_bytes_committed{pool="PS Old Gen",} 2.863661056E9 # HELP jvm_memory_pool_bytes_max Max bytes of a given JVM memory pool. # TYPE jvm_memory_pool_bytes_max gauge jvm_memory_pool_bytes_max{pool="Code Cache",} 2.5165824E8 jvm_memory_pool_bytes_max{pool="Metaspace",} -1.0 jvm_memory_pool_bytes_max{pool="Compressed Class Space",} 1.073741824E9 -jvm_memory_pool_bytes_max{pool="G1 Eden Space",} -1.0 -jvm_memory_pool_bytes_max{pool="G1 Survivor Space",} -1.0 -jvm_memory_pool_bytes_max{pool="G1 Old Gen",} 4.294967296E9 +jvm_memory_pool_bytes_max{pool="PS Eden Space",} 1.202716672E9 +jvm_memory_pool_bytes_max{pool="PS Survivor Space",} 1.14819072E8 +jvm_memory_pool_bytes_max{pool="PS Old Gen",} 2.863661056E9 # HELP jvm_memory_pool_bytes_init Initial bytes of a given JVM memory pool. # TYPE jvm_memory_pool_bytes_init gauge jvm_memory_pool_bytes_init{pool="Code Cache",} 2555904.0 jvm_memory_pool_bytes_init{pool="Metaspace",} 0.0 jvm_memory_pool_bytes_init{pool="Compressed Class Space",} 0.0 -jvm_memory_pool_bytes_init{pool="G1 Eden Space",} 2.26492416E8 -jvm_memory_pool_bytes_init{pool="G1 Survivor Space",} 0.0 -jvm_memory_pool_bytes_init{pool="G1 Old Gen",} 4.06847488E9 -# HELP datomic_garbage_segments Number of garbage segments created. -# TYPE datomic_garbage_segments gauge -datomic_garbage_segments 2334.0 -# HELP datomic_index_writes_msec Time per index segment write. -# TYPE datomic_index_writes_msec gauge -datomic_index_writes_msec 1707.0 -# HELP datomic_index_creation_msec Time to create index in msec, reported at end of indexing job. -# TYPE datomic_index_creation_msec gauge -datomic_index_creation_msec 32430.0 -# HELP datomic_index_fulltext_creation_msec Time to create fulltext portion of index in msec. -# TYPE datomic_index_fulltext_creation_msec gauge -datomic_index_fulltext_creation_msec 0.0 -# HELP datomic_successful_metric_reports Number of successful metric reports over a 1 min period. -# TYPE datomic_successful_metric_reports gauge -datomic_successful_metric_reports 1.0 +jvm_memory_pool_bytes_init{pool="PS Eden Space",} 1.073741824E9 +jvm_memory_pool_bytes_init{pool="PS Survivor Space",} 1.78782208E8 +jvm_memory_pool_bytes_init{pool="PS Old Gen",} 2.863661056E9 +# HELP jvm_threads_current Current thread count of a JVM +# TYPE jvm_threads_current gauge +jvm_threads_current 90.0 +# HELP jvm_threads_daemon Daemon thread count of a JVM +# TYPE jvm_threads_daemon gauge +jvm_threads_daemon 45.0 +# HELP jvm_threads_peak Peak thread count of a JVM +# TYPE jvm_threads_peak gauge +jvm_threads_peak 94.0 +# HELP jvm_threads_started_total Started thread count of a JVM +# TYPE jvm_threads_started_total counter +jvm_threads_started_total 121.0 +# HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers +# TYPE jvm_threads_deadlocked gauge +jvm_threads_deadlocked 0.0 +# HELP jvm_threads_deadlocked_monitor Cycles of JVM-threads that are in deadlock waiting to acquire object monitors +# TYPE jvm_threads_deadlocked_monitor gauge +jvm_threads_deadlocked_monitor 0.0 +# HELP datomic_transactions_seconds_total Total time of transactions in seconds. +# TYPE datomic_transactions_seconds_total counter +datomic_transactions_seconds_total 339.009 +# HELP datomic_memory_index_consumed_bytes RAM consumed by memory index in bytes. +# TYPE datomic_memory_index_consumed_bytes gauge +datomic_memory_index_consumed_bytes 3.5E7 +# HELP datomic_alarms Number of alarms/problems that have occurred distinguished by their kind. +# TYPE datomic_alarms gauge +datomic_alarms{kind="index-job-failed",} 0.0 +datomic_alarms{kind="other",} 0.0 # HELP datomic_heartbeats Number of heartbeats. # TYPE datomic_heartbeats gauge datomic_heartbeats 12.0 +# HELP datomic_object_cache_requests Number of requests to the Datomic object cache. +# TYPE datomic_object_cache_requests gauge +datomic_object_cache_requests 821.0 +# HELP datomic_storage_read_bytes_total Total number of bytes read from storage. +# TYPE datomic_storage_read_bytes_total counter +datomic_storage_read_bytes_total 495987.0 +# HELP datomic_index_creation_seconds Time to create index in seconds, reported at end of indexing job. +# TYPE datomic_index_creation_seconds gauge +datomic_index_creation_seconds 11.94 +# HELP datomic_index_datoms Number of datoms stored by the index, all sorts. +# TYPE datomic_index_datoms gauge +datomic_index_datoms 6602659.0 +# HELP datomic_object_cache_hits_ratio Datomic object cache hit ratio. +# TYPE datomic_object_cache_hits_ratio gauge +datomic_object_cache_hits_ratio 0.7403065825067628 +# HELP datomic_storage_write_seconds Time spent writing to storage in seconds. +# TYPE datomic_storage_write_seconds gauge +datomic_storage_write_seconds 2.508 # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. # TYPE process_cpu_seconds_total counter -process_cpu_seconds_total 276.92 +process_cpu_seconds_total 244.54 # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. # TYPE process_start_time_seconds gauge -process_start_time_seconds 1.571915290017E9 +process_start_time_seconds 1.571923073319E9 # HELP process_open_fds Number of open file descriptors. # TYPE process_open_fds gauge -process_open_fds 530.0 +process_open_fds 454.0 # HELP process_max_fds Maximum number of open file descriptors. # TYPE process_max_fds gauge process_max_fds 1048576.0 # HELP process_virtual_memory_bytes Virtual memory size in bytes. # TYPE process_virtual_memory_bytes gauge -process_virtual_memory_bytes 1.0579365888E10 +process_virtual_memory_bytes 1.0496651264E10 # HELP process_resident_memory_bytes Resident memory size in bytes. # TYPE process_resident_memory_bytes gauge -process_resident_memory_bytes 3.939934208E9 -# HELP datomic_index_writes Number of segments written by indexing job, reported at end. -# TYPE datomic_index_writes gauge -datomic_index_writes 2103.0 -# HELP datomic_datoms Number of unique datoms in the index. -# TYPE datomic_datoms gauge -datomic_datoms 1.6888212E7 -# HELP datomic_transactions_write_log_msec_total Total time of transactions spent writing to log per transaction batch. -# TYPE datomic_transactions_write_log_msec_total counter -datomic_transactions_write_log_msec_total 6292.0 -# HELP datomic_transactions_add_fulltext_msec_total Total time of transactions spent to add fulltext. -# TYPE datomic_transactions_add_fulltext_msec_total counter -datomic_transactions_add_fulltext_msec_total 147.0 -# HELP datomic_index_datoms Number of datoms stored by the index, all sorts. -# TYPE datomic_index_datoms gauge -datomic_index_datoms 4.5733616E7 -# HELP datomic_transacted_bytes_total Total volume of transaction data to log, peers in bytes. -# TYPE datomic_transacted_bytes_total counter -datomic_transacted_bytes_total 3.013932E7 -# HELP datomic_storage_write_operations_total Total number of storage write operations. -# TYPE datomic_storage_write_operations_total counter -datomic_storage_write_operations_total 4148.0 -# HELP datomic_transactions_total Total number of transactions. -# TYPE datomic_transactions_total counter -datomic_transactions_total 657.0 -# HELP datomic_storage_read_bytes_total Total number of bytes read from storage. -# TYPE datomic_storage_read_bytes_total counter -datomic_storage_read_bytes_total 1049555.0 -# HELP datomic_storage_read_msec Time spent reading from storage. -# TYPE datomic_storage_read_msec gauge -datomic_storage_read_msec 51.0 -# HELP datomic_transactions_msec_total Total time of transactions in msec. -# TYPE datomic_transactions_msec_total counter -datomic_transactions_msec_total 415808.0 -# HELP datomic_object_cache_size Number of segments in the Datomic object cache. -# TYPE datomic_object_cache_size gauge -datomic_object_cache_size 3819.0 -# HELP datomic_storage_write_bytes_total Total number of bytes written to storage. -# TYPE datomic_storage_write_bytes_total counter -datomic_storage_write_bytes_total 6.2769877E7 -# HELP datomic_heartbeats_msec Time spent writing to storage as part of the heartbeat (transactor writes location). -# TYPE datomic_heartbeats_msec gauge -datomic_heartbeats_msec 60000.0 -# HELP datomic_transacted_datoms_total Number of transacted datoms. -# TYPE datomic_transacted_datoms_total counter -datomic_transacted_datoms_total 1718506.0 -# HELP datomic_alarms Number of alarms/problems that have occurred distinguished by their kind. -# TYPE datomic_alarms gauge -datomic_alarms{kind="index-job-failed",} 0.0 -datomic_alarms{kind="other",} 0.0 -# HELP datomic_available_ram_megabytes Unused RAM on transactor in MB. -# TYPE datomic_available_ram_megabytes gauge -datomic_available_ram_megabytes 1490.0 -# HELP datomic_storage_write_msec Time spent writing to storage. -# TYPE datomic_storage_write_msec gauge -datomic_storage_write_msec 1099.0 -# HELP datomic_object_cache_hits_ratio Datomic object cache hit ratio. -# TYPE datomic_object_cache_hits_ratio gauge -datomic_object_cache_hits_ratio 0.8896067415730337 -# HELP datomic_index_segments Number of segments in the index. -# TYPE datomic_index_segments gauge -datomic_index_segments 9374.0 -# HELP datomic_object_cache_requests Number of requests to the Datomic object cache. -# TYPE datomic_object_cache_requests gauge -datomic_object_cache_requests 3167.0 -# HELP datomic_remote_peers Number of remote peers connected. -# TYPE datomic_remote_peers gauge -datomic_remote_peers 1.0 -# HELP datomic_memory_index_consumed_megabytes RAM consumed by memory index in MB. -# TYPE datomic_memory_index_consumed_megabytes gauge -datomic_memory_index_consumed_megabytes 4.0 -# HELP jvm_classes_loaded The number of classes that are currently loaded in the JVM -# TYPE jvm_classes_loaded gauge -jvm_classes_loaded 19783.0 -# HELP jvm_classes_loaded_total The total number of classes that have been loaded since the JVM has started execution -# TYPE jvm_classes_loaded_total counter -jvm_classes_loaded_total 19783.0 -# HELP jvm_classes_unloaded_total The total number of classes that have been unloaded since the JVM has started execution -# TYPE jvm_classes_unloaded_total counter -jvm_classes_unloaded_total 0.0 -# HELP datomic_transactions_batch Number of transactions batched into a single write to the log. -# TYPE datomic_transactions_batch gauge -datomic_transactions_batch 358.0 -# HELP datomic_storage_read_operations_total Total number of storage read operations. -# TYPE datomic_storage_read_operations_total counter -datomic_storage_read_operations_total 757.0 -# HELP jvm_info JVM version info -# TYPE jvm_info gauge -jvm_info{version="1.8.0_222-b10",vendor="Oracle Corporation",runtime="OpenJDK Runtime Environment",} 1.0 -# HELP jvm_threads_current Current thread count of a JVM -# TYPE jvm_threads_current gauge -jvm_threads_current 69.0 -# HELP jvm_threads_daemon Daemon thread count of a JVM -# TYPE jvm_threads_daemon gauge -jvm_threads_daemon 33.0 -# HELP jvm_threads_peak Peak thread count of a JVM -# TYPE jvm_threads_peak gauge -jvm_threads_peak 75.0 -# HELP jvm_threads_started_total Started thread count of a JVM -# TYPE jvm_threads_started_total counter -jvm_threads_started_total 91.0 -# HELP jvm_threads_deadlocked Cycles of JVM-threads that are in deadlock waiting to acquire object monitors or ownable synchronizers -# TYPE jvm_threads_deadlocked gauge -jvm_threads_deadlocked 0.0 -# HELP jvm_threads_deadlocked_monitor Cycles of JVM-threads that are in deadlock waiting to acquire object monitors -# TYPE jvm_threads_deadlocked_monitor gauge -jvm_threads_deadlocked_monitor 0.0 -# HELP datomic_storage_backoff_msec Time spent in backoff/retry around calls to storage. -# TYPE datomic_storage_backoff_msec gauge -datomic_storage_backoff_msec 0.0 -# HELP jvm_gc_collection_seconds Time spent in a given JVM garbage collector in seconds. -# TYPE jvm_gc_collection_seconds summary -jvm_gc_collection_seconds_count{gc="G1 Young Generation",} 49.0 -jvm_gc_collection_seconds_sum{gc="G1 Young Generation",} 1.812 -jvm_gc_collection_seconds_count{gc="G1 Old Generation",} 0.0 -jvm_gc_collection_seconds_sum{gc="G1 Old Generation",} 0.0 +process_resident_memory_bytes 2.107416576E9 +# HELP datomic_storage_backoff_seconds Time spent in backoff/retry around calls to storage in seconds. +# TYPE datomic_storage_backoff_seconds gauge +datomic_storage_backoff_seconds 0.0 +# HELP datomic_index_writes_seconds Time per index segment write in seconds. +# TYPE datomic_index_writes_seconds gauge +datomic_index_writes_seconds 3.97 ``` ## Troubleshooting @@ -405,3 +405,8 @@ __Problem:__ The transactor refuses to start because there is an error related t __Solution:__ Depending on the Datomic version in use the netty version that comes with it may be too old missing methods required by this project. Resolve this issue by replacing the netty-all*.jar in Datomic's `/lib` directory with a newer one. _This is also covered by the docker example in the __examples__ section of the repository._ +## License + +Copyright © 2019 LIFE Research Center + +Distributed under the Eclipse Public License. diff --git a/project.clj b/project.clj index 453694e..10d86e2 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject datomic-tx-metrics "0.2.0" +(defproject datomic-tx-metrics "0.3.0" :description "Containing a callback handler for collecting Datomic Transactor + JVM metrics for consumption (e.g. by Prometheus) using a web endpoint offered by the included web server." :dependencies [[aleph "0.4.6"] diff --git a/src/datomic_tx_metrics/core.clj b/src/datomic_tx_metrics/core.clj index 2151f19..b22143d 100644 --- a/src/datomic_tx_metrics/core.clj +++ b/src/datomic_tx_metrics/core.clj @@ -55,15 +55,15 @@ "Total volume of transaction data to log, peers in bytes." {:namespace "datomic"}) -(prom/defcounter transactions-sec-total - "Total time of transactions in sec." +(prom/defcounter transactions-seconds-total + "Total time of transactions in seconds." {:namespace "datomic"}) -(prom/defcounter transactions-add-fulltext-sec-total +(prom/defcounter transactions-add-fulltext-seconds-total "Total time of transactions spent to add fulltext in seconds." {:namespace "datomic"}) -(prom/defcounter transactions-write-log-sec-total +(prom/defcounter transactions-write-log-seconds-total "Total time of transactions spent writing to log per transaction batch in seconds." {:namespace "datomic"}) @@ -83,15 +83,15 @@ "Number of segments written by indexing job, reported at end." {:namespace "datomic"}) -(prom/defgauge index-writes-sec +(prom/defgauge index-writes-seconds "Time per index segment write in seconds." {:namespace "datomic"}) -(prom/defgauge index-creation-sec +(prom/defgauge index-creation-seconds "Time to create index in seconds, reported at end of indexing job." {:namespace "datomic"}) -(prom/defgauge index-fulltext-creation-sec +(prom/defgauge index-fulltext-creation-seconds "Time to create fulltext portion of index in seconds." {:namespace "datomic"}) @@ -99,7 +99,7 @@ "RAM consumed by memory index in bytes." {:namespace "datomic"}) -(prom/defgauge memory-index-fill-sec +(prom/defgauge memory-index-fill-seconds "Estimate of the time to fill the memory index in seconds, given the current write load." {:namespace "datomic"}) @@ -111,7 +111,7 @@ "Total number of bytes written to storage." {:namespace "datomic"}) -(prom/defgauge storage-write-sec +(prom/defgauge storage-write-seconds "Time spent writing to storage in seconds." {:namespace "datomic"}) @@ -123,11 +123,11 @@ "Total number of bytes read from storage." {:namespace "datomic"}) -(prom/defgauge storage-read-sec +(prom/defgauge storage-read-seconds "Time spent reading from storage in seconds." {:namespace "datomic"}) -(prom/defgauge storage-backoff-sec +(prom/defgauge storage-backoff-seconds "Time spent in backoff/retry around calls to storage in seconds." {:namespace "datomic"}) @@ -143,7 +143,7 @@ "Number of garbage segments created." {:namespace "datomic"}) -(prom/defgauge heartbeats-sec +(prom/defgauge heartbeats-seconds "Time spent writing to storage in seconds as part of the heartbeat (transactor writes location)." {:namespace "datomic"}) @@ -169,28 +169,28 @@ (.register transactions-total) (.register transactions-batch) (.register transacted-bytes-total) - (.register transactions-sec-total) - (.register transactions-add-fulltext-sec-total) - (.register transactions-write-log-sec-total) + (.register transactions-seconds-total) + (.register transactions-add-fulltext-seconds-total) + (.register transactions-write-log-seconds-total) (.register datoms) (.register index-datoms) (.register index-segments) (.register index-writes) - (.register index-writes-sec) - (.register index-creation-sec) - (.register index-fulltext-creation-sec) + (.register index-writes-seconds) + (.register index-creation-seconds) + (.register index-fulltext-creation-seconds) (.register memory-index-consumed-bytes) (.register storage-write-operations-total) (.register storage-write-bytes-total) - (.register storage-write-sec) + (.register storage-write-seconds) (.register storage-read-operations-total) (.register storage-read-bytes-total) - (.register storage-read-sec) - (.register storage-backoff-sec) + (.register storage-read-seconds) + (.register storage-backoff-seconds) (.register storage-backoff-retries-total) (.register object-cache-hits-ratio) (.register garbage-segments) - (.register heartbeats-sec) + (.register heartbeats-seconds) (.register heartbeats) )) @@ -266,13 +266,13 @@ (prom/inc! transacted-bytes-total sum)) (when-let [{:keys [sum]} (:TransactionMsec tx-metrics)] - (prom/inc! transactions-sec-total (msec-to-sec sum))) + (prom/inc! transactions-seconds-total (msec-to-sec sum))) (when-let [{:keys [sum]} (:DbAddFulltextMsec tx-metrics)] - (prom/inc! transactions-add-fulltext-sec-total (msec-to-sec sum))) + (prom/inc! transactions-add-fulltext-seconds-total (msec-to-sec sum))) (when-let [{:keys [sum]} (:LogWriteMsec tx-metrics)] - (prom/inc! transactions-write-log-sec-total (msec-to-sec sum))) + (prom/inc! transactions-write-log-seconds-total (msec-to-sec sum))) (if-let [{:keys [sum]} (:Datoms tx-metrics)] (prom/set! datoms sum) @@ -293,45 +293,45 @@ (prom/clear! index-writes)) (if-let [{:keys [sum]} (:IndexWriteMsec tx-metrics)] - (prom/set! index-writes-sec (msec-to-sec sum)) - (prom/clear! index-writes-sec)) + (prom/set! index-writes-seconds (msec-to-sec sum)) + (prom/clear! index-writes-seconds)) (if-let [{:keys [sum]} (:CreateEntireIndexMsec tx-metrics)] - (prom/set! index-creation-sec (msec-to-sec sum)) - (prom/clear! index-creation-sec)) + (prom/set! index-creation-seconds (msec-to-sec sum)) + (prom/clear! index-creation-seconds)) (if-let [{:keys [sum]} (:CreateFulltextIndexMsec tx-metrics)] - (prom/set! index-fulltext-creation-sec (msec-to-sec sum)) - (prom/clear! index-fulltext-creation-sec)) + (prom/set! index-fulltext-creation-seconds (msec-to-sec sum)) + (prom/clear! index-fulltext-creation-seconds)) (when-let [{:keys [sum]} (:MemoryIndexMB tx-metrics)] (prom/set! memory-index-consumed-bytes (mb-to-bytes sum))) (if-let [{:keys [sum]} (:MemoryIndexFillMsec tx-metrics)] - (prom/set! memory-index-fill-sec (msec-to-sec sum)) - (prom/clear! memory-index-fill-sec)) + (prom/set! memory-index-fill-seconds (msec-to-sec sum)) + (prom/clear! memory-index-fill-seconds)) (when-let [{:keys [sum count]} (:StoragePutBytes tx-metrics)] (prom/inc! storage-write-operations-total count) (prom/inc! storage-write-bytes-total sum)) (if-let [{:keys [sum]} (:StoragePutMsec tx-metrics)] - (prom/set! storage-write-sec (msec-to-sec sum)) - (prom/clear! storage-write-sec)) + (prom/set! storage-write-seconds (msec-to-sec sum)) + (prom/clear! storage-write-seconds)) (when-let [{:keys [sum count]} (:StorageGetBytes tx-metrics)] (prom/inc! storage-read-operations-total count) (prom/inc! storage-read-bytes-total sum)) (if-let [{:keys [sum]} (:StorageGetMsec tx-metrics)] - (prom/set! storage-read-sec (msec-to-sec sum)) - (prom/clear! storage-read-sec)) + (prom/set! storage-read-seconds (msec-to-sec sum)) + (prom/clear! storage-read-seconds)) (if-let [{:keys [sum count]} (:StorageBackoff tx-metrics)] (do - (prom/set! storage-backoff-sec (msec-to-sec sum)) + (prom/set! storage-backoff-seconds (msec-to-sec sum)) (prom/inc! storage-backoff-retries-total count)) - (prom/clear! storage-backoff-sec)) + (prom/clear! storage-backoff-seconds)) (if-let [{:keys [sum count]} (:ObjectCache tx-metrics)] (do @@ -346,7 +346,7 @@ (prom/clear! garbage-segments)) (when-let [{:keys [sum count]} (:HeartbeatMsec tx-metrics)] - (prom/set! heartbeats-sec (msec-to-sec sum)) + (prom/set! heartbeats-seconds (msec-to-sec sum)) (prom/set! heartbeats count)) )