You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ko...@apache.org on 2018/03/02 02:52:09 UTC

[1/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x-SOLR-11795 [created] 961269aa5


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient-LICENSE-ASL.txt b/solr/licenses/simpleclient-LICENSE-ASL.txt
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/solr/licenses/simpleclient-LICENSE-ASL.txt
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) 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. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient-NOTICE.txt b/solr/licenses/simpleclient-NOTICE.txt
new file mode 100644
index 0000000..cbd3cd9
--- /dev/null
+++ b/solr/licenses/simpleclient-NOTICE.txt
@@ -0,0 +1,11 @@
+Prometheus instrumentation library for JVM applications
+Copyright 2012-2015 The Prometheus Authors
+
+This product includes software developed at
+Boxever Ltd. (http://www.boxever.com/).
+
+This product includes software developed at
+SoundCloud Ltd. (http://soundcloud.com/).
+
+This product includes software developed as part of the
+Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient_common-0.2.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient_common-0.2.0.jar.sha1 b/solr/licenses/simpleclient_common-0.2.0.jar.sha1
new file mode 100644
index 0000000..1e1c2e9
--- /dev/null
+++ b/solr/licenses/simpleclient_common-0.2.0.jar.sha1
@@ -0,0 +1 @@
+42d513358b26ae44137c620fa517d37b5e707ae1

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient_common-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient_common-LICENSE-ASL.txt b/solr/licenses/simpleclient_common-LICENSE-ASL.txt
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/solr/licenses/simpleclient_common-LICENSE-ASL.txt
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) 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. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient_common-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient_common-NOTICE.txt b/solr/licenses/simpleclient_common-NOTICE.txt
new file mode 100644
index 0000000..cbd3cd9
--- /dev/null
+++ b/solr/licenses/simpleclient_common-NOTICE.txt
@@ -0,0 +1,11 @@
+Prometheus instrumentation library for JVM applications
+Copyright 2012-2015 The Prometheus Authors
+
+This product includes software developed at
+Boxever Ltd. (http://www.boxever.com/).
+
+This product includes software developed at
+SoundCloud Ltd. (http://soundcloud.com/).
+
+This product includes software developed as part of the
+Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1 b/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1
new file mode 100644
index 0000000..7d188b5
--- /dev/null
+++ b/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1
@@ -0,0 +1 @@
+f644860c08c787821c8c7ce78c408cea187fe1a3

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt b/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) 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. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient_httpserver-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient_httpserver-NOTICE.txt b/solr/licenses/simpleclient_httpserver-NOTICE.txt
new file mode 100644
index 0000000..cbd3cd9
--- /dev/null
+++ b/solr/licenses/simpleclient_httpserver-NOTICE.txt
@@ -0,0 +1,11 @@
+Prometheus instrumentation library for JVM applications
+Copyright 2012-2015 The Prometheus Authors
+
+This product includes software developed at
+Boxever Ltd. (http://www.boxever.com/).
+
+This product includes software developed at
+SoundCloud Ltd. (http://soundcloud.com/).
+
+This product includes software developed as part of the
+Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png
new file mode 100644
index 0000000..69f21a4
Binary files /dev/null and b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png
new file mode 100644
index 0000000..96efece
Binary files /dev/null and b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc b/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc
new file mode 100644
index 0000000..0d5295b
--- /dev/null
+++ b/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc
@@ -0,0 +1,288 @@
+= Monitoring Solr with Prometheus and Grafana
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+You can monitor Solr using solr-exporter that exposes Solr's metrics to https://prometheus.io[Prometheus], and visualize metrics using https://grafana.com[Grafana].
+
+It allows users to monitor not only Solr metrics which come from <<metrics-reporting.adoc#metrics-api,Metrics API>> but also facet counts which come from <<searching.adoc#searching,Searching>>.
+
+.solr-exporter Diagram
+image::images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png[image,width=600]
+
+This feature is experimental status.
+
+== Running solr-exporter
+
+You can start solr-exporter by running `./bin/solr-exporter` from the solr-exporter directory.
+
+[source,plain]
+----
+$ cd ./contrib/prometheus-exporter
+$ ./bin/solr-exporter -p 9983 -b http://localhost:8983/solr -f ./conf/solr-exporter-config.xml -n 8
+----
+
+If you are on Windows platform, you can start solr-exporter by running `.\bin\solr-exporter.cmd` instead.
+
+[source,plain]
+----
+> cd .\contrib\prometheus
+> .\bin\solr-exporter.cmd -p 9983 -b http://localhost:8983/solr -f .\conf\solr-exporter-config.xml -n 8
+----
+
+You can also connect to Solr in SolrCloud mode like this.
+
+[source,plain]
+----
+$ cd ./contrib/prometheus
+$ ./bin/solr-exporter -p 9983 -z localhost:2181/solr -f ./conf/solr-exporter-config.xml -n 16
+----
+
+See command help:
+
+[source,plain]
+----
+$ ./bin/solr-exporter -h
+usage: SolrCollector [-h] [-v] [-p PORT] [-b BASE_URL] [-z ZK_HOST] [-f CONFIG]
+                     [-n NUM_THREADS]
+
+Prometheus exporter for Apache Solr.
+
+optional arguments:
+  -h, --help             show this help message and exit
+  -p PORT, --port PORT   solr-exporter listen port
+  -b BASE_URL, --baseurl BASE_URL
+                         specify Solr base URL when connecting  to Solr in standalone mode (for
+                         example 'http://localhost:8983/solr')
+  -z ZK_HOST, --zkhost ZK_HOST
+                         specify  ZooKeeper  connection  string  when  connecting  to  Solr  in
+                         SolrCloud mode (for example 'localhost:2181/solr')
+  -f CONFIG, --config-file CONFIG
+                         specify configuration file
+  -n NUM_THREADS, --num-thread NUM_THREADS
+                         specify number of threads
+----
+
+The Solr's metrics exposed by solr-exporter can see at the following URL.
+
+http://localhost:9983/metrics[http://localhost:9983/metrics]
+
+
+== solr-exporter Configuration
+
+The configuration is in `./config/solr-exporter-config.xml`. An example with all possible options:
+
+[source,xml]
+----
+<config>
+
+  <rules>
+
+    <ping>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/ping</str>
+        </lst>
+        <arr name="jsonQueries">
+          <str>
+            . as $object | $object |
+            (if $object.status == "OK" then 1.0 else 0.0 end) as $value |
+            {
+              name         : "solr_ping",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/ping.html",
+              label_names  : [],
+              label_values : [],
+              value        : $value
+            }
+          </str>
+        </arr>
+      </lst>
+    </ping>
+
+    <metrics>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/metrics</str>
+          <lst name="params">
+            <str name="group">all</str>
+            <str name="type">all</str>
+            <str name="prefix"></str>
+            <str name="property"></str>
+          </lst>
+        </lst>
+        <arr name="jsonQueries">
+          <!--
+            jetty metrics
+          -->
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler")) | select(.key | endswith("xx-responses")) as $object |
+            $object.key | split(".") | last | split("-") | first as $status |
+            $object.value.count as $value |
+            {
+            name         : "solr_metrics_jetty_response_total",
+            type         : "COUNTER",
+            help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+            label_names  : ["status"],
+            label_values : [$status],
+            value        : $value
+            }
+          </str>
+
+...
+
+        </arr>
+      </lst>
+    </metrics>
+
+    <collections>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/collections</str>
+          <lst name="params">
+            <str name="action">CLUSTERSTATUS</str>
+          </lst>
+        </lst>
+        <arr name="jsonQueries">
+          <str>
+            .cluster.live_nodes | length as $value|
+            {
+              name         : "solr_collections_live_nodes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus",
+              label_names  : [],
+              label_values : [],
+              value        : $value
+            }
+          </str>
+
+...
+
+        </arr>
+      </lst>
+    </collections>
+
+    <search>
+      <lst name="request">
+        <lst name="query">
+          <str name="collection">collection1</str>
+          <str name="path">/select</str>
+          <lst name="params">
+            <str name="q">*:*</str>
+            <str name="start">0</str>
+            <str name="rows">0</str>
+            <str name="json.facet">
+              {
+                category: {
+                  type: terms,
+                  field: cat
+                }
+              }
+            </str>
+          </lst>
+        </lst>
+        <arr name="jsonQueries">
+          <str>
+            .facets.category.buckets[] as $object |
+            $object.val as $term |
+            $object.count as $value |
+            {
+              name         : "solr_facets_category",
+              type         : "GAUGE",
+              help         : "Category facets",
+              label_names  : ["term"],
+              label_values : [$term],
+              value        : $value
+            }
+          </str>
+        </arr>
+      </lst>
+    </search>
+
+  </rules>
+
+</config>
+----
+
+|===
+|Name|Description
+
+|ping|Scrape <<ping.adoc#ping,Ping>> response.
+|metrics|Scrape <<metrics-reporting.adoc#metrics-api,Metrics API>> response.
+|collections|Scrape <<collections-api.adoc#collections-api,Collections API>> response.
+|search|Scrape <<searching.adoc#searching,Search API>> response.
+|*.query|Query parameter for each features. You can specify `collection`, `core`, `path`, and `params`.
+|*.jsonQueries|JSON Query that is jq syntax. For more details, see https://stedolan.github.io/jq/manual/[https://stedolan.github.io/jq/manual/].
+|===
+
+jq query has to output JSON in the following format.
+
+[source,json]
+----
+{
+  name         : "solr_ping",
+  type         : "GAUGE",
+  help         : "See following URL: https://lucene.apache.org/solr/guide/ping.html",
+  label_names  : ["base_url","core"],
+  label_values : ["http://localhost:8983/solr","collection1"],
+  value        : 1.0
+}
+----
+
+It will be converted to the following exposition format.
+
+[source,plain]
+----
+# TYPE solr_ping gauge
+# HELP solr_ping See following URL: https://lucene.apache.org/solr/guide/ping.html
+solr_ping{base_url="http://localhost:8983/solr",core="collection1"} 1.0
+----
+
+|===
+|Name|Description
+
+|name|The metric name to set. For more details, see https://prometheus.io/docs/practices/naming/[https://prometheus.io/docs/practices/naming/].
+|type|The type of the metric, can be `COUNTER`, `GAUGE`, `SUMMARY`, `HISTOGRAM` or `UNTYPED`. For more detauils, see https://prometheus.io/docs/concepts/metric_types/[https://prometheus.io/docs/concepts/metric_types/].
+|help|Help text for the metric.
+|label_names|Label names for the metric. For more details, see https://prometheus.io/docs/practices/naming/[https://prometheus.io/docs/practices/naming/].
+|label_values|Label values for the metric. For more details, see https://prometheus.io/docs/practices/naming/[https://prometheus.io/docs/practices/naming/].
+|value|Value for the metric. Value must be set to Double type.
+|===
+
+
+== Prometheus Configuration
+
+You need to specify the solr-exporter listen address into `scrape_configs` in `prometheus.yml`. See following example:
+
+[source,plain]
+----
+scrape_configs:
+  - job_name: 'solr'
+    static_configs:
+      - targets: ['localhost:9983']
+----
+
+When you apply the above settings to prometheus, it will start to pull Solr's metrics from solr-exporter.
+
+
+== Grafana Dashboard
+
+A Grafana sample dashboard is provided at the following JSON file.
+
+`./contrib/prometheus-exporter/conf/grafana-solr-dashboard.json`
+
+.Grafana Dashboard
+image::images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png[image,width=800]

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/solr-ref-guide/src/monitoring-solr.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/monitoring-solr.adoc b/solr/solr-ref-guide/src/monitoring-solr.adoc
index 0576e53..2fb7077 100644
--- a/solr/solr-ref-guide/src/monitoring-solr.adoc
+++ b/solr/solr-ref-guide/src/monitoring-solr.adoc
@@ -1,5 +1,5 @@
 = Monitoring Solr
-:page-children: metrics-reporting, mbean-request-handler, configuring-logging, using-jmx-with-solr, performance-statistics-reference
+:page-children: metrics-reporting, mbean-request-handler, configuring-logging, using-jmx-with-solr, monitoring-solr-with-prometheus-and-grafana, performance-statistics-reference
 // Licensed to the Apache Software Foundation (ASF) under one
 // or more contributor license agreements.  See the NOTICE file
 // distributed with this work for additional information
@@ -30,6 +30,8 @@ Common administrative tasks include:
 
 <<using-jmx-with-solr.adoc#using-jmx-with-solr,Using JMX with Solr>>: Describes how to use Java Management Extensions with Solr.
 
+<<monitoring-solr-with-prometheus-and-grafana.adoc#monitoring-solr-with-prometheus-and-grafana,Monitoring Solr with Prometheus and Grafana>>: Describes how to monitor Solr with Prometheus and Grafana.
+
 <<performance-statistics-reference.adoc#performance-statistics-reference,Performance Statistics Reference>>: Additional information on statistics returned from JMX.
 
 


[6/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/conf/log4j.properties b/solr/contrib/prometheus-exporter/conf/log4j.properties
new file mode 100644
index 0000000..5dd6899
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/conf/log4j.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+log4j.rootLogger=INFO, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS} %-5p [%c] - %m%n


[5/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml b/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml
new file mode 100644
index 0000000..b043835
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml
@@ -0,0 +1,1806 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+
+  <rules>
+
+    <ping>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/ping</str>
+        </lst>
+        <arr name="jsonQueries">
+          <str>
+            . as $object | $object |
+            (if $object.status == "OK" then 1.0 else 0.0 end) as $value |
+            {
+              name         : "solr_ping",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/ping.html",
+              label_names  : [],
+              label_values : [],
+              value        : $value
+            }
+          </str>
+        </arr>
+      </lst>
+    </ping>
+
+    <metrics>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/metrics</str>
+          <lst name="params">
+            <str name="group">all</str>
+            <str name="type">all</str>
+            <str name="prefix"></str>
+            <str name="property"></str>
+          </lst>
+        </lst>
+        <arr name="jsonQueries">
+          <!--
+            jetty metrics
+          -->
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler")) | select(.key | endswith("xx-responses")) as $object |
+            $object.key | split(".") | last | split("-") | first as $status |
+            $object.value.count as $value |
+            {
+            name         : "solr_metrics_jetty_response_total",
+            type         : "COUNTER",
+            help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+            label_names  : ["status"],
+            label_values : [$status],
+            value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler.")) | select(.key | endswith("-requests")) | select (.value | type == "object") as $object |
+            $object.key | split(".") | last | split("-") | first as $method |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_jetty_requests_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["method"],
+              label_values : [$method],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key == "org.eclipse.jetty.server.handler.DefaultHandler.dispatches") as $object |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_jetty_dispatches_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : [],
+              label_values : [],
+              value        : $value
+            }
+          </str>
+          <!--
+            jvm metrics
+          -->
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("buffers.")) | select(.key | endswith(".Count")) as $object |
+            $object.key | split(".")[1] as $pool |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_buffers",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["pool"],
+              label_values : [$pool],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("buffers.")) | select(.key | (endswith(".MemoryUsed") or endswith(".TotalCapacity"))) as $object |
+            $object.key | split(".")[1] as $pool |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_buffers_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["pool", "item"],
+              label_values : [$pool, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("gc.")) | select(.key | endswith(".count")) as $object |
+            $object.key | split(".")[1] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_gc_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("gc.")) | select(.key | endswith(".time")) as $object |
+            $object.key | split(".")[1] as $item |
+            ($object.value / 1000) as $value |
+            {
+              name         : "solr_metrics_jvm_gc_seconds_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.heap.")) | select(.key | endswith(".usage") | not) as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_heap_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.non-heap.")) | select(.key | endswith(".usage") | not) as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_non_heap_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.pools.")) | select(.key | endswith(".usage") | not) as $object |
+            $object.key | split(".")[2] as $space |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_pools_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["space", "item"],
+              label_values : [$space, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.total.")) as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.committedVirtualMemorySize" or .key == "os.freePhysicalMemorySize" or .key == "os.freeSwapSpaceSize" or .key =="os.totalPhysicalMemorySize" or .key == "os.totalSwapSpaceSize") as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_memory_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.maxFileDescriptorCount" or .key == "os.openFileDescriptorCount") as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_file_descriptors",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.processCpuLoad" or .key == "os.systemCpuLoad") as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_cpu_load",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <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>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.systemLoadAverage") as $object |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_load_average",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : ["systemLoadAverage"],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("threads.")) | select(.key | endswith(".count")) as $object |
+            $object.key | split(".")[1] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_threads",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_client_errors_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_errors_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".requestTimes")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_requests_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".serverErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_server_errors_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".timeouts")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_timeouts_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".totalTime")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            ($object.value / 1000) as $value |
+            {
+              name         : "solr_metrics_node_time_seconds_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | startswith("CONTAINER.cores.")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_cores",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "item"],
+              label_values : [$category, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | startswith("CONTAINER.fs.coreRoot.")) | select(.key | endswith(".totalSpace") or endswith(".usableSpace")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            $key_items[3] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_core_root_fs_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "item"],
+              label_values : [$category, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".completed")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+            (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_thread_pool_completed_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "executor"],
+              label_values : [$category, $handler, $executor],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".running")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+            (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_thread_pool_running",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "executor"],
+              label_values : [$category, $handler, $executor],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".submitted")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+            (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_thread_pool_submitted_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "executor"],
+              label_values : [$category, $handler, $executor],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith("Connections")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            $key_items[1] as $handler |
+            $key_items[2] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_connections",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "item"],
+              label_values : [$category, $handler, $item],
+              value        : $value
+            }
+          </str>
+
+          <!--
+            core metrics
+          -->
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_client_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_client_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".errors")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".requestTimes")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_requests_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_requests_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".serverErrors")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_server_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_server_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".timeouts")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_timeouts_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_timeouts_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".totalTime")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            ($object.value / 1000) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_time_seconds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_time_seconds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select (.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "CACHE.core.fieldCache") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.value.entries_count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_field_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core"],
+              label_values: [$category, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_field_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica"],
+              label_values: [$category, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "lookups" or .key == "hits" or .key == "size" or .key == "evictions" or .key == "inserts") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cache",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cache",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "hitratio") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "warmupTime") as $target |
+            $target.key as $item |
+            ($target.value / 1000) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_warmup_time_seconds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_warmup_time_seconds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "cumulative_lookups" or .key == "cumulative_hits" or .key == "cumulative_evictions" or .key == "cumulative_inserts") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "cumulative_hitratio") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CORE.fs.")) | select (.key | endswith(".totalSpace") or endswith(".usableSpace")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_fs_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "item"],
+              label_values: [$category, $core, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_fs_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("HIGHLIGHTER.")) | select (.key | endswith(".requests")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $name |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_highlighter_request_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "name", "item"],
+              label_values: [$category, $core, $name, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_highlighter_request_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "name", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $name, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "INDEX.sizeInBytes") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_index_size_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core"],
+              label_values: [$category, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_index_size_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica"],
+              label_values: [$category, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "REPLICATION./replication.isMaster") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            (if $object.value == true then 1.0 else 0.0 end) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_replication_master",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_replication_master",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "REPLICATION./replication.isSlave") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            (if $object.value == true then 1.0 else 0.0 end) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_replication_slave",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_replication_slave",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "SEARCHER.searcher.deletedDocs" or .key == "SEARCHER.searcher.maxDoc" or .key == "SEARCHER.searcher.numDocs") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_documents",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "item"],
+              label_values: [$category, $core, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_documents",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.adds") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_adds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_adds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.autoCommits") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_auto_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_auto_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.commits") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeAdds") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_adds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_adds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeDeletesById") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeDeletesByQuery") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeErrors") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.deletesById") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.deletesByQuery") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.docsPending") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_pending_docs",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_pending_docs",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.errors") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_errors",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_errors",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.expungeDeletes") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_expunge_deletes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_expunge_deletes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.merges") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_merges_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_merges_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.optimizes") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_optimizes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_optimizes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.rollbacks") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_rollbacks_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_rollbacks_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len ==

<TRUNCATED>

[4/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/ivy.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/ivy.xml b/solr/contrib/prometheus-exporter/ivy.xml
new file mode 100644
index 0000000..a8f8894
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/ivy.xml
@@ -0,0 +1,40 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="2.0">
+  <info organisation="org.apache.solr" module="prometheus"/>
+  <configurations defaultconfmapping="compile->master;test->master">
+    <conf name="compile" transitive="false"/>
+    <conf name="test" transitive="false"/>
+  </configurations>
+  <dependencies>
+    <dependency org="io.prometheus" name="simpleclient" rev="${/io.prometheus/simpleclient}" conf="compile"/>
+    <dependency org="io.prometheus" name="simpleclient_common" rev="${/io.prometheus/simpleclient_common}" conf="compile"/>
+    <dependency org="io.prometheus" name="simpleclient_httpserver" rev="${/io.prometheus/simpleclient_httpserver}" conf="compile"/>
+    <dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="${/com.fasterxml.jackson.core/jackson-core}" conf="compile"/>
+    <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="${/com.fasterxml.jackson.core/jackson-databind}" conf="compile"/>
+    <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="${/com.fasterxml.jackson.core/jackson-annotations}" conf="compile"/>
+    <dependency org="net.thisptr" name="jackson-jq" rev="${/net.thisptr/jackson-jq}" conf="compile"/>
+    <dependency org="net.sourceforge.argparse4j" name="argparse4j" rev="${/net.sourceforge.argparse4j/argparse4j}" conf="compile"/>
+    <dependency org="org.slf4j" name="slf4j-api" rev="${/org.slf4j/slf4j-api}" conf="compile"/>
+    <dependency org="org.slf4j" name="slf4j-log4j12" rev="${/org.slf4j/slf4j-log4j12}" conf="compile"/>
+    <dependency org="log4j" name="log4j" rev="${/log4j/log4j}" conf="compile"/>
+
+    <exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
+  </dependencies>
+</ivy-module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/SolrCollector.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/SolrCollector.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/SolrCollector.java
new file mode 100644
index 0000000..66bae42
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/SolrCollector.java
@@ -0,0 +1,463 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.collector;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.solr.core.Config;
+import org.apache.solr.prometheus.scraper.SolrScraper;
+import io.prometheus.client.Collector;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.NoOpResponseParser;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.CoreAdminRequest;
+import org.apache.solr.common.params.CoreAdminParams;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.ExecutorUtil;
+import org.apache.solr.util.DOMUtil;
+import org.apache.solr.util.DefaultSolrThreadFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Node;
+
+import java.lang.invoke.MethodHandles;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * SolrCollector
+ */
+public class SolrCollector extends Collector implements Collector.Describable {
+  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  private SolrClient solrClient;
+  private Config config;
+  private int numThreads;
+  private ExecutorService executorService;
+  private static ObjectMapper om = new ObjectMapper();
+
+  /**
+   * Constructor.
+   */
+  public SolrCollector(SolrClient solrClient, Config config, int numThreads) {
+    this.solrClient = solrClient;
+    this.config = config;
+    this.numThreads = numThreads;
+  }
+
+  /**
+   * Describe scrape status.
+   */
+  public List<Collector.MetricFamilySamples> describe() {
+    List<MetricFamilySamples> metricFamilies = new ArrayList<>();
+    metricFamilies.add(new MetricFamilySamples("solr_exporter_duration_seconds", Type.GAUGE, "Time this Solr scrape took, in seconds.", new ArrayList<>()));
+    return metricFamilies;
+  }
+
+  /**
+   * Collect samples.
+   */
+  public List<MetricFamilySamples> collect() {
+    // start time of scraping.
+    long startTime = System.nanoTime();
+
+    this.executorService = ExecutorUtil.newMDCAwareFixedThreadPool(numThreads, new DefaultSolrThreadFactory("solr-exporter"));
+
+    Map<String, MetricFamilySamples> metricFamilySamplesMap = new LinkedHashMap<>();
+
+    List<Future<Map<String, MetricFamilySamples>>> futureList = new ArrayList<>();
+
+    try {
+      // Ping
+      Node pingNode = this.config.getNode("/config/rules/ping", true);
+      if (pingNode != null) {
+        NamedList pingNL = DOMUtil.childNodesToNamedList(pingNode);
+        List<NamedList> requestsNL = pingNL.getAll("request");
+
+        if (this.solrClient instanceof CloudSolrClient) {
+          // in SolrCloud mode
+          List<HttpSolrClient> httpSolrClients = new ArrayList<>();
+          try {
+            httpSolrClients = getHttpSolrClients((CloudSolrClient) this.solrClient);
+            for (HttpSolrClient httpSolrClient : httpSolrClients) {
+              for (NamedList requestNL : requestsNL) {
+                String coreName = (String) ((NamedList) requestNL.get("query")).get("core");
+                String collectionName = (String) ((NamedList) requestNL.get("query")).get("collection");
+                if (coreName == null && collectionName == null) {
+                  try {
+                    List<String> cores = getCores(httpSolrClient);
+                    for (String core : cores) {
+                      LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+                      LinkedHashMap query = (LinkedHashMap) conf.get("query");
+                      if (query != null) {
+                        query.put("core", core);
+                      }
+
+                      SolrScraper scraper = new SolrScraper(httpSolrClient, conf);
+                      Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+                      futureList.add(future);
+                    }
+                  } catch (SolrServerException | IOException e) {
+                    this.logger.error("failed to get cores: " + e.getMessage());
+                  }
+                } else if (coreName != null && collectionName == null) {
+                  LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+                  SolrScraper scraper = new SolrScraper(httpSolrClient, conf);
+                  Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+                  futureList.add(future);
+                }
+              }
+            }
+
+            // wait for HttpColeClients
+            for (Future<Map<String, MetricFamilySamples>> future : futureList) {
+              try {
+                Map<String, MetricFamilySamples> m = future.get(60, TimeUnit.SECONDS);
+                mergeMetrics(metricFamilySamplesMap, m);
+              } catch (InterruptedException | ExecutionException | TimeoutException e) {
+                this.logger.error(e.getMessage());
+              }
+            }
+          } catch (SolrServerException | IOException e) {
+            this.logger.error("failed to get HttpSolrClients: " + e.getMessage());
+          } finally {
+            for (HttpSolrClient httpSolrClient : httpSolrClients) {
+              try {
+                httpSolrClient.close();
+              } catch (IOException e) {
+                this.logger.error("failed to close HttpSolrClient: " + e.getMessage());
+              }
+            }
+          }
+
+          // collection
+          for (NamedList requestNL : requestsNL) {
+            String coreName = (String) ((NamedList) requestNL.get("query")).get("core");
+            String collectionName = (String) ((NamedList) requestNL.get("query")).get("collection");
+            if (coreName == null && collectionName == null) {
+              try {
+                List<String> collections = getCollections((CloudSolrClient) this.solrClient);
+                for (String collection : collections) {
+                  LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+                  LinkedHashMap query = (LinkedHashMap) conf.get("query");
+                  if (query != null) {
+                    query.put("collection", collection);
+                  }
+
+                  SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+                  Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+                  futureList.add(future);
+                }
+              } catch (SolrServerException | IOException e) {
+                this.logger.error("failed to get cores: " + e.getMessage());
+              }
+            } else if (coreName == null && collectionName != null) {
+              LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+
+              SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+              Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+              futureList.add(future);
+            }
+          }
+        } else {
+          // in Standalone mode
+          for (NamedList requestNL : requestsNL) {
+            String coreName = (String) ((NamedList) requestNL.get("query")).get("core");
+            if (coreName == null) {
+              try {
+                List<String> cores = getCores((HttpSolrClient) this.solrClient);
+                for (String core : cores) {
+                  LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+                  LinkedHashMap query = (LinkedHashMap) conf.get("query");
+                  if (query != null) {
+                    query.put("core", core);
+                  }
+
+                  SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+                  Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+                  futureList.add(future);
+                }
+              } catch (SolrServerException | IOException e) {
+                this.logger.error("failed to get cores: " + e.getMessage());
+              }
+            } else {
+              LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+
+              SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+              Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+              futureList.add(future);
+            }
+          }
+        }
+      }
+
+      // Metrics
+      Node metricsNode = this.config.getNode("/config/rules/metrics", false);
+      if (metricsNode != null) {
+        NamedList metricsNL = DOMUtil.childNodesToNamedList(metricsNode);
+        List<NamedList> requestsNL = metricsNL.getAll("request");
+
+        if (this.solrClient instanceof CloudSolrClient) {
+          // in SolrCloud mode
+          List<HttpSolrClient> httpSolrClients = new ArrayList<>();
+          try {
+            httpSolrClients = getHttpSolrClients((CloudSolrClient) this.solrClient);
+            for (HttpSolrClient httpSolrClient : httpSolrClients) {
+              for (NamedList requestNL : requestsNL) {
+                LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+
+                SolrScraper scraper = new SolrScraper(httpSolrClient, conf);
+                Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+                futureList.add(future);
+              }
+            }
+
+            // wait for HttpColeClients
+            for (Future<Map<String, MetricFamilySamples>> future : futureList) {
+              try {
+                Map<String, MetricFamilySamples> m = future.get(60, TimeUnit.SECONDS);
+                mergeMetrics(metricFamilySamplesMap, m);
+              } catch (InterruptedException | ExecutionException | TimeoutException e) {
+                this.logger.error(e.getMessage());
+              }
+            }
+          } catch (SolrServerException | IOException e) {
+            this.logger.error(e.getMessage());
+          } finally {
+            for (HttpSolrClient httpSolrClient : httpSolrClients) {
+              try {
+                httpSolrClient.close();
+              } catch (IOException e) {
+                this.logger.error(e.getMessage());
+              }
+            }
+          }
+        } else {
+          // in Standalone mode
+          for (NamedList requestNL : requestsNL) {
+            LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+
+            SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+            Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+            futureList.add(future);
+          }
+        }
+      }
+
+      // Collections
+      Node collectionsNode = this.config.getNode("/config/rules/collections", false);
+      if (collectionsNode != null && this.solrClient instanceof CloudSolrClient) {
+        NamedList collectionsNL = DOMUtil.childNodesToNamedList(collectionsNode);
+        List<NamedList> requestsNL = collectionsNL.getAll("request");
+
+        for (NamedList requestNL : requestsNL) {
+          LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+
+          SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+          Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+          futureList.add(future);
+        }
+      }
+
+      // Search
+      Node searchNode = this.config.getNode("/config/rules/search", false);
+      if (searchNode != null) {
+        NamedList searchNL = DOMUtil.childNodesToNamedList(searchNode);
+        List<NamedList> requestsNL = searchNL.getAll("request");
+
+        for (NamedList requestNL : requestsNL) {
+          LinkedHashMap conf = (LinkedHashMap) requestNL.asMap(10);
+
+          SolrScraper scraper = new SolrScraper(this.solrClient, conf);
+          Future<Map<String, MetricFamilySamples>> future = this.executorService.submit(scraper);
+          futureList.add(future);
+        }
+      }
+
+      // get future
+      for (Future<Map<String, MetricFamilySamples>> future : futureList) {
+        try {
+          Map<String, MetricFamilySamples> m = future.get(60, TimeUnit.SECONDS);
+          mergeMetrics(metricFamilySamplesMap, m);
+        } catch (InterruptedException | ExecutionException | TimeoutException e) {
+          this.logger.error(e.getMessage());
+        }
+      }
+    } catch (Exception e) {
+      this.logger.error(e.getMessage());
+      e.printStackTrace();
+    }
+
+    // return value
+    List<MetricFamilySamples> metricFamiliesSamplesList = new ArrayList<>();
+
+    // add solr metrics
+    for (String gaugeMetricName : metricFamilySamplesMap.keySet()) {
+      MetricFamilySamples metricFamilySamples = metricFamilySamplesMap.get(gaugeMetricName);
+      if (metricFamilySamples.samples.size() > 0) {
+        metricFamiliesSamplesList.add(metricFamilySamples);
+      }
+    }
+
+    // add scrape duration metric
+    List<MetricFamilySamples.Sample> durationSample = new ArrayList<>();
+    durationSample.add(new MetricFamilySamples.Sample("solr_exporter_duration_seconds", new ArrayList<>(), new ArrayList<>(), (System.nanoTime() - startTime) / 1.0E9));
+    metricFamiliesSamplesList.add(new MetricFamilySamples("solr_exporter_duration_seconds", Type.GAUGE, "Time this Solr exporter took, in seconds.", durationSample));
+
+    this.executorService.shutdown();
+
+    return metricFamiliesSamplesList;
+  }
+
+  /**
+   * Merge metrics.
+   */
+  private Map<String, MetricFamilySamples> mergeMetrics(Map<String, MetricFamilySamples> metrics1, Map<String, MetricFamilySamples> metrics2) {
+    // marge MetricFamilySamples
+    for (String k : metrics2.keySet()) {
+      if (metrics1.containsKey(k)) {
+        for (MetricFamilySamples.Sample sample : metrics2.get(k).samples) {
+          if (!metrics1.get(k).samples.contains(sample)) {
+            metrics1.get(k).samples.add(sample);
+          }
+        }
+      } else {
+        metrics1.put(k, metrics2.get(k));
+      }
+    }
+
+    return metrics1;
+  }
+
+
+  /**
+   * Get target cores via CoreAdminAPI.
+   */
+  public static List<String> getCores(HttpSolrClient httpSolrClient) throws SolrServerException, IOException {
+    List<String> cores = new ArrayList<>();
+
+    NoOpResponseParser responseParser = new NoOpResponseParser();
+    responseParser.setWriterType("json");
+
+    httpSolrClient.setParser(responseParser);
+
+    CoreAdminRequest coreAdminRequest = new CoreAdminRequest();
+    coreAdminRequest.setAction(CoreAdminParams.CoreAdminAction.STATUS);
+    coreAdminRequest.setIndexInfoNeeded(false);
+
+    NamedList<Object> coreAdminResponse = httpSolrClient.request(coreAdminRequest);
+
+    JsonNode statusJsonNode = om.readTree((String) coreAdminResponse.get("response")).get("status");
+
+    for (Iterator<JsonNode> i = statusJsonNode.iterator(); i.hasNext(); ) {
+      String core = i.next().get("name").textValue();
+      if (!cores.contains(core)) {
+        cores.add(core);
+      }
+    }
+
+    return cores;
+  }
+
+  /**
+   * Get target cores via CollectionsAPI.
+   */
+  public static List<String> getCollections(CloudSolrClient cloudSolrClient) throws SolrServerException, IOException {
+    List<String> collections = new ArrayList<>();
+
+    NoOpResponseParser responseParser = new NoOpResponseParser();
+    responseParser.setWriterType("json");
+
+    cloudSolrClient.setParser(responseParser);
+
+    CollectionAdminRequest collectionAdminRequest = new CollectionAdminRequest.List();
+
+    NamedList<Object> collectionAdminResponse = cloudSolrClient.request(collectionAdminRequest);
+
+    JsonNode collectionsJsonNode = om.readTree((String) collectionAdminResponse.get("response")).get("collections");
+
+    for (Iterator<JsonNode> i = collectionsJsonNode.iterator(); i.hasNext(); ) {
+      String collection = i.next().textValue();
+      if (!collections.contains(collection)) {
+        collections.add(collection);
+      }
+    }
+
+    return collections;
+  }
+
+  /**
+   * Get base urls via CollectionsAPI.
+   */
+  private List<String> getBaseUrls(CloudSolrClient cloudSolrClient) throws SolrServerException, IOException {
+    List<String> baseUrls = new ArrayList<>();
+
+    NoOpResponseParser responseParser = new NoOpResponseParser();
+    responseParser.setWriterType("json");
+
+    cloudSolrClient.setParser(responseParser);
+
+    CollectionAdminRequest collectionAdminRequest = new CollectionAdminRequest.ClusterStatus();
+
+    NamedList<Object> collectionAdminResponse = cloudSolrClient.request(collectionAdminRequest);
+
+    List<JsonNode> baseUrlJsonNode = om.readTree((String) collectionAdminResponse.get("response")).findValues("base_url");
+
+    for (Iterator<JsonNode> i = baseUrlJsonNode.iterator(); i.hasNext(); ) {
+      String baseUrl = i.next().textValue();
+      if (!baseUrls.contains(baseUrl)) {
+        baseUrls.add(baseUrl);
+      }
+    }
+
+    return baseUrls;
+  }
+
+  /**
+   * Get HTTP Solr Clients
+   */
+  private List<HttpSolrClient> getHttpSolrClients(CloudSolrClient cloudSolrClient) throws SolrServerException, IOException {
+    List<HttpSolrClient> solrClients = new ArrayList<>();
+
+    for (String baseUrl : getBaseUrls(cloudSolrClient)) {
+      NoOpResponseParser responseParser = new NoOpResponseParser();
+      responseParser.setWriterType("json");
+
+      HttpSolrClient.Builder builder = new HttpSolrClient.Builder();
+      builder.withBaseSolrUrl(baseUrl);
+
+      HttpSolrClient httpSolrClient = builder.build();
+      httpSolrClient.setParser(responseParser);
+
+      solrClients.add(httpSolrClient);
+    }
+
+    return solrClients;
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/package-info.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/package-info.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/package-info.java
new file mode 100644
index 0000000..63b17fe
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/collector/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** 
+ * Solr metrics collector.
+ */
+package org.apache.solr.prometheus.collector;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java
new file mode 100644
index 0000000..752f176
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/SolrExporter.java
@@ -0,0 +1,254 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import io.prometheus.client.CollectorRegistry;
+import io.prometheus.client.Counter;
+import io.prometheus.client.exporter.HTTPServer;
+import net.sourceforge.argparse4j.ArgumentParsers;
+import net.sourceforge.argparse4j.inf.ArgumentParser;
+import net.sourceforge.argparse4j.inf.ArgumentParserException;
+import net.sourceforge.argparse4j.inf.Namespace;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.NoOpResponseParser;
+import org.apache.solr.core.Config;
+import org.apache.solr.core.SolrResourceLoader;
+import org.apache.solr.prometheus.collector.SolrCollector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.SAXException;
+
+import java.lang.invoke.MethodHandles;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * SolrExporter
+ */
+public class SolrExporter {
+  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  private static final String[] ARG_PORT_FLAGS = { "-p", "--port" };
+  private static final String ARG_PORT_METAVAR = "PORT";
+  private static final String ARG_PORT_DEST = "port";
+  private static final Integer ARG_PORT_DEFAULT = 9983;
+  private static final String ARG_PORT_HELP = "solr-exporter listen port";
+
+  private static final String[] ARG_BASE_URL_FLAGS = { "-b", "--baseurl" };
+  private static final String ARG_BASE_URL_METAVAR = "BASE_URL";
+  private static final String ARG_BASE_URL_DEST = "baseUrl";
+  private static final String ARG_BASE_URL_DEFAULT = "";
+  private static final String ARG_BASE_URL_HELP = "specify Solr base URL when connecting to Solr in standalone mode (for example 'http://localhost:8983/solr')";
+
+  private static final String[] ARG_ZK_HOST_FLAGS = { "-z", "--zkhost" };
+  private static final String ARG_ZK_HOST_METAVAR = "ZK_HOST";
+  private static final String ARG_ZK_HOST_DEST = "zkHost";
+  private static final String ARG_ZK_HOST_DEFAULT = "";
+  private static final String ARG_ZK_HOST_HELP = "specify ZooKeeper connection string when connecting to Solr in SolrCloud mode (for example 'localhost:2181/solr')";
+
+  private static final String[] ARG_CONFIG_FLAGS = { "-f", "--config-file" };
+  private static final String ARG_CONFIG_METAVAR = "CONFIG";
+  private static final String ARG_CONFIG_DEST = "configFile";
+  private static final String ARG_CONFIG_DEFAULT = "./conf/solr-exporter-config.xml";
+  private static final String ARG_CONFIG_HELP = "specify configuration file";
+
+  private static final String[] ARG_NUM_THREADS_FLAGS = { "-n", "--num-thread" };
+  private static final String ARG_NUM_THREADS_METAVAR = "NUM_THREADS";
+  private static final String ARG_NUM_THREADS_DEST = "numThreads";
+  private static final Integer ARG_NUM_THREADS_DEFAULT = 1;
+  private static final String ARG_NUM_THREADS_HELP = "specify number of threads";
+
+  private int port;
+  private SolrClient solrClient;
+  private Config config;
+  private int numThreads;
+
+  CollectorRegistry registry = new CollectorRegistry();
+
+  private HTTPServer httpServer;
+  private SolrCollector collector;
+
+  private SolrResourceLoader loader;
+
+  public static final Counter scrapeErrorTotal = Counter.build()
+      .name("solr_exporter_scrape_error_total")
+      .help("Number of scrape error.").register();
+
+  /**
+   * Constructor.
+   */
+  public SolrExporter(int port, String connStr, Path configPath, int numThreads) throws ParserConfigurationException, SAXException, IOException {
+    this(port, createClient(connStr), configPath, numThreads);
+  }
+
+  /**
+   * Constructor.
+   */
+  public SolrExporter(int port, SolrClient solrClient, Path configPath, int numThreads) throws ParserConfigurationException, SAXException, IOException {
+    super();
+
+    this.loader = new SolrResourceLoader(configPath.getParent());
+
+    this.port = port;
+    this.solrClient = solrClient;
+    this.config = new Config(this.loader, configPath.getFileName().toString());
+    this.numThreads = numThreads;
+  }
+
+  /**
+   * Start HTTP server for exporting Solr metrics.
+   */
+  public void start() throws IOException {
+    this.collector = new SolrCollector(solrClient, config, numThreads);
+    this.registry.register(this.collector);
+    this.registry.register(scrapeErrorTotal);
+    this.httpServer = new HTTPServer(new InetSocketAddress(port), this.registry);
+  }
+
+  /**
+   * Stop HTTP server for exporting Solr metrics.
+   */
+  public void stop() {
+    this.httpServer.stop();
+    this.registry.unregister(this.collector);
+//    this.collector.shutdown();
+  }
+
+  /**
+   * Create Solr client
+   */
+  private static SolrClient createClient(String connStr) {
+    SolrClient solrClient;
+
+    Pattern baseUrlPattern = Pattern.compile("^https?:\\/\\/[\\w\\/:%#\\$&\\?\\(\\)~\\.=\\+\\-]+$");
+    Pattern zkHostPattern = Pattern.compile("^(?<host>[^\\/]+)(?<chroot>|(?:\\/.*))$");
+    Matcher matcher;
+
+    matcher = baseUrlPattern.matcher(connStr);
+    if (matcher.matches()) {
+      NoOpResponseParser responseParser = new NoOpResponseParser();
+      responseParser.setWriterType("json");
+
+      HttpSolrClient.Builder builder = new HttpSolrClient.Builder();
+      builder.withBaseSolrUrl(connStr);
+
+      HttpSolrClient httpSolrClient = builder.build();
+      httpSolrClient.setParser(responseParser);
+
+      solrClient = httpSolrClient;
+    } else {
+      String host = "";
+      String chroot = "";
+
+      matcher = zkHostPattern.matcher(connStr);
+      if (matcher.matches()) {
+        host = matcher.group("host") != null ? matcher.group("host") : "";
+        chroot = matcher.group("chroot") != null ? matcher.group("chroot") : "";
+      }
+
+      NoOpResponseParser responseParser = new NoOpResponseParser();
+      responseParser.setWriterType("json");
+
+      CloudSolrClient.Builder builder = new CloudSolrClient.Builder();
+      if (host.contains(",")) {
+        List<String> hosts = new ArrayList<>();
+        for (String h : host.split(",")) {
+          if (h != null && !h.equals("")) {
+            hosts.add(h.trim());
+          }
+        }
+        builder.withZkHost(hosts);
+      } else {
+        builder.withZkHost(host);
+      }
+      if (chroot.equals("")) {
+        builder.withZkChroot("/");
+      } else {
+        builder.withZkChroot(chroot);
+      }
+
+      CloudSolrClient cloudSolrClient = builder.build();
+      cloudSolrClient.setParser(responseParser);
+
+      solrClient = cloudSolrClient;
+    }
+
+    return solrClient;
+  }
+
+  /**
+   * Entry point of SolrExporter.
+   */
+  public static void main( String[] args ) {
+    ArgumentParser parser = ArgumentParsers.newArgumentParser(SolrCollector.class.getSimpleName())
+        .description("Prometheus exporter for Apache Solr.");
+
+    parser.addArgument(ARG_PORT_FLAGS)
+        .metavar(ARG_PORT_METAVAR).dest(ARG_PORT_DEST).type(Integer.class)
+        .setDefault(ARG_PORT_DEFAULT).help(ARG_PORT_HELP);
+
+    parser.addArgument(ARG_BASE_URL_FLAGS)
+        .metavar(ARG_BASE_URL_METAVAR).dest(ARG_BASE_URL_DEST).type(String.class)
+        .setDefault(ARG_BASE_URL_DEFAULT).help(ARG_BASE_URL_HELP);
+
+    parser.addArgument(ARG_ZK_HOST_FLAGS)
+        .metavar(ARG_ZK_HOST_METAVAR).dest(ARG_ZK_HOST_DEST).type(String.class)
+        .setDefault(ARG_ZK_HOST_DEFAULT).help(ARG_ZK_HOST_HELP);
+
+    parser.addArgument(ARG_CONFIG_FLAGS)
+        .metavar(ARG_CONFIG_METAVAR).dest(ARG_CONFIG_DEST).type(String.class)
+        .setDefault(ARG_CONFIG_DEFAULT).help(ARG_CONFIG_HELP);
+
+    parser.addArgument(ARG_NUM_THREADS_FLAGS)
+        .metavar(ARG_NUM_THREADS_METAVAR).dest(ARG_NUM_THREADS_DEST).type(Integer.class)
+        .setDefault(ARG_NUM_THREADS_DEFAULT).help(ARG_NUM_THREADS_HELP);
+
+    try {
+      Namespace res = parser.parseArgs(args);
+
+      int port = res.getInt(ARG_PORT_DEST);
+
+      String connStr = "http://localhost:8983/solr";
+      if (!res.getString(ARG_BASE_URL_DEST).equals("")) {
+        connStr = res.getString(ARG_BASE_URL_DEST);
+      } else if (!res.getString(ARG_ZK_HOST_DEST).equals("")) {
+        connStr = res.getString(ARG_ZK_HOST_DEST);
+      }
+
+      Path configPath = Paths.get(res.getString(ARG_CONFIG_DEST));
+      int numThreads = res.getInt(ARG_NUM_THREADS_DEST);
+
+      SolrExporter solrExporter = new SolrExporter(port, connStr, configPath, numThreads);
+      solrExporter.start();
+      logger.info("Start server");
+    } catch (ParserConfigurationException | SAXException | IOException e) {
+      logger.error("Start server failed: " + e.toString());
+    } catch (ArgumentParserException e) {
+      parser.handleError(e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/package-info.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/package-info.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/package-info.java
new file mode 100644
index 0000000..81f33f9
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** 
+ * Solr metrics exporter.
+ */
+package org.apache.solr.prometheus.exporter;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/SolrScraper.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/SolrScraper.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/SolrScraper.java
new file mode 100644
index 0000000..dd74384
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/SolrScraper.java
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.scraper;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.solr.prometheus.exporter.SolrExporter;
+import io.prometheus.client.Collector;
+import net.thisptr.jackson.jq.JsonQuery;
+import net.thisptr.jackson.jq.exception.JsonQueryException;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.request.QueryRequest;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.util.NamedList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.invoke.MethodHandles;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+/**
+ * SolrScraper
+ */
+public class SolrScraper implements Callable<Map<String, Collector.MetricFamilySamples>> {
+  private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  private SolrClient solrClient;
+  private LinkedHashMap conf;
+
+  private List<String> labelNames;
+  private List<String> labelValues;
+
+  /**
+   * Constructor.
+   */
+  public SolrScraper(SolrClient solrClient, LinkedHashMap conf) {
+    super();
+
+    this.solrClient = solrClient;
+    this.conf = conf;
+
+    this.labelNames = new ArrayList<>();
+    this.labelValues = new ArrayList<>();
+  }
+
+  /**
+   * Execute collectResponse
+   */
+  @Override
+  public Map<String, Collector.MetricFamilySamples> call() throws Exception {
+    return collectResponse(this.solrClient, this.conf);
+  }
+
+  /**
+   * Collect facet count.
+   */
+  public Map<String, Collector.MetricFamilySamples> collectResponse(SolrClient solrClient, LinkedHashMap conf) {
+    Map<String, Collector.MetricFamilySamples> metricFamilySamplesMap = new LinkedHashMap<>();
+
+    try {
+      // create Solr request parameters
+      LinkedHashMap confQuery = (LinkedHashMap) conf.get("query");
+      LinkedHashMap confParams = (LinkedHashMap) confQuery.get("params");
+      String path = (String) confQuery.get("path");
+      String core = (String) confQuery.get("core");
+      String collection = (String) confQuery.get("collection");
+      ArrayList<String> jsonQueries = (ArrayList<String>) conf.get("jsonQueries");
+
+      ModifiableSolrParams params = new ModifiableSolrParams();
+      if (confParams != null) {
+        for (Object k : confParams.keySet()) {
+          String name = (String) k;
+          String value = (String) confParams.get(k);
+          params.add(name, value);
+        }
+      }
+
+      // create Solr queryConfig request
+      QueryRequest queryRequest = new QueryRequest(params);
+      queryRequest.setPath(path);
+
+      // request to Solr
+      NamedList<Object> queryResponse = null;
+      try {
+        if (core == null && collection == null) {
+          queryResponse = solrClient.request(queryRequest);
+        } else if (core != null) {
+          queryResponse = solrClient.request(queryRequest, core);
+        } else if (collection != null) {
+          queryResponse = solrClient.request(queryRequest, collection);
+        }
+      } catch (SolrServerException | IOException e) {
+        this.logger.error("failed to request: " + queryRequest.getPath() + " " + e.getMessage());
+      }
+
+      ObjectMapper om = new ObjectMapper();
+
+      JsonNode metricsJson = om.readTree((String) queryResponse.get("response"));
+
+      List<JsonQuery> jqs = new ArrayList<>();
+      if (jsonQueries != null) {
+        for (String jsonQuery : jsonQueries) {
+          JsonQuery compiledJsonQuery = JsonQuery.compile(jsonQuery);
+          jqs.add(compiledJsonQuery);
+        }
+      }
+
+      for (int i = 0; i < jqs.size(); i++) {
+        JsonQuery q = jqs.get(i);
+        try {
+          List<JsonNode> results = q.apply(metricsJson);
+          for (JsonNode result : results) {
+            String type = result.get("type").textValue();
+            String name = result.get("name").textValue();
+            String help = result.get("help").textValue();
+            Double value = result.get("value").doubleValue();
+            ArrayList<String> labelNames = new ArrayList<>(this.labelNames);
+            ArrayList<String> labelValues = new ArrayList<>(this.labelValues);
+
+            if (solrClient instanceof CloudSolrClient) {
+              labelNames.add("zk_host");
+              labelValues.add(((CloudSolrClient) solrClient).getZkHost());
+            }
+
+            if (collection != null) {
+              labelNames.add("collection");
+              labelValues.add(collection);
+            }
+
+            if (solrClient instanceof HttpSolrClient) {
+              labelNames.add("base_url");
+              labelValues.add(((HttpSolrClient) solrClient).getBaseURL());
+            }
+
+            if (core != null) {
+              labelNames.add("core");
+              labelValues.add(core);
+            }
+
+            for(Iterator<JsonNode> ite = result.get("label_names").iterator();ite.hasNext();){
+              JsonNode item = ite.next();
+              labelNames.add(item.textValue());
+            }
+            for(Iterator<JsonNode> ite = result.get("label_values").iterator();ite.hasNext();){
+              JsonNode item = ite.next();
+              labelValues.add(item.textValue());
+            }
+
+            if (labelNames.indexOf("core") < 0 && labelNames.indexOf("collection") >= 0 && labelNames.indexOf("shard") >= 0 && labelNames.indexOf("replica") >= 0) {
+              StringBuffer sb = new StringBuffer();
+              sb.append(labelValues.get(labelNames.indexOf("collection")))
+                  .append("_")
+                  .append(labelValues.get(labelNames.indexOf("shard")))
+                  .append("_")
+                  .append(labelValues.get(labelNames.indexOf("replica")));
+
+              labelNames.add("core");
+              labelValues.add(sb.toString());
+            }
+
+            if (!metricFamilySamplesMap.containsKey(name)) {
+              Collector.MetricFamilySamples metricFamilySamples = new Collector.MetricFamilySamples(
+                name,
+                Collector.Type.valueOf(type),
+                help,
+                new ArrayList<>()
+              );
+              metricFamilySamplesMap.put(name, metricFamilySamples);
+            }
+
+            Collector.MetricFamilySamples.Sample sample = new Collector.MetricFamilySamples.Sample(name, labelNames, labelValues, value);
+
+            if (!metricFamilySamplesMap.get(name).samples.contains(sample)) {
+              metricFamilySamplesMap.get(name).samples.add(sample);
+            }
+          }
+        } catch (JsonQueryException e) {
+          this.logger.error(e.toString() + " " + q.toString());
+          SolrExporter.scrapeErrorTotal.inc();
+        }
+      }
+    } catch (HttpSolrClient.RemoteSolrException | IOException e) {
+      this.logger.error("failed to request: " + e.toString());
+    } catch (Exception e) {
+      this.logger.error(e.toString());
+      e.printStackTrace();
+    }
+
+    return metricFamilySamplesMap;
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java
new file mode 100644
index 0000000..85c4eaa
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** 
+ * Solr metrics scraper.
+ */
+package org.apache.solr.prometheus.scraper;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/java/overview.html
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/java/overview.html b/solr/contrib/prometheus-exporter/src/java/overview.html
new file mode 100644
index 0000000..df1c45a
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/overview.html
@@ -0,0 +1,26 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html>
+<body>
+Apache Solr Search Server: Solr Prometheus Exporter contrib
+
+<p>
+This package provides tools for monitoring Solr with Prometheus.
+</p>
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties b/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties
new file mode 100644
index 0000000..5dd6899
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties
@@ -0,0 +1,22 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+log4j.rootLogger=INFO, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS} %-5p [%c] - %m%n


[7/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/conf/grafana-solr-dashboard.json
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/conf/grafana-solr-dashboard.json b/solr/contrib/prometheus-exporter/conf/grafana-solr-dashboard.json
new file mode 100644
index 0000000..96fb818
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/conf/grafana-solr-dashboard.json
@@ -0,0 +1,4465 @@
+{
+  "__inputs": [
+    {
+      "name": "DS_PROMETHEUS",
+      "label": "Prometheus",
+      "description": "",
+      "type": "datasource",
+      "pluginId": "prometheus",
+      "pluginName": "Prometheus"
+    }
+  ],
+  "__requires": [
+    {
+      "type": "grafana",
+      "id": "grafana",
+      "name": "Grafana",
+      "version": "4.6.3"
+    },
+    {
+      "type": "panel",
+      "id": "graph",
+      "name": "Graph",
+      "version": ""
+    },
+    {
+      "type": "datasource",
+      "id": "prometheus",
+      "name": "Prometheus",
+      "version": "1.0.0"
+    }
+  ],
+  "annotations": {
+    "list": [
+      {
+        "builtIn": 1,
+        "datasource": "-- Grafana --",
+        "enable": true,
+        "hide": true,
+        "iconColor": "rgba(0, 211, 255, 1)",
+        "name": "Annotations & Alerts",
+        "type": "dashboard"
+      }
+    ]
+  },
+  "description": "Solr Dashboard",
+  "editable": true,
+  "gnetId": null,
+  "graphTooltip": 0,
+  "hideControls": false,
+  "id": null,
+  "links": [],
+  "refresh": "1m",
+  "rows": [
+    {
+      "collapse": false,
+      "height": "250px",
+      "panels": [
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 2,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_jetty_requests_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{method}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Requests",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "description": "",
+          "fill": 1,
+          "id": 1,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_jetty_response_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{status}}",
+              "refId": "A",
+              "step": 40
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Response",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 55,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": true,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 12,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_jetty_dispatches_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Dispatches",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        }
+      ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
+      "showTitle": true,
+      "title": "Jetty Metrics",
+      "titleSize": "h3"
+    },
+    {
+      "collapse": false,
+      "height": 250,
+      "panels": [
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 3,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_buffers{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{pool}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Buffers",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 4,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_buffers_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{pool}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Buffer Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 5,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_jvm_gc_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "GC Count",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 6,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_jvm_gc_seconds_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "GC Time",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "decimals": null,
+              "format": "s",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 7,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_memory_heap_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Heap Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 8,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_memory_non_heap_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Non-Heap Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 9,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_memory_pools_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{space}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Pool Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 10,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_memory_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Memory Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 16,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": true,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 12,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_threads{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Threads",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        }
+      ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
+      "showTitle": true,
+      "title": "JVM Metrics",
+      "titleSize": "h3"
+    },
+    {
+      "collapse": false,
+      "height": 250,
+      "panels": [
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 11,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_os_memory_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Memory Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 12,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_os_file_descriptors{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "File Descriptors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 13,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_os_cpu_load{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "CPU Load",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "percentunit",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 14,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_jvm_os_cpu_time_seconds{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "CPU Time",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 15,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": true,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 12,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_jvm_os_load_average{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Load Average",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        }
+      ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
+      "showTitle": true,
+      "title": "OS Metrics",
+      "titleSize": "h3"
+    },
+    {
+      "collapse": false,
+      "height": 250,
+      "panels": [
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 19,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_requests_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Requests",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 22,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_time_seconds_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Request Time",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 17,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_client_errors_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Client Errors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 20,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_server_errors_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Server Errors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 18,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_errors_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Errors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 21,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_timeouts_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Timeouts",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 23,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_node_cores{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Cores",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 24,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_node_core_root_fs_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Core Root File System",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 25,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_thread_pool_completed_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{handler}} {{executor}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Thread Pool Completed",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 26,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_node_thread_pool_submitted_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{handler}} {{executor}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Thread Pool Submitted",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 27,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": true,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 12,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_node_thread_pool_running{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{handler}} {{executor}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Thread Pool Running",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 28,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "rightSide": true,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 12,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_node_connections{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}} {{handler}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Connections",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        }
+      ],
+      "repeat": null,
+      "repeatIteration": null,
+      "repeatRowId": null,
+      "showTitle": true,
+      "title": "Node Metrics",
+      "titleSize": "h3"
+    },
+    {
+      "collapse": false,
+      "height": 250,
+      "panels": [
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 31,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_requests_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Requests",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 34,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_time_seconds_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Request Time",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 29,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_client_errors_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Client Errors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 32,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_server_errors_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Server Errors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 30,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_errors_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Errors",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 33,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_timeouts_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}{{handler}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Timeouts",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 35,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_field_cache_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Field Cache",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 36,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_core_searcher_cache{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}} {{type}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Searcher Cache",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 37,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_core_searcher_warmup_time_seconds{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}} {{type}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Searcher Warm Up Time",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 38,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "increase(solr_metrics_core_searcher_cumulative_cache_total{base_url=~\"$base_url\"}[1m])",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}} {{type}} {{item}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Searcher Cumulative Cache",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 39,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_core_fs_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "File System",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 40,
+          "legend": {
+            "alignAsTable": true,
+            "avg": false,
+            "current": false,
+            "max": false,
+            "min": false,
+            "show": true,
+            "total": false,
+            "values": false
+          },
+          "lines": true,
+          "linewidth": 1,
+          "links": [],
+          "nullPointMode": "null",
+          "percentage": false,
+          "pointradius": 5,
+          "points": false,
+          "renderer": "flot",
+          "seriesOverrides": [],
+          "spaceLength": 10,
+          "span": 6,
+          "stack": false,
+          "steppedLine": false,
+          "targets": [
+            {
+              "expr": "solr_metrics_core_index_size_bytes{base_url=~\"$base_url\"}",
+              "format": "time_series",
+              "intervalFactor": 2,
+              "legendFormat": "{{base_url}}/{{core}}",
+              "refId": "A"
+            }
+          ],
+          "thresholds": [],
+          "timeFrom": null,
+          "timeShift": null,
+          "title": "Index Size",
+          "tooltip": {
+            "shared": true,
+            "sort": 0,
+            "value_type": "individual"
+          },
+          "type": "graph",
+          "xaxis": {
+            "buckets": null,
+            "mode": "time",
+            "name": null,
+            "show": true,
+            "values": []
+          },
+          "yaxes": [
+            {
+              "format": "decbytes",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": "0",
+              "show": true
+            },
+            {
+              "format": "short",
+              "label": null,
+              "logBase": 1,
+              "max": null,
+              "min": null,
+              "show": true
+            }
+          ]
+        },
+        {
+          "aliasColors": {},
+          "bars": false,
+          "dashLength": 10,
+          "dashes": false,
+          "datasource": "${DS_PROMETHEUS}",
+          "fill": 1,
+          "id": 41,
+          "legend": {
+        

<TRUNCATED>

[3/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml b/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml
new file mode 100644
index 0000000..dc49f56
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml
@@ -0,0 +1,1806 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+
+  <rules>
+
+    <ping>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/ping</str>
+        </lst>
+        <arr name="jsonQueries">
+          <str>
+            . as $object | $object |
+            (if $object.status == "OK" then 1.0 else 0.0 end) as $value |
+            {
+              name         : "solr_ping",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/ping.html",
+              label_names  : [],
+              label_values : [],
+              value        : $value
+            }
+          </str>
+        </arr>
+      </lst>
+    </ping>
+
+    <metrics>
+      <lst name="request">
+        <lst name="query">
+          <str name="path">/admin/metrics</str>
+          <lst name="params">
+            <str name="group">all</str>
+            <str name="type">all</str>
+            <str name="prefix"></str>
+            <str name="property"></str>
+          </lst>
+        </lst>
+        <arr name="jsonQueries">
+          <!--
+            jetty metrics
+          -->
+          <!--
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler")) | select(.key | endswith("xx-responses")) as $object |
+            $object.key | split(".") | last | split("-") | first as $status |
+            $object.value.count as $value |
+            {
+            name         : "solr_metrics_jetty_response_total",
+            type         : "COUNTER",
+            help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+            label_names  : ["status"],
+            label_values : [$status],
+            value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler.")) | select(.key | endswith("-requests")) | select (.value | type == "object") as $object |
+            $object.key | split(".") | last | split("-") | first as $method |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_jetty_requests_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["method"],
+              label_values : [$method],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jetty"] | to_entries | .[] | select(.key == "org.eclipse.jetty.server.handler.DefaultHandler.dispatches") as $object |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_jetty_dispatches_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : [],
+              label_values : [],
+              value        : $value
+            }
+          </str>
+          -->
+          <!--
+            jvm metrics
+          -->
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("buffers.")) | select(.key | endswith(".Count")) as $object |
+            $object.key | split(".")[1] as $pool |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_buffers",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["pool"],
+              label_values : [$pool],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("buffers.")) | select(.key | (endswith(".MemoryUsed") or endswith(".TotalCapacity"))) as $object |
+            $object.key | split(".")[1] as $pool |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_buffers_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["pool", "item"],
+              label_values : [$pool, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("gc.")) | select(.key | endswith(".count")) as $object |
+            $object.key | split(".")[1] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_gc_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("gc.")) | select(.key | endswith(".time")) as $object |
+            $object.key | split(".")[1] as $item |
+            ($object.value / 1000) as $value |
+            {
+              name         : "solr_metrics_jvm_gc_seconds_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.heap.")) | select(.key | endswith(".usage") | not) as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_heap_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.non-heap.")) | select(.key | endswith(".usage") | not) as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_non_heap_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.pools.")) | select(.key | endswith(".usage") | not) as $object |
+            $object.key | split(".")[2] as $space |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_pools_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["space", "item"],
+              label_values : [$space, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.total.")) as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_memory_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.committedVirtualMemorySize" or .key == "os.freePhysicalMemorySize" or .key == "os.freeSwapSpaceSize" or .key =="os.totalPhysicalMemorySize" or .key == "os.totalSwapSpaceSize") as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_memory_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.maxFileDescriptorCount" or .key == "os.openFileDescriptorCount") as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_file_descriptors",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.processCpuLoad" or .key == "os.systemCpuLoad") as $object |
+            $object.key | split(".") | last as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_cpu_load",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <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>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.systemLoadAverage") as $object |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_os_load_average",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : ["systemLoadAverage"],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("threads.")) | select(.key | endswith(".count")) as $object |
+            $object.key | split(".")[1] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_jvm_threads",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["item"],
+              label_values : [$item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_client_errors_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_errors_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".requestTimes")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_requests_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".serverErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_server_errors_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".timeouts")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_timeouts_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".totalTime")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            ($object.value / 1000) as $value |
+            {
+              name         : "solr_metrics_node_time_seconds_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler"],
+              label_values : [$category, $handler],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | startswith("CONTAINER.cores.")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_cores",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "item"],
+              label_values : [$category, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | startswith("CONTAINER.fs.coreRoot.")) | select(.key | endswith(".totalSpace") or endswith(".usableSpace")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            $key_items[3] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_core_root_fs_bytes",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "item"],
+              label_values : [$category, $item],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".completed")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+            (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_thread_pool_completed_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "executor"],
+              label_values : [$category, $handler, $executor],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".running")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+            (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_thread_pool_running",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "executor"],
+              label_values : [$category, $handler, $executor],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".submitted")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+            (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+            $object.value.count as $value |
+            {
+              name         : "solr_metrics_node_thread_pool_submitted_total",
+              type         : "COUNTER",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "executor"],
+              label_values : [$category, $handler, $executor],
+              value        : $value
+            }
+          </str>
+          <str>
+            .metrics["solr.node"] | to_entries | .[] | select(.key | endswith("Connections")) as $object |
+            $object.key | split(".") as $key_items |
+            $key_items | length as $label_len |
+            $key_items[0] as $category |
+            $key_items[1] as $handler |
+            $key_items[2] as $item |
+            $object.value as $value |
+            {
+              name         : "solr_metrics_node_connections",
+              type         : "GAUGE",
+              help         : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names  : ["category", "handler", "item"],
+              label_values : [$category, $handler, $item],
+              value        : $value
+            }
+          </str>
+
+          <!--
+            core metrics
+          -->
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_client_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_client_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".errors")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".requestTimes")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_requests_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_requests_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".serverErrors")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_server_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_server_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".timeouts")) | select (.value | type == "object") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_timeouts_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_timeouts_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | endswith(".totalTime")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            select($handler | startswith("/")) |
+            ($object.value / 1000) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_time_seconds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_time_seconds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select (.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "CACHE.core.fieldCache") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.value.entries_count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_field_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core"],
+              label_values: [$category, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_field_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica"],
+              label_values: [$category, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "lookups" or .key == "hits" or .key == "size" or .key == "evictions" or .key == "inserts") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cache",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cache",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "hitratio") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "warmupTime") as $target |
+            $target.key as $item |
+            ($target.value / 1000) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_warmup_time_seconds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_warmup_time_seconds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "cumulative_lookups" or .key == "cumulative_hits" or .key == "cumulative_evictions" or .key == "cumulative_inserts") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $type |
+            $object.value | to_entries | .[] | select(.key == "cumulative_hitratio") as $target |
+            $target.key as $item |
+            $target.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "type", "item"],
+              label_values: [$category, $core, $type, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_cumulative_cache_ratio",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("CORE.fs.")) | select (.key | endswith(".totalSpace") or endswith(".usableSpace")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_fs_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "item"],
+              label_values: [$category, $core, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_fs_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key | startswith("HIGHLIGHTER.")) | select (.key | endswith(".requests")) as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $name |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_highlighter_request_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "name", "item"],
+              label_values: [$category, $core, $name, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_highlighter_request_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "name", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $name, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "INDEX.sizeInBytes") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_index_size_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core"],
+              label_values: [$category, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_index_size_bytes",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica"],
+              label_values: [$category, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "REPLICATION./replication.isMaster") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            (if $object.value == true then 1.0 else 0.0 end) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_replication_master",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_replication_master",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "REPLICATION./replication.isSlave") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            (if $object.value == true then 1.0 else 0.0 end) as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_replication_slave",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_replication_slave",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "SEARCHER.searcher.deletedDocs" or .key == "SEARCHER.searcher.maxDoc" or .key == "SEARCHER.searcher.numDocs") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[2] as $item |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_searcher_documents",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "item"],
+              label_values: [$category, $core, $item],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_searcher_documents",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "core", "collection", "shard", "replica", "item"],
+              label_values: [$category, $core, $collection, $shard, $replica, $item],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.adds") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_adds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_adds",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.autoCommits") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_auto_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_auto_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.commits") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_commits_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeAdds") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_adds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_adds_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeDeletesById") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeDeletesByQuery") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeErrors") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_errors_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.deletesById") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_id",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.deletesByQuery") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_deletes_by_query",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.docsPending") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_pending_docs",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_pending_docs",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.errors") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_errors",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_errors",
+              type: "GAUGE",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.expungeDeletes") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_expunge_deletes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_expunge_deletes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.merges") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_merges_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_merges_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.optimizes") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_optimizes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_optimizes_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+            (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+            (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+            $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.rollbacks") as $object |
+            $object.key | split(".")[0] as $category |
+            $object.key | split(".")[1] as $handler |
+            $object.value.count as $value |
+            if $parent_key_item_len == 3 then
+            {
+              name: "solr_metrics_core_update_handler_rollbacks_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core"],
+              label_values: [$category, $handler, $core],
+              value: $value
+            }
+            else
+            {
+              name: "solr_metrics_core_update_handler_rollbacks_total",
+              type: "COUNTER",
+              help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+              label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+              label_values: [$category, $handler, $core, $collection, $shard, $replica],
+              value: $value
+            }
+            end
+          </str>
+          <str>
+            .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+            $parent.key | split(".") as $parent_key_items |
+            $parent_key_items | length as $parent_key_item_len |
+            (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+            (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+            (if $parent_key_item_len == 5 

<TRUNCATED>

[2/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
new file mode 100644
index 0000000..caa3317
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+
+ This example schema is the recommended starting point for users.
+ It should be kept correct and concise, usable out-of-the-box.
+
+
+ For more information, on how to customize this file, please see
+ http://lucene.apache.org/solr/guide/documents-fields-and-schema-design.html
+
+ PERFORMANCE NOTE: this schema includes many optional features and should not
+ be used for benchmarking.  To improve performance one could
+  - set stored="false" for all fields possible (esp large fields) when you
+    only need to search on the field but don't need to return the original
+    value.
+  - set indexed="false" if you don't need to search on the field, but only
+    return the field as a result of searching on other indexed fields.
+  - remove all unneeded copyField statements
+  - for best index size and searching performance, set "index" to false
+    for all general text fields, use copyField to copy them to the
+    catchall "text" field, and use that for searching.
+-->
+
+<schema name="collection1-config" version="1.6">
+    <!-- attribute "name" is the name of this schema and is only used for display purposes.
+       version="x.y" is Solr's version number for the schema syntax and
+       semantics.  It should not normally be changed by applications.
+
+       1.0: multiValued attribute did not exist, all fields are multiValued
+            by nature
+       1.1: multiValued attribute introduced, false by default
+       1.2: omitTermFreqAndPositions attribute introduced, true by default
+            except for text fields.
+       1.3: removed optional field compress feature
+       1.4: autoGeneratePhraseQueries attribute introduced to drive QueryParser
+            behavior when a single string produces multiple tokens.  Defaults
+            to off for version >= 1.4
+       1.5: omitNorms defaults to true for primitive field types
+            (int, float, boolean, string...)
+       1.6: useDocValuesAsStored defaults to true.
+    -->
+
+    <!-- Valid attributes for fields:
+     name: mandatory - the name for the field
+     type: mandatory - the name of a field type from the
+       fieldTypes section
+     indexed: true if this field should be indexed (searchable or sortable)
+     stored: true if this field should be retrievable
+     docValues: true if this field should have doc values. Doc Values is
+       recommended (required, if you are using *Point fields) for faceting,
+       grouping, sorting and function queries. Doc Values will make the index
+       faster to load, more NRT-friendly and more memory-efficient.
+       They are currently only supported by StrField, UUIDField, all
+       *PointFields, and depending on the field type, they might require
+       the field to be single-valued, be required or have a default value
+       (check the documentation of the field type you're interested in for
+       more information)
+     multiValued: true if this field may contain multiple values per document
+     omitNorms: (expert) set to true to omit the norms associated with
+       this field (this disables length normalization and index-time
+       boosting for the field, and saves some memory).  Only full-text
+       fields or fields that need an index-time boost need norms.
+       Norms are omitted for primitive (non-analyzed) types by default.
+     termVectors: [false] set to true to store the term vector for a
+       given field.
+       When using MoreLikeThis, fields used for similarity should be
+       stored for best performance.
+     termPositions: Store position information with the term vector.
+       This will increase storage costs.
+     termOffsets: Store offset information with the term vector. This
+       will increase storage costs.
+     required: The field is required.  It will throw an error if the
+       value does not exist
+     default: a value that should be used if no value is specified
+       when adding a document.
+    -->
+
+    <!-- field names should consist of alphanumeric or underscore characters only and
+      not start with a digit.  This is not currently strictly enforced,
+      but other field names will not have first class support from all components
+      and back compatibility is not guaranteed.  Names with both leading and
+      trailing underscores (e.g. _version_) are reserved.
+    -->
+
+    <!-- In this _default configset, only four fields are pre-declared:
+         id, _version_, and _text_ and _root_. All other fields will be type guessed and added via the
+         "add-unknown-fields-to-the-schema" update request processor chain declared in solrconfig.xml.
+
+         Note that many dynamic fields are also defined - you can use them to specify a
+         field's type via field naming conventions - see below.
+
+         WARNING: The _text_ catch-all field will significantly increase your index size.
+         If you don't need it, consider removing it and the corresponding copyField directive.
+    -->
+
+    <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
+    <!-- docValues are enabled by default for long type so we don't need to index the version field  -->
+    <field name="_version_" type="plong" indexed="false" stored="false"/>
+    <field name="_root_" type="string" indexed="true" stored="false" docValues="false" />
+    <field name="_text_" type="text_general" indexed="true" stored="false" multiValued="true"/>
+
+    <!-- This can be enabled, in case the client does not know what fields may be searched. It isn't enabled by default
+         because it's very expensive to index everything twice. -->
+    <!-- <copyField source="*" dest="_text_"/> -->
+
+    <!-- Dynamic field definitions allow using convention over configuration
+       for fields via the specification of patterns to match field names.
+       EXAMPLE:  name="*_i" will match any field ending in _i (like myid_i, z_i)
+       RESTRICTION: the glob-like pattern in the name attribute must have a "*" only at the start or the end.  -->
+
+    <dynamicField name="*_i"  type="pint"    indexed="true"  stored="true"/>
+    <dynamicField name="*_is" type="pints"    indexed="true"  stored="true"/>
+    <dynamicField name="*_s"  type="string"  indexed="true"  stored="true" />
+    <dynamicField name="*_ss" type="strings"  indexed="true"  stored="true"/>
+    <dynamicField name="*_l"  type="plong"   indexed="true"  stored="true"/>
+    <dynamicField name="*_ls" type="plongs"   indexed="true"  stored="true"/>
+    <dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
+    <dynamicField name="*_b"  type="boolean" indexed="true" stored="true"/>
+    <dynamicField name="*_bs" type="booleans" indexed="true" stored="true"/>
+    <dynamicField name="*_f"  type="pfloat"  indexed="true"  stored="true"/>
+    <dynamicField name="*_fs" type="pfloats"  indexed="true"  stored="true"/>
+    <dynamicField name="*_d"  type="pdouble" indexed="true"  stored="true"/>
+    <dynamicField name="*_ds" type="pdoubles" indexed="true"  stored="true"/>
+
+    <!-- Type used for data-driven schema, to add a string copy for each text field -->
+    <dynamicField name="*_str" type="strings" stored="false" docValues="true" indexed="false" />
+
+    <dynamicField name="*_dt"  type="pdate"    indexed="true"  stored="true"/>
+    <dynamicField name="*_dts" type="pdate"    indexed="true"  stored="true" multiValued="true"/>
+    <dynamicField name="*_p"  type="location" indexed="true" stored="true"/>
+    <dynamicField name="*_srpt"  type="location_rpt" indexed="true" stored="true"/>
+
+    <!-- payloaded dynamic fields -->
+    <dynamicField name="*_dpf" type="delimited_payloads_float" indexed="true"  stored="true"/>
+    <dynamicField name="*_dpi" type="delimited_payloads_int" indexed="true"  stored="true"/>
+    <dynamicField name="*_dps" type="delimited_payloads_string" indexed="true"  stored="true"/>
+
+    <dynamicField name="attr_*" type="text_general" indexed="true" stored="true" multiValued="true"/>
+
+    <!-- Field to use to determine and enforce document uniqueness.
+      Unless this field is marked with required="false", it will be a required field
+    -->
+    <uniqueKey>id</uniqueKey>
+
+    <!-- copyField commands copy one field to another at the time a document
+       is added to the index.  It's used either to index the same field differently,
+       or to add multiple fields to the same field for easier/faster searching.
+
+    <copyField source="sourceFieldName" dest="destinationFieldName"/>
+    -->
+
+    <!-- field type definitions. The "name" attribute is
+       just a label to be used by field definitions.  The "class"
+       attribute and any other attributes determine the real
+       behavior of the fieldType.
+         Class names starting with "solr" refer to java classes in a
+       standard package such as org.apache.solr.analysis
+    -->
+
+    <!-- sortMissingLast and sortMissingFirst attributes are optional attributes are
+         currently supported on types that are sorted internally as strings
+         and on numeric types.
+       This includes "string", "boolean", "pint", "pfloat", "plong", "pdate", "pdouble".
+       - If sortMissingLast="true", then a sort on this field will cause documents
+         without the field to come after documents with the field,
+         regardless of the requested sort order (asc or desc).
+       - If sortMissingFirst="true", then a sort on this field will cause documents
+         without the field to come before documents with the field,
+         regardless of the requested sort order.
+       - If sortMissingLast="false" and sortMissingFirst="false" (the default),
+         then default lucene sorting will be used which places docs without the
+         field first in an ascending sort and last in a descending sort.
+    -->
+
+    <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
+    <fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true" />
+    <fieldType name="strings" class="solr.StrField" sortMissingLast="true" multiValued="true" docValues="true" />
+
+    <!-- boolean type: "true" or "false" -->
+    <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+    <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
+
+    <!--
+      Numeric field types that index values using KD-trees.
+      Point fields don't support FieldCache, so they must have docValues="true" if needed for sorting, faceting, functions, etc.
+    -->
+    <fieldType name="pint" class="solr.IntPointField" docValues="true"/>
+    <fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
+    <fieldType name="plong" class="solr.LongPointField" docValues="true"/>
+    <fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
+
+    <fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
+    <fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
+    <fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
+    <fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
+
+    <!-- The format for this date field is of the form 1995-12-31T23:59:59Z, and
+         is a more restricted form of the canonical representation of dateTime
+         http://www.w3.org/TR/xmlschema-2/#dateTime
+         The trailing "Z" designates UTC time and is mandatory.
+         Optional fractional seconds are allowed: 1995-12-31T23:59:59.999Z
+         All other components are mandatory.
+
+         Expressions can also be used to denote calculations that should be
+         performed relative to "NOW" to determine the value, ie...
+
+               NOW/HOUR
+                  ... Round to the start of the current hour
+               NOW-1DAY
+                  ... Exactly 1 day prior to now
+               NOW/DAY+6MONTHS+3DAYS
+                  ... 6 months and 3 days in the future from the start of
+                      the current day
+
+      -->
+    <!-- KD-tree versions of date fields -->
+    <fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
+    <fieldType name="pdates" class="solr.DatePointField" docValues="true" multiValued="true"/>
+
+    <!--Binary data type. The data should be sent/retrieved in as Base64 encoded Strings -->
+    <fieldType name="binary" class="solr.BinaryField"/>
+
+    <!-- solr.TextField allows the specification of custom text analyzers
+         specified as a tokenizer and a list of token filters. Different
+         analyzers may be specified for indexing and querying.
+
+         The optional positionIncrementGap puts space between multiple fields of
+         this type on the same document, with the purpose of preventing false phrase
+         matching across fields.
+
+         For more info on customizing your analyzer chain, please see
+         http://lucene.apache.org/solr/guide/understanding-analyzers-tokenizers-and-filters.html#understanding-analyzers-tokenizers-and-filters
+     -->
+
+    <!-- One can also specify an existing Analyzer class that has a
+         default constructor via the class attribute on the analyzer element.
+         Example:
+    <fieldType name="text_greek" class="solr.TextField">
+      <analyzer class="org.apache.lucene.analysis.el.GreekAnalyzer"/>
+    </fieldType>
+    -->
+
+    <!-- A text field that only splits on whitespace for exact matching of words -->
+    <dynamicField name="*_ws" type="text_ws"  indexed="true"  stored="true"/>
+    <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
+      <analyzer>
+        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <!-- A general text field that has reasonable, generic
+         cross-language defaults: it tokenizes with StandardTokenizer,
+	       removes stop words from case-insensitive "stopwords.txt"
+	       (empty by default), and down cases.  At query time only, it
+	       also applies synonyms.
+	  -->
+    <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
+      <analyzer type="index">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+        <!-- in this example, we will only use synonyms at query time
+        <filter class="solr.SynonymGraphFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
+        <filter class="solr.FlattenGraphFilterFactory"/>
+        -->
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+        <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <!-- Just like text_general except it reverses the characters of
+	       each token, to enable more efficient leading wildcard queries.
+    -->
+    <dynamicField name="*_txt_rev" type="text_general_rev"  indexed="true"  stored="true"/>
+    <fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
+      <analyzer type="index">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+        <filter class="solr.LowerCaseFilterFactory"/>
+        <filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
+                maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.SynonymGraphFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
+        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
+        <filter class="solr.LowerCaseFilterFactory"/>
+      </analyzer>
+    </fieldType>
+
+    <dynamicField name="*_phon_en" type="phonetic_en"  indexed="true"  stored="true"/>
+    <fieldType name="phonetic_en" stored="false" indexed="true" class="solr.TextField" >
+      <analyzer>
+        <tokenizer class="solr.StandardTokenizerFactory"/>
+        <filter class="solr.DoubleMetaphoneFilterFactory" inject="false"/>
+      </analyzer>
+    </fieldType>
+
+    <!-- lowercases the entire field value, keeping it as a single token.  -->
+    <dynamicField name="*_s_lower" type="lowercase"  indexed="true"  stored="true"/>
+    <fieldType name="lowercase" class="solr.TextField" positionIncrementGap="100">
+      <analyzer>
+        <tokenizer class="solr.KeywordTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory" />
+      </analyzer>
+    </fieldType>
+
+    <!--
+      Example of using PathHierarchyTokenizerFactory at index time, so
+      queries for paths match documents at that path, or in descendent paths
+    -->
+    <dynamicField name="*_descendent_path" type="descendent_path"  indexed="true"  stored="true"/>
+    <fieldType name="descendent_path" class="solr.TextField">
+      <analyzer type="index">
+        <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.KeywordTokenizerFactory" />
+      </analyzer>
+    </fieldType>
+
+    <!--
+      Example of using PathHierarchyTokenizerFactory at query time, so
+      queries for paths match documents at that path, or in ancestor paths
+    -->
+    <dynamicField name="*_ancestor_path" type="ancestor_path"  indexed="true"  stored="true"/>
+    <fieldType name="ancestor_path" class="solr.TextField">
+      <analyzer type="index">
+        <tokenizer class="solr.KeywordTokenizerFactory" />
+      </analyzer>
+      <analyzer type="query">
+        <tokenizer class="solr.PathHierarchyTokenizerFactory" delimiter="/" />
+      </analyzer>
+    </fieldType>
+
+    <!-- This point type indexes the coordinates as separate fields (subFields)
+      If subFieldType is defined, it references a type, and a dynamic field
+      definition is created matching *___<typename>.  Alternately, if
+      subFieldSuffix is defined, that is used to create the subFields.
+      Example: if subFieldType="double", then the coordinates would be
+        indexed in fields myloc_0___double,myloc_1___double.
+      Example: if subFieldSuffix="_d" then the coordinates would be indexed
+        in fields myloc_0_d,myloc_1_d
+      The subFields are an implementation detail of the fieldType, and end
+      users normally should not need to know about them.
+     -->
+    <dynamicField name="*_point" type="point"  indexed="true"  stored="true"/>
+    <fieldType name="point" class="solr.PointType" dimension="2" subFieldSuffix="_d"/>
+
+    <!-- A specialized field for geospatial search filters and distance sorting. -->
+    <fieldType name="location" class="solr.LatLonPointSpatialField" docValues="true"/>
+
+    <!-- A geospatial field type that supports multiValued and polygon shapes.
+      For more information about this and other spatial fields see:
+      http://lucene.apache.org/solr/guide/spatial-search.html
+    -->
+    <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
+               geo="true" distErrPct="0.025" maxDistErr="0.001" distanceUnits="kilometers" />
+
+    <!-- Payloaded field types -->
+    <fieldType name="delimited_payloads_float" stored="false" indexed="true" class="solr.TextField">
+      <analyzer>
+        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+        <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float"/>
+      </analyzer>
+    </fieldType>
+    <fieldType name="delimited_payloads_int" stored="false" indexed="true" class="solr.TextField">
+      <analyzer>
+        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+        <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="integer"/>
+      </analyzer>
+    </fieldType>
+    <fieldType name="delimited_payloads_string" stored="false" indexed="true" class="solr.TextField">
+      <analyzer>
+        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+        <filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="identity"/>
+      </analyzer>
+    </fieldType>
+
+    <!-- Similarity is the scoring routine for each document vs. a query.
+       A custom Similarity or SimilarityFactory may be specified here, but
+       the default is fine for most applications.
+       For more info: http://lucene.apache.org/solr/guide/other-schema-elements.html#OtherSchemaElements-Similarity
+    -->
+    <!--
+     <similarity class="com.example.solr.CustomSimilarityFactory">
+       <str name="paramkey">param value</str>
+     </similarity>
+    -->
+
+</schema>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
new file mode 100644
index 0000000..72c5430
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+
+  <dataDir>${solr.data.dir:}</dataDir>
+
+  <directoryFactory name="DirectoryFactory"
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
+
+  <codecFactory class="solr.SchemaCodecFactory"/>
+
+  <indexConfig>
+    <lockType>${solr.lock.type:native}</lockType>
+  </indexConfig>
+
+  <jmx />
+
+  <updateHandler class="solr.DirectUpdateHandler2">
+
+    <updateLog>
+      <str name="dir">${solr.ulog.dir:}</str>
+      <int name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}</int>
+    </updateLog>
+
+    <autoCommit>
+      <maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
+      <openSearcher>false</openSearcher>
+    </autoCommit>
+
+    <autoSoftCommit>
+      <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
+    </autoSoftCommit>
+
+  </updateHandler>
+
+  <query>
+
+    <maxBooleanClauses>1024</maxBooleanClauses>
+
+    <filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/>
+
+    <queryResultCache class="solr.LRUCache"
+                      size="512"
+                      initialSize="512"
+                      autowarmCount="0"/>
+
+    <documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/>
+
+    <cache name="perSegFilter"
+           class="solr.search.LRUCache"
+           size="10"
+           initialSize="0"
+           autowarmCount="10"
+           regenerator="solr.NoOpRegenerator" />
+
+    <enableLazyFieldLoading>true</enableLazyFieldLoading>
+
+    <queryResultWindowSize>20</queryResultWindowSize>
+
+    <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
+
+    <listener event="newSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+      </arr>
+    </listener>
+    <listener event="firstSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+      </arr>
+    </listener>
+
+    <useColdSearcher>false</useColdSearcher>
+
+  </query>
+
+  <requestDispatcher>
+
+    <httpCaching never304="true" />
+
+  </requestDispatcher>
+
+  <!-- Request Handlers
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    -->
+  <!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    -->
+  <requestHandler name="/select" class="solr.SearchHandler">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+      <int name="rows">10</int>
+    </lst>
+  </requestHandler>
+
+  <!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    -->
+
+  <!-- Add unknown fields to the schema
+
+       Field type guessing update processors that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types. Text content will be indexed as "text_general" as
+       well as a copy to a plain string version in *_str.
+
+       These require that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true.
+
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    -->
+  <updateProcessor class="solr.UUIDUpdateProcessorFactory" name="uuid"/>
+  <updateProcessor class="solr.RemoveBlankFieldUpdateProcessorFactory" name="remove-blank"/>
+  <updateProcessor class="solr.FieldNameMutatingUpdateProcessorFactory" name="field-name-mutating">
+    <str name="pattern">[^\w-\.]</str>
+    <str name="replacement">_</str>
+  </updateProcessor>
+  <updateProcessor class="solr.ParseBooleanFieldUpdateProcessorFactory" name="parse-boolean"/>
+  <updateProcessor class="solr.ParseLongFieldUpdateProcessorFactory" name="parse-long"/>
+  <updateProcessor class="solr.ParseDoubleFieldUpdateProcessorFactory" name="parse-double"/>
+  <updateProcessor class="solr.ParseDateFieldUpdateProcessorFactory" name="parse-date">
+    <arr name="format">
+      <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str>
+      <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str>
+      <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str>
+      <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str>
+      <str>yyyy-MM-dd'T'HH:mm:ssZ</str>
+      <str>yyyy-MM-dd'T'HH:mm:ss</str>
+      <str>yyyy-MM-dd'T'HH:mmZ</str>
+      <str>yyyy-MM-dd'T'HH:mm</str>
+      <str>yyyy-MM-dd HH:mm:ss.SSSZ</str>
+      <str>yyyy-MM-dd HH:mm:ss,SSSZ</str>
+      <str>yyyy-MM-dd HH:mm:ss.SSS</str>
+      <str>yyyy-MM-dd HH:mm:ss,SSS</str>
+      <str>yyyy-MM-dd HH:mm:ssZ</str>
+      <str>yyyy-MM-dd HH:mm:ss</str>
+      <str>yyyy-MM-dd HH:mmZ</str>
+      <str>yyyy-MM-dd HH:mm</str>
+      <str>yyyy-MM-dd</str>
+    </arr>
+  </updateProcessor>
+  <updateProcessor class="solr.AddSchemaFieldsUpdateProcessorFactory" name="add-schema-fields">
+    <lst name="typeMapping">
+      <str name="valueClass">java.lang.String</str>
+      <str name="fieldType">text_general</str>
+      <lst name="copyField">
+        <str name="dest">*_str</str>
+        <int name="maxChars">256</int>
+      </lst>
+      <!-- Use as default mapping instead of defaultFieldType -->
+      <bool name="default">true</bool>
+    </lst>
+    <lst name="typeMapping">
+      <str name="valueClass">java.lang.Boolean</str>
+      <str name="fieldType">booleans</str>
+    </lst>
+    <lst name="typeMapping">
+      <str name="valueClass">java.util.Date</str>
+      <str name="fieldType">pdates</str>
+    </lst>
+    <lst name="typeMapping">
+      <str name="valueClass">java.lang.Long</str>
+      <str name="valueClass">java.lang.Integer</str>
+      <str name="fieldType">plongs</str>
+    </lst>
+    <lst name="typeMapping">
+      <str name="valueClass">java.lang.Number</str>
+      <str name="fieldType">pdoubles</str>
+    </lst>
+  </updateProcessor>
+
+  <!-- The update.autoCreateFields property can be turned to false to disable schemaless mode -->
+  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:true}"
+           processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date,add-schema-fields">
+    <processor class="solr.LogUpdateProcessorFactory"/>
+    <processor class="solr.DistributedUpdateProcessorFactory"/>
+    <processor class="solr.RunUpdateProcessorFactory"/>
+  </updateRequestProcessorChain>
+
+  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
+    <!-- For the purposes of the tutorial, JSON responses are written as
+     plain text so that they are easy to read in *any* browser.
+     If you expect a MIME type of "application/json" just remove this override.
+    -->
+    <str name="content-type">text/plain; charset=UTF-8</str>
+  </queryResponseWriter>
+
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
new file mode 100644
index 0000000..ae1e83e
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
@@ -0,0 +1,14 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
new file mode 100644
index 0000000..eab4ee8
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
@@ -0,0 +1,29 @@
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#-----------------------------------------------------------------------
+#some test synonym mappings unlikely to appear in real input text
+aaafoo => aaabar
+bbbfoo => bbbfoo bbbbar
+cccfoo => cccbar cccbaz
+fooaaa,baraaa,bazaaa
+
+# Some synonym groups specific to this example
+GB,gib,gigabyte,gigabytes
+MB,mib,megabyte,megabytes
+Television, Televisions, TV, TVs
+#notice we use "gib" instead of "GiB" so any WordDelimiterGraphFilter coming
+#after us won't split it into two words.
+
+# Synonym mappings can be used for spelling correction too
+pixima => pixma
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
new file mode 100644
index 0000000..01743d3
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="GB18030"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+  <doc>
+    <field name="id">GB18030TEST</field>
+    <field name="name">Test with some GB18030 encoded characters</field>
+    <field name="features">No accents here</field>
+    <field name="features">����һ������</field>
+    <field name="features">This is a feature (translated)</field>
+    <field name="features">����ļ��Ǻ��й���</field>
+    <field name="features">This document is very shiny (translated)</field>
+    <field name="price">0.0</field>
+    <field name="inStock">true</field>
+  </doc>
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
new file mode 100644
index 0000000..9cf7d1b
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
@@ -0,0 +1,56 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+  <field name="id">SP2514N</field>
+  <field name="name">Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133</field>
+  <field name="manu">Samsung Electronics Co. Ltd.</field>
+  <!-- Join -->
+  <field name="manu_id_s">samsung</field>
+  <field name="cat">electronics</field>
+  <field name="cat">hard drive</field>
+  <field name="features">7200RPM, 8MB cache, IDE Ultra ATA-133</field>
+  <field name="features">NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor</field>
+  <field name="price">92.0</field>
+  <field name="popularity">6</field>
+  <field name="inStock">true</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+  <!-- Near Oklahoma city -->
+  <field name="store">35.0752,-97.032</field>
+</doc>
+
+<doc>
+  <field name="id">6H500F0</field>
+  <field name="name">Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300</field>
+  <field name="manu">Maxtor Corp.</field>
+  <!-- Join -->
+  <field name="manu_id_s">maxtor</field>
+  <field name="cat">electronics</field>
+  <field name="cat">hard drive</field>
+  <field name="features">SATA 3.0Gb/s, NCQ</field>
+  <field name="features">8.5ms seek</field>
+  <field name="features">16MB cache</field>
+  <field name="price">350.0</field>
+  <field name="popularity">6</field>
+  <field name="inStock">true</field>
+  <!-- Buffalo store -->
+  <field name="store">45.17614,-93.87341</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+</doc>
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
new file mode 100644
index 0000000..3de32f3
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
@@ -0,0 +1,60 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+
+<doc>
+  <field name="id">F8V7067-APL-KIT</field>
+  <field name="name">Belkin Mobile Power Cord for iPod w/ Dock</field>
+  <field name="manu">Belkin</field>
+  <!-- Join -->
+  <field name="manu_id_s">belkin</field>
+  <field name="cat">electronics</field>
+  <field name="cat">connector</field>
+  <field name="features">car power adapter, white</field>
+  <field name="weight">4.0</field>
+  <field name="price">19.95</field>
+  <field name="popularity">1</field>
+  <field name="inStock">false</field>
+  <!-- Buffalo store -->
+  <field name="store">45.18014,-93.87741</field>
+  <field name="manufacturedate_dt">2005-08-01T16:30:25Z</field>
+</doc>
+
+<doc>
+  <field name="id">IW-02</field>
+  <field name="name">iPod &amp; iPod Mini USB 2.0 Cable</field>
+  <field name="manu">Belkin</field>
+  <!-- Join -->
+  <field name="manu_id_s">belkin</field>
+  <field name="cat">electronics</field>
+  <field name="cat">connector</field>
+  <field name="features">car power adapter for iPod, white</field>
+  <field name="weight">2.0</field>
+  <field name="price">11.50</field>
+  <field name="popularity">1</field>
+  <field name="inStock">false</field>
+  <!-- San Francisco store -->
+  <field name="store">37.7752,-122.4232</field>
+  <field name="manufacturedate_dt">2006-02-14T23:55:59Z</field>
+</doc>
+
+
+</add>
+
+
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
new file mode 100644
index 0000000..1ca5f6f
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
@@ -0,0 +1,40 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+  <field name="id">MA147LL/A</field>
+  <field name="name">Apple 60 GB iPod with Video Playback Black</field>
+  <field name="manu">Apple Computer Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">apple</field>
+  <field name="cat">electronics</field>
+  <field name="cat">music</field>
+  <field name="features">iTunes, Podcasts, Audiobooks</field>
+  <field name="features">Stores up to 15,000 songs, 25,000 photos, or 150 hours of video</field>
+  <field name="features">2.5-inch, 320x240 color TFT LCD display with LED backlight</field>
+  <field name="features">Up to 20 hours of battery life</field>
+  <field name="features">Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video</field>
+  <field name="features">Notes, Calendar, Phone book, Hold button, Date display, Photo wallet, Built-in games, JPEG photo playback, Upgradeable firmware, USB 2.0 compatibility, Playback speed control, Rechargeable capability, Battery level indication</field>
+  <field name="includes">earbud headphones, USB cable</field>
+  <field name="weight">5.5</field>
+  <field name="price">399.00</field>
+  <field name="popularity">10</field>
+  <field name="inStock">true</field>
+  <!-- Dodge City store -->
+  <field name="store">37.7752,-100.0232</field>
+  <field name="manufacturedate_dt">2005-10-12T08:00:00Z</field>
+</doc></add>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
new file mode 100644
index 0000000..e3121d5
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
@@ -0,0 +1,75 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+  <doc>
+    <field name="id">adata</field>
+    <field name="compName_s">A-Data Technology</field>
+    <field name="address_s">46221 Landing Parkway Fremont, CA 94538</field>
+  </doc>
+  <doc>
+    <field name="id">apple</field>
+    <field name="compName_s">Apple</field>
+    <field name="address_s">1 Infinite Way, Cupertino CA</field>
+  </doc>
+  <doc>
+    <field name="id">asus</field>
+    <field name="compName_s">ASUS Computer</field>
+    <field name="address_s">800 Corporate Way Fremont, CA 94539</field>
+  </doc>
+  <doc>
+    <field name="id">ati</field>
+    <field name="compName_s">ATI Technologies</field>
+    <field name="address_s">33 Commerce Valley Drive East Thornhill, ON L3T 7N6 Canada</field>
+  </doc>
+  <doc>
+    <field name="id">belkin</field>
+    <field name="compName_s">Belkin</field>
+    <field name="address_s">12045 E. Waterfront Drive Playa Vista, CA 90094</field>
+  </doc>
+  <doc>
+    <field name="id">canon</field>
+    <field name="compName_s">Canon, Inc.</field>
+    <field name="address_s">One Canon Plaza Lake Success, NY 11042</field>
+  </doc>
+  <doc>
+    <field name="id">corsair</field>
+    <field name="compName_s">Corsair Microsystems</field>
+    <field name="address_s">46221 Landing Parkway Fremont, CA 94538</field>
+  </doc>
+  <doc>
+    <field name="id">dell</field>
+    <field name="compName_s">Dell, Inc.</field>
+    <field name="address_s">One Dell Way Round Rock, Texas 78682</field>
+  </doc>
+  <doc>
+    <field name="id">maxtor</field>
+    <field name="compName_s">Maxtor Corporation</field>
+    <field name="address_s">920 Disc Drive Scotts Valley, CA 95066</field>
+  </doc>
+  <doc>
+    <field name="id">samsung</field>
+    <field name="compName_s">Samsung Electronics Co. Ltd.</field>
+    <field name="address_s">105 Challenger Rd. Ridgefield Park, NJ 07660-0511</field>
+  </doc>
+  <doc>
+    <field name="id">viewsonic</field>
+    <field name="compName_s">ViewSonic Corp</field>
+    <field name="address_s">381 Brea Canyon Road Walnut, CA 91789-0708</field>
+  </doc>
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
new file mode 100644
index 0000000..48af522
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
@@ -0,0 +1,77 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+  <field name="id">TWINX2048-3200PRO</field>
+  <field name="name">CORSAIR  XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail</field>
+  <field name="manu">Corsair Microsystems Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">corsair</field>
+  <field name="cat">electronics</field>
+  <field name="cat">memory</field>
+  <field name="features">CAS latency 2,  2-3-3-6 timing, 2.75v, unbuffered, heat-spreader</field>
+  <field name="price">185.00</field>
+  <field name="popularity">5</field>
+  <field name="inStock">true</field>
+  <!-- San Francisco store -->
+  <field name="store">37.7752,-122.4232</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+
+  <!-- a field for testing payload tagged text via DelimitedPayloadTokenFilter -->
+  <field name="payloads">electronics|6.0 memory|3.0</field>
+</doc>
+
+<doc>
+  <field name="id">VS1GB400C3</field>
+  <field name="name">CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail</field>
+  <field name="manu">Corsair Microsystems Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">corsair</field>
+  <field name="cat">electronics</field>
+  <field name="cat">memory</field>
+  <field name="price">74.99</field>
+  <field name="popularity">7</field>
+  <field name="inStock">true</field>
+  <!-- Dodge City store -->
+  <field name="store">37.7752,-100.0232</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+
+  <field name="payloads">electronics|4.0 memory|2.0</field>
+</doc>
+
+<doc>
+  <field name="id">VDBDB1A16</field>
+  <field name="name">A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM</field>
+  <field name="manu">A-DATA Technology Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">corsair</field>
+  <field name="cat">electronics</field>
+  <field name="cat">memory</field>
+  <field name="features">CAS latency 3,   2.7v</field>
+  <!-- note: price & popularity is missing on this one -->
+  <field name="popularity">0</field>
+  <field name="inStock">true</field>
+  <!-- Buffalo store -->
+  <field name="store">45.18414,-93.88141</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+
+  <field name="payloads">electronics|0.9 memory|0.1</field>
+</doc>
+
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
new file mode 100644
index 0000000..b1b8036
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
@@ -0,0 +1,65 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Example documents utilizing the CurrencyField type -->
+<add>
+<doc>
+  <field name="id">USD</field>
+  <field name="name">One Dollar</field>
+  <field name="manu">Bank of America</field>
+  <field name="manu_id_s">boa</field>
+  <field name="cat">currency</field>
+  <field name="features">Coins and notes</field>
+  <field name="price_c">1,USD</field>
+  <field name="inStock">true</field>
+</doc>
+
+<doc>
+  <field name="id">EUR</field>
+  <field name="name">One Euro</field>
+  <field name="manu">European Union</field>
+  <field name="manu_id_s">eu</field>
+  <field name="cat">currency</field>
+  <field name="features">Coins and notes</field>
+  <field name="price_c">1,EUR</field>
+  <field name="inStock">true</field>
+</doc>
+
+<doc>
+  <field name="id">GBP</field>
+  <field name="name">One British Pound</field>
+  <field name="manu">U.K.</field>
+  <field name="manu_id_s">uk</field>
+  <field name="cat">currency</field>
+  <field name="features">Coins and notes</field>
+  <field name="price_c">1,GBP</field>
+  <field name="inStock">true</field>
+</doc>
+
+<doc>
+  <field name="id">NOK</field>
+  <field name="name">One Krone</field>
+  <field name="manu">Bank of Norway</field>
+  <field name="manu_id_s">nor</field>
+  <field name="cat">currency</field>
+  <field name="features">Coins and notes</field>
+  <field name="price_c">1,NOK</field>
+  <field name="inStock">true</field>
+</doc>
+
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
new file mode 100644
index 0000000..d0343af
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+  <field name="id">3007WFP</field>
+  <field name="name">Dell Widescreen UltraSharp 3007WFP</field>
+  <field name="manu">Dell, Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">dell</field>
+  <field name="cat">electronics and computer1</field>
+  <field name="features">30" TFT active matrix LCD, 2560 x 1600, .25mm dot pitch, 700:1 contrast</field>
+  <field name="includes">USB cable</field>
+  <field name="weight">401.6</field>
+  <field name="price">2199.0</field>
+  <field name="popularity">6</field>
+  <field name="inStock">true</field>
+  <!-- Buffalo store -->
+  <field name="store">43.17614,-90.57341</field>
+</doc></add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
new file mode 100644
index 0000000..eaf9e22
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
@@ -0,0 +1,33 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+  <field name="id">VA902B</field>
+  <field name="name">ViewSonic VA902B - flat panel display - TFT - 19"</field>
+  <field name="manu">ViewSonic Corp.</field>
+  <!-- Join -->
+  <field name="manu_id_s">viewsonic</field>
+  <field name="cat">electronics and stuff2</field>
+  <field name="features">19" TFT active matrix LCD, 8ms response time, 1280 x 1024 native resolution</field>
+  <field name="weight">190.4</field>
+  <field name="price">279.95</field>
+  <field name="popularity">6</field>
+  <field name="inStock">true</field>
+  <!-- Buffalo store -->
+  <field name="store">45.18814,-93.88541</field>
+</doc></add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
new file mode 100644
index 0000000..a8f51b6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
@@ -0,0 +1,43 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+  <field name="id">0579B002</field>
+  <field name="name">Canon PIXMA MP500 All-In-One Photo Printer</field>
+  <field name="manu">Canon Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">canon</field>
+  <field name="cat">electronics</field>
+  <field name="cat">multifunction printer</field>
+  <field name="cat">printer</field>
+  <field name="cat">scanner</field>
+  <field name="cat">copier</field>
+  <field name="features">Multifunction ink-jet color photo printer</field>
+  <field name="features">Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi</field>
+  <field name="features">2.5" color LCD preview screen</field>
+  <field name="features">Duplex Copying</field>
+  <field name="features">Printing speed up to 29ppm black, 19ppm color</field>
+  <field name="features">Hi-Speed USB</field>
+  <field name="features">memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard</field>
+  <field name="weight">352.0</field>
+  <field name="price">179.99</field>
+  <field name="popularity">6</field>
+  <field name="inStock">true</field>
+  <!-- Buffalo store -->
+  <field name="store">45.19214,-93.89941</field>
+</doc></add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
new file mode 100644
index 0000000..656b656
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+  <title>Welcome to Solr</title>
+</head>
+<body>
+<p>
+  Here is some text
+</p>
+<p>distinct<br/>words</p>
+<div>Here is some text in a div</div>
+<div>This has a <a href="http://www.apache.org">link</a>.</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
new file mode 100644
index 0000000..145c6fd
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add><doc>
+  <field name="id">9885A004</field>
+  <field name="name">Canon PowerShot SD500</field>
+  <field name="manu">Canon Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">canon</field>
+  <field name="cat">electronics</field>
+  <field name="cat">camera</field>
+  <field name="features">3x zoop, 7.1 megapixel Digital ELPH</field>
+  <field name="features">movie clips up to 640x480 @30 fps</field>
+  <field name="features">2.0" TFT LCD, 118,000 pixels</field>
+  <field name="features">built in flash, red-eye reduction</field>
+  <field name="includes">32MB SD card, USB cable, AV cable, battery</field>
+  <field name="weight">6.4</field>
+  <field name="price">329.95</field>
+  <field name="popularity">7</field>
+  <field name="inStock">true</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z</field>
+  <!-- Buffalo store -->
+  <field name="store">45.19614,-93.90341</field>
+</doc></add>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
new file mode 100644
index 0000000..a365617
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
@@ -0,0 +1,38 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+  <field name="id">SOLR1000</field>
+  <field name="name">Solr, the Enterprise Search Server</field>
+  <field name="manu">Apache Software Foundation</field>
+  <field name="cat">software</field>
+  <field name="cat">search</field>
+  <field name="features">Advanced Full-Text Search Capabilities using Lucene</field>
+  <field name="features">Optimized for High Volume Web Traffic</field>
+  <field name="features">Standards Based Open Interfaces - XML and HTTP</field>
+  <field name="features">Comprehensive HTML Administration Interfaces</field>
+  <field name="features">Scalability - Efficient Replication to other Solr Search Servers</field>
+  <field name="features">Flexible and Adaptable with XML configuration and Schema</field>
+  <field name="features">Good unicode support: h&#xE9;llo (hello with an accent over the e)</field>
+  <field name="price">0.0</field>
+  <field name="popularity">10</field>
+  <field name="inStock">true</field>
+  <field name="incubationdate_dt">2006-01-17T00:00:00.000Z</field>
+</doc>
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
new file mode 100644
index 0000000..ee300a6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- 
+  After posting this to Solr with bin/post, searching for "êâîôû" from
+  the solr/admin/ search page must return this document.
+ -->
+
+<add>
+  <doc>
+    <field name="id">UTF8TEST</field>
+    <field name="name">Test with some UTF-8 encoded characters</field>
+    <field name="manu">Apache Software Foundation</field>
+    <field name="cat">software</field>
+    <field name="cat">search</field>
+    <field name="features">No accents here</field>
+    <field name="features">This is an e acute: é</field>
+    <field name="features">eaiou with circumflexes: êâîôû</field>
+    <field name="features">eaiou with umlauts: ëäïöü</field>
+    <field name="features">tag with escaped chars: &lt;nicetag/&gt;</field>
+    <field name="features">escaped ampersand: Bonnie &amp; Clyde</field>
+    <field name="features">Outside the BMP:𐌈 codepoint=10308, a circle with an x inside. UTF8=f0908c88 UTF16=d800 df08</field>
+    <field name="price">0.0</field>
+    <field name="inStock">true</field>
+  </doc>
+</add>
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
new file mode 100644
index 0000000..d867d82
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
@@ -0,0 +1,62 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<add>
+<doc>
+  <field name="id">EN7800GTX/2DHTV/256M</field>
+  <field name="name">ASUS Extreme N7800GTX/2DHTV (256 MB)</field>
+  <!-- Denormalized -->
+  <field name="manu">ASUS Computer Inc.</field>
+  <!-- Join -->
+  <field name="manu_id_s">asus</field>
+  <field name="cat">electronics</field>
+  <field name="cat">graphics card</field>
+  <field name="features">NVIDIA GeForce 7800 GTX GPU/VPU clocked at 486MHz</field>
+  <field name="features">256MB GDDR3 Memory clocked at 1.35GHz</field>
+  <field name="features">PCI Express x16</field>
+  <field name="features">Dual DVI connectors, HDTV out, video input</field>
+  <field name="features">OpenGL 2.0, DirectX 9.0</field>
+  <field name="weight">16.0</field>
+  <field name="price">479.95</field>
+  <field name="popularity">7</field>
+  <field name="store">40.7143,-74.006</field>
+  <field name="inStock">false</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z/DAY</field>
+</doc>
+  <!-- yes, you can add more than one document at a time -->
+<doc>
+  <field name="id">100-435805</field>
+  <field name="name">ATI Radeon X1900 XTX 512 MB PCIE Video Card</field>
+  <field name="manu">ATI Technologies</field>
+  <!-- Join -->
+  <field name="manu_id_s">ati</field>
+  <field name="cat">electronics</field>
+  <field name="cat">graphics card</field>
+  <field name="features">ATI RADEON X1900 GPU/VPU clocked at 650MHz</field>
+  <field name="features">512MB GDDR3 SDRAM clocked at 1.55GHz</field>
+  <field name="features">PCI Express x16</field>
+  <field name="features">dual DVI, HDTV, svideo, composite out</field>
+  <field name="features">OpenGL 2.0, DirectX 9.0</field>
+  <field name="weight">48.0</field>
+  <field name="price">649.99</field>
+  <field name="popularity">7</field>
+  <field name="inStock">false</field>
+  <field name="manufacturedate_dt">2006-02-13T15:26:37Z/DAY</field>
+  <!-- NYC store -->
+  <field name="store">40.7143,-74.006</field>
+</doc>
+</add>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
new file mode 100644
index 0000000..676f8ab
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.collector;
+
+import org.apache.solr.core.Config;
+import org.apache.solr.core.SolrResourceLoader;
+import org.apache.solr.prometheus.exporter.SolrExporter;
+import org.apache.solr.prometheus.exporter.SolrExporterTestBase;
+import io.prometheus.client.CollectorRegistry;
+import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Unit test for SolrCollector.
+ */
+@Slow
+public class SolrCollectorTest extends SolrExporterTestBase {
+  CollectorRegistry registry;
+
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    registry = new CollectorRegistry();
+  }
+
+  @Override
+  public void tearDown() throws Exception {
+    super.tearDown();
+  }
+
+  @Test
+  public void testSolrCollector() throws Exception {
+    String name = "solr-exporter-config.xml";
+    SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
+    Config config = new Config(loader, name);
+
+    CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+    SolrCollector collector = new SolrCollector(cloudSolrClient, config, 1);
+
+    assertNotNull(collector);
+  }
+
+  @Test
+  public void testCollect() throws Exception {
+    String name = "solr-exporter-config.xml";
+    SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
+    Config config = new Config(loader, name);
+
+    CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+    SolrCollector collector = new SolrCollector(cloudSolrClient, config, 1);
+
+    this.registry.register(collector);
+    this.registry.register(SolrExporter.scrapeErrorTotal);
+
+    // index sample docs
+    File exampleDocsDir = new File(getFile("exampledocs").getAbsolutePath());
+    List<File> xmlFiles = Arrays.asList(exampleDocsDir.listFiles((dir, file) -> file.endsWith(".xml")));
+    for (File xml : xmlFiles) {
+      ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
+      req.addFile(xml, "application/xml");
+      cloudSolrClient.request(req, "collection1");
+    }
+    cloudSolrClient.commit("collection1");
+
+    // collect metrics
+    collector.collect();
+
+    // check scrape error count
+    assertEquals(0.0, registry.getSampleValue("solr_exporter_scrape_error_total", new String[]{}, new String[]{}), .001);
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
new file mode 100644
index 0000000..237a6cb
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
+import org.junit.Test;
+
+import java.io.File;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Unit test for SolrExporter.
+ */
+@Slow
+public class SolrExporterTest extends SolrExporterTestBase {
+
+  @Override
+  public void setUp() throws Exception {
+      super.setUp();
+  }
+
+  @Override
+  public void tearDown() throws Exception {
+      super.tearDown();
+  }
+
+  @Test
+  public void testExecute() throws Exception {
+    // solr client
+    CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+    int port;
+    ServerSocket socket = null;
+    try {
+      socket = new ServerSocket(0);
+      port = socket.getLocalPort();
+    } finally {
+      socket.close();
+    }
+
+    // index sample docs
+    File exampleDocsDir = new File(getFile("exampledocs").getAbsolutePath());
+    List<File> xmlFiles = Arrays.asList(exampleDocsDir.listFiles((dir, name) -> name.endsWith(".xml")));
+    for (File xml : xmlFiles) {
+      ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
+      req.addFile(xml, "application/xml");
+      cloudSolrClient.request(req, "collection1");
+    }
+    cloudSolrClient.commit("collection1");
+
+    // start exporter
+    SolrExporter solrExporter = new SolrExporter(port, cloudSolrClient, getFile("conf/solr-exporter-config.xml").toPath(), 1);
+    try {
+      solrExporter.start();
+
+      URI uri = new URI("http://localhost:" + String.valueOf(port) + "/metrics");
+
+      CloseableHttpClient httpclient = HttpClients.createDefault();
+      CloseableHttpResponse response = null;
+      try {
+        HttpGet request = new HttpGet(uri);
+        response = httpclient.execute(request);
+
+        int expectedHTTPStatusCode = HttpStatus.SC_OK;
+        int actualHTTPStatusCode = response.getStatusLine().getStatusCode();
+        assertEquals(expectedHTTPStatusCode, actualHTTPStatusCode);
+      } finally {
+        response.close();
+        httpclient.close();
+      }
+    } finally {
+      solrExporter.stop();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
new file mode 100644
index 0000000..57ba8e0
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.cloud.AbstractDistribZkTestBase;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.junit.BeforeClass;
+
+/**
+ * Test base class.
+ */
+@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
+public class SolrExporterTestBase extends SolrCloudTestCase {
+  public static String COLLECTION = "collection1";
+  public static String CONF_NAME = COLLECTION + "_config";
+  public static String CONF_DIR = getFile("configsets/" + COLLECTION + "/conf").getAbsolutePath();
+  public static int NUM_SHARDS = 2;
+  public static int NUM_REPLICAS = 2;
+  public static int MAX_SHARDS_PER_NODE = 1;
+  public static int NUM_NODES = (NUM_SHARDS * NUM_REPLICAS + (MAX_SHARDS_PER_NODE - 1)) / MAX_SHARDS_PER_NODE;
+  public static int TIMEOUT = 60;
+
+  @BeforeClass
+  public static void setupCluster() throws Exception {
+    configureCluster(NUM_NODES)
+        .addConfig(CONF_NAME, getFile(CONF_DIR).toPath())
+        .configure();
+
+    CollectionAdminRequest
+        .createCollection(COLLECTION, CONF_NAME, NUM_SHARDS, NUM_REPLICAS)
+        .setMaxShardsPerNode(MAX_SHARDS_PER_NODE)
+        .process(cluster.getSolrClient());
+
+    AbstractDistribZkTestBase
+        .waitForRecoveriesToFinish(COLLECTION, cluster.getSolrClient().getZkStateReader(), true, true, TIMEOUT);
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/argparse4j-0.8.1.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/argparse4j-0.8.1.jar.sha1 b/solr/licenses/argparse4j-0.8.1.jar.sha1
new file mode 100644
index 0000000..27a0568
--- /dev/null
+++ b/solr/licenses/argparse4j-0.8.1.jar.sha1
@@ -0,0 +1 @@
+2c8241f84acf6c924bd75be0dbd68e8d74fbcd70

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/argparse4j-LICENSE-MIT.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/argparse4j-LICENSE-MIT.txt b/solr/licenses/argparse4j-LICENSE-MIT.txt
new file mode 100644
index 0000000..2354213
--- /dev/null
+++ b/solr/licenses/argparse4j-LICENSE-MIT.txt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2011-2017 Tatsuhiro Tsujikawa
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/argparse4j-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/argparse4j-NOTICE.txt b/solr/licenses/argparse4j-NOTICE.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/jackson-jq-0.0.8.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/jackson-jq-0.0.8.jar.sha1 b/solr/licenses/jackson-jq-0.0.8.jar.sha1
new file mode 100644
index 0000000..4b7a4d2
--- /dev/null
+++ b/solr/licenses/jackson-jq-0.0.8.jar.sha1
@@ -0,0 +1 @@
+9bd1a7f8268a436674a4f3210f11ef4eebe14d84

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/jackson-jq-LICENSE-ASL.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/jackson-jq-LICENSE-ASL.txt b/solr/licenses/jackson-jq-LICENSE-ASL.txt
new file mode 100644
index 0000000..8fd4d51
--- /dev/null
+++ b/solr/licenses/jackson-jq-LICENSE-ASL.txt
@@ -0,0 +1,16 @@
+jackson-jq
+----------
+
+Copyright (C) 2015 Eiichi Sato
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/jackson-jq-NOTICE.txt
----------------------------------------------------------------------
diff --git a/solr/licenses/jackson-jq-NOTICE.txt b/solr/licenses/jackson-jq-NOTICE.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/licenses/simpleclient-0.2.0.jar.sha1
----------------------------------------------------------------------
diff --git a/solr/licenses/simpleclient-0.2.0.jar.sha1 b/solr/licenses/simpleclient-0.2.0.jar.sha1
new file mode 100644
index 0000000..ce8b16f
--- /dev/null
+++ b/solr/licenses/simpleclient-0.2.0.jar.sha1
@@ -0,0 +1 @@
+be8de6a5a01f25074be3b27a8db4448c9cce0168


[8/8] lucene-solr:branch_7x-SOLR-11795: SOLR-11795: Add Solr metrics exporter for Prometheus

Posted by ko...@apache.org.
SOLR-11795: Add Solr metrics exporter for Prometheus


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/961269aa
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/961269aa
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/961269aa

Branch: refs/heads/branch_7x-SOLR-11795
Commit: 961269aa5d0feef86cac9b4a94c2268de9f498f6
Parents: e2b3a97
Author: koji <ko...@apache.org>
Authored: Fri Mar 2 11:18:10 2018 +0900
Committer: koji <ko...@apache.org>
Committed: Fri Mar 2 11:25:09 2018 +0900

----------------------------------------------------------------------
 dev-tools/idea/.idea/ant.xml                    |    1 +
 .../Solr_prometheus_exporter_library.xml        |   10 +
 dev-tools/idea/.idea/modules.xml                |    1 +
 dev-tools/idea/.idea/workspace.xml              |   13 +-
 .../prometheus-exporter/prometheus-exporter.iml |   37 +
 dev-tools/maven/solr/contrib/pom.xml.template   |    1 +
 .../prometheus-exporter/pom.xml.template        |   80 +
 lucene/ivy-versions.properties                  |   14 +-
 solr/CHANGES.txt                                |    2 +
 solr/build.xml                                  |    6 +-
 solr/contrib/prometheus-exporter/README.md      |   21 +
 solr/contrib/prometheus-exporter/README.txt     |    1 +
 .../prometheus-exporter/bin/solr-exporter       |  122 +
 .../prometheus-exporter/bin/solr-exporter.cmd   |  104 +
 solr/contrib/prometheus-exporter/build.xml      |   64 +
 .../conf/grafana-solr-dashboard.json            | 4465 ++++++++++++++++++
 .../prometheus-exporter/conf/log4j.properties   |   22 +
 .../conf/solr-exporter-config.xml               | 1806 +++++++
 solr/contrib/prometheus-exporter/ivy.xml        |   40 +
 .../prometheus/collector/SolrCollector.java     |  463 ++
 .../solr/prometheus/collector/package-info.java |   21 +
 .../solr/prometheus/exporter/SolrExporter.java  |  254 +
 .../solr/prometheus/exporter/package-info.java  |   21 +
 .../solr/prometheus/scraper/SolrScraper.java    |  214 +
 .../solr/prometheus/scraper/package-info.java   |   21 +
 .../prometheus-exporter/src/java/overview.html  |   26 +
 .../src/test-files/conf/log4j.properties        |   22 +
 .../test-files/conf/solr-exporter-config.xml    | 1806 +++++++
 .../configsets/collection1/conf/managed-schema  |  412 ++
 .../configsets/collection1/conf/solrconfig.xml  |  232 +
 .../configsets/collection1/conf/stopwords.txt   |   14 +
 .../configsets/collection1/conf/synonyms.txt    |   29 +
 .../test-files/exampledocs/gb18030-example.xml  |   32 +
 .../src/test-files/exampledocs/hd.xml           |   56 +
 .../src/test-files/exampledocs/ipod_other.xml   |   60 +
 .../src/test-files/exampledocs/ipod_video.xml   |   40 +
 .../test-files/exampledocs/manufacturers.xml    |   75 +
 .../src/test-files/exampledocs/mem.xml          |   77 +
 .../src/test-files/exampledocs/money.xml        |   65 +
 .../src/test-files/exampledocs/monitor.xml      |   34 +
 .../src/test-files/exampledocs/monitor2.xml     |   33 +
 .../src/test-files/exampledocs/mp500.xml        |   43 +
 .../src/test-files/exampledocs/sample.html      |   13 +
 .../src/test-files/exampledocs/sd500.xml        |   38 +
 .../src/test-files/exampledocs/solr.xml         |   38 +
 .../src/test-files/exampledocs/utf8-example.xml |   42 +
 .../src/test-files/exampledocs/vidcard.xml      |   62 +
 .../prometheus/collector/SolrCollectorTest.java |   94 +
 .../prometheus/exporter/SolrExporterTest.java   |   99 +
 .../exporter/SolrExporterTestBase.java          |   53 +
 solr/licenses/argparse4j-0.8.1.jar.sha1         |    1 +
 solr/licenses/argparse4j-LICENSE-MIT.txt        |   23 +
 solr/licenses/argparse4j-NOTICE.txt             |    0
 solr/licenses/jackson-jq-0.0.8.jar.sha1         |    1 +
 solr/licenses/jackson-jq-LICENSE-ASL.txt        |   16 +
 solr/licenses/jackson-jq-NOTICE.txt             |    0
 solr/licenses/simpleclient-0.2.0.jar.sha1       |    1 +
 solr/licenses/simpleclient-LICENSE-ASL.txt      |  201 +
 solr/licenses/simpleclient-NOTICE.txt           |   11 +
 .../licenses/simpleclient_common-0.2.0.jar.sha1 |    1 +
 .../simpleclient_common-LICENSE-ASL.txt         |  201 +
 solr/licenses/simpleclient_common-NOTICE.txt    |   11 +
 .../simpleclient_httpserver-0.2.0.jar.sha1      |    1 +
 .../simpleclient_httpserver-LICENSE-ASL.txt     |  201 +
 .../licenses/simpleclient_httpserver-NOTICE.txt |   11 +
 .../grafana-solr-dashboard.png                  |  Bin 0 -> 808611 bytes
 .../solr-exporter-diagram.png                   |  Bin 0 -> 29070 bytes
 ...toring-solr-with-prometheus-and-grafana.adoc |  288 ++
 solr/solr-ref-guide/src/monitoring-solr.adoc    |    4 +-
 69 files changed, 12264 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/idea/.idea/ant.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/ant.xml b/dev-tools/idea/.idea/ant.xml
index 6c7bc8c..172c265 100644
--- a/dev-tools/idea/.idea/ant.xml
+++ b/dev-tools/idea/.idea/ant.xml
@@ -47,6 +47,7 @@
     <buildFile url="file://$PROJECT_DIR$/solr/contrib/dataimporthandler/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/solr/contrib/extraction/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/solr/contrib/langid/build.xml" />
+    <buildFile url="file://$PROJECT_DIR$/solr/contrib/prometheus-exporter/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/solr/contrib/uima/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/solr/contrib/velocity/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/solr/solrj/build.xml" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/idea/.idea/libraries/Solr_prometheus_exporter_library.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/libraries/Solr_prometheus_exporter_library.xml b/dev-tools/idea/.idea/libraries/Solr_prometheus_exporter_library.xml
new file mode 100644
index 0000000..0fd8670
--- /dev/null
+++ b/dev-tools/idea/.idea/libraries/Solr_prometheus_exporter_library.xml
@@ -0,0 +1,10 @@
+<component name="libraryTable">
+  <library name="Solr prometheus exporter library">
+    <CLASSES>
+      <root url="file://$PROJECT_DIR$/solr/contrib/prometheus-exporter/lib" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+    <jarDirectory url="file://$PROJECT_DIR$/solr/contrib/prometheus-exporter/lib" recursive="false" />
+  </library>
+</component>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/idea/.idea/modules.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/modules.xml b/dev-tools/idea/.idea/modules.xml
index 4df1000..207a675 100644
--- a/dev-tools/idea/.idea/modules.xml
+++ b/dev-tools/idea/.idea/modules.xml
@@ -57,6 +57,7 @@
       <module group="Solr/Contrib" filepath="$PROJECT_DIR$/solr/contrib/extraction/extraction.iml" />
       <module group="Solr/Contrib" filepath="$PROJECT_DIR$/solr/contrib/langid/langid.iml" />
       <module group="Solr/Contrib" filepath="$PROJECT_DIR$/solr/contrib/ltr/ltr.iml" />
+      <module group="Solr/Contrib" filepath="$PROJECT_DIR$/solr/contrib/prometheus-exporter/prometheus-exporter.iml" />
       <module group="Solr/Contrib" filepath="$PROJECT_DIR$/solr/contrib/uima/uima.iml" />
       <module group="Solr/Contrib" filepath="$PROJECT_DIR$/solr/contrib/velocity/velocity.iml" />
     </modules>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/idea/.idea/workspace.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/workspace.xml b/dev-tools/idea/.idea/workspace.xml
index 11794af..ba9a383 100644
--- a/dev-tools/idea/.idea/workspace.xml
+++ b/dev-tools/idea/.idea/workspace.xml
@@ -324,6 +324,14 @@
       <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
       <patterns><pattern testClass=".*\.Test[^.]*|.*\.[^.]*Test" /></patterns>
     </configuration>
+    <configuration default="false" name="Solr prometheus-exporter contrib" type="JUnit" factoryName="JUnit">
+      <module name="prometheus-exporter" />
+      <option name="TEST_OBJECT" value="pattern" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/solr/contrib/prometheus-exporter" />
+      <option name="VM_PARAMETERS" value="-ea" />
+      <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
+      <patterns><pattern testClass=".*\.Test[^.]*|.*\.[^.]*Test" /></patterns>
+    </configuration>
     <configuration default="false" name="Solr uima contrib" type="JUnit" factoryName="JUnit">
       <module name="uima" />
       <option name="TEST_OBJECT" value="pattern" />
@@ -382,8 +390,9 @@
       <item index="37" class="java.lang.String" itemvalue="JUnit.Solr extraction contrib" />
       <item index="38" class="java.lang.String" itemvalue="JUnit.Solr langid contrib" />
       <item index="39" class="java.lang.String" itemvalue="JUnit.Solr ltr contrib" />
-      <item index="40" class="java.lang.String" itemvalue="JUnit.Solr uima contrib" />
-      <item index="41" class="java.lang.String" itemvalue="JUnit.Solr velocity contrib" />
+      <item index="40" class="java.lang.String" itemvalue="JUnit.Solr prometheus-exporter contrib" />
+      <item index="41" class="java.lang.String" itemvalue="JUnit.Solr uima contrib" />
+      <item index="42" class="java.lang.String" itemvalue="JUnit.Solr velocity contrib" />
     </list>
   </component>
 </project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/idea/solr/contrib/prometheus-exporter/prometheus-exporter.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/contrib/prometheus-exporter/prometheus-exporter.iml b/dev-tools/idea/solr/contrib/prometheus-exporter/prometheus-exporter.iml
new file mode 100644
index 0000000..b3d115b
--- /dev/null
+++ b/dev-tools/idea/solr/contrib/prometheus-exporter/prometheus-exporter.iml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../idea-build/solr/contrib/prometheus-exporter/classes/java" />
+    <output-test url="file://$MODULE_DIR$/../../../idea-build/solr/contrib/prometheus-exporter/classes/test" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test-files" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="TEST" name="JUnit" level="project" />
+    <orderEntry type="library" name="Solr core library" level="project" />
+    <orderEntry type="library" name="Solrj library" level="project" />
+    <orderEntry type="module-library" scope="TEST">
+      <library>
+        <CLASSES>
+          <root url="file://$MODULE_DIR$/lib" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+        <jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
+    <orderEntry type="module" scope="TEST" module-name="solr-test-framework" />
+    <orderEntry type="library" name="Solr core library" level="project" />
+    <orderEntry type="library" name="Solrj library" level="project" />
+    <orderEntry type="library" name="Solr prometheus exporter library" level="project" />
+    <orderEntry type="module" module-name="lucene-core" />
+    <orderEntry type="module" module-name="solr-core" />
+    <orderEntry type="module" module-name="solrj" />
+    <orderEntry type="module" module-name="analysis-common" />
+  </component>
+</module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/maven/solr/contrib/pom.xml.template
----------------------------------------------------------------------
diff --git a/dev-tools/maven/solr/contrib/pom.xml.template b/dev-tools/maven/solr/contrib/pom.xml.template
index fec3385..733e308 100644
--- a/dev-tools/maven/solr/contrib/pom.xml.template
+++ b/dev-tools/maven/solr/contrib/pom.xml.template
@@ -39,6 +39,7 @@
     <module>extraction</module>
     <module>langid</module>
     <module>ltr</module>
+    <module>prometheus-exporter</module>
     <module>uima</module>
     <module>velocity</module>
   </modules>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/dev-tools/maven/solr/contrib/prometheus-exporter/pom.xml.template
----------------------------------------------------------------------
diff --git a/dev-tools/maven/solr/contrib/prometheus-exporter/pom.xml.template b/dev-tools/maven/solr/contrib/prometheus-exporter/pom.xml.template
new file mode 100644
index 0000000..1d2d508
--- /dev/null
+++ b/dev-tools/maven/solr/contrib/prometheus-exporter/pom.xml.template
@@ -0,0 +1,80 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.solr</groupId>
+    <artifactId>solr-parent</artifactId>
+    <version>@version@</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+  <groupId>org.apache.solr</groupId>
+  <artifactId>solr-prometheus-exporter</artifactId>
+  <packaging>jar</packaging>
+  <name>Apache Solr Prometheus Exporter Package</name>
+  <description>
+    Apache Solr Prometheus Exporter Package
+  </description>
+  <properties>
+    <module-directory>solr/contrib/prometheus-exporter</module-directory>
+    <relative-top-level>../../../..</relative-top-level>
+    <module-path>${relative-top-level}/${module-directory}</module-path>
+  </properties>
+  <scm>
+    <connection>scm:git:${vc-anonymous-base-url}</connection>
+    <developerConnection>scm:git:${vc-dev-base-url}</developerConnection>
+    <url>${vc-browse-base-url};f=${module-directory}</url>
+  </scm>
+  <dependencies>
+    <dependency>
+      <!-- lucene-test-framework dependency must be declared before lucene-core -->
+      <!-- This dependency cannot be put into solr-parent, because local        -->
+      <!-- dependencies are always ordered before inherited dependencies.       -->
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-test-framework</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-test-framework</artifactId>
+      <scope>test</scope>
+    </dependency>
+    @solr-prometheus-exporter.internal.dependencies@
+    @solr-prometheus-exporter.external.dependencies@
+    @solr-prometheus-exporter.internal.test.dependencies@
+    @solr-prometheus-exporter.external.test.dependencies@
+  </dependencies>
+  <build>
+    <sourceDirectory>${module-path}/src/java</sourceDirectory>
+    <testSourceDirectory>${module-path}/src/test</testSourceDirectory>
+    <testResources>
+      <testResource>
+        <directory>${module-path}/src/test-files</directory>
+      </testResource>
+      <testResource>
+        <directory>${top-level}/dev-tools/maven/solr</directory>
+        <includes>
+          <include>maven.testlogging.properties</include>
+        </includes>
+      </testResource>
+    </testResources>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/lucene/ivy-versions.properties
----------------------------------------------------------------------
diff --git a/lucene/ivy-versions.properties b/lucene/ivy-versions.properties
index 5ab36dd..05955e4 100644
--- a/lucene/ivy-versions.properties
+++ b/lucene/ivy-versions.properties
@@ -70,6 +70,11 @@ io.dropwizard.metrics.version = 3.2.2
 io.netty.netty-all.version = 4.0.36.Final
 /io.netty/netty-all = ${io.netty.netty-all.version}
 
+io.prometheus.version = 0.2.0
+/io.prometheus/simpleclient = ${io.prometheus.version}
+/io.prometheus/simpleclient_common = ${io.prometheus.version}
+/io.prometheus/simpleclient_httpserver = ${io.prometheus.version}
+
 /javax.activation/activation = 1.1.1
 /javax.servlet/javax.servlet-api = 3.1.0
 /javax.servlet/servlet-api = 2.4
@@ -82,7 +87,15 @@ io.netty.netty-all.version = 4.0.36.Final
 /net.bytebuddy/byte-buddy = 1.6.2
 /net.hydromatic/eigenbase-properties = 1.1.5
 /net.sf.ehcache/ehcache-core = 2.4.4
+
+net.sourceforge.argparse4j.version = 0.8.1
+/net.sourceforge.argparse4j/argparse4j = ${net.sourceforge.argparse4j.version}
+
 /net.sourceforge.nekohtml/nekohtml = 1.9.17
+
+net.thisptr.version = 0.0.8
+/net.thisptr/jackson-jq = ${net.thisptr.version}
+
 /org.antlr/antlr4-runtime = 4.5.1-1
 
 /org.apache.ant/ant = 1.8.2
@@ -288,7 +301,6 @@ org.slf4j.version = 1.7.24
 /org.tallison/jmatio = 1.2
 /org.tukaani/xz = 1.6
 
-
 ua.net.nlp.morfologik-ukrainian-search.version = 3.9.0
 /ua.net.nlp/morfologik-ukrainian-search = ${ua.net.nlp.morfologik-ukrainian-search.version}
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8ce9b36..58d1435 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -150,6 +150,8 @@ New Features
 
 * SOLR-12006: Add a '*_t' and '*_t_sort' dynamic field for single valued text fields (Varun Thacker)
 
+* SOLR-11795: Add Solr metrics exporter for Prometheus (Minoru Osuka via koji)
+
 Bug Fixes
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/build.xml
----------------------------------------------------------------------
diff --git a/solr/build.xml b/solr/build.xml
index 400c711..3f0596f 100644
--- a/solr/build.xml
+++ b/solr/build.xml
@@ -571,19 +571,19 @@
       <tarfileset dir="."
                   prefix="${fullnamever}"
                   includes="LICENSE.txt NOTICE.txt CHANGES.txt README.txt SYSTEM_REQUIREMENTS.txt
-                            bin/** server/** example/** contrib/**/lib/** contrib/**/README.txt 
+                            bin/** server/** example/** contrib/**/lib/** contrib/**/conf/** contrib/**/README.txt
                             licenses/**"
                   excludes="licenses/README.committers.txt **/data/ **/logs/* 
                             **/classes/ **/*.sh **/ivy.xml **/build.xml
                             **/bin/ **/*.iml **/*.ipr **/*.iws **/pom.xml 
-                            **/*pom.xml.template server/etc/test/" />
+                            **/*pom.xml.template server/etc/test/ contrib/**/src/" />
       <tarfileset dir="${dest}/contrib-lucene-libs-to-package"
                   prefix="${fullnamever}"
                   includes="**" />
       <tarfileset dir="."
                   filemode="755"
                   prefix="${fullnamever}"
-                  includes="bin/** server/**/*.sh example/**/*.sh example/**/bin/"
+                  includes="bin/** server/**/*.sh example/**/*.sh example/**/bin/ contrib/**/bin/**"
                   excludes="server/etc/test/**" />
       <tarfileset dir="."
                   prefix="${fullnamever}"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/README.md
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/README.md b/solr/contrib/prometheus-exporter/README.md
new file mode 100644
index 0000000..888f237
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/README.md
@@ -0,0 +1,21 @@
+Welcome to Apache Solr Prometheus Exporter
+========
+
+Apache Solr Prometheus Exporter (solr-exporter) provides a way for you to expose metrics for Solr to Prometheus.
+
+# Getting Started With Solr Prometheus Exporter
+
+For information on how to get started with solr-exporter please see:
+ * [Solr Reference Guide's section on Monitoring Solr with Prometheus and Grafana](https://lucene.apache.org/solr/guide/monitoring-solr-with-prometheus-and-grafana.html)
+
+# Getting Started With Solr
+
+For information on how to get started with solr please see:
+ * [solr/README.txt](../../README.txt)
+ * [Solr Tutorial](https://lucene.apache.org/solr/guide/solr-tutorial.html)
+
+# How To Contribute
+
+For information on how to contribute see:
+ * http://wiki.apache.org/lucene-java/HowToContribute
+ * http://wiki.apache.org/solr/HowToContribute

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/README.txt
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/README.txt b/solr/contrib/prometheus-exporter/README.txt
new file mode 100644
index 0000000..42061c0
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/README.txt
@@ -0,0 +1 @@
+README.md
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/bin/solr-exporter
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/bin/solr-exporter b/solr/contrib/prometheus-exporter/bin/solr-exporter
new file mode 100755
index 0000000..bf28488
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/bin/solr-exporter
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+BASEDIR=`dirname $0`/..
+BASEDIR=`(cd "$BASEDIR"; pwd)`
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true
+           if [ -z "$JAVA_VERSION" ] ; then
+             JAVA_VERSION="CurrentJDK"
+           else
+             echo "Using Java version: $JAVA_VERSION"
+           fi
+           if [ -z "$JAVA_HOME" ] ; then
+             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
+           fi
+           ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# If a specific java binary isn't specified search for the standard 'java' binary
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD=`which java`
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "  We cannot execute $JAVACMD"
+  exit 1
+fi
+
+if [ -z "$REPO" ]
+then
+  REPO="$BASEDIR"/lib
+fi
+
+CLASSPATH=$CLASSPATH_PREFIX
+for JAR in $(find "$REPO" -name '*.jar')
+do
+  CLASSPATH="$CLASSPATH":"$JAR"
+done
+for JAR in $(find "$BASEDIR"/../../dist/solrj-lib -name '*.jar')
+do
+  CLASSPATH="$CLASSPATH":"$JAR"
+done
+for JAR in $(find "$BASEDIR"/../../dist -name 'solr-core-*.jar')
+do
+  CLASSPATH="$CLASSPATH":"$JAR"
+done
+for JAR in $(find "$BASEDIR"/../../dist -name 'solr-solrj-*.jar')
+do
+  CLASSPATH="$CLASSPATH":"$JAR"
+done
+for JAR in $(find "$BASEDIR"/../../dist -name 'solr-prometheus-exporter-*.jar')
+do
+  CLASSPATH="$CLASSPATH":"$JAR"
+done
+for JAR in $(find "$BASEDIR"/lucene-libs -name '*.jar')
+do
+  CLASSPATH="$CLASSPATH":"$JAR"
+done
+
+EXTRA_JVM_ARGUMENTS="-Xmx512m -Dlog4j.configuration=file:"$BASEDIR"/conf/log4j.properties"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
+  [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
+  [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
+fi
+
+exec "$JAVACMD" $JAVA_OPTS \
+  $EXTRA_JVM_ARGUMENTS \
+  -classpath "$CLASSPATH" \
+  -Dapp.name="solr-exporter" \
+  -Dapp.pid="$$" \
+  -Dapp.repo="$REPO" \
+  -Dbasedir="$BASEDIR" \
+  org.apache.solr.prometheus.exporter.SolrExporter \
+  "$@"

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd b/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd
new file mode 100644
index 0000000..05d8275
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd
@@ -0,0 +1,104 @@
+@REM
+@REM  Licensed to the Apache Software Foundation (ASF) under one or more
+@REM  contributor license agreements.  See the NOTICE file distributed with
+@REM  this work for additional information regarding copyright ownership.
+@REM  The ASF licenses this file to You under the Apache License, Version 2.0
+@REM  (the "License"); you may not use this file except in compliance with
+@REM  the License.  You may obtain a copy of the License at
+@REM
+@REM      http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM  Unless required by applicable law or agreed to in writing, software
+@REM  distributed under the License is distributed on an "AS IS" BASIS,
+@REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM  See the License for the specific language governing permissions and
+@REM  limitations under the License.
+
+@echo off
+
+set ERROR_CODE=0
+
+:init
+@REM Decide how to startup depending on the version of windows
+
+@REM -- Win98ME
+if NOT "%OS%"=="Windows_NT" goto Win9xArg
+
+@REM set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" @setlocal
+
+@REM -- 4NT shell
+if "%eval[2+2]" == "4" goto 4NTArgs
+
+@REM -- Regular WinNT shell
+set CMD_LINE_ARGS=%*
+goto WinNTGetScriptDir
+
+@REM The 4NT Shell from jp software
+:4NTArgs
+set CMD_LINE_ARGS=%$
+goto WinNTGetScriptDir
+
+:Win9xArg
+@REM Slurp the command line arguments.  This loop allows for an unlimited number
+@REM of agruments (up to the command line limit, anyway).
+set CMD_LINE_ARGS=
+:Win9xApp
+if %1a==a goto Win9xGetScriptDir
+set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
+shift
+goto Win9xApp
+
+:Win9xGetScriptDir
+set SAVEDIR=%CD%
+%0\
+cd %0\..\.. 
+set BASEDIR=%CD%
+cd %SAVEDIR%
+set SAVE_DIR=
+goto repoSetup
+
+:WinNTGetScriptDir
+set BASEDIR=%~dp0\..
+
+:repoSetup
+
+
+if "%JAVACMD%"=="" set JAVACMD=java
+
+if "%REPO%"=="" set REPO=%BASEDIR%\lib
+
+set CLASSPATH="%CLASSPATH%";"%REPO%\*;%BASEDIR%\..\..\dist\solrj-lib\*;%BASEDIR%\..\..\dist\solr-core-*;%BASEDIR%\..\..\dist\solr-solrj-*;%BASEDIR%\..\..\dist\solr-prometheus-exporter-*;%BASEDIR%\lib\*"
+set EXTRA_JVM_ARGUMENTS=-Xmx512m -Dlog4j.configuration=file:%BASEDIR%/conf/log4j.properties
+goto endInit
+
+@REM Reaching here means variables are defined and arguments have been captured
+:endInit
+
+%JAVACMD% %JAVA_OPTS% %EXTRA_JVM_ARGUMENTS% -classpath %CLASSPATH_PREFIX%;%CLASSPATH% -Dapp.name="solr-exporter" -Dapp.repo="%REPO%" -Dbasedir="%BASEDIR%" com.github.mosuka.solr.prometheus.exporter.SolrExporter %CMD_LINE_ARGS%
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+if "%OS%"=="Windows_NT" @endlocal
+set ERROR_CODE=1
+
+:end
+@REM set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" goto endNT
+
+@REM For old DOS remove the set variables from ENV - we assume they were not set
+@REM before we started - at least we don't leave any baggage around
+set CMD_LINE_ARGS=
+goto postExec
+
+:endNT
+@endlocal
+
+:postExec
+
+if "%FORCE_EXIT_ON_ERROR%" == "on" (
+  if %ERROR_CODE% NEQ 0 exit %ERROR_CODE%
+)
+
+exit /B %ERROR_CODE%

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/961269aa/solr/contrib/prometheus-exporter/build.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/prometheus-exporter/build.xml b/solr/contrib/prometheus-exporter/build.xml
new file mode 100644
index 0000000..3c6ce7e
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/build.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ -->
+
+<project name="solr-prometheus-exporter" default="default">
+
+  <description>
+    Prometheus exporter for exposing metrics from Solr using Metrics API and Search API.
+  </description>
+
+  <import file="../contrib-build.xml"/>
+
+  <path id="common.analysis.lucene.libs">
+    <pathelement path="${analyzers-common.jar}"/>
+  </path>
+
+  <path id="classpath">
+    <path refid="common.analysis.lucene.libs"/>
+    <path refid="solr.base.classpath"/>
+  </path>
+
+  <target name="module-jars-to-solr" depends="-module-jars-to-solr-not-for-package,-module-jars-to-solr-package"/>
+
+  <target name="-module-jars-to-solr-not-for-package" unless="called.from.create-package">
+    <antcall target="jar-analyzers-common" inheritall="true"/>
+    <property name="analyzers-common.uptodate" value="true"/>
+    <mkdir dir="${build.dir}/lucene-libs"/>
+    <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+      <fileset file="${analyzers-common.jar}"/>
+    </copy>
+  </target>
+
+  <target name="-module-jars-to-solr-package" if="called.from.create-package">
+    <antcall target="-unpack-lucene-tgz" inheritall="true"/>
+    <pathconvert property="relative.common.analysis.lucene.libs" pathsep=",">
+      <path refid="common.analysis.lucene.libs"/>
+      <globmapper from="${common.build.dir}/*" to="*" handledirsep="true"/>
+    </pathconvert>
+    <mkdir dir="${build.dir}/lucene-libs"/>
+    <copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
+      <fileset dir="${lucene.tgz.unpack.dir}/lucene-${version}" includes="${relative.common.analysis.lucene.libs}"/>
+    </copy>
+  </target>
+
+  <target name="compile-core" depends="jar-analyzers-common, solr-contrib-build.compile-core"/>
+
+  <target name="dist" depends="module-jars-to-solr, common-solr.dist"/>
+
+</project>