├── .github ├── CODEOWNERS └── workflows │ └── release.yaml ├── .gitignore ├── Dockerfile ├── Dockerfile.kubernetes ├── Dockerfile.privatecloud ├── Jenkinsfile ├── LICENSE ├── Makefile ├── README.md ├── VERSION ├── conf ├── grafana.ini └── provisioning │ ├── dashboards.yml │ └── datasources.yml ├── dashboards.grafanacloud ├── messaging.json └── topic.json ├── dashboards.kubernetes ├── billing.json ├── bookkeeper.json ├── broker.json ├── connector_sink.json ├── connector_source.json ├── container.json ├── functions.json ├── jvm.json ├── loadbalance.json ├── messaging.json ├── node.json ├── overview.json ├── proxy.json ├── pulsar_detector.json ├── recovery.json ├── topic.json ├── transaction.json └── zookeeper-3.6.json ├── dashboards.privatecloud ├── billing.json ├── bookkeeper.json ├── broker.json ├── connector_sink.json ├── connector_source.json ├── container.json ├── functions.json ├── jvm.json ├── loadbalance.json ├── messaging.json ├── node.json ├── overview.json ├── proxy.json ├── pulsar_detector.json ├── recovery.json ├── topic.json ├── transaction.json └── zookeeper-3.6.json ├── dashboards.template ├── bookkeeper.json.j2 ├── broker.json.j2 ├── functions.json ├── jvm.json.j2 ├── kop.json.j2 ├── loadbalance.json.j2 ├── logs.json ├── messaging.json.j2 ├── node.json.j2 ├── overview.json.j2 ├── proxy.json.j2 ├── pulsar_detector.json ├── topic.json.j2 ├── transaction.json.j2 ├── zookeeper-3.6.json.j2 └── zookeeper.json.j2 ├── dashboards ├── bookkeeper.json ├── broker.json ├── functions.json ├── jvm.json ├── kop.json ├── loadbalance.json ├── logs.json ├── messaging.json ├── node.json ├── overview.json ├── proxy.json ├── pulsar_detector.json ├── topic.json ├── transaction.json ├── zookeeper-3.6.json └── zookeeper.json ├── entrypoint.sh ├── gettingStarted.md ├── images └── prometheus-targets.png ├── private-cloud ├── entrypoint.sh ├── grafana.ini └── provisioning │ ├── dashboards.yml │ └── datasources.yml ├── prometheus ├── cluster.yml.template └── standalone.yml.template ├── publish.sh ├── scripts └── generate_dashboards.sh └── stable.txt /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @codelipenghui @streamnative/platform 2 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release Docker Image 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | required: true 8 | type: string 9 | description: e.g. 0.1.0 10 | dockerfile: 11 | required: true 12 | type: choice 13 | description: choose the dockerfile type to build 14 | options: 15 | - Dockerfile.kubernetes 16 | - Dockerfile.privatecloud 17 | jobs: 18 | docker: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v4 22 | with: 23 | ref: v${{ inputs.version }} 24 | 25 | - name: Login to Docker Hub 26 | uses: docker/login-action@v3 27 | with: 28 | username: ${{ secrets.DOCKER_USER }} 29 | password: ${{ secrets.DOCKER_PASSWORD }} 30 | 31 | - name: Get the date 32 | id: date 33 | run: echo "::set-output name=date::$(date +'%Y-%m-%d')" 34 | 35 | - name: Build and push k8s 36 | if: ${{ github.event.inputs.dockerfile == 'Dockerfile.kubernetes' }} 37 | uses: docker/build-push-action@v5 38 | with: 39 | push: true 40 | tags: streamnative/apache-pulsar-grafana-dashboard-k8s:${{ inputs.version }} 41 | file: ${{ inputs.dockerfile }} 42 | build-args: | 43 | BUILD_DATE=${{ steps.date.outputs.date }} 44 | VCS_REF=v${{ inputs.version }} 45 | VERSION=${{ inputs.version }} 46 | 47 | - name: Build and push private 48 | if: ${{ github.event.inputs.dockerfile == 'Dockerfile.privatecloud' }} 49 | uses: docker/build-push-action@v5 50 | with: 51 | push: true 52 | tags: streamnative/private-cloud-grafana:${{ inputs.version }} 53 | file: ${{ inputs.dockerfile }} 54 | build-args: | 55 | BUILD_DATE=${{ steps.date.outputs.date }} 56 | VCS_REF=v${{ inputs.version }} 57 | VERSION=${{ inputs.version }} 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | # Binaries for programs and plugins 4 | *.exe 5 | *.exe~ 6 | *.dll 7 | *.so 8 | *.dylib 9 | 10 | # Test binary, build with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | out/ 16 | 17 | # Intellij 18 | .idea/ 19 | *.iml 20 | *.iws 21 | 22 | # Eclipse 23 | .classpath 24 | .project 25 | .settings/ 26 | .recommenders/ 27 | 28 | # Mac 29 | .DS_Store 30 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | FROM grafana/grafana:9.5.6-ubuntu 21 | 22 | ARG BUILD_DATE 23 | ARG VCS_REF 24 | ARG VERSION 25 | LABEL org.label-schema.build-date=$BUILD_DATE \ 26 | org.label-schema.name="Apache Pulsar Grafana Dashboard" \ 27 | org.label-schema.description="An Apache Pulsar Grafana Dashboard for monitoring Pulsar clusters" \ 28 | org.label-schema.url="https://github.com/streamnative/apache-pulsar-grafana-dashboard" \ 29 | org.label-schema.vcs-ref=$VCS_REF \ 30 | org.label-schema.vcs-url="https://github.com/streamnative/apache-pulsar-grafana-dashboard" \ 31 | org.label-schema.vendor="StreamNative Limited" \ 32 | org.label-schema.version=$VERSION \ 33 | org.label-schema.schema-version="1.0" 34 | 35 | USER root 36 | 37 | RUN apt-get update \ 38 | && apt-get upgrade -y \ 39 | && apt-get install -y python3-pip procps 40 | RUN pip3 install j2cli 41 | 42 | USER grafana 43 | 44 | RUN mkdir -p /var/lib/grafana/pulsar 45 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning 46 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/notifiers 47 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/dashboards 48 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/dashboard_templates 49 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/datasources 50 | COPY conf/grafana.ini /etc/grafana/grafana.ini 51 | COPY conf/provisioning/dashboards.yml /var/lib/grafana/pulsar_provisioning/dashboards/pulsar.yml 52 | COPY conf/provisioning/datasources.yml /var/lib/grafana/pulsar_provisioning/datasources/pulsar.yml 53 | COPY dashboards/* /var/lib/grafana/pulsar_provisioning/dashboard_templates/ 54 | COPY entrypoint.sh /pulsar_grafana_entrypoint.sh 55 | 56 | EXPOSE 3000 57 | 58 | ENV PULSAR_PROMETHEUS_URL http://localhost:9090 59 | ENV PULSAR_CLUSTER pulsar-cluster 60 | ENV GF_LOKI_URL http://localhost:3100 61 | ENV GF_LOKI_DATASOURCE_NAME pulsar-loki 62 | ENV GF_PATHS_PROVISIONING /var/lib/grafana/pulsar_provisioning 63 | ENV GRAFANA_ADMIN_USER admin 64 | ENV GRAFANA_ADMIN_PASSWORD happypulsaring 65 | 66 | ENTRYPOINT ["/pulsar_grafana_entrypoint.sh"] 67 | -------------------------------------------------------------------------------- /Dockerfile.kubernetes: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | FROM grafana/grafana:12.0.0 21 | 22 | ARG BUILD_DATE 23 | ARG VCS_REF 24 | ARG VERSION 25 | LABEL org.label-schema.build-date=$BUILD_DATE \ 26 | org.label-schema.name="Apache Pulsar Grafana Dashboard" \ 27 | org.label-schema.description="An Apache Pulsar Grafana Dashboard for monitoring Pulsar clusters" \ 28 | org.label-schema.url="https://github.com/streamnative/apache-pulsar-grafana-dashboard" \ 29 | org.label-schema.vcs-ref=$VCS_REF \ 30 | org.label-schema.vcs-url="https://github.com/streamnative/apache-pulsar-grafana-dashboard" \ 31 | org.label-schema.vendor="StreamNative Limited" \ 32 | org.label-schema.version=$VERSION \ 33 | org.label-schema.schema-version="1.0" 34 | 35 | USER root 36 | 37 | RUN apk add --no-cache \ 38 | bash \ 39 | py3-pip \ 40 | procps 41 | 42 | RUN pip3 install --break-system-packages --no-cache-dir j2cli 43 | 44 | USER grafana 45 | 46 | RUN mkdir -p /var/lib/grafana/pulsar 47 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning 48 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/notifiers 49 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/dashboards 50 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/dashboard_templates 51 | RUN mkdir -p /var/lib/grafana/pulsar_provisioning/datasources 52 | COPY conf/grafana.ini /etc/grafana/grafana.ini 53 | COPY conf/provisioning/dashboards.yml /var/lib/grafana/pulsar_provisioning/dashboards/pulsar.yml 54 | COPY conf/provisioning/datasources.yml /var/lib/grafana/pulsar_provisioning/datasources/pulsar.yml 55 | COPY dashboards.kubernetes/* /var/lib/grafana/pulsar_provisioning/dashboard_templates/ 56 | COPY entrypoint.sh /pulsar_grafana_entrypoint.sh 57 | 58 | EXPOSE 3000 59 | 60 | ENV PULSAR_PROMETHEUS_URL http://localhost:9090 61 | ENV GF_LOKI_URL http://localhost:3100 62 | ENV GF_LOKI_DATASOURCE_NAME pulsar-loki 63 | ENV PULSAR_CLUSTER pulsar-cluster 64 | ENV GF_PATHS_PROVISIONING /var/lib/grafana/pulsar_provisioning 65 | 66 | ENTRYPOINT ["/pulsar_grafana_entrypoint.sh"] 67 | -------------------------------------------------------------------------------- /Dockerfile.privatecloud: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | FROM grafana/grafana:12.0.0 21 | 22 | ARG BUILD_DATE 23 | ARG VCS_REF 24 | ARG VERSION 25 | LABEL org.label-schema.build-date=$BUILD_DATE \ 26 | org.label-schema.name="Private Cloud Grafana Dashboard" \ 27 | org.label-schema.description="An Apache Pulsar Grafana Dashboard for monitoring Private Cloud" \ 28 | org.label-schema.url="https://github.com/streamnative/apache-pulsar-grafana-dashboard" \ 29 | org.label-schema.vcs-ref=$VCS_REF \ 30 | org.label-schema.vcs-url="https://github.com/streamnative/apache-pulsar-grafana-dashboard" \ 31 | org.label-schema.vendor="StreamNative Limited" \ 32 | org.label-schema.version=$VERSION \ 33 | org.label-schema.schema-version="1.0" 34 | 35 | USER root 36 | 37 | RUN apk add --no-cache \ 38 | bash \ 39 | py3-pip \ 40 | procps 41 | 42 | RUN pip3 install --break-system-packages --no-cache-dir j2cli 43 | 44 | USER grafana 45 | 46 | COPY private-cloud/grafana.ini /etc/grafana/grafana.ini 47 | COPY private-cloud/provisioning/dashboards.yml /etc/grafana/provisioning/dashboards/pulsar.yml 48 | COPY private-cloud/provisioning/datasources.yml /etc/grafana/provisioning/datasources/pulsar.yml 49 | COPY dashboards.privatecloud/* /etc/grafana/provisioning/dashboard_templates/ 50 | COPY private-cloud/entrypoint.sh /pulsar_grafana_entrypoint.sh 51 | 52 | EXPOSE 3000 53 | 54 | ENV PULSAR_PROMETHEUS_URL http://prometheus-server 55 | ENV GF_LOKI_URL http://localhost:3100 56 | ENV GF_LOKI_DATASOURCE_NAME pulsar-loki 57 | ENV PULSAR_CLUSTER pulsar-cluster 58 | ENV GF_PATHS_PROVISIONING /etc/grafana/provisioning 59 | 60 | ENTRYPOINT ["/pulsar_grafana_entrypoint.sh"] 61 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | stages { 4 | stage ("build") { 5 | when { 6 | branch 'master' 7 | } 8 | steps { 9 | build 'sn-oss-build-pulsar-grafana-dashboard-image' 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | default: docker_build docker_k8s_build 2 | 3 | docker_build: 4 | @docker build \ 5 | --build-arg VCS_REF=`git rev-parse --short HEAD` \ 6 | --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ 7 | --build-arg VERSION=`cat VERSION` \ 8 | -t streamnative/apache-pulsar-grafana-dashboard:`cat VERSION` \ 9 | . 10 | docker_k8s_build: 11 | @docker build \ 12 | --build-arg VCS_REF=`git rev-parse --short HEAD` \ 13 | --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ 14 | --build-arg VERSION=`cat VERSION` \ 15 | -f Dockerfile.kubernetes \ 16 | -t streamnative/apache-pulsar-grafana-dashboard-k8s:`cat VERSION` \ 17 | . 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apache Pulsar Grafana Dashboard 2 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fstreamnative%2Fapache-pulsar-grafana-dashboard.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fstreamnative%2Fapache-pulsar-grafana-dashboard?ref=badge_shield) 3 | 4 | 5 | The Grafana dashboard docker image is available at 6 | [Docker Hub](https://hub.docker.com/r/streamnative/apache-pulsar-grafana-dashboard). 7 | 8 | To use this dashboard image, provide the following environment variables: 9 | 10 | - *PULSAR_PROMETHEUS_URL*: The HTTP URL that points to your prometheus service. For example, `http://:9090`. 11 | - *PULSAR_CLUSTER*: The pulsar cluster name. The cluster name is aligned with your prometheus configuration. 12 | See [Prometheus](#prometheus) for more details. 13 | 14 | ## Prometheus 15 | 16 | To display the metrics correctly with this dashboard, configure your Prometheus server to collect metrics from Pulsar correctly. 17 | 18 | 1. Attach your prometheus service to an extra label - `cluster`. The cluster name is aligned with the `PULSAR_CLUSTER` name you have provided to the grafana dashboard. 19 | ```yaml 20 | global: 21 | ... 22 | external_labels: 23 | cluster: 24 | ``` 25 | 26 | 2. Make sure the job name of each component is the same with the ones in this dashboard. 27 | - job *proxy*: the machines that run pulsar proxies. 28 | - job *broker*: the machines that run pulsar brokers. 29 | - job *bookie*: the machines that run bookies. 30 | - job *zookeeper*: the machines that run zookeeper. 31 | - job *node_metrics*: all the machines of the pulsar cluster. 32 | 33 | How to configure your prometheus server to collect the metrics of a Pulsar cluster, refer to [example prometheus config](prometheus/cluster.yml.template). 34 | 35 | ## Usage 36 | 37 | Use this Grafana Dashboard on a standalone cluster. 38 | 39 | #### Start Pulsar Standalone 40 | 41 | Download the pulsar binary and follow the instruction to 42 | [start a standalone cluster](http://pulsar.apache.org/docs/en/standalone/) on your computer. 43 | 44 | #### Start Prometheus 45 | 46 | 1. Generate a Prometheus config file. 47 | 48 | Two options are available to generate a prometheus config file. 49 | - Copy the template file [prometheus/standalone.yml.template](prometheus/standalone.yml.template), and replace `{{ STANDALONE_HOST }}` with your IP address of the machine running pulsar standalone. 50 | - Install [j2cli](https://github.com/kolypto/j2cli). j2cli is a command-line tool for templating [Jinja2](http://jinja.pocoo.org/docs/) 51 | template files. You can use j2cli to generate a Prometheus config file from the standalone template. 52 | 53 | ```bash 54 | 55 | $ STANDALONE_HOST="$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{ print $2 }')" j2 prometheus/standalone.yml.template > /tmp/standalone.prometheus.yml 56 | 57 | ``` 58 | 59 | In Ubuntu, set `STANDALONE_HOST` as below. 60 | ```bash 61 | 62 | $ STANDALONE_HOST="$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{ print $2 }' | awk -F ':' '{ print $2 }' | awk 'NR==2')" j2 prometheus/standalone.yml.template > /tmp/standalone.prometheus.yml 63 | 64 | ``` 65 | 66 | If it doesn't work properly, you can set the IP manually. 67 | 68 | 69 | 2. Run Prometheus with the generated prometheus config file. 70 | 71 | 72 | ```bash 73 | docker run -p 9090:9090 -v /tmp/standalone.prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus 74 | ``` 75 | 76 | After running the prometheus successfully, you have access to http://localhost:9090/targets, where you can see prometheus detecting all pulsar components, shown as follows. 77 | 78 | ![](images/prometheus-targets.png?raw=true) 79 | 80 | #### Start Grafana Dashbard 81 | 82 | When you have a Pulsar standalone and a Prometheus server connecting to the Pulsar standalone, you can start with the Grafana Dashboard. 83 | 84 | ```bash 85 | export PULSAR_PROMETHEUS_URL=http://$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{ print $2 }'):9090 86 | export PULSAR_CLUSTER=standalone 87 | docker run -it -p 3000:3000 -e PULSAR_PROMETHEUS_URL="${PULSAR_PROMETHEUS_URL}" -e PULSAR_CLUSTER="${PULSAR_CLUSTER}" streamnative/apache-pulsar-grafana-dashboard:latest 88 | ``` 89 | 90 | In Ubuntu, set `PULSAR_PROMETHEUS_URL` in this way. 91 | 92 | ```bash 93 | export PULSAR_PROMETHEUS_URL=http://$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{ print $2 }' | awk -F ':' '{ print $2 }' | awk 'NR==2'):9090 94 | ``` 95 | 96 | If it doesn't work properly, you can set the IP manually. 97 | 98 | Access the Grafana Dashboard at http://localhost:3000. 99 | The default user name is `admin`, the default password is `happypulsaring`, and they are set in the [conf/grafana.ini](conf/grafana.ini) file. 100 | 101 | ## Import dashboard to your Grafana installation 102 | 103 | > First of all, you need to make sure your prometheus is configured to attach `cluster` 104 | > label as described in section [#prometheus](#prometheus). 105 | 106 | If you already have a grafana installation and you would like to import the dashboards to your grafana installation. 107 | 108 | You can run [scripts/generate_dashboards.sh](scripts/generate_dashboards.sh) to generate a datasource and 109 | the dashboard files that you can use to import to your installation. 110 | 111 | ```bash 112 | ./scripts/generate_dashboards.sh 113 | ``` 114 | 115 | - ``: The url points to your prometheus servcie. E.g. `http://localhost:9090` 116 | - ``: Your pulsar cluster name. 117 | 118 | The datasource yaml file and dashboard json files will be generated under `target/datasources` and `target/dashboards`. 119 | You can then import those files into your grafana installation. 120 | 121 | ## Details 122 | 123 | The Grafana Docker Image contains the following built-in dashboards for different components in an Apache Pulsar cluster. 124 | These dashboards are: 125 | 126 | - *Overview*: This renders the overview health of a Pulsar cluster. 127 | - *Messaging Metrics*: This renders the metrics related to Pulsar messaging (e.g. producers, consumers, msg backlog and so on). 128 | - *Proxy Metrics*: This renders the metrics related to Pulsar proxies if you have run proxies in your Pulsar clusters. _This doesn't apply to a standalone cluster._ 129 | - *Bookie Metrics*: This renders the metrics related to Bookies. _This doesn't apply to a Standalone cluster since a Pulsar standalone doesn't expose bookie metrics._ 130 | - *ZooKeeper*: This renders the metrics related to ZooKeeper cluster. 131 | - *JVM Metrics*: This renders the jvm related metrics of all the components in a Pulsar cluster (For example, proxies, brokers, bookies, and so on). 132 | 133 | System metrics are rendered in the *Node Metrics* dashboard and some portions in *Overview* dashboard. 134 | The system metrics used by these dashboards are collected by Prometheus [Node Exporter](https://github.com/prometheus/node_exporter). 135 | So you have to configure each pulsar machine to run node exporter, and configure your Prometheus to scrape the metrics from node exporters. 136 | 137 | ## Build Your Own Image (Optional) 138 | 139 | To customize and build your own dashboard image, issue the following command: 140 | 141 | ```bash 142 | make 143 | ``` 144 | 145 | Checkout [Makefile](Makefile) for the details of the command used for building the docker image. 146 | 147 | 148 | ## License 149 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fstreamnative%2Fapache-pulsar-grafana-dashboard.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fstreamnative%2Fapache-pulsar-grafana-dashboard?ref=badge_large) 150 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.1.0-SNAPSHOT 2 | -------------------------------------------------------------------------------- /conf/provisioning/dashboards.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018-2019 Sijie. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # # config file version 18 | apiVersion: 1 19 | 20 | providers: 21 | - name: 'pulsar' 22 | orgId: 1 23 | folder: '' 24 | type: file 25 | allowUiUpdates: true 26 | options: 27 | path: /var/lib/grafana/pulsar_provisioning/dashboards 28 | -------------------------------------------------------------------------------- /conf/provisioning/datasources.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Sijie. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # config file version 18 | apiVersion: 1 19 | 20 | # list of datasources to insert/update depending 21 | # on what's available in the datbase 22 | datasources: 23 | # name of the datasource. Required 24 | - name: "{{ PULSAR_CLUSTER }}" 25 | # datasource type. Required 26 | type: prometheus 27 | # access mode. direct or proxy. Required 28 | access: proxy 29 | # org id. will default to orgId 1 if not specified 30 | orgId: 1 31 | # url 32 | url: "{{ PULSAR_PROMETHEUS_URL }}" 33 | # database password, if used 34 | # password: 35 | # database user, if used 36 | # user: 37 | # database name, if used 38 | # database: 39 | # enable/disable basic auth 40 | basicAuth: false 41 | # basic auth username 42 | # basicAuthUser: 43 | # basic auth password 44 | # basicAuthPassword: 45 | # enable/disable with credentials headers 46 | # withCredentials: 47 | # mark as default datasource. Max one per org 48 | # isDefault: 49 | # fields that will be converted to json and stored in json_data 50 | # jsonData: 51 | # graphiteVersion: "1.1" 52 | # tlsAuth: false 53 | # tlsAuthWithCACert: false 54 | # httpHeaderName1: "Authorization" 55 | # json object of data that will be encrypted. 56 | # secureJsonData: 57 | # tlsCACert: "..." 58 | # tlsClientCert: "..." 59 | # tlsClientKey: "..." 60 | # # 61 | # httpHeaderValue1: "Bearer xf5yhfkpsnmgo" 62 | version: 1 63 | # allow users to edit datasources from the UI. 64 | editable: true 65 | - name: "{{ GF_LOKI_DATASOURCE_NAME }}" 66 | type: loki 67 | access: proxy 68 | url: "{{ GF_LOKI_URL }}" 69 | version: 1 70 | editable: true 71 | -------------------------------------------------------------------------------- /dashboards.kubernetes/jvm.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": { 7 | "uid": "${DataSource}" 8 | }, 9 | "enable": true, 10 | "hide": true, 11 | "iconColor": "rgba(0, 211, 255, 1)", 12 | "name": "Annotations & Alerts", 13 | "type": "dashboard" 14 | } 15 | ] 16 | }, 17 | "description": "JVM Related Metrics", 18 | "editable": true, 19 | "fiscalYearStartMonth": 0, 20 | "graphTooltip": 0, 21 | "id": 7, 22 | "links": [], 23 | "liveNow": false, 24 | "panels": [ 25 | { 26 | "collapsed": false, 27 | "datasource": { 28 | "type": "datasource", 29 | "uid": "grafana" 30 | }, 31 | "gridPos": { 32 | "h": 1, 33 | "w": 24, 34 | "x": 0, 35 | "y": 0 36 | }, 37 | "id": 41, 38 | "panels": [], 39 | "repeat": "kubernetes_pod_name", 40 | "targets": [ 41 | { 42 | "datasource": { 43 | "type": "datasource", 44 | "uid": "grafana" 45 | }, 46 | "refId": "A" 47 | } 48 | ], 49 | "title": "$job - $kubernetes_pod_name", 50 | "type": "row" 51 | }, 52 | { 53 | "aliasColors": {}, 54 | "bars": false, 55 | "dashLength": 10, 56 | "dashes": false, 57 | "datasource": { 58 | "type": "prometheus", 59 | "uid": "${DataSource}" 60 | }, 61 | "decimals": 1, 62 | "fill": 1, 63 | "fillGradient": 0, 64 | "gridPos": { 65 | "h": 6, 66 | "w": 6, 67 | "x": 0, 68 | "y": 1 69 | }, 70 | "hiddenSeries": false, 71 | "id": 4, 72 | "legend": { 73 | "avg": false, 74 | "current": false, 75 | "max": false, 76 | "min": false, 77 | "show": false, 78 | "total": false, 79 | "values": false 80 | }, 81 | "lines": true, 82 | "linewidth": 1, 83 | "links": [], 84 | "nullPointMode": "null", 85 | "options": { 86 | "alertThreshold": true 87 | }, 88 | "percentage": false, 89 | "pluginVersion": "9.5.6", 90 | "pointradius": 5, 91 | "points": false, 92 | "renderer": "flot", 93 | "seriesOverrides": [], 94 | "spaceLength": 10, 95 | "stack": false, 96 | "steppedLine": false, 97 | "targets": [ 98 | { 99 | "datasource": { 100 | "type": "prometheus", 101 | "uid": "${DataSource}" 102 | }, 103 | "expr": "irate(process_cpu_seconds_total{kubernetes_pod_name=~\"$kubernetes_pod_name\"}[30s]) * 100\n\n", 104 | "format": "time_series", 105 | "interval": "", 106 | "intervalFactor": 2, 107 | "legendFormat": "{{kubernetes_pod_name}}", 108 | "metric": "process_cpu_seconds_total", 109 | "refId": "A", 110 | "step": 20 111 | } 112 | ], 113 | "thresholds": [ 114 | { 115 | "colorMode": "ok", 116 | "fill": false, 117 | "line": true, 118 | "op": "gt", 119 | "value": 100 120 | } 121 | ], 122 | "timeRegions": [], 123 | "title": "CPU", 124 | "tooltip": { 125 | "shared": true, 126 | "sort": 0, 127 | "value_type": "individual" 128 | }, 129 | "type": "graph", 130 | "xaxis": { 131 | "mode": "time", 132 | "show": true, 133 | "values": [] 134 | }, 135 | "yaxes": [ 136 | { 137 | "format": "percent", 138 | "label": "", 139 | "logBase": 1, 140 | "min": "0", 141 | "show": true 142 | }, 143 | { 144 | "format": "short", 145 | "logBase": 1, 146 | "show": true 147 | } 148 | ], 149 | "yaxis": { 150 | "align": false 151 | } 152 | }, 153 | { 154 | "aliasColors": {}, 155 | "bars": false, 156 | "dashLength": 10, 157 | "dashes": false, 158 | "datasource": { 159 | "type": "prometheus", 160 | "uid": "${DataSource}" 161 | }, 162 | "fill": 1, 163 | "fillGradient": 0, 164 | "gridPos": { 165 | "h": 6, 166 | "w": 6, 167 | "x": 6, 168 | "y": 1 169 | }, 170 | "hiddenSeries": false, 171 | "id": 1, 172 | "legend": { 173 | "alignAsTable": false, 174 | "avg": false, 175 | "current": false, 176 | "hideEmpty": false, 177 | "max": false, 178 | "min": false, 179 | "rightSide": false, 180 | "show": false, 181 | "total": false, 182 | "values": false 183 | }, 184 | "lines": true, 185 | "linewidth": 1, 186 | "links": [], 187 | "nullPointMode": "null", 188 | "options": { 189 | "alertThreshold": true 190 | }, 191 | "percentage": false, 192 | "pluginVersion": "9.5.6", 193 | "pointradius": 5, 194 | "points": false, 195 | "renderer": "flot", 196 | "seriesOverrides": [], 197 | "spaceLength": 10, 198 | "stack": false, 199 | "steppedLine": false, 200 | "targets": [ 201 | { 202 | "datasource": { 203 | "type": "prometheus", 204 | "uid": "${DataSource}" 205 | }, 206 | "expr": "sum(jvm_memory_bytes_committed{kubernetes_pod_name=~\"$kubernetes_pod_name\"})", 207 | "format": "time_series", 208 | "hide": false, 209 | "interval": "", 210 | "intervalFactor": 2, 211 | "legendFormat": "Heap size", 212 | "metric": "jvm_memory_bytes_committed", 213 | "refId": "A", 214 | "step": 20 215 | }, 216 | { 217 | "datasource": { 218 | "type": "prometheus", 219 | "uid": "${DataSource}" 220 | }, 221 | "expr": "sum(jvm_memory_bytes_used{kubernetes_pod_name=~\"$kubernetes_pod_name\"})", 222 | "format": "time_series", 223 | "interval": "", 224 | "intervalFactor": 2, 225 | "legendFormat": "Used", 226 | "metric": "jvm_memory_bytes_used", 227 | "refId": "B", 228 | "step": 20 229 | }, 230 | { 231 | "datasource": { 232 | "type": "prometheus", 233 | "uid": "${DataSource}" 234 | }, 235 | "expr": "sum(jvm_memory_bytes_max{kubernetes_pod_name=~\"$kubernetes_pod_name\"})", 236 | "format": "time_series", 237 | "interval": "", 238 | "intervalFactor": 2, 239 | "legendFormat": "Max", 240 | "metric": "jvm_memory_bytes_max", 241 | "refId": "C", 242 | "step": 20 243 | } 244 | ], 245 | "thresholds": [], 246 | "timeRegions": [], 247 | "title": "Heap Memory", 248 | "tooltip": { 249 | "shared": true, 250 | "sort": 0, 251 | "value_type": "individual" 252 | }, 253 | "type": "graph", 254 | "xaxis": { 255 | "mode": "time", 256 | "show": true, 257 | "values": [] 258 | }, 259 | "yaxes": [ 260 | { 261 | "format": "decbytes", 262 | "label": "", 263 | "logBase": 1, 264 | "show": true 265 | }, 266 | { 267 | "format": "short", 268 | "logBase": 1, 269 | "show": false 270 | } 271 | ], 272 | "yaxis": { 273 | "align": false 274 | } 275 | }, 276 | { 277 | "aliasColors": {}, 278 | "bars": false, 279 | "dashLength": 10, 280 | "dashes": false, 281 | "datasource": { 282 | "type": "prometheus", 283 | "uid": "${DataSource}" 284 | }, 285 | "fill": 1, 286 | "fillGradient": 0, 287 | "gridPos": { 288 | "h": 6, 289 | "w": 6, 290 | "x": 12, 291 | "y": 1 292 | }, 293 | "hiddenSeries": false, 294 | "id": 2, 295 | "legend": { 296 | "avg": false, 297 | "current": false, 298 | "max": false, 299 | "min": false, 300 | "show": false, 301 | "total": false, 302 | "values": false 303 | }, 304 | "lines": true, 305 | "linewidth": 1, 306 | "links": [], 307 | "nullPointMode": "null", 308 | "options": { 309 | "alertThreshold": true 310 | }, 311 | "percentage": false, 312 | "pluginVersion": "9.5.6", 313 | "pointradius": 5, 314 | "points": false, 315 | "renderer": "flot", 316 | "seriesOverrides": [], 317 | "spaceLength": 10, 318 | "stack": false, 319 | "steppedLine": false, 320 | "targets": [ 321 | { 322 | "datasource": { 323 | "type": "prometheus", 324 | "uid": "${DataSource}" 325 | }, 326 | "expr": "jvm_memory_direct_bytes_used{kubernetes_pod_name=~\"$kubernetes_pod_name\"}", 327 | "format": "time_series", 328 | "interval": "", 329 | "intervalFactor": 2, 330 | "legendFormat": "Used", 331 | "metric": "jvm_memory_direct_bytes_used", 332 | "refId": "A", 333 | "step": 20 334 | }, 335 | { 336 | "datasource": { 337 | "type": "prometheus", 338 | "uid": "${DataSource}" 339 | }, 340 | "expr": "jvm_memory_direct_bytes_max{kubernetes_pod_name=~\"$kubernetes_pod_name\"}", 341 | "format": "time_series", 342 | "interval": "", 343 | "intervalFactor": 2, 344 | "legendFormat": "Max", 345 | "metric": "jvm_memory_direct_bytes_max", 346 | "refId": "B", 347 | "step": 20 348 | } 349 | ], 350 | "thresholds": [], 351 | "timeRegions": [], 352 | "title": "Direct Memory", 353 | "tooltip": { 354 | "shared": true, 355 | "sort": 0, 356 | "value_type": "individual" 357 | }, 358 | "type": "graph", 359 | "xaxis": { 360 | "mode": "time", 361 | "show": true, 362 | "values": [] 363 | }, 364 | "yaxes": [ 365 | { 366 | "format": "decbytes", 367 | "label": "", 368 | "logBase": 1, 369 | "show": true 370 | }, 371 | { 372 | "format": "short", 373 | "label": "", 374 | "logBase": 1, 375 | "show": true 376 | } 377 | ], 378 | "yaxis": { 379 | "align": false 380 | } 381 | }, 382 | { 383 | "aliasColors": {}, 384 | "bars": false, 385 | "dashLength": 10, 386 | "dashes": false, 387 | "datasource": { 388 | "type": "prometheus", 389 | "uid": "${DataSource}" 390 | }, 391 | "fill": 1, 392 | "fillGradient": 0, 393 | "gridPos": { 394 | "h": 6, 395 | "w": 6, 396 | "x": 18, 397 | "y": 1 398 | }, 399 | "hiddenSeries": false, 400 | "id": 3, 401 | "legend": { 402 | "avg": false, 403 | "current": false, 404 | "max": false, 405 | "min": false, 406 | "show": false, 407 | "total": false, 408 | "values": false 409 | }, 410 | "lines": true, 411 | "linewidth": 1, 412 | "links": [], 413 | "nullPointMode": "null", 414 | "options": { 415 | "alertThreshold": true 416 | }, 417 | "percentage": false, 418 | "pluginVersion": "9.5.6", 419 | "pointradius": 5, 420 | "points": false, 421 | "renderer": "flot", 422 | "seriesOverrides": [ 423 | { 424 | "alias": "old count", 425 | "yaxis": 2 426 | }, 427 | { 428 | "alias": "young count", 429 | "yaxis": 2 430 | } 431 | ], 432 | "spaceLength": 10, 433 | "stack": false, 434 | "steppedLine": false, 435 | "targets": [ 436 | { 437 | "datasource": { 438 | "type": "prometheus", 439 | "uid": "${DataSource}" 440 | }, 441 | "expr": "sum(increase(jvm_gc_collection_seconds_sum{kubernetes_pod_name=~\"$kubernetes_pod_name\"}[30s]))", 442 | "format": "time_series", 443 | "hide": false, 444 | "interval": "", 445 | "intervalFactor": 2, 446 | "legendFormat": "Pause", 447 | "metric": "jvm_gc_collection_seconds_count", 448 | "refId": "B", 449 | "step": 20 450 | } 451 | ], 452 | "thresholds": [], 453 | "timeRegions": [], 454 | "title": "GC Pauses", 455 | "tooltip": { 456 | "shared": true, 457 | "sort": 0, 458 | "value_type": "individual" 459 | }, 460 | "type": "graph", 461 | "xaxis": { 462 | "mode": "time", 463 | "show": true, 464 | "values": [] 465 | }, 466 | "yaxes": [ 467 | { 468 | "format": "s", 469 | "label": "", 470 | "logBase": 1, 471 | "min": "0", 472 | "show": true 473 | }, 474 | { 475 | "format": "short", 476 | "label": "", 477 | "logBase": 1, 478 | "min": "0", 479 | "show": false 480 | } 481 | ], 482 | "yaxis": { 483 | "align": false 484 | } 485 | } 486 | ], 487 | "refresh": "1m", 488 | "schemaVersion": 38, 489 | "style": "dark", 490 | "tags": [ 491 | "jvm" 492 | ], 493 | "templating": { 494 | "list": [ 495 | { 496 | "current": { 497 | "text": "All", 498 | "value": [ 499 | "$__all" 500 | ] 501 | }, 502 | "hide": 0, 503 | "includeAll": false, 504 | "label": "DataSource", 505 | "multi": false, 506 | "name": "DataSource", 507 | "options": [], 508 | "query": "prometheus", 509 | "queryValue": "", 510 | "refresh": 1, 511 | "regex": "^(?!Prometheus).*$", 512 | "skipUrlSync": false, 513 | "type": "datasource" 514 | }, 515 | { 516 | "current": { 517 | "text": "All", 518 | "value": [ 519 | "$__all" 520 | ] 521 | }, 522 | "datasource": { 523 | "type": "prometheus", 524 | "uid": "${DataSource}" 525 | }, 526 | "definition": "pulsar_version_info{cluster=~\".+\"}", 527 | "hide": 0, 528 | "includeAll": false, 529 | "label": "Pulsar Cluster", 530 | "multi": false, 531 | "name": "cluster", 532 | "options": [], 533 | "query": { 534 | "query": "pulsar_version_info{cluster=~\".+\"}", 535 | "refId": "StandardVariableQuery" 536 | }, 537 | "refresh": 1, 538 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 539 | "skipUrlSync": false, 540 | "sort": 0, 541 | "type": "query" 542 | }, 543 | { 544 | "current": { 545 | "selected": false, 546 | "text": "All", 547 | "value": "$__all" 548 | }, 549 | "datasource": { 550 | "type": "prometheus", 551 | "uid": "${DataSource}" 552 | }, 553 | "definition": "", 554 | "hide": 0, 555 | "includeAll": true, 556 | "label": "Job", 557 | "multi": false, 558 | "name": "job", 559 | "options": [], 560 | "query": "jvm_memory_bytes_used{job=~\".+\"}", 561 | "refresh": 1, 562 | "regex": "/.*[^_]job=\\\"([^\\\"]+)\\\".*/", 563 | "skipUrlSync": false, 564 | "sort": 1, 565 | "tagValuesQuery": "", 566 | "tagsQuery": "", 567 | "type": "query", 568 | "useTags": false 569 | }, 570 | { 571 | "current": { 572 | "selected": false, 573 | "text": "All", 574 | "value": "$__all" 575 | }, 576 | "datasource": { 577 | "type": "prometheus", 578 | "uid": "${DataSource}" 579 | }, 580 | "definition": "", 581 | "hide": 0, 582 | "includeAll": true, 583 | "label": "Instance", 584 | "multi": true, 585 | "name": "kubernetes_pod_name", 586 | "options": [], 587 | "query": "jvm_memory_bytes_used{cluster=~\"$cluster\",job=~\"$job\", kubernetes_pod_name=~\".+\"}", 588 | "refresh": 2, 589 | "regex": "/.*[^_]kubernetes_pod_name=\\\"([^\\\"]+)\\\".*/", 590 | "skipUrlSync": false, 591 | "sort": 1, 592 | "tagValuesQuery": "", 593 | "tagsQuery": "", 594 | "type": "query", 595 | "useTags": false 596 | } 597 | ] 598 | }, 599 | "time": { 600 | "from": "now-1h", 601 | "to": "now" 602 | }, 603 | "timepicker": { 604 | "refresh_intervals": [ 605 | "5s", 606 | "10s", 607 | "30s", 608 | "1m", 609 | "5m", 610 | "15m", 611 | "30m", 612 | "1h", 613 | "2h", 614 | "1d" 615 | ], 616 | "time_options": [ 617 | "5m", 618 | "15m", 619 | "1h", 620 | "6h", 621 | "12h", 622 | "24h", 623 | "2d", 624 | "7d", 625 | "30d" 626 | ] 627 | }, 628 | "timezone": "browser", 629 | "title": "JVM Metrics", 630 | "uid": "S9e71oLmk", 631 | "version": 9, 632 | "weekStart": "" 633 | } -------------------------------------------------------------------------------- /dashboards.kubernetes/recovery.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "$$hashKey": "object:2065", 6 | "builtIn": 1, 7 | "datasource": { 8 | "type": "prometheus", 9 | "uid": "${DataSource}" 10 | }, 11 | "enable": true, 12 | "hide": true, 13 | "iconColor": "rgba(0, 211, 255, 1)", 14 | "name": "Annotations & Alerts", 15 | "type": "dashboard" 16 | } 17 | ] 18 | }, 19 | "editable": true, 20 | "fiscalYearStartMonth": 0, 21 | "graphTooltip": 0, 22 | "id": 80, 23 | "links": [], 24 | "liveNow": false, 25 | "panels": [ 26 | { 27 | "aliasColors": {}, 28 | "bars": false, 29 | "dashLength": 10, 30 | "dashes": false, 31 | "datasource": { 32 | "type": "prometheus", 33 | "uid": "${DataSource}" 34 | }, 35 | "fieldConfig": { 36 | "defaults": { 37 | "links": [] 38 | }, 39 | "overrides": [] 40 | }, 41 | "fill": 1, 42 | "fillGradient": 0, 43 | "gridPos": { 44 | "h": 9, 45 | "w": 24, 46 | "x": 0, 47 | "y": 0 48 | }, 49 | "hiddenSeries": false, 50 | "id": 2, 51 | "legend": { 52 | "avg": false, 53 | "current": false, 54 | "max": false, 55 | "min": false, 56 | "show": true, 57 | "total": false, 58 | "values": false 59 | }, 60 | "lines": true, 61 | "linewidth": 1, 62 | "nullPointMode": "null", 63 | "options": { 64 | "alertThreshold": true 65 | }, 66 | "percentage": false, 67 | "pluginVersion": "9.5.6", 68 | "pointradius": 2, 69 | "points": false, 70 | "renderer": "flot", 71 | "seriesOverrides": [], 72 | "spaceLength": 10, 73 | "stack": false, 74 | "steppedLine": false, 75 | "targets": [ 76 | { 77 | "datasource": { 78 | "type": "prometheus", 79 | "uid": "${DataSource}" 80 | }, 81 | "expr": "sum(auditor_NUM_UNDER_REPLICATED_LEDGERS_count{cluster=~\"$cluster\", success=\"true\"})", 82 | "interval": "", 83 | "legendFormat": "$cluster", 84 | "refId": "A" 85 | } 86 | ], 87 | "thresholds": [], 88 | "timeRegions": [], 89 | "title": "Under-Replicated Ledgers count", 90 | "tooltip": { 91 | "shared": true, 92 | "sort": 0, 93 | "value_type": "individual" 94 | }, 95 | "type": "graph", 96 | "xaxis": { 97 | "mode": "time", 98 | "show": true, 99 | "values": [] 100 | }, 101 | "yaxes": [ 102 | { 103 | "format": "short", 104 | "logBase": 1, 105 | "show": true 106 | }, 107 | { 108 | "format": "short", 109 | "logBase": 1, 110 | "show": true 111 | } 112 | ], 113 | "yaxis": { 114 | "align": false 115 | } 116 | }, 117 | { 118 | "aliasColors": {}, 119 | "bars": false, 120 | "dashLength": 10, 121 | "dashes": false, 122 | "datasource": { 123 | "type": "prometheus", 124 | "uid": "${DataSource}" 125 | }, 126 | "fieldConfig": { 127 | "defaults": { 128 | "links": [] 129 | }, 130 | "overrides": [] 131 | }, 132 | "fill": 1, 133 | "fillGradient": 0, 134 | "gridPos": { 135 | "h": 9, 136 | "w": 12, 137 | "x": 0, 138 | "y": 9 139 | }, 140 | "hiddenSeries": false, 141 | "id": 3, 142 | "legend": { 143 | "avg": false, 144 | "current": false, 145 | "max": false, 146 | "min": false, 147 | "show": true, 148 | "total": false, 149 | "values": false 150 | }, 151 | "lines": true, 152 | "linewidth": 1, 153 | "nullPointMode": "null", 154 | "options": { 155 | "alertThreshold": true 156 | }, 157 | "percentage": false, 158 | "pluginVersion": "9.5.6", 159 | "pointradius": 2, 160 | "points": false, 161 | "renderer": "flot", 162 | "seriesOverrides": [], 163 | "spaceLength": 10, 164 | "stack": false, 165 | "steppedLine": false, 166 | "targets": [ 167 | { 168 | "datasource": { 169 | "type": "prometheus", 170 | "uid": "${DataSource}" 171 | }, 172 | "expr": "irate(replication_worker_NUM_BYTES_READ_sum{cluster=~\"$cluster\", kubernetes_pod_name=~\"$kubernetes_pod_name\", success=\"true\"}[1m])", 173 | "interval": "", 174 | "legendFormat": "{{ kubernetes_pod_name }}", 175 | "refId": "A" 176 | } 177 | ], 178 | "thresholds": [], 179 | "timeRegions": [], 180 | "title": "Replication read throughput (bytes/s)", 181 | "tooltip": { 182 | "shared": true, 183 | "sort": 0, 184 | "value_type": "individual" 185 | }, 186 | "type": "graph", 187 | "xaxis": { 188 | "mode": "time", 189 | "show": true, 190 | "values": [] 191 | }, 192 | "yaxes": [ 193 | { 194 | "format": "bytes", 195 | "logBase": 1, 196 | "min": "0", 197 | "show": true 198 | }, 199 | { 200 | "format": "short", 201 | "logBase": 1, 202 | "show": true 203 | } 204 | ], 205 | "yaxis": { 206 | "align": false 207 | } 208 | }, 209 | { 210 | "aliasColors": {}, 211 | "bars": false, 212 | "dashLength": 10, 213 | "dashes": false, 214 | "datasource": { 215 | "type": "prometheus", 216 | "uid": "${DataSource}" 217 | }, 218 | "fieldConfig": { 219 | "defaults": { 220 | "links": [] 221 | }, 222 | "overrides": [] 223 | }, 224 | "fill": 1, 225 | "fillGradient": 0, 226 | "gridPos": { 227 | "h": 9, 228 | "w": 12, 229 | "x": 12, 230 | "y": 9 231 | }, 232 | "hiddenSeries": false, 233 | "id": 5, 234 | "legend": { 235 | "avg": false, 236 | "current": false, 237 | "max": false, 238 | "min": false, 239 | "show": true, 240 | "total": false, 241 | "values": false 242 | }, 243 | "lines": true, 244 | "linewidth": 1, 245 | "nullPointMode": "null", 246 | "options": { 247 | "alertThreshold": true 248 | }, 249 | "percentage": false, 250 | "pluginVersion": "9.5.6", 251 | "pointradius": 2, 252 | "points": false, 253 | "renderer": "flot", 254 | "seriesOverrides": [], 255 | "spaceLength": 10, 256 | "stack": false, 257 | "steppedLine": false, 258 | "targets": [ 259 | { 260 | "datasource": { 261 | "type": "prometheus", 262 | "uid": "${DataSource}" 263 | }, 264 | "expr": "irate(replication_worker_NUM_ENTRIES_READ{cluster=~\"$cluster\", kubernetes_pod_name=~\"$kubernetes_pod_name\"}[1m])", 265 | "interval": "", 266 | "legendFormat": "{{ kubernetes_pod_name }}", 267 | "refId": "A" 268 | } 269 | ], 270 | "thresholds": [], 271 | "timeRegions": [], 272 | "title": "Replication read entry rate (entries/s)", 273 | "tooltip": { 274 | "shared": true, 275 | "sort": 0, 276 | "value_type": "individual" 277 | }, 278 | "type": "graph", 279 | "xaxis": { 280 | "mode": "time", 281 | "show": true, 282 | "values": [] 283 | }, 284 | "yaxes": [ 285 | { 286 | "format": "short", 287 | "logBase": 1, 288 | "show": true 289 | }, 290 | { 291 | "format": "short", 292 | "logBase": 1, 293 | "show": true 294 | } 295 | ], 296 | "yaxis": { 297 | "align": false 298 | } 299 | }, 300 | { 301 | "aliasColors": {}, 302 | "bars": false, 303 | "dashLength": 10, 304 | "dashes": false, 305 | "datasource": { 306 | "type": "prometheus", 307 | "uid": "${DataSource}" 308 | }, 309 | "fieldConfig": { 310 | "defaults": { 311 | "links": [] 312 | }, 313 | "overrides": [] 314 | }, 315 | "fill": 1, 316 | "fillGradient": 0, 317 | "gridPos": { 318 | "h": 9, 319 | "w": 12, 320 | "x": 0, 321 | "y": 18 322 | }, 323 | "hiddenSeries": false, 324 | "id": 6, 325 | "legend": { 326 | "avg": false, 327 | "current": false, 328 | "max": false, 329 | "min": false, 330 | "show": true, 331 | "total": false, 332 | "values": false 333 | }, 334 | "lines": true, 335 | "linewidth": 1, 336 | "nullPointMode": "null", 337 | "options": { 338 | "alertThreshold": true 339 | }, 340 | "percentage": false, 341 | "pluginVersion": "9.5.6", 342 | "pointradius": 2, 343 | "points": false, 344 | "renderer": "flot", 345 | "seriesOverrides": [], 346 | "spaceLength": 10, 347 | "stack": false, 348 | "steppedLine": false, 349 | "targets": [ 350 | { 351 | "datasource": { 352 | "type": "prometheus", 353 | "uid": "${DataSource}" 354 | }, 355 | "expr": "irate(replication_worker_NUM_BYTES_WRITTEN_sum{cluster=~\"$cluster\", kubernetes_pod_name=~\"$kubernetes_pod_name\", success=\"true\"}[1m])", 356 | "interval": "", 357 | "legendFormat": "{{ kubernetes_pod_name }}", 358 | "refId": "A" 359 | } 360 | ], 361 | "thresholds": [], 362 | "timeRegions": [], 363 | "title": "Replication write throughput (bytes/s)", 364 | "tooltip": { 365 | "shared": true, 366 | "sort": 0, 367 | "value_type": "individual" 368 | }, 369 | "type": "graph", 370 | "xaxis": { 371 | "mode": "time", 372 | "show": true, 373 | "values": [] 374 | }, 375 | "yaxes": [ 376 | { 377 | "format": "bytes", 378 | "logBase": 1, 379 | "min": "0", 380 | "show": true 381 | }, 382 | { 383 | "format": "short", 384 | "logBase": 1, 385 | "show": true 386 | } 387 | ], 388 | "yaxis": { 389 | "align": false 390 | } 391 | }, 392 | { 393 | "aliasColors": {}, 394 | "bars": false, 395 | "dashLength": 10, 396 | "dashes": false, 397 | "datasource": { 398 | "type": "prometheus", 399 | "uid": "${DataSource}" 400 | }, 401 | "fieldConfig": { 402 | "defaults": { 403 | "links": [] 404 | }, 405 | "overrides": [] 406 | }, 407 | "fill": 1, 408 | "fillGradient": 0, 409 | "gridPos": { 410 | "h": 9, 411 | "w": 12, 412 | "x": 12, 413 | "y": 18 414 | }, 415 | "hiddenSeries": false, 416 | "id": 4, 417 | "legend": { 418 | "avg": false, 419 | "current": false, 420 | "max": false, 421 | "min": false, 422 | "show": true, 423 | "total": false, 424 | "values": false 425 | }, 426 | "lines": true, 427 | "linewidth": 1, 428 | "nullPointMode": "null", 429 | "options": { 430 | "alertThreshold": true 431 | }, 432 | "percentage": false, 433 | "pluginVersion": "9.5.6", 434 | "pointradius": 2, 435 | "points": false, 436 | "renderer": "flot", 437 | "seriesOverrides": [], 438 | "spaceLength": 10, 439 | "stack": false, 440 | "steppedLine": false, 441 | "targets": [ 442 | { 443 | "datasource": { 444 | "type": "prometheus", 445 | "uid": "${DataSource}" 446 | }, 447 | "expr": "irate(replication_worker_NUM_ENTRIES_WRITTEN{cluster=~\"$cluster\", kubernetes_pod_name=~\"$kubernetes_pod_name\"}[1m])", 448 | "interval": "", 449 | "legendFormat": "$cluster", 450 | "refId": "A" 451 | } 452 | ], 453 | "thresholds": [], 454 | "timeRegions": [], 455 | "title": "Replication write entry rate (entries/s)", 456 | "tooltip": { 457 | "shared": true, 458 | "sort": 0, 459 | "value_type": "individual" 460 | }, 461 | "type": "graph", 462 | "xaxis": { 463 | "mode": "time", 464 | "show": true, 465 | "values": [] 466 | }, 467 | "yaxes": [ 468 | { 469 | "format": "short", 470 | "logBase": 1, 471 | "show": true 472 | }, 473 | { 474 | "format": "short", 475 | "logBase": 1, 476 | "show": true 477 | } 478 | ], 479 | "yaxis": { 480 | "align": false 481 | } 482 | } 483 | ], 484 | "refresh": "", 485 | "schemaVersion": 38, 486 | "style": "dark", 487 | "tags": [], 488 | "templating": { 489 | "list": [ 490 | { 491 | "current": { 492 | "selected": false, 493 | "text": "All", 494 | "value": "$__all" 495 | }, 496 | "hide": 0, 497 | "includeAll": false, 498 | "label": "DataSource", 499 | "multi": false, 500 | "name": "DataSource", 501 | "options": [], 502 | "query": "prometheus", 503 | "queryValue": "", 504 | "refresh": 1, 505 | "regex": "^(?!Prometheus).*$", 506 | "skipUrlSync": false, 507 | "type": "datasource" 508 | }, 509 | { 510 | "current": { 511 | "selected": false, 512 | "text": "All", 513 | "value": "$__all" 514 | }, 515 | 516 | "datasource": { 517 | "type": "prometheus", 518 | "uid": "${DataSource}" 519 | }, 520 | "definition": "pulsar_version_info{cluster=~\".+\"}", 521 | "hide": 0, 522 | "includeAll": false, 523 | "label": "Pulsar Cluster", 524 | "multi": false, 525 | "name": "cluster", 526 | "options": [], 527 | "query": { 528 | "query": "pulsar_version_info{cluster=~\".+\"}", 529 | "refId": "StandardVariableQuery" 530 | }, 531 | "refresh": 1, 532 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 533 | "skipUrlSync": false, 534 | "sort": 0, 535 | "type": "query" 536 | }, 537 | { 538 | "current": { 539 | "selected": true, 540 | "text": [ 541 | "All" 542 | ], 543 | "value": [ 544 | "$__all" 545 | ] 546 | }, 547 | "datasource": { 548 | "type": "prometheus", 549 | "uid": "${DataSource}" 550 | }, 551 | "definition": "replication_worker_NUM_BYTES_READ_count{cluster=~\"$cluster\", kubernetes_pod_name=~\".+\"}", 552 | "hide": 0, 553 | "includeAll": true, 554 | "label": "Bookie Recovery", 555 | "multi": true, 556 | "name": "kubernetes_pod_name", 557 | "options": [], 558 | "query": "replication_worker_NUM_BYTES_READ_count{cluster=~\"$cluster\", kubernetes_pod_name=~\".+\"}", 559 | "refresh": 2, 560 | "regex": "/.*[^_]kubernetes_pod_name=\\\"([^\\\"]+)\\\".*/", 561 | "skipUrlSync": false, 562 | "sort": 1, 563 | "tagValuesQuery": "", 564 | "tagsQuery": "", 565 | "type": "query", 566 | "useTags": false 567 | } 568 | ] 569 | }, 570 | "time": { 571 | "from": "now-6h", 572 | "to": "now" 573 | }, 574 | "timepicker": { 575 | "refresh_intervals": [ 576 | "5s", 577 | "10s", 578 | "30s", 579 | "1m", 580 | "5m", 581 | "15m", 582 | "30m", 583 | "1h", 584 | "2h", 585 | "1d" 586 | ] 587 | }, 588 | "timezone": "", 589 | "title": "Auto Recovery Metrics", 590 | "uid": "Z_S6797Mz", 591 | "version": 2, 592 | "weekStart": "" 593 | } -------------------------------------------------------------------------------- /dashboards.privatecloud/jvm.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": { 7 | "uid": "${DataSource}" 8 | }, 9 | "enable": true, 10 | "hide": true, 11 | "iconColor": "rgba(0, 211, 255, 1)", 12 | "name": "Annotations & Alerts", 13 | "type": "dashboard" 14 | } 15 | ] 16 | }, 17 | "description": "JVM Related Metrics", 18 | "editable": true, 19 | "fiscalYearStartMonth": 0, 20 | "graphTooltip": 0, 21 | "id": 7, 22 | "links": [], 23 | "liveNow": false, 24 | "panels": [ 25 | { 26 | "collapsed": false, 27 | "datasource": { 28 | "type": "datasource", 29 | "uid": "grafana" 30 | }, 31 | "gridPos": { 32 | "h": 1, 33 | "w": 24, 34 | "x": 0, 35 | "y": 0 36 | }, 37 | "id": 41, 38 | "panels": [], 39 | "repeat": "pod", 40 | "targets": [ 41 | { 42 | "datasource": { 43 | "type": "datasource", 44 | "uid": "grafana" 45 | }, 46 | "refId": "A" 47 | } 48 | ], 49 | "title": "$job - $pod", 50 | "type": "row" 51 | }, 52 | { 53 | "aliasColors": {}, 54 | "bars": false, 55 | "dashLength": 10, 56 | "dashes": false, 57 | "datasource": { 58 | "type": "prometheus", 59 | "uid": "${DataSource}" 60 | }, 61 | "decimals": 1, 62 | "fill": 1, 63 | "fillGradient": 0, 64 | "gridPos": { 65 | "h": 6, 66 | "w": 6, 67 | "x": 0, 68 | "y": 1 69 | }, 70 | "hiddenSeries": false, 71 | "id": 4, 72 | "legend": { 73 | "avg": false, 74 | "current": false, 75 | "max": false, 76 | "min": false, 77 | "show": false, 78 | "total": false, 79 | "values": false 80 | }, 81 | "lines": true, 82 | "linewidth": 1, 83 | "links": [], 84 | "nullPointMode": "null", 85 | "options": { 86 | "alertThreshold": true 87 | }, 88 | "percentage": false, 89 | "pluginVersion": "9.5.6", 90 | "pointradius": 5, 91 | "points": false, 92 | "renderer": "flot", 93 | "seriesOverrides": [], 94 | "spaceLength": 10, 95 | "stack": false, 96 | "steppedLine": false, 97 | "targets": [ 98 | { 99 | "datasource": { 100 | "type": "prometheus", 101 | "uid": "${DataSource}" 102 | }, 103 | "expr": "irate(process_cpu_seconds_total{pod=~\"$pod\"}[30s]) * 100", 104 | "format": "time_series", 105 | "interval": "", 106 | "intervalFactor": 2, 107 | "legendFormat": "{{pod}}", 108 | "metric": "process_cpu_seconds_total", 109 | "refId": "A", 110 | "step": 20 111 | } 112 | ], 113 | "thresholds": [ 114 | { 115 | "colorMode": "ok", 116 | "fill": false, 117 | "line": true, 118 | "op": "gt", 119 | "value": 100 120 | } 121 | ], 122 | "timeRegions": [], 123 | "title": "CPU", 124 | "tooltip": { 125 | "shared": true, 126 | "sort": 0, 127 | "value_type": "individual" 128 | }, 129 | "type": "graph", 130 | "xaxis": { 131 | "mode": "time", 132 | "show": true, 133 | "values": [] 134 | }, 135 | "yaxes": [ 136 | { 137 | "format": "percent", 138 | "label": "", 139 | "logBase": 1, 140 | "min": "0", 141 | "show": true 142 | }, 143 | { 144 | "format": "short", 145 | "logBase": 1, 146 | "show": true 147 | } 148 | ], 149 | "yaxis": { 150 | "align": false 151 | } 152 | }, 153 | { 154 | "aliasColors": {}, 155 | "bars": false, 156 | "dashLength": 10, 157 | "dashes": false, 158 | "datasource": { 159 | "type": "prometheus", 160 | "uid": "${DataSource}" 161 | }, 162 | "fill": 1, 163 | "fillGradient": 0, 164 | "gridPos": { 165 | "h": 6, 166 | "w": 6, 167 | "x": 6, 168 | "y": 1 169 | }, 170 | "hiddenSeries": false, 171 | "id": 1, 172 | "legend": { 173 | "alignAsTable": false, 174 | "avg": false, 175 | "current": false, 176 | "hideEmpty": false, 177 | "max": false, 178 | "min": false, 179 | "rightSide": false, 180 | "show": false, 181 | "total": false, 182 | "values": false 183 | }, 184 | "lines": true, 185 | "linewidth": 1, 186 | "links": [], 187 | "nullPointMode": "null", 188 | "options": { 189 | "alertThreshold": true 190 | }, 191 | "percentage": false, 192 | "pluginVersion": "9.5.6", 193 | "pointradius": 5, 194 | "points": false, 195 | "renderer": "flot", 196 | "seriesOverrides": [], 197 | "spaceLength": 10, 198 | "stack": false, 199 | "steppedLine": false, 200 | "targets": [ 201 | { 202 | "datasource": { 203 | "type": "prometheus", 204 | "uid": "${DataSource}" 205 | }, 206 | "expr": "sum(jvm_memory_bytes_committed{pod=~\"$pod\"})", 207 | "format": "time_series", 208 | "hide": false, 209 | "interval": "", 210 | "intervalFactor": 2, 211 | "legendFormat": "Heap size", 212 | "metric": "jvm_memory_bytes_committed", 213 | "refId": "A", 214 | "step": 20 215 | }, 216 | { 217 | "datasource": { 218 | "type": "prometheus", 219 | "uid": "${DataSource}" 220 | }, 221 | "expr": "sum(jvm_memory_bytes_used{pod=~\"$pod\"})", 222 | "format": "time_series", 223 | "interval": "", 224 | "intervalFactor": 2, 225 | "legendFormat": "Used", 226 | "metric": "jvm_memory_bytes_used", 227 | "refId": "B", 228 | "step": 20 229 | }, 230 | { 231 | "datasource": { 232 | "type": "prometheus", 233 | "uid": "${DataSource}" 234 | }, 235 | "expr": "sum(jvm_memory_bytes_max{pod=~\"$pod\"})", 236 | "format": "time_series", 237 | "interval": "", 238 | "intervalFactor": 2, 239 | "legendFormat": "Max", 240 | "metric": "jvm_memory_bytes_max", 241 | "refId": "C", 242 | "step": 20 243 | } 244 | ], 245 | "thresholds": [], 246 | "timeRegions": [], 247 | "title": "Heap Memory", 248 | "tooltip": { 249 | "shared": true, 250 | "sort": 0, 251 | "value_type": "individual" 252 | }, 253 | "type": "graph", 254 | "xaxis": { 255 | "mode": "time", 256 | "show": true, 257 | "values": [] 258 | }, 259 | "yaxes": [ 260 | { 261 | "format": "decbytes", 262 | "label": "", 263 | "logBase": 1, 264 | "show": true 265 | }, 266 | { 267 | "format": "short", 268 | "logBase": 1, 269 | "show": false 270 | } 271 | ], 272 | "yaxis": { 273 | "align": false 274 | } 275 | }, 276 | { 277 | "aliasColors": {}, 278 | "bars": false, 279 | "dashLength": 10, 280 | "dashes": false, 281 | "datasource": { 282 | "type": "prometheus", 283 | "uid": "${DataSource}" 284 | }, 285 | "fill": 1, 286 | "fillGradient": 0, 287 | "gridPos": { 288 | "h": 6, 289 | "w": 6, 290 | "x": 12, 291 | "y": 1 292 | }, 293 | "hiddenSeries": false, 294 | "id": 2, 295 | "legend": { 296 | "avg": false, 297 | "current": false, 298 | "max": false, 299 | "min": false, 300 | "show": false, 301 | "total": false, 302 | "values": false 303 | }, 304 | "lines": true, 305 | "linewidth": 1, 306 | "links": [], 307 | "nullPointMode": "null", 308 | "options": { 309 | "alertThreshold": true 310 | }, 311 | "percentage": false, 312 | "pluginVersion": "9.5.6", 313 | "pointradius": 5, 314 | "points": false, 315 | "renderer": "flot", 316 | "seriesOverrides": [], 317 | "spaceLength": 10, 318 | "stack": false, 319 | "steppedLine": false, 320 | "targets": [ 321 | { 322 | "datasource": { 323 | "type": "prometheus", 324 | "uid": "${DataSource}" 325 | }, 326 | "expr": "jvm_memory_direct_bytes_used{pod=~\"$pod\"}", 327 | "format": "time_series", 328 | "interval": "", 329 | "intervalFactor": 2, 330 | "legendFormat": "Used", 331 | "metric": "jvm_memory_direct_bytes_used", 332 | "refId": "A", 333 | "step": 20 334 | }, 335 | { 336 | "datasource": { 337 | "type": "prometheus", 338 | "uid": "${DataSource}" 339 | }, 340 | "expr": "jvm_memory_direct_bytes_max{pod=~\"$pod\"}", 341 | "format": "time_series", 342 | "interval": "", 343 | "intervalFactor": 2, 344 | "legendFormat": "Max", 345 | "metric": "jvm_memory_direct_bytes_max", 346 | "refId": "B", 347 | "step": 20 348 | } 349 | ], 350 | "thresholds": [], 351 | "timeRegions": [], 352 | "title": "Direct Memory", 353 | "tooltip": { 354 | "shared": true, 355 | "sort": 0, 356 | "value_type": "individual" 357 | }, 358 | "type": "graph", 359 | "xaxis": { 360 | "mode": "time", 361 | "show": true, 362 | "values": [] 363 | }, 364 | "yaxes": [ 365 | { 366 | "format": "decbytes", 367 | "label": "", 368 | "logBase": 1, 369 | "show": true 370 | }, 371 | { 372 | "format": "short", 373 | "label": "", 374 | "logBase": 1, 375 | "show": true 376 | } 377 | ], 378 | "yaxis": { 379 | "align": false 380 | } 381 | }, 382 | { 383 | "aliasColors": {}, 384 | "bars": false, 385 | "dashLength": 10, 386 | "dashes": false, 387 | "datasource": { 388 | "type": "prometheus", 389 | "uid": "${DataSource}" 390 | }, 391 | "fill": 1, 392 | "fillGradient": 0, 393 | "gridPos": { 394 | "h": 6, 395 | "w": 6, 396 | "x": 18, 397 | "y": 1 398 | }, 399 | "hiddenSeries": false, 400 | "id": 3, 401 | "legend": { 402 | "avg": false, 403 | "current": false, 404 | "max": false, 405 | "min": false, 406 | "show": false, 407 | "total": false, 408 | "values": false 409 | }, 410 | "lines": true, 411 | "linewidth": 1, 412 | "links": [], 413 | "nullPointMode": "null", 414 | "options": { 415 | "alertThreshold": true 416 | }, 417 | "percentage": false, 418 | "pluginVersion": "9.5.6", 419 | "pointradius": 5, 420 | "points": false, 421 | "renderer": "flot", 422 | "seriesOverrides": [ 423 | { 424 | "alias": "old count", 425 | "yaxis": 2 426 | }, 427 | { 428 | "alias": "young count", 429 | "yaxis": 2 430 | } 431 | ], 432 | "spaceLength": 10, 433 | "stack": false, 434 | "steppedLine": false, 435 | "targets": [ 436 | { 437 | "datasource": { 438 | "type": "prometheus", 439 | "uid": "${DataSource}" 440 | }, 441 | "expr": "sum(increase(jvm_gc_collection_seconds_sum{pod=~\"$pod\"}[30s]))", 442 | "format": "time_series", 443 | "hide": false, 444 | "interval": "", 445 | "intervalFactor": 2, 446 | "legendFormat": "Pause", 447 | "metric": "jvm_gc_collection_seconds_count", 448 | "refId": "B", 449 | "step": 20 450 | } 451 | ], 452 | "thresholds": [], 453 | "timeRegions": [], 454 | "title": "GC Pauses", 455 | "tooltip": { 456 | "shared": true, 457 | "sort": 0, 458 | "value_type": "individual" 459 | }, 460 | "type": "graph", 461 | "xaxis": { 462 | "mode": "time", 463 | "show": true, 464 | "values": [] 465 | }, 466 | "yaxes": [ 467 | { 468 | "format": "s", 469 | "label": "", 470 | "logBase": 1, 471 | "min": "0", 472 | "show": true 473 | }, 474 | { 475 | "format": "short", 476 | "label": "", 477 | "logBase": 1, 478 | "min": "0", 479 | "show": false 480 | } 481 | ], 482 | "yaxis": { 483 | "align": false 484 | } 485 | } 486 | ], 487 | "refresh": "1m", 488 | "schemaVersion": 38, 489 | "style": "dark", 490 | "tags": [ 491 | "jvm" 492 | ], 493 | "templating": { 494 | "list": [ 495 | { 496 | "current": { 497 | "text": "All", 498 | "value": [ 499 | "$__all" 500 | ] 501 | }, 502 | "hide": 0, 503 | "includeAll": false, 504 | "label": "DataSource", 505 | "multi": false, 506 | "name": "DataSource", 507 | "options": [], 508 | "query": "prometheus", 509 | "queryValue": "", 510 | "refresh": 1, 511 | "regex": "^(?!Prometheus).*$", 512 | "skipUrlSync": false, 513 | "type": "datasource" 514 | }, 515 | { 516 | "current": { 517 | "text": "All", 518 | "value": [ 519 | "$__all" 520 | ] 521 | }, 522 | "datasource": { 523 | "type": "prometheus", 524 | "uid": "${DataSource}" 525 | }, 526 | "definition": "pulsar_version_info{cloud_streamnative_io_cluster=~\".+\"}", 527 | "hide": 0, 528 | "includeAll": false, 529 | "label": "Pulsar Cluster", 530 | "multi": false, 531 | "name": "cluster", 532 | "options": [], 533 | "query": { 534 | "query": "pulsar_version_info{cloud_streamnative_io_cluster=~\".+\"}", 535 | "refId": "StandardVariableQuery" 536 | }, 537 | "refresh": 1, 538 | "regex": "/.*[^_]cloud_streamnative_io_cluster=\\\"([^\\\"]+)\\\".*/", 539 | "skipUrlSync": false, 540 | "sort": 0, 541 | "type": "query" 542 | }, 543 | { 544 | "current": { 545 | "selected": false, 546 | "text": "All", 547 | "value": "$__all" 548 | }, 549 | "datasource": { 550 | "type": "prometheus", 551 | "uid": "${DataSource}" 552 | }, 553 | "definition": "", 554 | "hide": 0, 555 | "includeAll": true, 556 | "label": "Component", 557 | "multi": false, 558 | "name": "component", 559 | "options": [], 560 | "query": "jvm_memory_bytes_used{cloud_streamnative_io_component=~\".+\"}", 561 | "refresh": 1, 562 | "regex": "/.*[^_]cloud_streamnative_io_component=\\\"([^\\\"]+)\\\".*/", 563 | "skipUrlSync": false, 564 | "sort": 1, 565 | "tagValuesQuery": "", 566 | "tagsQuery": "", 567 | "type": "query", 568 | "useTags": false 569 | }, 570 | { 571 | "current": { 572 | "selected": false, 573 | "text": "All", 574 | "value": "$__all" 575 | }, 576 | "datasource": { 577 | "type": "prometheus", 578 | "uid": "${DataSource}" 579 | }, 580 | "definition": "", 581 | "hide": 0, 582 | "includeAll": true, 583 | "label": "Pod", 584 | "multi": true, 585 | "name": "pod", 586 | "options": [], 587 | "query": "jvm_memory_bytes_used{cloud_streamnative_io_cluster=~\"$cluster\",cloud_streamnative_io_component=~\"$component\", pod=~\".+\"}", 588 | "refresh": 2, 589 | "regex": "/.*[^_]pod=\\\"([^\\\"]+)\\\".*/", 590 | "skipUrlSync": false, 591 | "sort": 1, 592 | "tagValuesQuery": "", 593 | "tagsQuery": "", 594 | "type": "query", 595 | "useTags": false 596 | } 597 | ] 598 | }, 599 | "time": { 600 | "from": "now-1h", 601 | "to": "now" 602 | }, 603 | "timepicker": { 604 | "refresh_intervals": [ 605 | "5s", 606 | "10s", 607 | "30s", 608 | "1m", 609 | "5m", 610 | "15m", 611 | "30m", 612 | "1h", 613 | "2h", 614 | "1d" 615 | ], 616 | "time_options": [ 617 | "5m", 618 | "15m", 619 | "1h", 620 | "6h", 621 | "12h", 622 | "24h", 623 | "2d", 624 | "7d", 625 | "30d" 626 | ] 627 | }, 628 | "timezone": "browser", 629 | "title": "JVM Metrics", 630 | "uid": "S9e71oLmk", 631 | "version": 9, 632 | "weekStart": "" 633 | } -------------------------------------------------------------------------------- /dashboards.privatecloud/recovery.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "$$hashKey": "object:2065", 6 | "builtIn": 1, 7 | "datasource": { 8 | "type": "prometheus", 9 | "uid": "${DataSource}" 10 | }, 11 | "enable": true, 12 | "hide": true, 13 | "iconColor": "rgba(0, 211, 255, 1)", 14 | "name": "Annotations & Alerts", 15 | "type": "dashboard" 16 | } 17 | ] 18 | }, 19 | "editable": true, 20 | "fiscalYearStartMonth": 0, 21 | "graphTooltip": 0, 22 | "id": 80, 23 | "links": [], 24 | "liveNow": false, 25 | "panels": [ 26 | { 27 | "aliasColors": {}, 28 | "bars": false, 29 | "dashLength": 10, 30 | "dashes": false, 31 | "datasource": { 32 | "type": "prometheus", 33 | "uid": "${DataSource}" 34 | }, 35 | "fieldConfig": { 36 | "defaults": { 37 | "links": [] 38 | }, 39 | "overrides": [] 40 | }, 41 | "fill": 1, 42 | "fillGradient": 0, 43 | "gridPos": { 44 | "h": 9, 45 | "w": 24, 46 | "x": 0, 47 | "y": 0 48 | }, 49 | "hiddenSeries": false, 50 | "id": 2, 51 | "legend": { 52 | "avg": false, 53 | "current": false, 54 | "max": false, 55 | "min": false, 56 | "show": true, 57 | "total": false, 58 | "values": false 59 | }, 60 | "lines": true, 61 | "linewidth": 1, 62 | "nullPointMode": "null", 63 | "options": { 64 | "alertThreshold": true 65 | }, 66 | "percentage": false, 67 | "pluginVersion": "9.5.6", 68 | "pointradius": 2, 69 | "points": false, 70 | "renderer": "flot", 71 | "seriesOverrides": [], 72 | "spaceLength": 10, 73 | "stack": false, 74 | "steppedLine": false, 75 | "targets": [ 76 | { 77 | "datasource": { 78 | "type": "prometheus", 79 | "uid": "${DataSource}" 80 | }, 81 | "expr": "sum(auditor_NUM_UNDER_REPLICATED_LEDGERS_count{cloud_streamnative_io_cluster=~\"$cluster\", success=\"true\"})", 82 | "interval": "", 83 | "legendFormat": "$cluster", 84 | "refId": "A" 85 | } 86 | ], 87 | "thresholds": [], 88 | "timeRegions": [], 89 | "title": "Under-Replicated Ledgers count", 90 | "tooltip": { 91 | "shared": true, 92 | "sort": 0, 93 | "value_type": "individual" 94 | }, 95 | "type": "graph", 96 | "xaxis": { 97 | "mode": "time", 98 | "show": true, 99 | "values": [] 100 | }, 101 | "yaxes": [ 102 | { 103 | "format": "short", 104 | "logBase": 1, 105 | "show": true 106 | }, 107 | { 108 | "format": "short", 109 | "logBase": 1, 110 | "show": true 111 | } 112 | ], 113 | "yaxis": { 114 | "align": false 115 | } 116 | }, 117 | { 118 | "aliasColors": {}, 119 | "bars": false, 120 | "dashLength": 10, 121 | "dashes": false, 122 | "datasource": { 123 | "type": "prometheus", 124 | "uid": "${DataSource}" 125 | }, 126 | "fieldConfig": { 127 | "defaults": { 128 | "links": [] 129 | }, 130 | "overrides": [] 131 | }, 132 | "fill": 1, 133 | "fillGradient": 0, 134 | "gridPos": { 135 | "h": 9, 136 | "w": 12, 137 | "x": 0, 138 | "y": 9 139 | }, 140 | "hiddenSeries": false, 141 | "id": 3, 142 | "legend": { 143 | "avg": false, 144 | "current": false, 145 | "max": false, 146 | "min": false, 147 | "show": true, 148 | "total": false, 149 | "values": false 150 | }, 151 | "lines": true, 152 | "linewidth": 1, 153 | "nullPointMode": "null", 154 | "options": { 155 | "alertThreshold": true 156 | }, 157 | "percentage": false, 158 | "pluginVersion": "9.5.6", 159 | "pointradius": 2, 160 | "points": false, 161 | "renderer": "flot", 162 | "seriesOverrides": [], 163 | "spaceLength": 10, 164 | "stack": false, 165 | "steppedLine": false, 166 | "targets": [ 167 | { 168 | "datasource": { 169 | "type": "prometheus", 170 | "uid": "${DataSource}" 171 | }, 172 | "expr": "irate(replication_worker_NUM_BYTES_READ_sum{cloud_streamnative_io_cluster=~\"$cluster\", pod=~\"$pod\", success=\"true\"}[5m])", 173 | "interval": "", 174 | "legendFormat": "{{ pod }}", 175 | "refId": "A" 176 | } 177 | ], 178 | "thresholds": [], 179 | "timeRegions": [], 180 | "title": "Replication read throughput (bytes/s)", 181 | "tooltip": { 182 | "shared": true, 183 | "sort": 0, 184 | "value_type": "individual" 185 | }, 186 | "type": "graph", 187 | "xaxis": { 188 | "mode": "time", 189 | "show": true, 190 | "values": [] 191 | }, 192 | "yaxes": [ 193 | { 194 | "format": "bytes", 195 | "logBase": 1, 196 | "min": "0", 197 | "show": true 198 | }, 199 | { 200 | "format": "short", 201 | "logBase": 1, 202 | "show": true 203 | } 204 | ], 205 | "yaxis": { 206 | "align": false 207 | } 208 | }, 209 | { 210 | "aliasColors": {}, 211 | "bars": false, 212 | "dashLength": 10, 213 | "dashes": false, 214 | "datasource": { 215 | "type": "prometheus", 216 | "uid": "${DataSource}" 217 | }, 218 | "fieldConfig": { 219 | "defaults": { 220 | "links": [] 221 | }, 222 | "overrides": [] 223 | }, 224 | "fill": 1, 225 | "fillGradient": 0, 226 | "gridPos": { 227 | "h": 9, 228 | "w": 12, 229 | "x": 12, 230 | "y": 9 231 | }, 232 | "hiddenSeries": false, 233 | "id": 5, 234 | "legend": { 235 | "avg": false, 236 | "current": false, 237 | "max": false, 238 | "min": false, 239 | "show": true, 240 | "total": false, 241 | "values": false 242 | }, 243 | "lines": true, 244 | "linewidth": 1, 245 | "nullPointMode": "null", 246 | "options": { 247 | "alertThreshold": true 248 | }, 249 | "percentage": false, 250 | "pluginVersion": "9.5.6", 251 | "pointradius": 2, 252 | "points": false, 253 | "renderer": "flot", 254 | "seriesOverrides": [], 255 | "spaceLength": 10, 256 | "stack": false, 257 | "steppedLine": false, 258 | "targets": [ 259 | { 260 | "datasource": { 261 | "type": "prometheus", 262 | "uid": "${DataSource}" 263 | }, 264 | "expr": "irate(replication_worker_NUM_ENTRIES_READ{cloud_streamnative_io_cluster=~\"$cluster\", pod=~\"$pod\"}[5m])", 265 | "interval": "", 266 | "legendFormat": "{{ pod }}", 267 | "refId": "A" 268 | } 269 | ], 270 | "thresholds": [], 271 | "timeRegions": [], 272 | "title": "Replication read entry rate (entries/s)", 273 | "tooltip": { 274 | "shared": true, 275 | "sort": 0, 276 | "value_type": "individual" 277 | }, 278 | "type": "graph", 279 | "xaxis": { 280 | "mode": "time", 281 | "show": true, 282 | "values": [] 283 | }, 284 | "yaxes": [ 285 | { 286 | "format": "short", 287 | "logBase": 1, 288 | "show": true 289 | }, 290 | { 291 | "format": "short", 292 | "logBase": 1, 293 | "show": true 294 | } 295 | ], 296 | "yaxis": { 297 | "align": false 298 | } 299 | }, 300 | { 301 | "aliasColors": {}, 302 | "bars": false, 303 | "dashLength": 10, 304 | "dashes": false, 305 | "datasource": { 306 | "type": "prometheus", 307 | "uid": "${DataSource}" 308 | }, 309 | "fieldConfig": { 310 | "defaults": { 311 | "links": [] 312 | }, 313 | "overrides": [] 314 | }, 315 | "fill": 1, 316 | "fillGradient": 0, 317 | "gridPos": { 318 | "h": 9, 319 | "w": 12, 320 | "x": 0, 321 | "y": 18 322 | }, 323 | "hiddenSeries": false, 324 | "id": 6, 325 | "legend": { 326 | "avg": false, 327 | "current": false, 328 | "max": false, 329 | "min": false, 330 | "show": true, 331 | "total": false, 332 | "values": false 333 | }, 334 | "lines": true, 335 | "linewidth": 1, 336 | "nullPointMode": "null", 337 | "options": { 338 | "alertThreshold": true 339 | }, 340 | "percentage": false, 341 | "pluginVersion": "9.5.6", 342 | "pointradius": 2, 343 | "points": false, 344 | "renderer": "flot", 345 | "seriesOverrides": [], 346 | "spaceLength": 10, 347 | "stack": false, 348 | "steppedLine": false, 349 | "targets": [ 350 | { 351 | "datasource": { 352 | "type": "prometheus", 353 | "uid": "${DataSource}" 354 | }, 355 | "expr": "irate(replication_worker_NUM_BYTES_WRITTEN_sum{cloud_streamnative_io_cluster=~\"$cluster\", pod=~\"$pod\", success=\"true\"}[5m])", 356 | "interval": "", 357 | "legendFormat": "{{ pod }}", 358 | "refId": "A" 359 | } 360 | ], 361 | "thresholds": [], 362 | "timeRegions": [], 363 | "title": "Replication write throughput (bytes/s)", 364 | "tooltip": { 365 | "shared": true, 366 | "sort": 0, 367 | "value_type": "individual" 368 | }, 369 | "type": "graph", 370 | "xaxis": { 371 | "mode": "time", 372 | "show": true, 373 | "values": [] 374 | }, 375 | "yaxes": [ 376 | { 377 | "format": "bytes", 378 | "logBase": 1, 379 | "min": "0", 380 | "show": true 381 | }, 382 | { 383 | "format": "short", 384 | "logBase": 1, 385 | "show": true 386 | } 387 | ], 388 | "yaxis": { 389 | "align": false 390 | } 391 | }, 392 | { 393 | "aliasColors": {}, 394 | "bars": false, 395 | "dashLength": 10, 396 | "dashes": false, 397 | "datasource": { 398 | "type": "prometheus", 399 | "uid": "${DataSource}" 400 | }, 401 | "fieldConfig": { 402 | "defaults": { 403 | "links": [] 404 | }, 405 | "overrides": [] 406 | }, 407 | "fill": 1, 408 | "fillGradient": 0, 409 | "gridPos": { 410 | "h": 9, 411 | "w": 12, 412 | "x": 12, 413 | "y": 18 414 | }, 415 | "hiddenSeries": false, 416 | "id": 4, 417 | "legend": { 418 | "avg": false, 419 | "current": false, 420 | "max": false, 421 | "min": false, 422 | "show": true, 423 | "total": false, 424 | "values": false 425 | }, 426 | "lines": true, 427 | "linewidth": 1, 428 | "nullPointMode": "null", 429 | "options": { 430 | "alertThreshold": true 431 | }, 432 | "percentage": false, 433 | "pluginVersion": "9.5.6", 434 | "pointradius": 2, 435 | "points": false, 436 | "renderer": "flot", 437 | "seriesOverrides": [], 438 | "spaceLength": 10, 439 | "stack": false, 440 | "steppedLine": false, 441 | "targets": [ 442 | { 443 | "datasource": { 444 | "type": "prometheus", 445 | "uid": "${DataSource}" 446 | }, 447 | "expr": "irate(replication_worker_NUM_ENTRIES_WRITTEN{cloud_streamnative_io_cluster=~\"$cluster\", pod=~\"$pod\"}[5m])", 448 | "interval": "", 449 | "legendFormat": "$cluster", 450 | "refId": "A" 451 | } 452 | ], 453 | "thresholds": [], 454 | "timeRegions": [], 455 | "title": "Replication write entry rate (entries/s)", 456 | "tooltip": { 457 | "shared": true, 458 | "sort": 0, 459 | "value_type": "individual" 460 | }, 461 | "type": "graph", 462 | "xaxis": { 463 | "mode": "time", 464 | "show": true, 465 | "values": [] 466 | }, 467 | "yaxes": [ 468 | { 469 | "format": "short", 470 | "logBase": 1, 471 | "show": true 472 | }, 473 | { 474 | "format": "short", 475 | "logBase": 1, 476 | "show": true 477 | } 478 | ], 479 | "yaxis": { 480 | "align": false 481 | } 482 | } 483 | ], 484 | "refresh": "", 485 | "schemaVersion": 38, 486 | "style": "dark", 487 | "tags": [], 488 | "templating": { 489 | "list": [ 490 | { 491 | "current": { 492 | "selected": false, 493 | "text": "All", 494 | "value": "$__all" 495 | }, 496 | "hide": 0, 497 | "includeAll": false, 498 | "label": "DataSource", 499 | "multi": false, 500 | "name": "DataSource", 501 | "options": [], 502 | "query": "prometheus", 503 | "queryValue": "", 504 | "refresh": 1, 505 | "regex": "^(?!Prometheus).*$", 506 | "skipUrlSync": false, 507 | "type": "datasource" 508 | }, 509 | { 510 | "current": { 511 | "selected": false, 512 | "text": "All", 513 | "value": "$__all" 514 | }, 515 | 516 | "datasource": { 517 | "type": "prometheus", 518 | "uid": "${DataSource}" 519 | }, 520 | "definition": "pulsar_version_info{cloud_streamnative_io_cluster=~\".+\"}", 521 | "hide": 0, 522 | "includeAll": false, 523 | "label": "Pulsar Cluster", 524 | "multi": false, 525 | "name": "cluster", 526 | "options": [], 527 | "query": { 528 | "query": "pulsar_version_info{cloud_streamnative_io_cluster=~\".+\"}", 529 | "refId": "StandardVariableQuery" 530 | }, 531 | "refresh": 1, 532 | "regex": "/.*[^_]cloud_streamnative_io_cluster=\\\"([^\\\"]+)\\\".*/", 533 | "skipUrlSync": false, 534 | "sort": 0, 535 | "type": "query" 536 | }, 537 | { 538 | "current": { 539 | "selected": true, 540 | "text": [ 541 | "All" 542 | ], 543 | "value": [ 544 | "$__all" 545 | ] 546 | }, 547 | "datasource": { 548 | "type": "prometheus", 549 | "uid": "${DataSource}" 550 | }, 551 | "definition": "replication_worker_NUM_BYTES_READ_count{cloud_streamnative_io_cluster=~\"$cluster\", pod=~\".+\"}", 552 | "hide": 0, 553 | "includeAll": true, 554 | "label": "Bookie Recovery", 555 | "multi": true, 556 | "name": "pod", 557 | "options": [], 558 | "query": "replication_worker_NUM_BYTES_READ_count{cloud_streamnative_io_cluster=~\"$cluster\", pod=~\".+\"}", 559 | "refresh": 2, 560 | "regex": "/.*[^_]pod=\\\"([^\\\"]+)\\\".*/", 561 | "skipUrlSync": false, 562 | "sort": 1, 563 | "tagValuesQuery": "", 564 | "tagsQuery": "", 565 | "type": "query", 566 | "useTags": false 567 | } 568 | ] 569 | }, 570 | "time": { 571 | "from": "now-6h", 572 | "to": "now" 573 | }, 574 | "timepicker": { 575 | "refresh_intervals": [ 576 | "5s", 577 | "10s", 578 | "30s", 579 | "1m", 580 | "5m", 581 | "15m", 582 | "30m", 583 | "1h", 584 | "2h", 585 | "1d" 586 | ] 587 | }, 588 | "timezone": "", 589 | "title": "Auto Recovery Metrics", 590 | "uid": "Z_S6797Mz", 591 | "version": 2, 592 | "weekStart": "" 593 | } -------------------------------------------------------------------------------- /dashboards.template/functions.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "editable": true, 16 | "gnetId": null, 17 | "graphTooltip": 0, 18 | "id": 10, 19 | "iteration": 1588844930760, 20 | "links": [], 21 | "panels": [ 22 | { 23 | "cacheTimeout": null, 24 | "colorBackground": false, 25 | "colorValue": true, 26 | "colors": [ 27 | "#299c46", 28 | "rgba(237, 129, 40, 0.89)", 29 | "#d44a3a" 30 | ], 31 | "datasource": "{{ PULSAR_CLUSTER }}", 32 | "format": "dateTimeAsIso", 33 | "gauge": { 34 | "maxValue": 100, 35 | "minValue": 0, 36 | "show": false, 37 | "thresholdLabels": false, 38 | "thresholdMarkers": true 39 | }, 40 | "gridPos": { 41 | "h": 9, 42 | "w": 4, 43 | "x": 0, 44 | "y": 0 45 | }, 46 | "id": 4, 47 | "interval": null, 48 | "links": [], 49 | "mappingType": 1, 50 | "mappingTypes": [ 51 | { 52 | "name": "value to text", 53 | "value": 1 54 | }, 55 | { 56 | "name": "range to text", 57 | "value": 2 58 | } 59 | ], 60 | "maxDataPoints": 100, 61 | "nullPointMode": "connected", 62 | "nullText": null, 63 | "postfix": "", 64 | "postfixFontSize": "50%", 65 | "prefix": "", 66 | "prefixFontSize": "50%", 67 | "rangeMaps": [ 68 | { 69 | "from": "null", 70 | "text": "N/A", 71 | "to": "null" 72 | } 73 | ], 74 | "sparkline": { 75 | "fillColor": "rgba(31, 118, 189, 0.18)", 76 | "full": false, 77 | "lineColor": "rgb(31, 120, 193)", 78 | "show": false, 79 | "ymax": null, 80 | "ymin": null 81 | }, 82 | "tableColumn": "", 83 | "targets": [ 84 | { 85 | "expr": "pulsar_function_last_invocation{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}", 86 | "interval": "", 87 | "legendFormat": "{{ fqfn }}", 88 | "refId": "A" 89 | } 90 | ], 91 | "thresholds": "", 92 | "timeFrom": null, 93 | "timeShift": null, 94 | "title": "Function Last Invocation", 95 | "transparent": true, 96 | "type": "singlestat", 97 | "valueFontSize": "80%", 98 | "valueMaps": [ 99 | { 100 | "op": "=", 101 | "text": "N/A", 102 | "value": "null" 103 | } 104 | ], 105 | "valueName": "current" 106 | }, 107 | { 108 | "aliasColors": {}, 109 | "bars": false, 110 | "dashLength": 10, 111 | "dashes": false, 112 | "datasource": "{{ PULSAR_CLUSTER }}", 113 | "fill": 1, 114 | "fillGradient": 0, 115 | "gridPos": { 116 | "h": 9, 117 | "w": 7, 118 | "x": 4, 119 | "y": 0 120 | }, 121 | "hiddenSeries": false, 122 | "id": 10, 123 | "legend": { 124 | "avg": false, 125 | "current": false, 126 | "max": false, 127 | "min": false, 128 | "show": true, 129 | "total": true, 130 | "values": true 131 | }, 132 | "lines": true, 133 | "linewidth": 1, 134 | "nullPointMode": "null", 135 | "options": { 136 | "dataLinks": [] 137 | }, 138 | "percentage": false, 139 | "pointradius": 2, 140 | "points": false, 141 | "renderer": "flot", 142 | "seriesOverrides": [], 143 | "spaceLength": 10, 144 | "stack": false, 145 | "steppedLine": false, 146 | "targets": [ 147 | { 148 | "expr": "irate(pulsar_function_system_exceptions_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}[5m])", 149 | "hide": false, 150 | "interval": "", 151 | "legendFormat": "system exceptions", 152 | "refId": "A" 153 | }, 154 | { 155 | "expr": "irate(pulsar_function_user_exceptions_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}[5m])", 156 | "hide": false, 157 | "interval": "", 158 | "legendFormat": "user exceptions", 159 | "refId": "B" 160 | } 161 | ], 162 | "thresholds": [], 163 | "timeFrom": null, 164 | "timeRegions": [], 165 | "timeShift": null, 166 | "title": "Functions Exceptions Num", 167 | "tooltip": { 168 | "shared": true, 169 | "sort": 0, 170 | "value_type": "individual" 171 | }, 172 | "transparent": true, 173 | "type": "graph", 174 | "xaxis": { 175 | "buckets": null, 176 | "mode": "time", 177 | "name": null, 178 | "show": true, 179 | "values": [] 180 | }, 181 | "yaxes": [ 182 | { 183 | "decimals": 0, 184 | "format": "none", 185 | "label": null, 186 | "logBase": 1, 187 | "max": null, 188 | "min": "0", 189 | "show": true 190 | }, 191 | { 192 | "format": "short", 193 | "label": null, 194 | "logBase": 1, 195 | "max": null, 196 | "min": null, 197 | "show": false 198 | } 199 | ], 200 | "yaxis": { 201 | "align": false, 202 | "alignLevel": null 203 | } 204 | }, 205 | { 206 | "aliasColors": {}, 207 | "bars": false, 208 | "dashLength": 10, 209 | "dashes": false, 210 | "datasource": "{{ PULSAR_CLUSTER }}", 211 | "fill": 1, 212 | "fillGradient": 0, 213 | "gridPos": { 214 | "h": 9, 215 | "w": 12, 216 | "x": 12, 217 | "y": 0 218 | }, 219 | "hiddenSeries": false, 220 | "id": 2, 221 | "legend": { 222 | "alignAsTable": false, 223 | "avg": false, 224 | "current": true, 225 | "max": false, 226 | "min": false, 227 | "show": true, 228 | "total": false, 229 | "values": true 230 | }, 231 | "lines": true, 232 | "linewidth": 1, 233 | "nullPointMode": "null", 234 | "options": { 235 | "dataLinks": [] 236 | }, 237 | "percentage": false, 238 | "pointradius": 2, 239 | "points": false, 240 | "renderer": "flot", 241 | "seriesOverrides": [], 242 | "spaceLength": 10, 243 | "stack": false, 244 | "steppedLine": false, 245 | "targets": [ 246 | { 247 | "expr": "pulsar_function_process_latency_ms{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}", 248 | "hide": false, 249 | "interval": "", 250 | "legendFormat": "{{ quantile }}", 251 | "refId": "A" 252 | } 253 | ], 254 | "thresholds": [], 255 | "timeFrom": null, 256 | "timeRegions": [], 257 | "timeShift": null, 258 | "title": "Function process latency", 259 | "tooltip": { 260 | "shared": true, 261 | "sort": 0, 262 | "value_type": "individual" 263 | }, 264 | "transparent": true, 265 | "type": "graph", 266 | "xaxis": { 267 | "buckets": null, 268 | "mode": "time", 269 | "name": null, 270 | "show": true, 271 | "values": [] 272 | }, 273 | "yaxes": [ 274 | { 275 | "format": "ms", 276 | "label": null, 277 | "logBase": 2, 278 | "max": null, 279 | "min": null, 280 | "show": true 281 | }, 282 | { 283 | "format": "short", 284 | "label": null, 285 | "logBase": 1, 286 | "max": null, 287 | "min": null, 288 | "show": false 289 | } 290 | ], 291 | "yaxis": { 292 | "align": false, 293 | "alignLevel": null 294 | } 295 | }, 296 | { 297 | "aliasColors": {}, 298 | "bars": false, 299 | "dashLength": 10, 300 | "dashes": false, 301 | "datasource": "{{ PULSAR_CLUSTER }}", 302 | "fill": 1, 303 | "fillGradient": 0, 304 | "gridPos": { 305 | "h": 8, 306 | "w": 12, 307 | "x": 0, 308 | "y": 9 309 | }, 310 | "hiddenSeries": false, 311 | "id": 8, 312 | "legend": { 313 | "avg": false, 314 | "current": false, 315 | "max": false, 316 | "min": false, 317 | "show": true, 318 | "total": false, 319 | "values": false 320 | }, 321 | "lines": true, 322 | "linewidth": 1, 323 | "nullPointMode": "null", 324 | "options": { 325 | "dataLinks": [] 326 | }, 327 | "percentage": false, 328 | "pointradius": 2, 329 | "points": false, 330 | "renderer": "flot", 331 | "seriesOverrides": [], 332 | "spaceLength": 10, 333 | "stack": false, 334 | "steppedLine": false, 335 | "targets": [ 336 | { 337 | "expr": "irate(pulsar_function_received_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"} [30s])", 338 | "interval": "", 339 | "legendFormat": "receive message numbers", 340 | "refId": "A" 341 | } 342 | ], 343 | "thresholds": [], 344 | "timeFrom": null, 345 | "timeRegions": [], 346 | "timeShift": null, 347 | "title": "Received Rate", 348 | "tooltip": { 349 | "shared": true, 350 | "sort": 0, 351 | "value_type": "individual" 352 | }, 353 | "transparent": true, 354 | "type": "graph", 355 | "xaxis": { 356 | "buckets": null, 357 | "mode": "time", 358 | "name": null, 359 | "show": true, 360 | "values": [] 361 | }, 362 | "yaxes": [ 363 | { 364 | "format": "none", 365 | "label": null, 366 | "logBase": 1, 367 | "max": null, 368 | "min": null, 369 | "show": true 370 | }, 371 | { 372 | "format": "short", 373 | "label": null, 374 | "logBase": 1, 375 | "max": null, 376 | "min": null, 377 | "show": true 378 | } 379 | ], 380 | "yaxis": { 381 | "align": false, 382 | "alignLevel": null 383 | } 384 | }, 385 | { 386 | "aliasColors": {}, 387 | "bars": false, 388 | "dashLength": 10, 389 | "dashes": false, 390 | "datasource": "{{ PULSAR_CLUSTER }}", 391 | "fill": 1, 392 | "fillGradient": 0, 393 | "gridPos": { 394 | "h": 8, 395 | "w": 12, 396 | "x": 12, 397 | "y": 9 398 | }, 399 | "hiddenSeries": false, 400 | "id": 6, 401 | "legend": { 402 | "avg": false, 403 | "current": false, 404 | "max": false, 405 | "min": false, 406 | "show": true, 407 | "total": false, 408 | "values": false 409 | }, 410 | "lines": true, 411 | "linewidth": 1, 412 | "nullPointMode": "null", 413 | "options": { 414 | "dataLinks": [] 415 | }, 416 | "percentage": false, 417 | "pointradius": 2, 418 | "points": false, 419 | "renderer": "flot", 420 | "seriesOverrides": [], 421 | "spaceLength": 10, 422 | "stack": false, 423 | "steppedLine": false, 424 | "targets": [ 425 | { 426 | "expr": "irate(pulsar_function_processed_successfully_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"} [30s])", 427 | "interval": "", 428 | "legendFormat": "{{ cluster }}", 429 | "refId": "A" 430 | } 431 | ], 432 | "thresholds": [], 433 | "timeFrom": null, 434 | "timeRegions": [], 435 | "timeShift": null, 436 | "title": "Processed Successfully Rate", 437 | "tooltip": { 438 | "shared": true, 439 | "sort": 0, 440 | "value_type": "individual" 441 | }, 442 | "transparent": true, 443 | "type": "graph", 444 | "xaxis": { 445 | "buckets": null, 446 | "mode": "time", 447 | "name": null, 448 | "show": true, 449 | "values": [] 450 | }, 451 | "yaxes": [ 452 | { 453 | "format": "none", 454 | "label": null, 455 | "logBase": 1, 456 | "max": null, 457 | "min": null, 458 | "show": true 459 | }, 460 | { 461 | "format": "short", 462 | "label": null, 463 | "logBase": 1, 464 | "max": null, 465 | "min": null, 466 | "show": true 467 | } 468 | ], 469 | "yaxis": { 470 | "align": false, 471 | "alignLevel": null 472 | } 473 | } 474 | ], 475 | "schemaVersion": 22, 476 | "style": "dark", 477 | "tags": [], 478 | "templating": { 479 | "list": [ 480 | { 481 | "allValue": null, 482 | "current": {}, 483 | "datasource": "{{ PULSAR_CLUSTER }}", 484 | "definition": "{cluster=~\".+\"}", 485 | "hide": 0, 486 | "includeAll": false, 487 | "index": -1, 488 | "label": "Cluster", 489 | "multi": false, 490 | "name": "cluster", 491 | "options": [], 492 | "query": "{cluster=~\".+\"}", 493 | "refresh": 1, 494 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 495 | "skipUrlSync": false, 496 | "sort": 1, 497 | "tagValuesQuery": "", 498 | "tags": [], 499 | "tagsQuery": "", 500 | "type": "query", 501 | "useTags": false 502 | }, 503 | { 504 | "allValue": null, 505 | "current": {}, 506 | "datasource": "{{ PULSAR_CLUSTER }}", 507 | "definition": "{namespace=~\".+\"}", 508 | "hide": 0, 509 | "includeAll": false, 510 | "index": -1, 511 | "label": "Namespace", 512 | "multi": false, 513 | "name": "namespace", 514 | "options": [], 515 | "query": "{namespace=~\".+\"}", 516 | "refresh": 1, 517 | "regex": "/.*namespace=\\\"([^\\\"]+)\\\".*/", 518 | "skipUrlSync": false, 519 | "sort": 1, 520 | "tagValuesQuery": "", 521 | "tags": [], 522 | "tagsQuery": "", 523 | "type": "query", 524 | "useTags": false 525 | }, 526 | { 527 | "allValue": null, 528 | "current": {}, 529 | "datasource": "{{ PULSAR_CLUSTER }}", 530 | "definition": "{fqfn=~\".+\"}", 531 | "hide": 0, 532 | "includeAll": false, 533 | "index": -1, 534 | "label": "FQFN", 535 | "multi": false, 536 | "name": "fqfn", 537 | "options": [], 538 | "query": "{fqfn=~\".+\"}", 539 | "refresh": 1, 540 | "regex": "/.*fqfn=\\\"([^\\\"]+)\\\".*/", 541 | "skipUrlSync": false, 542 | "sort": 1, 543 | "tagValuesQuery": "", 544 | "tags": [], 545 | "tagsQuery": "", 546 | "type": "query", 547 | "useTags": false 548 | } 549 | ] 550 | }, 551 | "time": { 552 | "from": "now-15m", 553 | "to": "now" 554 | }, 555 | "timepicker": { 556 | "refresh_intervals": [ 557 | "5s", 558 | "10s", 559 | "30s", 560 | "1m", 561 | "5m", 562 | "15m", 563 | "30m", 564 | "1h", 565 | "2h", 566 | "1d" 567 | ] 568 | }, 569 | "timezone": "", 570 | "title": "Pulsar Functions", 571 | "uid": "EyZIXQ6Wk", 572 | "variables": { 573 | "list": [] 574 | }, 575 | "version": 33 576 | } 577 | -------------------------------------------------------------------------------- /dashboards.template/jvm.json.j2: -------------------------------------------------------------------------------- 1 | {%- if PULSAR_CUSTOM_PROMETHEUS not in [ '','no','No','NO','na','NA','false','False','0' ] %} 2 | {#- 3 | If custom change "instance" key to "pod" 4 | This will make graph ledgends display the pod name instead of IP and port information 5 | #} 6 | {%- set CONTEXT = "pod" %} 7 | {%- else %} 8 | {%- set CONTEXT = "instance" %} 9 | {%- endif -%} 10 | { 11 | "__inputs": [ 12 | { 13 | "name": "DS_TEST-CLUSTER", 14 | "label": "{{ PULSAR_CLUSTER }}", 15 | "description": "", 16 | "type": "datasource", 17 | "pluginId": "prometheus", 18 | "pluginName": "Prometheus" 19 | } 20 | ], 21 | "__requires": [ 22 | { 23 | "type": "grafana", 24 | "id": "grafana", 25 | "name": "Grafana", 26 | "version": "5.3.2" 27 | }, 28 | { 29 | "type": "panel", 30 | "id": "graph", 31 | "name": "Graph", 32 | "version": "5.0.0" 33 | }, 34 | { 35 | "type": "datasource", 36 | "id": "prometheus", 37 | "name": "Prometheus", 38 | "version": "5.0.0" 39 | } 40 | ], 41 | "annotations": { 42 | "list": [ 43 | { 44 | "builtIn": 1, 45 | "datasource": "-- Grafana --", 46 | "enable": true, 47 | "hide": true, 48 | "iconColor": "rgba(0, 211, 255, 1)", 49 | "name": "Annotations & Alerts", 50 | "type": "dashboard" 51 | } 52 | ] 53 | }, 54 | "description": "JVM Related Metrics", 55 | "editable": true, 56 | "gnetId": null, 57 | "graphTooltip": 0, 58 | "id": null, 59 | "iteration": 1543910801781, 60 | "links": [], 61 | "panels": [ 62 | { 63 | "collapsed": false, 64 | "gridPos": { 65 | "h": 1, 66 | "w": 24, 67 | "x": 0, 68 | "y": 0 69 | }, 70 | "id": 41, 71 | "panels": [], 72 | "repeat": "instance", 73 | "title": "$job - $instance", 74 | "type": "row" 75 | }, 76 | { 77 | "aliasColors": {}, 78 | "bars": false, 79 | "dashLength": 10, 80 | "dashes": false, 81 | "datasource": "{{ PULSAR_CLUSTER }}", 82 | "decimals": 1, 83 | "fill": 1, 84 | "gridPos": { 85 | "h": 6, 86 | "w": 6, 87 | "x": 0, 88 | "y": 1 89 | }, 90 | "id": 4, 91 | "legend": { 92 | "avg": false, 93 | "current": false, 94 | "max": false, 95 | "min": false, 96 | "show": false, 97 | "total": false, 98 | "values": false 99 | }, 100 | "lines": true, 101 | "linewidth": 1, 102 | "links": [], 103 | "nullPointMode": "null", 104 | "percentage": false, 105 | "pointradius": 5, 106 | "points": false, 107 | "renderer": "flot", 108 | "seriesOverrides": [], 109 | "spaceLength": 10, 110 | "stack": false, 111 | "steppedLine": false, 112 | "targets": [ 113 | { 114 | "expr": "irate(process_cpu_seconds_total{{ '{' }}{{ CONTEXT }}=~\"$instance\"}[30s]) * 100\n\n", 115 | "format": "time_series", 116 | "interval": "", 117 | "intervalFactor": 2, 118 | "legendFormat": "{{ '{{' }} {{ CONTEXT }} {{ '}}' }}", 119 | "metric": "process_cpu_seconds_total", 120 | "refId": "A", 121 | "step": 20 122 | } 123 | ], 124 | "thresholds": [ 125 | { 126 | "colorMode": "ok", 127 | "fill": false, 128 | "line": true, 129 | "op": "gt", 130 | "value": 100 131 | } 132 | ], 133 | "timeFrom": null, 134 | "timeShift": null, 135 | "title": "CPU", 136 | "tooltip": { 137 | "shared": true, 138 | "sort": 0, 139 | "value_type": "individual" 140 | }, 141 | "type": "graph", 142 | "xaxis": { 143 | "buckets": null, 144 | "mode": "time", 145 | "name": null, 146 | "show": true, 147 | "values": [] 148 | }, 149 | "yaxes": [ 150 | { 151 | "format": "percent", 152 | "label": "", 153 | "logBase": 1, 154 | "max": null, 155 | "min": "0", 156 | "show": true 157 | }, 158 | { 159 | "format": "short", 160 | "label": null, 161 | "logBase": 1, 162 | "max": null, 163 | "min": null, 164 | "show": true 165 | } 166 | ], 167 | "yaxis": { 168 | "align": false, 169 | "alignLevel": null 170 | } 171 | }, 172 | { 173 | "aliasColors": {}, 174 | "bars": false, 175 | "dashLength": 10, 176 | "dashes": false, 177 | "datasource": "{{ PULSAR_CLUSTER }}", 178 | "fill": 1, 179 | "gridPos": { 180 | "h": 6, 181 | "w": 6, 182 | "x": 6, 183 | "y": 1 184 | }, 185 | "id": 1, 186 | "legend": { 187 | "alignAsTable": false, 188 | "avg": false, 189 | "current": false, 190 | "hideEmpty": false, 191 | "max": false, 192 | "min": false, 193 | "rightSide": false, 194 | "show": false, 195 | "total": false, 196 | "values": false 197 | }, 198 | "lines": true, 199 | "linewidth": 1, 200 | "links": [], 201 | "nullPointMode": "null", 202 | "percentage": false, 203 | "pointradius": 5, 204 | "points": false, 205 | "renderer": "flot", 206 | "seriesOverrides": [], 207 | "spaceLength": 10, 208 | "stack": false, 209 | "steppedLine": false, 210 | "targets": [ 211 | { 212 | "expr": "sum(jvm_memory_bytes_committed{{ '{' }}{{ CONTEXT }}=~\"$instance\"})", 213 | "format": "time_series", 214 | "hide": false, 215 | "interval": "", 216 | "intervalFactor": 2, 217 | "legendFormat": "Heap size", 218 | "metric": "jvm_memory_bytes_committed", 219 | "refId": "A", 220 | "step": 20 221 | }, 222 | { 223 | "expr": "sum(jvm_memory_bytes_used{{ '{' }}{{ CONTEXT }}=~\"$instance\"})", 224 | "format": "time_series", 225 | "interval": "", 226 | "intervalFactor": 2, 227 | "legendFormat": "Used", 228 | "metric": "jvm_memory_bytes_used", 229 | "refId": "B", 230 | "step": 20 231 | }, 232 | { 233 | "expr": "sum(jvm_memory_bytes_max{{ '{' }}{{ CONTEXT }}=~\"$instance\"})", 234 | "format": "time_series", 235 | "interval": "", 236 | "intervalFactor": 2, 237 | "legendFormat": "Max", 238 | "metric": "jvm_memory_bytes_max", 239 | "refId": "C", 240 | "step": 20 241 | } 242 | ], 243 | "thresholds": [], 244 | "timeFrom": null, 245 | "timeShift": null, 246 | "title": "Heap Memory", 247 | "tooltip": { 248 | "shared": true, 249 | "sort": 0, 250 | "value_type": "individual" 251 | }, 252 | "type": "graph", 253 | "xaxis": { 254 | "buckets": null, 255 | "mode": "time", 256 | "name": null, 257 | "show": true, 258 | "values": [] 259 | }, 260 | "yaxes": [ 261 | { 262 | "format": "decbytes", 263 | "label": "", 264 | "logBase": 1, 265 | "max": null, 266 | "min": null, 267 | "show": true 268 | }, 269 | { 270 | "format": "short", 271 | "label": null, 272 | "logBase": 1, 273 | "max": null, 274 | "min": null, 275 | "show": false 276 | } 277 | ], 278 | "yaxis": { 279 | "align": false, 280 | "alignLevel": null 281 | } 282 | }, 283 | { 284 | "aliasColors": {}, 285 | "bars": false, 286 | "dashLength": 10, 287 | "dashes": false, 288 | "datasource": "{{ PULSAR_CLUSTER }}", 289 | "fill": 1, 290 | "gridPos": { 291 | "h": 6, 292 | "w": 6, 293 | "x": 12, 294 | "y": 1 295 | }, 296 | "id": 2, 297 | "legend": { 298 | "avg": false, 299 | "current": false, 300 | "max": false, 301 | "min": false, 302 | "show": false, 303 | "total": false, 304 | "values": false 305 | }, 306 | "lines": true, 307 | "linewidth": 1, 308 | "links": [], 309 | "nullPointMode": "null", 310 | "percentage": false, 311 | "pointradius": 5, 312 | "points": false, 313 | "renderer": "flot", 314 | "seriesOverrides": [], 315 | "spaceLength": 10, 316 | "stack": false, 317 | "steppedLine": false, 318 | "targets": [ 319 | { 320 | "expr": "jvm_memory_direct_bytes_used{{ '{' }}{{ CONTEXT }}=~\"$instance\"}", 321 | "format": "time_series", 322 | "interval": "", 323 | "intervalFactor": 2, 324 | "legendFormat": "Used", 325 | "metric": "jvm_memory_direct_bytes_used", 326 | "refId": "A", 327 | "step": 20 328 | }, 329 | { 330 | "expr": "jvm_memory_direct_bytes_max{{ '{' }}{{ CONTEXT }}=~\"$instance\"}", 331 | "format": "time_series", 332 | "interval": "", 333 | "intervalFactor": 2, 334 | "legendFormat": "Max", 335 | "metric": "jvm_memory_direct_bytes_max", 336 | "refId": "B", 337 | "step": 20 338 | } 339 | ], 340 | "thresholds": [], 341 | "timeFrom": null, 342 | "timeShift": null, 343 | "title": "Direct Memory", 344 | "tooltip": { 345 | "shared": true, 346 | "sort": 0, 347 | "value_type": "individual" 348 | }, 349 | "type": "graph", 350 | "xaxis": { 351 | "buckets": null, 352 | "mode": "time", 353 | "name": null, 354 | "show": true, 355 | "values": [] 356 | }, 357 | "yaxes": [ 358 | { 359 | "format": "decbytes", 360 | "label": "", 361 | "logBase": 1, 362 | "max": null, 363 | "min": null, 364 | "show": true 365 | }, 366 | { 367 | "format": "short", 368 | "label": "", 369 | "logBase": 1, 370 | "max": null, 371 | "min": null, 372 | "show": true 373 | } 374 | ], 375 | "yaxis": { 376 | "align": false, 377 | "alignLevel": null 378 | } 379 | }, 380 | { 381 | "aliasColors": {}, 382 | "bars": false, 383 | "dashLength": 10, 384 | "dashes": false, 385 | "datasource": "{{ PULSAR_CLUSTER }}", 386 | "fill": 1, 387 | "gridPos": { 388 | "h": 6, 389 | "w": 6, 390 | "x": 18, 391 | "y": 1 392 | }, 393 | "id": 3, 394 | "legend": { 395 | "avg": false, 396 | "current": false, 397 | "max": false, 398 | "min": false, 399 | "show": false, 400 | "total": false, 401 | "values": false 402 | }, 403 | "lines": true, 404 | "linewidth": 1, 405 | "links": [], 406 | "nullPointMode": "null", 407 | "percentage": false, 408 | "pointradius": 5, 409 | "points": false, 410 | "renderer": "flot", 411 | "seriesOverrides": [ 412 | { 413 | "alias": "old count", 414 | "yaxis": 2 415 | }, 416 | { 417 | "alias": "young count", 418 | "yaxis": 2 419 | } 420 | ], 421 | "spaceLength": 10, 422 | "stack": false, 423 | "steppedLine": false, 424 | "targets": [ 425 | { 426 | "expr": "sum(increase(jvm_gc_collection_seconds_sum{{ '{' }}{{ CONTEXT }}=~\"$instance\"}[30s]))", 427 | "format": "time_series", 428 | "hide": false, 429 | "interval": "", 430 | "intervalFactor": 2, 431 | "legendFormat": "Pause", 432 | "metric": "jvm_gc_collection_seconds_count", 433 | "refId": "B", 434 | "step": 20 435 | } 436 | ], 437 | "thresholds": [], 438 | "timeFrom": null, 439 | "timeShift": null, 440 | "title": "GC Pauses", 441 | "tooltip": { 442 | "shared": true, 443 | "sort": 0, 444 | "value_type": "individual" 445 | }, 446 | "type": "graph", 447 | "xaxis": { 448 | "buckets": null, 449 | "mode": "time", 450 | "name": null, 451 | "show": true, 452 | "values": [] 453 | }, 454 | "yaxes": [ 455 | { 456 | "format": "s", 457 | "label": "", 458 | "logBase": 1, 459 | "max": null, 460 | "min": "0", 461 | "show": true 462 | }, 463 | { 464 | "format": "short", 465 | "label": "", 466 | "logBase": 1, 467 | "max": null, 468 | "min": "0", 469 | "show": false 470 | } 471 | ], 472 | "yaxis": { 473 | "align": false, 474 | "alignLevel": null 475 | } 476 | } 477 | ], 478 | "refresh": "1m", 479 | "schemaVersion": 16, 480 | "style": "dark", 481 | "tags": [ 482 | "jvm" 483 | ], 484 | "templating": { 485 | "list": [ 486 | { 487 | "allValue": null, 488 | "current": {}, 489 | "datasource": "{{ PULSAR_CLUSTER }}", 490 | "hide": 0, 491 | "includeAll": true, 492 | "label": "Cluster", 493 | "multi": false, 494 | "name": "cluster", 495 | "options": [], 496 | "query": "jvm_memory_bytes_used{cluster=~\".+\"}", 497 | "refresh": 1, 498 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 499 | "skipUrlSync": false, 500 | "sort": 0, 501 | "tagValuesQuery": "", 502 | "tags": [], 503 | "tagsQuery": "", 504 | "type": "query", 505 | "useTags": false 506 | }, 507 | { 508 | "allValue": null, 509 | "current": {}, 510 | "datasource": "{{ PULSAR_CLUSTER }}", 511 | "hide": 0, 512 | "includeAll": true, 513 | "label": "Job", 514 | "multi": false, 515 | "name": "job", 516 | "options": [], 517 | "query": "jvm_memory_bytes_used{job=~\".+\"}", 518 | "refresh": 1, 519 | "regex": "/.*[^_]job=\\\"([^\\\"]+)\\\".*/", 520 | "skipUrlSync": false, 521 | "sort": 1, 522 | "tagValuesQuery": "", 523 | "tags": [], 524 | "tagsQuery": "", 525 | "type": "query", 526 | "useTags": false 527 | }, 528 | { 529 | "allValue": null, 530 | "current": {}, 531 | "datasource": "{{ PULSAR_CLUSTER }}", 532 | "hide": 0, 533 | "includeAll": true, 534 | "label": "Instance", 535 | "multi": true, 536 | "name": "instance", 537 | "options": [], 538 | "query": "jvm_memory_bytes_used{job=~\"$job\", {{ CONTEXT }}=~\".+\"}", 539 | "refresh": 2, 540 | "regex": "/.*[^_]instance=\\\"([^\\\"]+)\\\".*/", 541 | "skipUrlSync": false, 542 | "sort": 1, 543 | "tagValuesQuery": "", 544 | "tags": [], 545 | "tagsQuery": "", 546 | "type": "query", 547 | "useTags": false 548 | } 549 | ] 550 | }, 551 | "time": { 552 | "from": "now-1h", 553 | "to": "now" 554 | }, 555 | "timepicker": { 556 | "refresh_intervals": [ 557 | "5s", 558 | "10s", 559 | "30s", 560 | "1m", 561 | "5m", 562 | "15m", 563 | "30m", 564 | "1h", 565 | "2h", 566 | "1d" 567 | ], 568 | "time_options": [ 569 | "5m", 570 | "15m", 571 | "1h", 572 | "6h", 573 | "12h", 574 | "24h", 575 | "2d", 576 | "7d", 577 | "30d" 578 | ] 579 | }, 580 | "timezone": "browser", 581 | "title": "JVM Metrics", 582 | "uid": "S9e71oLmk", 583 | "version": 9 584 | } 585 | -------------------------------------------------------------------------------- /dashboards.template/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "$$hashKey": "object:29", 6 | "builtIn": 1, 7 | "datasource": "-- Grafana --", 8 | "enable": true, 9 | "hide": true, 10 | "iconColor": "rgba(0, 211, 255, 1)", 11 | "name": "Annotations & Alerts", 12 | "type": "dashboard" 13 | } 14 | ] 15 | }, 16 | "editable": true, 17 | "gnetId": null, 18 | "graphTooltip": 0, 19 | "iteration": 1588939992919, 20 | "links": [], 21 | "panels": [ 22 | { 23 | "aliasColors": {}, 24 | "bars": false, 25 | "dashLength": 10, 26 | "dashes": false, 27 | "datasource": "{{ GF_LOKI_DATASOURCE_NAME }}", 28 | "fill": 1, 29 | "fillGradient": 0, 30 | "gridPos": { 31 | "h": 6, 32 | "w": 24, 33 | "x": 0, 34 | "y": 0 35 | }, 36 | "hiddenSeries": false, 37 | "id": 2, 38 | "legend": { 39 | "avg": false, 40 | "current": false, 41 | "max": false, 42 | "min": false, 43 | "show": true, 44 | "total": false, 45 | "values": false 46 | }, 47 | "lines": true, 48 | "linewidth": 1, 49 | "nullPointMode": "null", 50 | "options": { 51 | "dataLinks": [] 52 | }, 53 | "percentage": false, 54 | "pointradius": 2, 55 | "points": false, 56 | "renderer": "flot", 57 | "seriesOverrides": [], 58 | "spaceLength": 10, 59 | "stack": false, 60 | "steppedLine": false, 61 | "targets": [ 62 | { 63 | "expr": "sum(rate({cluster=\"$cluster\"}[5m]))", 64 | "refId": "A" 65 | } 66 | ], 67 | "thresholds": [], 68 | "timeFrom": null, 69 | "timeRegions": [], 70 | "timeShift": null, 71 | "title": "Logs Rate", 72 | "tooltip": { 73 | "shared": true, 74 | "sort": 0, 75 | "value_type": "individual" 76 | }, 77 | "type": "graph", 78 | "xaxis": { 79 | "buckets": null, 80 | "mode": "time", 81 | "name": null, 82 | "show": true, 83 | "values": [] 84 | }, 85 | "yaxes": [ 86 | { 87 | "format": "short", 88 | "label": null, 89 | "logBase": 1, 90 | "max": null, 91 | "min": null, 92 | "show": true 93 | }, 94 | { 95 | "format": "short", 96 | "label": null, 97 | "logBase": 1, 98 | "max": null, 99 | "min": null, 100 | "show": true 101 | } 102 | ], 103 | "yaxis": { 104 | "align": false, 105 | "alignLevel": null 106 | } 107 | }, 108 | { 109 | "datasource": "{{ GF_LOKI_DATASOURCE_NAME }}", 110 | "gridPos": { 111 | "h": 15, 112 | "w": 24, 113 | "x": 0, 114 | "y": 6 115 | }, 116 | "id": 4, 117 | "options": { 118 | "showLabels": false, 119 | "showTime": true, 120 | "sortOrder": "Descending", 121 | "wrapLogMessage": true 122 | }, 123 | "targets": [ 124 | { 125 | "expr": "{component=\"$component\", cluster=\"$cluster\", app=\"pulsar\"}", 126 | "refId": "A" 127 | } 128 | ], 129 | "timeFrom": null, 130 | "timeShift": null, 131 | "title": "Logs", 132 | "type": "logs" 133 | } 134 | ], 135 | "schemaVersion": 22, 136 | "style": "dark", 137 | "tags": [], 138 | "templating": { 139 | "list": [ 140 | { 141 | "allValue": null, 142 | "current": {}, 143 | "datasource": "{{ PULSAR_CLUSTER }}", 144 | "definition": "jvm_memory_bytes_used{job=~\".+\"}", 145 | "hide": 0, 146 | "includeAll": false, 147 | "index": -1, 148 | "label": "Component", 149 | "multi": false, 150 | "name": "component", 151 | "options": [], 152 | "query": "jvm_memory_bytes_used{job=~\".+\"}", 153 | "refresh": 1, 154 | "regex": "/.*[^_]job=\\\"([^\\\"]+)\\\".*/", 155 | "skipUrlSync": false, 156 | "sort": 1, 157 | "tagValuesQuery": "", 158 | "tags": [], 159 | "tagsQuery": "", 160 | "type": "query", 161 | "useTags": false 162 | }, 163 | { 164 | "allValue": null, 165 | "current": {}, 166 | "datasource": "{{ PULSAR_CLUSTER }}", 167 | "definition": "jvm_memory_bytes_used{cluster=~\".+\"}", 168 | "hide": 0, 169 | "includeAll": false, 170 | "index": -1, 171 | "label": "Cluster", 172 | "multi": false, 173 | "name": "cluster", 174 | "options": [], 175 | "query": "jvm_memory_bytes_used{cluster=~\".+\"}", 176 | "refresh": 1, 177 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 178 | "skipUrlSync": false, 179 | "sort": 1, 180 | "tagValuesQuery": "", 181 | "tags": [], 182 | "tagsQuery": "", 183 | "type": "query", 184 | "useTags": false 185 | } 186 | ] 187 | }, 188 | "time": { 189 | "from": "now-6h", 190 | "to": "now" 191 | }, 192 | "timepicker": { 193 | "refresh_intervals": [ 194 | "5s", 195 | "10s", 196 | "30s", 197 | "1m", 198 | "5m", 199 | "15m", 200 | "30m", 201 | "1h", 202 | "2h", 203 | "1d" 204 | ] 205 | }, 206 | "timezone": "", 207 | "title": "Pulsar Logs", 208 | "uid": "AIPqpE3Zk", 209 | "variables": { 210 | "list": [] 211 | }, 212 | "version": 2 213 | } 214 | -------------------------------------------------------------------------------- /dashboards.template/pulsar_detector.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "editable": true, 16 | "gnetId": null, 17 | "graphTooltip": 0, 18 | "id": 1, 19 | "links": [], 20 | "panels": [ 21 | { 22 | "cacheTimeout": null, 23 | "datasource": "{{ PULSAR_CLUSTER }}", 24 | "gridPos": { 25 | "h": 8, 26 | "w": 5, 27 | "x": 0, 28 | "y": 0 29 | }, 30 | "id": 6, 31 | "interval": "", 32 | "links": [], 33 | "options": { 34 | "fieldOptions": { 35 | "calcs": [ 36 | "sum" 37 | ], 38 | "defaults": { 39 | "mappings": [ 40 | { 41 | "id": 0, 42 | "op": "=", 43 | "text": "0", 44 | "type": 1, 45 | "value": "null" 46 | } 47 | ], 48 | "min": 0, 49 | "nullValueMode": "connected", 50 | "thresholds": { 51 | "mode": "absolute", 52 | "steps": [ 53 | { 54 | "color": "#299c46", 55 | "value": null 56 | }, 57 | { 58 | "color": "#FADE2A", 59 | "value": 50 60 | }, 61 | { 62 | "color": "#EAB839", 63 | "value": 500 64 | }, 65 | { 66 | "color": "#F2495C", 67 | "value": 5000 68 | } 69 | ] 70 | }, 71 | "title": "", 72 | "unit": "none" 73 | }, 74 | "overrides": [], 75 | "values": false 76 | }, 77 | "orientation": "horizontal", 78 | "showThresholdLabels": false, 79 | "showThresholdMarkers": false 80 | }, 81 | "pluginVersion": "6.7.3", 82 | "targets": [ 83 | { 84 | "expr": "sum(pulsar_detector_e2e_latency_ms_count{success=\"false\"}-pulsar_detector_e2e_latency_ms_count{success=\"false\"} offset 5m)", 85 | "interval": "", 86 | "legendFormat": "", 87 | "refId": "A" 88 | } 89 | ], 90 | "timeFrom": null, 91 | "timeShift": null, 92 | "title": "e2e failure count", 93 | "transparent": true, 94 | "type": "gauge" 95 | }, 96 | { 97 | "aliasColors": {}, 98 | "bars": false, 99 | "dashLength": 10, 100 | "dashes": false, 101 | "datasource": "{{ PULSAR_CLUSTER }}", 102 | "fill": 1, 103 | "fillGradient": 0, 104 | "gridPos": { 105 | "h": 8, 106 | "w": 10, 107 | "x": 5, 108 | "y": 0 109 | }, 110 | "hiddenSeries": false, 111 | "id": 4, 112 | "legend": { 113 | "alignAsTable": false, 114 | "avg": false, 115 | "current": true, 116 | "max": false, 117 | "min": false, 118 | "show": true, 119 | "total": false, 120 | "values": true 121 | }, 122 | "lines": true, 123 | "linewidth": 1, 124 | "nullPointMode": "connected", 125 | "options": { 126 | "dataLinks": [] 127 | }, 128 | "percentage": false, 129 | "pointradius": 2, 130 | "points": false, 131 | "renderer": "flot", 132 | "seriesOverrides": [], 133 | "spaceLength": 10, 134 | "stack": false, 135 | "steppedLine": false, 136 | "targets": [ 137 | { 138 | "expr": "pulsar_detector_publish_latency_ms", 139 | "format": "time_series", 140 | "instant": false, 141 | "interval": "", 142 | "intervalFactor": 1, 143 | "legendFormat": "{{ quantile }}", 144 | "refId": "A" 145 | } 146 | ], 147 | "thresholds": [], 148 | "timeFrom": null, 149 | "timeRegions": [], 150 | "timeShift": null, 151 | "title": "publish_latency", 152 | "tooltip": { 153 | "shared": true, 154 | "sort": 0, 155 | "value_type": "individual" 156 | }, 157 | "transparent": true, 158 | "type": "graph", 159 | "xaxis": { 160 | "buckets": null, 161 | "mode": "time", 162 | "name": null, 163 | "show": true, 164 | "values": [] 165 | }, 166 | "yaxes": [ 167 | { 168 | "decimals": null, 169 | "format": "ms", 170 | "label": null, 171 | "logBase": 10, 172 | "max": null, 173 | "min": null, 174 | "show": true 175 | }, 176 | { 177 | "format": "short", 178 | "label": null, 179 | "logBase": 1, 180 | "max": null, 181 | "min": null, 182 | "show": false 183 | } 184 | ], 185 | "yaxis": { 186 | "align": false, 187 | "alignLevel": null 188 | } 189 | }, 190 | { 191 | "aliasColors": {}, 192 | "bars": false, 193 | "dashLength": 10, 194 | "dashes": false, 195 | "datasource": "{{ PULSAR_CLUSTER }}", 196 | "description": "", 197 | "fill": 1, 198 | "fillGradient": 0, 199 | "gridPos": { 200 | "h": 8, 201 | "w": 9, 202 | "x": 15, 203 | "y": 0 204 | }, 205 | "hiddenSeries": false, 206 | "id": 2, 207 | "legend": { 208 | "alignAsTable": false, 209 | "avg": false, 210 | "current": true, 211 | "max": false, 212 | "min": false, 213 | "rightSide": false, 214 | "show": true, 215 | "sort": "max", 216 | "sortDesc": false, 217 | "total": false, 218 | "values": true 219 | }, 220 | "lines": true, 221 | "linewidth": 1, 222 | "nullPointMode": "connected", 223 | "options": { 224 | "dataLinks": [] 225 | }, 226 | "percentage": false, 227 | "pointradius": 2, 228 | "points": false, 229 | "renderer": "flot", 230 | "seriesOverrides": [], 231 | "spaceLength": 10, 232 | "stack": false, 233 | "steppedLine": false, 234 | "targets": [ 235 | { 236 | "expr": "pulsar_detector_e2e_latency_ms", 237 | "interval": "", 238 | "legendFormat": "{{ quantile }}", 239 | "refId": "B" 240 | } 241 | ], 242 | "thresholds": [], 243 | "timeFrom": null, 244 | "timeRegions": [], 245 | "timeShift": null, 246 | "title": "e2e_latency", 247 | "tooltip": { 248 | "shared": true, 249 | "sort": 0, 250 | "value_type": "individual" 251 | }, 252 | "transparent": true, 253 | "type": "graph", 254 | "xaxis": { 255 | "buckets": null, 256 | "min": null, 257 | "mode": "time", 258 | "name": null, 259 | "show": true, 260 | "values": [] 261 | }, 262 | "yaxes": [ 263 | { 264 | "format": "ms", 265 | "label": null, 266 | "logBase": 2, 267 | "max": null, 268 | "min": null, 269 | "show": true 270 | }, 271 | { 272 | "format": "none", 273 | "label": null, 274 | "logBase": 1, 275 | "max": null, 276 | "min": null, 277 | "show": false 278 | } 279 | ], 280 | "yaxis": { 281 | "align": false, 282 | "alignLevel": null 283 | } 284 | } 285 | ], 286 | "schemaVersion": 22, 287 | "style": "dark", 288 | "tags": [], 289 | "templating": { 290 | "list": [] 291 | }, 292 | "time": { 293 | "from": "now-6h", 294 | "to": "now" 295 | }, 296 | "timepicker": { 297 | "refresh_intervals": [ 298 | "5s", 299 | "10s", 300 | "30s", 301 | "1m", 302 | "5m", 303 | "15m", 304 | "30m", 305 | "1h", 306 | "2h", 307 | "1d" 308 | ] 309 | }, 310 | "timezone": "", 311 | "title": "pulsar_detector", 312 | "uid": "CKmGks6Wk", 313 | "variables": { 314 | "list": [] 315 | }, 316 | "version": 35 317 | } 318 | -------------------------------------------------------------------------------- /dashboards/functions.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "editable": true, 16 | "gnetId": null, 17 | "graphTooltip": 0, 18 | "id": 10, 19 | "iteration": 1588844930760, 20 | "links": [], 21 | "panels": [ 22 | { 23 | "cacheTimeout": null, 24 | "colorBackground": false, 25 | "colorValue": true, 26 | "colors": [ 27 | "#299c46", 28 | "rgba(237, 129, 40, 0.89)", 29 | "#d44a3a" 30 | ], 31 | "datasource": "{{ PULSAR_CLUSTER }}", 32 | "format": "dateTimeAsIso", 33 | "gauge": { 34 | "maxValue": 100, 35 | "minValue": 0, 36 | "show": false, 37 | "thresholdLabels": false, 38 | "thresholdMarkers": true 39 | }, 40 | "gridPos": { 41 | "h": 9, 42 | "w": 4, 43 | "x": 0, 44 | "y": 0 45 | }, 46 | "id": 4, 47 | "interval": null, 48 | "links": [], 49 | "mappingType": 1, 50 | "mappingTypes": [ 51 | { 52 | "name": "value to text", 53 | "value": 1 54 | }, 55 | { 56 | "name": "range to text", 57 | "value": 2 58 | } 59 | ], 60 | "maxDataPoints": 100, 61 | "nullPointMode": "connected", 62 | "nullText": null, 63 | "postfix": "", 64 | "postfixFontSize": "50%", 65 | "prefix": "", 66 | "prefixFontSize": "50%", 67 | "rangeMaps": [ 68 | { 69 | "from": "null", 70 | "text": "N/A", 71 | "to": "null" 72 | } 73 | ], 74 | "sparkline": { 75 | "fillColor": "rgba(31, 118, 189, 0.18)", 76 | "full": false, 77 | "lineColor": "rgb(31, 120, 193)", 78 | "show": false, 79 | "ymax": null, 80 | "ymin": null 81 | }, 82 | "tableColumn": "", 83 | "targets": [ 84 | { 85 | "expr": "pulsar_function_last_invocation{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}", 86 | "interval": "", 87 | "legendFormat": "{{ fqfn }}", 88 | "refId": "A" 89 | } 90 | ], 91 | "thresholds": "", 92 | "timeFrom": null, 93 | "timeShift": null, 94 | "title": "Function Last Invocation", 95 | "transparent": true, 96 | "type": "singlestat", 97 | "valueFontSize": "80%", 98 | "valueMaps": [ 99 | { 100 | "op": "=", 101 | "text": "N/A", 102 | "value": "null" 103 | } 104 | ], 105 | "valueName": "current" 106 | }, 107 | { 108 | "aliasColors": {}, 109 | "bars": false, 110 | "dashLength": 10, 111 | "dashes": false, 112 | "datasource": "{{ PULSAR_CLUSTER }}", 113 | "fill": 1, 114 | "fillGradient": 0, 115 | "gridPos": { 116 | "h": 9, 117 | "w": 7, 118 | "x": 4, 119 | "y": 0 120 | }, 121 | "hiddenSeries": false, 122 | "id": 10, 123 | "legend": { 124 | "avg": false, 125 | "current": false, 126 | "max": false, 127 | "min": false, 128 | "show": true, 129 | "total": true, 130 | "values": true 131 | }, 132 | "lines": true, 133 | "linewidth": 1, 134 | "nullPointMode": "null", 135 | "options": { 136 | "dataLinks": [] 137 | }, 138 | "percentage": false, 139 | "pointradius": 2, 140 | "points": false, 141 | "renderer": "flot", 142 | "seriesOverrides": [], 143 | "spaceLength": 10, 144 | "stack": false, 145 | "steppedLine": false, 146 | "targets": [ 147 | { 148 | "expr": "irate(pulsar_function_system_exceptions_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}[5m])", 149 | "hide": false, 150 | "interval": "", 151 | "legendFormat": "system exceptions", 152 | "refId": "A" 153 | }, 154 | { 155 | "expr": "irate(pulsar_function_user_exceptions_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}[5m])", 156 | "hide": false, 157 | "interval": "", 158 | "legendFormat": "user exceptions", 159 | "refId": "B" 160 | } 161 | ], 162 | "thresholds": [], 163 | "timeFrom": null, 164 | "timeRegions": [], 165 | "timeShift": null, 166 | "title": "Functions Exceptions Num", 167 | "tooltip": { 168 | "shared": true, 169 | "sort": 0, 170 | "value_type": "individual" 171 | }, 172 | "transparent": true, 173 | "type": "graph", 174 | "xaxis": { 175 | "buckets": null, 176 | "mode": "time", 177 | "name": null, 178 | "show": true, 179 | "values": [] 180 | }, 181 | "yaxes": [ 182 | { 183 | "decimals": 0, 184 | "format": "none", 185 | "label": null, 186 | "logBase": 1, 187 | "max": null, 188 | "min": "0", 189 | "show": true 190 | }, 191 | { 192 | "format": "short", 193 | "label": null, 194 | "logBase": 1, 195 | "max": null, 196 | "min": null, 197 | "show": false 198 | } 199 | ], 200 | "yaxis": { 201 | "align": false, 202 | "alignLevel": null 203 | } 204 | }, 205 | { 206 | "aliasColors": {}, 207 | "bars": false, 208 | "dashLength": 10, 209 | "dashes": false, 210 | "datasource": "{{ PULSAR_CLUSTER }}", 211 | "fill": 1, 212 | "fillGradient": 0, 213 | "gridPos": { 214 | "h": 9, 215 | "w": 12, 216 | "x": 12, 217 | "y": 0 218 | }, 219 | "hiddenSeries": false, 220 | "id": 2, 221 | "legend": { 222 | "alignAsTable": false, 223 | "avg": false, 224 | "current": true, 225 | "max": false, 226 | "min": false, 227 | "show": true, 228 | "total": false, 229 | "values": true 230 | }, 231 | "lines": true, 232 | "linewidth": 1, 233 | "nullPointMode": "null", 234 | "options": { 235 | "dataLinks": [] 236 | }, 237 | "percentage": false, 238 | "pointradius": 2, 239 | "points": false, 240 | "renderer": "flot", 241 | "seriesOverrides": [], 242 | "spaceLength": 10, 243 | "stack": false, 244 | "steppedLine": false, 245 | "targets": [ 246 | { 247 | "expr": "pulsar_function_process_latency_ms{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"}", 248 | "hide": false, 249 | "interval": "", 250 | "legendFormat": "{{ quantile }}", 251 | "refId": "A" 252 | } 253 | ], 254 | "thresholds": [], 255 | "timeFrom": null, 256 | "timeRegions": [], 257 | "timeShift": null, 258 | "title": "Function process latency", 259 | "tooltip": { 260 | "shared": true, 261 | "sort": 0, 262 | "value_type": "individual" 263 | }, 264 | "transparent": true, 265 | "type": "graph", 266 | "xaxis": { 267 | "buckets": null, 268 | "mode": "time", 269 | "name": null, 270 | "show": true, 271 | "values": [] 272 | }, 273 | "yaxes": [ 274 | { 275 | "format": "ms", 276 | "label": null, 277 | "logBase": 2, 278 | "max": null, 279 | "min": null, 280 | "show": true 281 | }, 282 | { 283 | "format": "short", 284 | "label": null, 285 | "logBase": 1, 286 | "max": null, 287 | "min": null, 288 | "show": false 289 | } 290 | ], 291 | "yaxis": { 292 | "align": false, 293 | "alignLevel": null 294 | } 295 | }, 296 | { 297 | "aliasColors": {}, 298 | "bars": false, 299 | "dashLength": 10, 300 | "dashes": false, 301 | "datasource": "{{ PULSAR_CLUSTER }}", 302 | "fill": 1, 303 | "fillGradient": 0, 304 | "gridPos": { 305 | "h": 8, 306 | "w": 12, 307 | "x": 0, 308 | "y": 9 309 | }, 310 | "hiddenSeries": false, 311 | "id": 8, 312 | "legend": { 313 | "avg": false, 314 | "current": false, 315 | "max": false, 316 | "min": false, 317 | "show": true, 318 | "total": false, 319 | "values": false 320 | }, 321 | "lines": true, 322 | "linewidth": 1, 323 | "nullPointMode": "null", 324 | "options": { 325 | "dataLinks": [] 326 | }, 327 | "percentage": false, 328 | "pointradius": 2, 329 | "points": false, 330 | "renderer": "flot", 331 | "seriesOverrides": [], 332 | "spaceLength": 10, 333 | "stack": false, 334 | "steppedLine": false, 335 | "targets": [ 336 | { 337 | "expr": "irate(pulsar_function_received_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"} [30s])", 338 | "interval": "", 339 | "legendFormat": "receive message numbers", 340 | "refId": "A" 341 | } 342 | ], 343 | "thresholds": [], 344 | "timeFrom": null, 345 | "timeRegions": [], 346 | "timeShift": null, 347 | "title": "Received Rate", 348 | "tooltip": { 349 | "shared": true, 350 | "sort": 0, 351 | "value_type": "individual" 352 | }, 353 | "transparent": true, 354 | "type": "graph", 355 | "xaxis": { 356 | "buckets": null, 357 | "mode": "time", 358 | "name": null, 359 | "show": true, 360 | "values": [] 361 | }, 362 | "yaxes": [ 363 | { 364 | "format": "none", 365 | "label": null, 366 | "logBase": 1, 367 | "max": null, 368 | "min": null, 369 | "show": true 370 | }, 371 | { 372 | "format": "short", 373 | "label": null, 374 | "logBase": 1, 375 | "max": null, 376 | "min": null, 377 | "show": true 378 | } 379 | ], 380 | "yaxis": { 381 | "align": false, 382 | "alignLevel": null 383 | } 384 | }, 385 | { 386 | "aliasColors": {}, 387 | "bars": false, 388 | "dashLength": 10, 389 | "dashes": false, 390 | "datasource": "{{ PULSAR_CLUSTER }}", 391 | "fill": 1, 392 | "fillGradient": 0, 393 | "gridPos": { 394 | "h": 8, 395 | "w": 12, 396 | "x": 12, 397 | "y": 9 398 | }, 399 | "hiddenSeries": false, 400 | "id": 6, 401 | "legend": { 402 | "avg": false, 403 | "current": false, 404 | "max": false, 405 | "min": false, 406 | "show": true, 407 | "total": false, 408 | "values": false 409 | }, 410 | "lines": true, 411 | "linewidth": 1, 412 | "nullPointMode": "null", 413 | "options": { 414 | "dataLinks": [] 415 | }, 416 | "percentage": false, 417 | "pointradius": 2, 418 | "points": false, 419 | "renderer": "flot", 420 | "seriesOverrides": [], 421 | "spaceLength": 10, 422 | "stack": false, 423 | "steppedLine": false, 424 | "targets": [ 425 | { 426 | "expr": "irate(pulsar_function_processed_successfully_total{cluster=~\"$cluster\", namespace=~\"$namespace\", fqfn=~\"$fqfn\"} [30s])", 427 | "interval": "", 428 | "legendFormat": "{{ cluster }}", 429 | "refId": "A" 430 | } 431 | ], 432 | "thresholds": [], 433 | "timeFrom": null, 434 | "timeRegions": [], 435 | "timeShift": null, 436 | "title": "Processed Successfully Rate", 437 | "tooltip": { 438 | "shared": true, 439 | "sort": 0, 440 | "value_type": "individual" 441 | }, 442 | "transparent": true, 443 | "type": "graph", 444 | "xaxis": { 445 | "buckets": null, 446 | "mode": "time", 447 | "name": null, 448 | "show": true, 449 | "values": [] 450 | }, 451 | "yaxes": [ 452 | { 453 | "format": "none", 454 | "label": null, 455 | "logBase": 1, 456 | "max": null, 457 | "min": null, 458 | "show": true 459 | }, 460 | { 461 | "format": "short", 462 | "label": null, 463 | "logBase": 1, 464 | "max": null, 465 | "min": null, 466 | "show": true 467 | } 468 | ], 469 | "yaxis": { 470 | "align": false, 471 | "alignLevel": null 472 | } 473 | } 474 | ], 475 | "schemaVersion": 22, 476 | "style": "dark", 477 | "tags": [], 478 | "templating": { 479 | "list": [ 480 | { 481 | "allValue": null, 482 | "current": {}, 483 | "datasource": "{{ PULSAR_CLUSTER }}", 484 | "definition": "{cluster=~\".+\"}", 485 | "hide": 0, 486 | "includeAll": false, 487 | "index": -1, 488 | "label": "Cluster", 489 | "multi": false, 490 | "name": "cluster", 491 | "options": [], 492 | "query": "{cluster=~\".+\"}", 493 | "refresh": 1, 494 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 495 | "skipUrlSync": false, 496 | "sort": 1, 497 | "tagValuesQuery": "", 498 | "tags": [], 499 | "tagsQuery": "", 500 | "type": "query", 501 | "useTags": false 502 | }, 503 | { 504 | "allValue": null, 505 | "current": {}, 506 | "datasource": "{{ PULSAR_CLUSTER }}", 507 | "definition": "{namespace=~\".+\"}", 508 | "hide": 0, 509 | "includeAll": false, 510 | "index": -1, 511 | "label": "Namespace", 512 | "multi": false, 513 | "name": "namespace", 514 | "options": [], 515 | "query": "{namespace=~\".+\"}", 516 | "refresh": 1, 517 | "regex": "/.*namespace=\\\"([^\\\"]+)\\\".*/", 518 | "skipUrlSync": false, 519 | "sort": 1, 520 | "tagValuesQuery": "", 521 | "tags": [], 522 | "tagsQuery": "", 523 | "type": "query", 524 | "useTags": false 525 | }, 526 | { 527 | "allValue": null, 528 | "current": {}, 529 | "datasource": "{{ PULSAR_CLUSTER }}", 530 | "definition": "{fqfn=~\".+\"}", 531 | "hide": 0, 532 | "includeAll": false, 533 | "index": -1, 534 | "label": "FQFN", 535 | "multi": false, 536 | "name": "fqfn", 537 | "options": [], 538 | "query": "{fqfn=~\".+\"}", 539 | "refresh": 1, 540 | "regex": "/.*fqfn=\\\"([^\\\"]+)\\\".*/", 541 | "skipUrlSync": false, 542 | "sort": 1, 543 | "tagValuesQuery": "", 544 | "tags": [], 545 | "tagsQuery": "", 546 | "type": "query", 547 | "useTags": false 548 | } 549 | ] 550 | }, 551 | "time": { 552 | "from": "now-15m", 553 | "to": "now" 554 | }, 555 | "timepicker": { 556 | "refresh_intervals": [ 557 | "5s", 558 | "10s", 559 | "30s", 560 | "1m", 561 | "5m", 562 | "15m", 563 | "30m", 564 | "1h", 565 | "2h", 566 | "1d" 567 | ] 568 | }, 569 | "timezone": "", 570 | "title": "Pulsar Functions", 571 | "uid": "EyZIXQ6Wk", 572 | "variables": { 573 | "list": [] 574 | }, 575 | "version": 33 576 | } 577 | -------------------------------------------------------------------------------- /dashboards/jvm.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_TEST-CLUSTER", 5 | "label": "{{ PULSAR_CLUSTER }}", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "prometheus", 9 | "pluginName": "Prometheus" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "5.3.2" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "5.0.0" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "prometheus", 28 | "name": "Prometheus", 29 | "version": "5.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [ 34 | { 35 | "builtIn": 1, 36 | "datasource": "-- Grafana --", 37 | "enable": true, 38 | "hide": true, 39 | "iconColor": "rgba(0, 211, 255, 1)", 40 | "name": "Annotations & Alerts", 41 | "type": "dashboard" 42 | } 43 | ] 44 | }, 45 | "description": "JVM Related Metrics", 46 | "editable": true, 47 | "gnetId": null, 48 | "graphTooltip": 0, 49 | "id": null, 50 | "iteration": 1543910801781, 51 | "links": [], 52 | "panels": [ 53 | { 54 | "collapsed": false, 55 | "gridPos": { 56 | "h": 1, 57 | "w": 24, 58 | "x": 0, 59 | "y": 0 60 | }, 61 | "id": 41, 62 | "panels": [], 63 | "repeat": "instance", 64 | "title": "$job - $instance", 65 | "type": "row" 66 | }, 67 | { 68 | "aliasColors": {}, 69 | "bars": false, 70 | "dashLength": 10, 71 | "dashes": false, 72 | "datasource": "{{ PULSAR_CLUSTER }}", 73 | "decimals": 1, 74 | "fill": 1, 75 | "gridPos": { 76 | "h": 6, 77 | "w": 6, 78 | "x": 0, 79 | "y": 1 80 | }, 81 | "id": 4, 82 | "legend": { 83 | "avg": false, 84 | "current": false, 85 | "max": false, 86 | "min": false, 87 | "show": false, 88 | "total": false, 89 | "values": false 90 | }, 91 | "lines": true, 92 | "linewidth": 1, 93 | "links": [], 94 | "nullPointMode": "null", 95 | "percentage": false, 96 | "pointradius": 5, 97 | "points": false, 98 | "renderer": "flot", 99 | "seriesOverrides": [], 100 | "spaceLength": 10, 101 | "stack": false, 102 | "steppedLine": false, 103 | "targets": [ 104 | { 105 | "expr": "irate(process_cpu_seconds_total{instance=~\"$instance\"}[30s]) * 100\n\n", 106 | "format": "time_series", 107 | "interval": "", 108 | "intervalFactor": 2, 109 | "legendFormat": "{{instance}}", 110 | "metric": "process_cpu_seconds_total", 111 | "refId": "A", 112 | "step": 20 113 | } 114 | ], 115 | "thresholds": [ 116 | { 117 | "colorMode": "ok", 118 | "fill": false, 119 | "line": true, 120 | "op": "gt", 121 | "value": 100 122 | } 123 | ], 124 | "timeFrom": null, 125 | "timeShift": null, 126 | "title": "CPU", 127 | "tooltip": { 128 | "shared": true, 129 | "sort": 0, 130 | "value_type": "individual" 131 | }, 132 | "type": "graph", 133 | "xaxis": { 134 | "buckets": null, 135 | "mode": "time", 136 | "name": null, 137 | "show": true, 138 | "values": [] 139 | }, 140 | "yaxes": [ 141 | { 142 | "format": "percent", 143 | "label": "", 144 | "logBase": 1, 145 | "max": null, 146 | "min": "0", 147 | "show": true 148 | }, 149 | { 150 | "format": "short", 151 | "label": null, 152 | "logBase": 1, 153 | "max": null, 154 | "min": null, 155 | "show": true 156 | } 157 | ], 158 | "yaxis": { 159 | "align": false, 160 | "alignLevel": null 161 | } 162 | }, 163 | { 164 | "aliasColors": {}, 165 | "bars": false, 166 | "dashLength": 10, 167 | "dashes": false, 168 | "datasource": "{{ PULSAR_CLUSTER }}", 169 | "fill": 1, 170 | "gridPos": { 171 | "h": 6, 172 | "w": 6, 173 | "x": 6, 174 | "y": 1 175 | }, 176 | "id": 1, 177 | "legend": { 178 | "alignAsTable": false, 179 | "avg": false, 180 | "current": false, 181 | "hideEmpty": false, 182 | "max": false, 183 | "min": false, 184 | "rightSide": false, 185 | "show": false, 186 | "total": false, 187 | "values": false 188 | }, 189 | "lines": true, 190 | "linewidth": 1, 191 | "links": [], 192 | "nullPointMode": "null", 193 | "percentage": false, 194 | "pointradius": 5, 195 | "points": false, 196 | "renderer": "flot", 197 | "seriesOverrides": [], 198 | "spaceLength": 10, 199 | "stack": false, 200 | "steppedLine": false, 201 | "targets": [ 202 | { 203 | "expr": "sum(jvm_memory_bytes_committed{instance=~\"$instance\"})", 204 | "format": "time_series", 205 | "hide": false, 206 | "interval": "", 207 | "intervalFactor": 2, 208 | "legendFormat": "Heap size", 209 | "metric": "jvm_memory_bytes_committed", 210 | "refId": "A", 211 | "step": 20 212 | }, 213 | { 214 | "expr": "sum(jvm_memory_bytes_used{instance=~\"$instance\"})", 215 | "format": "time_series", 216 | "interval": "", 217 | "intervalFactor": 2, 218 | "legendFormat": "Used", 219 | "metric": "jvm_memory_bytes_used", 220 | "refId": "B", 221 | "step": 20 222 | }, 223 | { 224 | "expr": "sum(jvm_memory_bytes_max{instance=~\"$instance\"})", 225 | "format": "time_series", 226 | "interval": "", 227 | "intervalFactor": 2, 228 | "legendFormat": "Max", 229 | "metric": "jvm_memory_bytes_max", 230 | "refId": "C", 231 | "step": 20 232 | } 233 | ], 234 | "thresholds": [], 235 | "timeFrom": null, 236 | "timeShift": null, 237 | "title": "Heap Memory", 238 | "tooltip": { 239 | "shared": true, 240 | "sort": 0, 241 | "value_type": "individual" 242 | }, 243 | "type": "graph", 244 | "xaxis": { 245 | "buckets": null, 246 | "mode": "time", 247 | "name": null, 248 | "show": true, 249 | "values": [] 250 | }, 251 | "yaxes": [ 252 | { 253 | "format": "decbytes", 254 | "label": "", 255 | "logBase": 1, 256 | "max": null, 257 | "min": null, 258 | "show": true 259 | }, 260 | { 261 | "format": "short", 262 | "label": null, 263 | "logBase": 1, 264 | "max": null, 265 | "min": null, 266 | "show": false 267 | } 268 | ], 269 | "yaxis": { 270 | "align": false, 271 | "alignLevel": null 272 | } 273 | }, 274 | { 275 | "aliasColors": {}, 276 | "bars": false, 277 | "dashLength": 10, 278 | "dashes": false, 279 | "datasource": "{{ PULSAR_CLUSTER }}", 280 | "fill": 1, 281 | "gridPos": { 282 | "h": 6, 283 | "w": 6, 284 | "x": 12, 285 | "y": 1 286 | }, 287 | "id": 2, 288 | "legend": { 289 | "avg": false, 290 | "current": false, 291 | "max": false, 292 | "min": false, 293 | "show": false, 294 | "total": false, 295 | "values": false 296 | }, 297 | "lines": true, 298 | "linewidth": 1, 299 | "links": [], 300 | "nullPointMode": "null", 301 | "percentage": false, 302 | "pointradius": 5, 303 | "points": false, 304 | "renderer": "flot", 305 | "seriesOverrides": [], 306 | "spaceLength": 10, 307 | "stack": false, 308 | "steppedLine": false, 309 | "targets": [ 310 | { 311 | "expr": "jvm_memory_direct_bytes_used{instance=~\"$instance\"}", 312 | "format": "time_series", 313 | "interval": "", 314 | "intervalFactor": 2, 315 | "legendFormat": "Used", 316 | "metric": "jvm_memory_direct_bytes_used", 317 | "refId": "A", 318 | "step": 20 319 | }, 320 | { 321 | "expr": "jvm_memory_direct_bytes_max{instance=~\"$instance\"}", 322 | "format": "time_series", 323 | "interval": "", 324 | "intervalFactor": 2, 325 | "legendFormat": "Max", 326 | "metric": "jvm_memory_direct_bytes_max", 327 | "refId": "B", 328 | "step": 20 329 | } 330 | ], 331 | "thresholds": [], 332 | "timeFrom": null, 333 | "timeShift": null, 334 | "title": "Direct Memory", 335 | "tooltip": { 336 | "shared": true, 337 | "sort": 0, 338 | "value_type": "individual" 339 | }, 340 | "type": "graph", 341 | "xaxis": { 342 | "buckets": null, 343 | "mode": "time", 344 | "name": null, 345 | "show": true, 346 | "values": [] 347 | }, 348 | "yaxes": [ 349 | { 350 | "format": "decbytes", 351 | "label": "", 352 | "logBase": 1, 353 | "max": null, 354 | "min": null, 355 | "show": true 356 | }, 357 | { 358 | "format": "short", 359 | "label": "", 360 | "logBase": 1, 361 | "max": null, 362 | "min": null, 363 | "show": true 364 | } 365 | ], 366 | "yaxis": { 367 | "align": false, 368 | "alignLevel": null 369 | } 370 | }, 371 | { 372 | "aliasColors": {}, 373 | "bars": false, 374 | "dashLength": 10, 375 | "dashes": false, 376 | "datasource": "{{ PULSAR_CLUSTER }}", 377 | "fill": 1, 378 | "gridPos": { 379 | "h": 6, 380 | "w": 6, 381 | "x": 18, 382 | "y": 1 383 | }, 384 | "id": 3, 385 | "legend": { 386 | "avg": false, 387 | "current": false, 388 | "max": false, 389 | "min": false, 390 | "show": false, 391 | "total": false, 392 | "values": false 393 | }, 394 | "lines": true, 395 | "linewidth": 1, 396 | "links": [], 397 | "nullPointMode": "null", 398 | "percentage": false, 399 | "pointradius": 5, 400 | "points": false, 401 | "renderer": "flot", 402 | "seriesOverrides": [ 403 | { 404 | "alias": "old count", 405 | "yaxis": 2 406 | }, 407 | { 408 | "alias": "young count", 409 | "yaxis": 2 410 | } 411 | ], 412 | "spaceLength": 10, 413 | "stack": false, 414 | "steppedLine": false, 415 | "targets": [ 416 | { 417 | "expr": "sum(increase(jvm_gc_collection_seconds_sum{instance=~\"$instance\"}[30s]))", 418 | "format": "time_series", 419 | "hide": false, 420 | "interval": "", 421 | "intervalFactor": 2, 422 | "legendFormat": "Pause", 423 | "metric": "jvm_gc_collection_seconds_count", 424 | "refId": "B", 425 | "step": 20 426 | } 427 | ], 428 | "thresholds": [], 429 | "timeFrom": null, 430 | "timeShift": null, 431 | "title": "GC Pauses", 432 | "tooltip": { 433 | "shared": true, 434 | "sort": 0, 435 | "value_type": "individual" 436 | }, 437 | "type": "graph", 438 | "xaxis": { 439 | "buckets": null, 440 | "mode": "time", 441 | "name": null, 442 | "show": true, 443 | "values": [] 444 | }, 445 | "yaxes": [ 446 | { 447 | "format": "s", 448 | "label": "", 449 | "logBase": 1, 450 | "max": null, 451 | "min": "0", 452 | "show": true 453 | }, 454 | { 455 | "format": "short", 456 | "label": "", 457 | "logBase": 1, 458 | "max": null, 459 | "min": "0", 460 | "show": false 461 | } 462 | ], 463 | "yaxis": { 464 | "align": false, 465 | "alignLevel": null 466 | } 467 | } 468 | ], 469 | "refresh": "1m", 470 | "schemaVersion": 16, 471 | "style": "dark", 472 | "tags": [ 473 | "jvm" 474 | ], 475 | "templating": { 476 | "list": [ 477 | { 478 | "allValue": null, 479 | "current": {}, 480 | "datasource": "{{ PULSAR_CLUSTER }}", 481 | "hide": 0, 482 | "includeAll": true, 483 | "label": "Cluster", 484 | "multi": false, 485 | "name": "cluster", 486 | "options": [], 487 | "query": "jvm_memory_bytes_used{cluster=~\".+\"}", 488 | "refresh": 1, 489 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 490 | "skipUrlSync": false, 491 | "sort": 0, 492 | "tagValuesQuery": "", 493 | "tags": [], 494 | "tagsQuery": "", 495 | "type": "query", 496 | "useTags": false 497 | }, 498 | { 499 | "allValue": null, 500 | "current": {}, 501 | "datasource": "{{ PULSAR_CLUSTER }}", 502 | "hide": 0, 503 | "includeAll": true, 504 | "label": "Job", 505 | "multi": false, 506 | "name": "job", 507 | "options": [], 508 | "query": "jvm_memory_bytes_used{job=~\".+\"}", 509 | "refresh": 1, 510 | "regex": "/.*[^_]job=\\\"([^\\\"]+)\\\".*/", 511 | "skipUrlSync": false, 512 | "sort": 1, 513 | "tagValuesQuery": "", 514 | "tags": [], 515 | "tagsQuery": "", 516 | "type": "query", 517 | "useTags": false 518 | }, 519 | { 520 | "allValue": null, 521 | "current": {}, 522 | "datasource": "{{ PULSAR_CLUSTER }}", 523 | "hide": 0, 524 | "includeAll": true, 525 | "label": "Instance", 526 | "multi": true, 527 | "name": "instance", 528 | "options": [], 529 | "query": "jvm_memory_bytes_used{job=~\"$job\", instance=~\".+\"}", 530 | "refresh": 2, 531 | "regex": "/.*[^_]instance=\\\"([^\\\"]+)\\\".*/", 532 | "skipUrlSync": false, 533 | "sort": 1, 534 | "tagValuesQuery": "", 535 | "tags": [], 536 | "tagsQuery": "", 537 | "type": "query", 538 | "useTags": false 539 | } 540 | ] 541 | }, 542 | "time": { 543 | "from": "now-1h", 544 | "to": "now" 545 | }, 546 | "timepicker": { 547 | "refresh_intervals": [ 548 | "5s", 549 | "10s", 550 | "30s", 551 | "1m", 552 | "5m", 553 | "15m", 554 | "30m", 555 | "1h", 556 | "2h", 557 | "1d" 558 | ], 559 | "time_options": [ 560 | "5m", 561 | "15m", 562 | "1h", 563 | "6h", 564 | "12h", 565 | "24h", 566 | "2d", 567 | "7d", 568 | "30d" 569 | ] 570 | }, 571 | "timezone": "browser", 572 | "title": "JVM Metrics", 573 | "uid": "S9e71oLmk", 574 | "version": 9 575 | } 576 | -------------------------------------------------------------------------------- /dashboards/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "$$hashKey": "object:29", 6 | "builtIn": 1, 7 | "datasource": "-- Grafana --", 8 | "enable": true, 9 | "hide": true, 10 | "iconColor": "rgba(0, 211, 255, 1)", 11 | "name": "Annotations & Alerts", 12 | "type": "dashboard" 13 | } 14 | ] 15 | }, 16 | "editable": true, 17 | "gnetId": null, 18 | "graphTooltip": 0, 19 | "iteration": 1588939992919, 20 | "links": [], 21 | "panels": [ 22 | { 23 | "aliasColors": {}, 24 | "bars": false, 25 | "dashLength": 10, 26 | "dashes": false, 27 | "datasource": "{{ GF_LOKI_DATASOURCE_NAME }}", 28 | "fill": 1, 29 | "fillGradient": 0, 30 | "gridPos": { 31 | "h": 6, 32 | "w": 24, 33 | "x": 0, 34 | "y": 0 35 | }, 36 | "hiddenSeries": false, 37 | "id": 2, 38 | "legend": { 39 | "avg": false, 40 | "current": false, 41 | "max": false, 42 | "min": false, 43 | "show": true, 44 | "total": false, 45 | "values": false 46 | }, 47 | "lines": true, 48 | "linewidth": 1, 49 | "nullPointMode": "null", 50 | "options": { 51 | "dataLinks": [] 52 | }, 53 | "percentage": false, 54 | "pointradius": 2, 55 | "points": false, 56 | "renderer": "flot", 57 | "seriesOverrides": [], 58 | "spaceLength": 10, 59 | "stack": false, 60 | "steppedLine": false, 61 | "targets": [ 62 | { 63 | "expr": "sum(rate({cluster=\"$cluster\"}[5m]))", 64 | "refId": "A" 65 | } 66 | ], 67 | "thresholds": [], 68 | "timeFrom": null, 69 | "timeRegions": [], 70 | "timeShift": null, 71 | "title": "Logs Rate", 72 | "tooltip": { 73 | "shared": true, 74 | "sort": 0, 75 | "value_type": "individual" 76 | }, 77 | "type": "graph", 78 | "xaxis": { 79 | "buckets": null, 80 | "mode": "time", 81 | "name": null, 82 | "show": true, 83 | "values": [] 84 | }, 85 | "yaxes": [ 86 | { 87 | "format": "short", 88 | "label": null, 89 | "logBase": 1, 90 | "max": null, 91 | "min": null, 92 | "show": true 93 | }, 94 | { 95 | "format": "short", 96 | "label": null, 97 | "logBase": 1, 98 | "max": null, 99 | "min": null, 100 | "show": true 101 | } 102 | ], 103 | "yaxis": { 104 | "align": false, 105 | "alignLevel": null 106 | } 107 | }, 108 | { 109 | "datasource": "{{ GF_LOKI_DATASOURCE_NAME }}", 110 | "gridPos": { 111 | "h": 15, 112 | "w": 24, 113 | "x": 0, 114 | "y": 6 115 | }, 116 | "id": 4, 117 | "options": { 118 | "showLabels": false, 119 | "showTime": true, 120 | "sortOrder": "Descending", 121 | "wrapLogMessage": true 122 | }, 123 | "targets": [ 124 | { 125 | "expr": "{component=\"$component\", cluster=\"$cluster\", app=\"pulsar\"}", 126 | "refId": "A" 127 | } 128 | ], 129 | "timeFrom": null, 130 | "timeShift": null, 131 | "title": "Logs", 132 | "type": "logs" 133 | } 134 | ], 135 | "schemaVersion": 22, 136 | "style": "dark", 137 | "tags": [], 138 | "templating": { 139 | "list": [ 140 | { 141 | "allValue": null, 142 | "current": {}, 143 | "datasource": "{{ PULSAR_CLUSTER }}", 144 | "definition": "jvm_memory_bytes_used{job=~\".+\"}", 145 | "hide": 0, 146 | "includeAll": false, 147 | "index": -1, 148 | "label": "Component", 149 | "multi": false, 150 | "name": "component", 151 | "options": [], 152 | "query": "jvm_memory_bytes_used{job=~\".+\"}", 153 | "refresh": 1, 154 | "regex": "/.*[^_]job=\\\"([^\\\"]+)\\\".*/", 155 | "skipUrlSync": false, 156 | "sort": 1, 157 | "tagValuesQuery": "", 158 | "tags": [], 159 | "tagsQuery": "", 160 | "type": "query", 161 | "useTags": false 162 | }, 163 | { 164 | "allValue": null, 165 | "current": {}, 166 | "datasource": "{{ PULSAR_CLUSTER }}", 167 | "definition": "jvm_memory_bytes_used{cluster=~\".+\"}", 168 | "hide": 0, 169 | "includeAll": false, 170 | "index": -1, 171 | "label": "Cluster", 172 | "multi": false, 173 | "name": "cluster", 174 | "options": [], 175 | "query": "jvm_memory_bytes_used{cluster=~\".+\"}", 176 | "refresh": 1, 177 | "regex": "/.*[^_]cluster=\\\"([^\\\"]+)\\\".*/", 178 | "skipUrlSync": false, 179 | "sort": 1, 180 | "tagValuesQuery": "", 181 | "tags": [], 182 | "tagsQuery": "", 183 | "type": "query", 184 | "useTags": false 185 | } 186 | ] 187 | }, 188 | "time": { 189 | "from": "now-6h", 190 | "to": "now" 191 | }, 192 | "timepicker": { 193 | "refresh_intervals": [ 194 | "5s", 195 | "10s", 196 | "30s", 197 | "1m", 198 | "5m", 199 | "15m", 200 | "30m", 201 | "1h", 202 | "2h", 203 | "1d" 204 | ] 205 | }, 206 | "timezone": "", 207 | "title": "Pulsar Logs", 208 | "uid": "AIPqpE3Zk", 209 | "variables": { 210 | "list": [] 211 | }, 212 | "version": 2 213 | } 214 | -------------------------------------------------------------------------------- /dashboards/pulsar_detector.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "editable": true, 16 | "gnetId": null, 17 | "graphTooltip": 0, 18 | "id": 1, 19 | "links": [], 20 | "panels": [ 21 | { 22 | "cacheTimeout": null, 23 | "datasource": "{{ PULSAR_CLUSTER }}", 24 | "gridPos": { 25 | "h": 8, 26 | "w": 5, 27 | "x": 0, 28 | "y": 0 29 | }, 30 | "id": 6, 31 | "interval": "", 32 | "links": [], 33 | "options": { 34 | "fieldOptions": { 35 | "calcs": [ 36 | "sum" 37 | ], 38 | "defaults": { 39 | "mappings": [ 40 | { 41 | "id": 0, 42 | "op": "=", 43 | "text": "0", 44 | "type": 1, 45 | "value": "null" 46 | } 47 | ], 48 | "min": 0, 49 | "nullValueMode": "connected", 50 | "thresholds": { 51 | "mode": "absolute", 52 | "steps": [ 53 | { 54 | "color": "#299c46", 55 | "value": null 56 | }, 57 | { 58 | "color": "#FADE2A", 59 | "value": 50 60 | }, 61 | { 62 | "color": "#EAB839", 63 | "value": 500 64 | }, 65 | { 66 | "color": "#F2495C", 67 | "value": 5000 68 | } 69 | ] 70 | }, 71 | "title": "", 72 | "unit": "none" 73 | }, 74 | "overrides": [], 75 | "values": false 76 | }, 77 | "orientation": "horizontal", 78 | "showThresholdLabels": false, 79 | "showThresholdMarkers": false 80 | }, 81 | "pluginVersion": "6.7.3", 82 | "targets": [ 83 | { 84 | "expr": "sum(pulsar_detector_e2e_latency_ms_count{success=\"false\"}-pulsar_detector_e2e_latency_ms_count{success=\"false\"} offset 5m)", 85 | "interval": "", 86 | "legendFormat": "", 87 | "refId": "A" 88 | } 89 | ], 90 | "timeFrom": null, 91 | "timeShift": null, 92 | "title": "e2e failure count", 93 | "transparent": true, 94 | "type": "gauge" 95 | }, 96 | { 97 | "aliasColors": {}, 98 | "bars": false, 99 | "dashLength": 10, 100 | "dashes": false, 101 | "datasource": "{{ PULSAR_CLUSTER }}", 102 | "fill": 1, 103 | "fillGradient": 0, 104 | "gridPos": { 105 | "h": 8, 106 | "w": 10, 107 | "x": 5, 108 | "y": 0 109 | }, 110 | "hiddenSeries": false, 111 | "id": 4, 112 | "legend": { 113 | "alignAsTable": false, 114 | "avg": false, 115 | "current": true, 116 | "max": false, 117 | "min": false, 118 | "show": true, 119 | "total": false, 120 | "values": true 121 | }, 122 | "lines": true, 123 | "linewidth": 1, 124 | "nullPointMode": "connected", 125 | "options": { 126 | "dataLinks": [] 127 | }, 128 | "percentage": false, 129 | "pointradius": 2, 130 | "points": false, 131 | "renderer": "flot", 132 | "seriesOverrides": [], 133 | "spaceLength": 10, 134 | "stack": false, 135 | "steppedLine": false, 136 | "targets": [ 137 | { 138 | "expr": "pulsar_detector_publish_latency_ms", 139 | "format": "time_series", 140 | "instant": false, 141 | "interval": "", 142 | "intervalFactor": 1, 143 | "legendFormat": "{{ quantile }}", 144 | "refId": "A" 145 | } 146 | ], 147 | "thresholds": [], 148 | "timeFrom": null, 149 | "timeRegions": [], 150 | "timeShift": null, 151 | "title": "publish_latency", 152 | "tooltip": { 153 | "shared": true, 154 | "sort": 0, 155 | "value_type": "individual" 156 | }, 157 | "transparent": true, 158 | "type": "graph", 159 | "xaxis": { 160 | "buckets": null, 161 | "mode": "time", 162 | "name": null, 163 | "show": true, 164 | "values": [] 165 | }, 166 | "yaxes": [ 167 | { 168 | "decimals": null, 169 | "format": "ms", 170 | "label": null, 171 | "logBase": 10, 172 | "max": null, 173 | "min": null, 174 | "show": true 175 | }, 176 | { 177 | "format": "short", 178 | "label": null, 179 | "logBase": 1, 180 | "max": null, 181 | "min": null, 182 | "show": false 183 | } 184 | ], 185 | "yaxis": { 186 | "align": false, 187 | "alignLevel": null 188 | } 189 | }, 190 | { 191 | "aliasColors": {}, 192 | "bars": false, 193 | "dashLength": 10, 194 | "dashes": false, 195 | "datasource": "{{ PULSAR_CLUSTER }}", 196 | "description": "", 197 | "fill": 1, 198 | "fillGradient": 0, 199 | "gridPos": { 200 | "h": 8, 201 | "w": 9, 202 | "x": 15, 203 | "y": 0 204 | }, 205 | "hiddenSeries": false, 206 | "id": 2, 207 | "legend": { 208 | "alignAsTable": false, 209 | "avg": false, 210 | "current": true, 211 | "max": false, 212 | "min": false, 213 | "rightSide": false, 214 | "show": true, 215 | "sort": "max", 216 | "sortDesc": false, 217 | "total": false, 218 | "values": true 219 | }, 220 | "lines": true, 221 | "linewidth": 1, 222 | "nullPointMode": "connected", 223 | "options": { 224 | "dataLinks": [] 225 | }, 226 | "percentage": false, 227 | "pointradius": 2, 228 | "points": false, 229 | "renderer": "flot", 230 | "seriesOverrides": [], 231 | "spaceLength": 10, 232 | "stack": false, 233 | "steppedLine": false, 234 | "targets": [ 235 | { 236 | "expr": "pulsar_detector_e2e_latency_ms", 237 | "interval": "", 238 | "legendFormat": "{{ quantile }}", 239 | "refId": "B" 240 | } 241 | ], 242 | "thresholds": [], 243 | "timeFrom": null, 244 | "timeRegions": [], 245 | "timeShift": null, 246 | "title": "e2e_latency", 247 | "tooltip": { 248 | "shared": true, 249 | "sort": 0, 250 | "value_type": "individual" 251 | }, 252 | "transparent": true, 253 | "type": "graph", 254 | "xaxis": { 255 | "buckets": null, 256 | "min": null, 257 | "mode": "time", 258 | "name": null, 259 | "show": true, 260 | "values": [] 261 | }, 262 | "yaxes": [ 263 | { 264 | "format": "ms", 265 | "label": null, 266 | "logBase": 2, 267 | "max": null, 268 | "min": null, 269 | "show": true 270 | }, 271 | { 272 | "format": "none", 273 | "label": null, 274 | "logBase": 1, 275 | "max": null, 276 | "min": null, 277 | "show": false 278 | } 279 | ], 280 | "yaxis": { 281 | "align": false, 282 | "alignLevel": null 283 | } 284 | } 285 | ], 286 | "schemaVersion": 22, 287 | "style": "dark", 288 | "tags": [], 289 | "templating": { 290 | "list": [] 291 | }, 292 | "time": { 293 | "from": "now-6h", 294 | "to": "now" 295 | }, 296 | "timepicker": { 297 | "refresh_intervals": [ 298 | "5s", 299 | "10s", 300 | "30s", 301 | "1m", 302 | "5m", 303 | "15m", 304 | "30m", 305 | "1h", 306 | "2h", 307 | "1d" 308 | ] 309 | }, 310 | "timezone": "", 311 | "title": "Pulsar Detector", 312 | "uid": "CKmGks6Wk", 313 | "variables": { 314 | "list": [] 315 | }, 316 | "version": 35 317 | } 318 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | 21 | echo 'Starting Grafana...' 22 | 23 | GRAFANA_CFG_FILE=${GRAFANA_CFG_FILE:-"/etc/grafana/grafana.ini"} 24 | GRAFANA_DATASOURCES_FILE=${GRAFANA_DATASOURCES_FILE:-"/var/lib/grafana/pulsar_provisioning/datasources/pulsar.yml"} 25 | GRAFANA_USE_BUILTIN_DASHBOARDS=${GRAFANA_USE_BUILTIN_DASHBOARDS:-"true"} 26 | 27 | # apply environment variables to pulsar datasource provisioning yaml file 28 | mv ${GRAFANA_DATASOURCES_FILE} /tmp/datasources_pulsar.yml.bak 29 | j2 /tmp/datasources_pulsar.yml.bak > ${GRAFANA_DATASOURCES_FILE} 30 | 31 | # apply envirionment variables to grafana conf 32 | j2 ${GRAFANA_CFG_FILE} > /var/lib/grafana/grafana.ini 33 | chmod 0400 /var/lib/grafana/grafana.ini 34 | 35 | # apply environment variables to pulsar provisioned dashboards 36 | if [ "x${GRAFANA_USE_BUILTIN_DASHBOARDS}" == "xtrue" ]; then 37 | for item in `ls /var/lib/grafana/pulsar_provisioning/dashboard_templates`; do 38 | OUTPUT_FILE=$(echo ${item} | sed 's/\.j2//') 39 | sed "s/{{ PULSAR_CLUSTER }}/${PULSAR_CLUSTER}/; s/{{ GF_LOKI_DATASOURCE_NAME }}/${GF_LOKI_DATASOURCE_NAME}/" /var/lib/grafana/pulsar_provisioning/dashboard_templates/${item} > /var/lib/grafana/pulsar_provisioning/dashboards/${OUTPUT_FILE} 40 | done 41 | fi 42 | 43 | echo "Initialized the pulsar data source." 44 | 45 | exec /run.sh --config /var/lib/grafana/grafana.ini 46 | -------------------------------------------------------------------------------- /gettingStarted.md: -------------------------------------------------------------------------------- 1 | # Apache Pulsar Grafana Dashboard 2 | Apache Pulsar Grafana dashboard is an open source visualization tool. It contains a unique Graphite target parser that enables easy metric and function editing. The Grafana dashboard is used to visualize time series data of different monitoring indexes. 3 | 4 | ## Get Started 5 | To use Apache Pulsar Grafana Dashboard, you have to start Pulsar cluster and Prometheus first. 6 | 7 | ### Start Pulsar 8 | If you haven't installed Pulsar, you can start Pulsar standalone with one of the following methods: 9 | - [start Pulsar locally](http://pulsar.apache.org/docs/en/standalone/) 10 | - [start Pulsar in Docker](http://pulsar.apache.org/docs/en/standalone-docker/) 11 | 12 | If you have deployed Pulsar cluster, you can get a list of machines for each component. 13 | 14 | ### Start Prometheus 15 | Before running Prometheus, you have to download a Prometheus image file and generate a config file. 16 | 1. Download a Prometheus image at [Docker Hub](https://hub.docker.com/r/prom/prometheus), and install it. 17 | 2. Generate a Prometheus config file. You can generate the config file with the following two options: 18 | - Create a `standalone.prometheus.yml` file in the `/tmp` directory, copy the contents of the [standalone.prometheus.template.yml](prometheus/standalone.yml.template) file to the `standalone.prometheus.yml` file, and replace `{{ STANDALONE_HOST }}` with IP address of the machine running pulsar standalone. 19 | - Install [j2cli](https://github.com/kolypto/j2cli). j2cli is a command-line tool for templating [Jinja2](http://jinja.pocoo.org/docs/) template files. You can use j2cli to generate a Prometheus config file from the standalone template. 20 | 21 | ```bash 22 | $ STANDALONE_HOST="$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{ print $2 }')" j2 prometheus/standalone.yml.template > /tmp/standalone.prometheus.yml 23 | ``` 24 | 25 | 3. Run Prometheus with the generated Prometheus config file. 26 | 27 | ```bash 28 | docker run -p 9090:9090 -v /tmp/standalone.prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus 29 | ``` 30 | 31 | ### Configure Prometheus Server for Pulsar cluster 32 | 33 | In the [prometheus/standalone.yml.template](prometheus/standalone.yml.template) template file, the default cluster name is set to `standalone`. If you are running Pulsar cluster, you need to configure your Prometheus server to collect the metrics of a Pulsar cluster. For details on configuration, refer to [example prometheus config](prometheus/cluster.yml.template). 34 | 35 | - Configure Prometheus service, and make sure your Prometheus service attaches an extra label `cluster` to the metrics collected from Pulsar cluster. The cluster name is aligned with the `PULSAR_CLUSTER` name you have provided to the grafana dashboard. 36 | ```yaml 37 | global: 38 | ... 39 | external_labels: 40 | cluster: 41 | ``` 42 | 43 | - Make sure the job name of each component is the same with the ones in this dashboard. 44 | - job *proxy*: the machines that run Pulsar proxies. 45 | - job *broker*: the machines that run Pulsar brokers. 46 | - job *bookie*: the machines that run bookies. 47 | - job *zookeeper*: the machines that run zookeeper. 48 | - job *node_metrics*: all the machines of the Pulsar cluster. 49 | 50 | 51 | After running the Prometheus successfully, you have access to http://localhost:9090/targets, where you can see Prometheus detecting all Pulsar components, shown as follows. 52 | 53 | ![](images/prometheus-targets.png?raw=true) 54 | 55 | ### Start Grafana Dashboard 56 | 57 | When you have a Pulsar cluster and a Prometheus server connecting to the Pulsar cluster, you can start Grafana Dashboard. 58 | 59 | 1. Download the Grafana dashboard docker image at 60 | [Docker Hub](https://hub.docker.com/r/streamnative/apache-pulsar-grafana-dashboard), and issue the following command in docker. 61 | 62 | `docker pull streamnative/apache-pulsar-grafana-dashboard` 63 | 64 | 2. Configure the following two environment variables in docker. 65 | - *PULSAR_PROMETHEUS_URL*: The HTTP URL that points to your Prometheus service. For example, 66 | `docker run -e PULSAR_PROMETHEUS_URL=http://:9090 `. 67 | - *PULSAR_CLUSTER*: The Pulsar cluster name. The cluster name is aligned with your Prometheus configuration. For example, `export PULSAR_CLUSTER=`. 68 | 69 | The following is a command sample. 70 | ```bash 71 | export PULSAR_PROMETHEUS_URL=http://$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{ print $2 }'):9090 72 | export PULSAR_CLUSTER=standalone 73 | docker run -it -p 3000:3000 -e PULSAR_PROMETHEUS_URL="${PULSAR_PROMETHEUS_URL}" -e PULSAR_CLUSTER="${PULSAR_CLUSTER}" streamnative/apache-pulsar-grafana-dashboard:latest 74 | ``` 75 | In this sample, you can access the Grafana Dashboard at http://localhost:3000. 76 | The default user name and password are `admin` and `happypulsaring`. You can set the user name and password in the [conf/grafana.ini](conf/grafana.ini) file. 77 | 78 | 79 | ## Dashboard Overview 80 | 81 | The Grafana Docker Image contains the following built-in dashboards for different components in an Apache Pulsar cluster. 82 | 83 | - *Overview*: This renders the overview health of a Pulsar cluster. 84 | - *Messaging Metrics*: This renders the metrics related to Pulsar messaging (e.g. producers, consumers, msg backlog and so on). 85 | - *Proxy Metrics*: This renders the metrics related to Pulsar proxies if you have run proxies in your Pulsar clusters. _This doesn't apply to a standalone cluster._ 86 | - *Bookie Metrics*: This renders the metrics related to Bookies. _This doesn't apply to a Standalone cluster since a Pulsar standalone doesn't expose bookie metrics._ 87 | - *ZooKeeper*: This renders the metrics related to ZooKeeper cluster. 88 | - *JVM Metrics*: This renders the jvm related metrics of all the components in a Pulsar cluster (For example, proxies, brokers, bookies, and so on). 89 | 90 | System metrics are rendered in the *Node Metrics* dashboard and some portions in *Overview* dashboard. 91 | The system metrics used by these dashboards are collected by Prometheus [Node Exporter](https://github.com/prometheus/node_exporter). 92 | So you have to configure each Pulsar machine to run node exporter, and configure your Prometheus to scrape the metrics from node exporters. 93 | 94 | ## Build Your Own Image (Optional) 95 | 96 | To customize and build your own dashboard image, issue the following command: 97 | 98 | ```bash 99 | make 100 | ``` 101 | 102 | Checkout [Makefile](Makefile) for the details of the command used for building the docker image. 103 | -------------------------------------------------------------------------------- /images/prometheus-targets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/streamnative/apache-pulsar-grafana-dashboard/22aed906a7082fbc127521a27c5a519d80e9dd97/images/prometheus-targets.png -------------------------------------------------------------------------------- /private-cloud/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | 21 | echo 'Starting Grafana...' 22 | 23 | GRAFANA_CFG_FILE=${GRAFANA_CFG_FILE:-"/etc/grafana/grafana.ini"} 24 | GRAFANA_DATASOURCES_FILE=${GRAFANA_DATASOURCES_FILE:-"/etc/grafana/provisioning/datasources/pulsar.yml"} 25 | GRAFANA_USE_BUILTIN_DASHBOARDS=${GRAFANA_USE_BUILTIN_DASHBOARDS:-"true"} 26 | 27 | # apply environment variables to pulsar datasource provisioning yaml file 28 | mv ${GRAFANA_DATASOURCES_FILE} /tmp/datasources_pulsar.yml.bak 29 | j2 /tmp/datasources_pulsar.yml.bak > ${GRAFANA_DATASOURCES_FILE} 30 | 31 | # apply envirionment variables to grafana conf 32 | j2 ${GRAFANA_CFG_FILE} > /var/lib/grafana/grafana.ini 33 | chmod 0400 /var/lib/grafana/grafana.ini 34 | 35 | # apply environment variables to pulsar provisioned dashboards 36 | if [ "x${GRAFANA_USE_BUILTIN_DASHBOARDS}" == "xtrue" ]; then 37 | for item in `ls /etc/grafana/provisioning/dashboard_templates`; do 38 | OUTPUT_FILE=$(echo ${item} | sed 's/\.j2//') 39 | sed "s/{{ PULSAR_CLUSTER }}/${PULSAR_CLUSTER}/; s/{{ GF_LOKI_DATASOURCE_NAME }}/${GF_LOKI_DATASOURCE_NAME}/" /etc/grafana/provisioning/dashboard_templates/${item} > /etc/grafana/provisioning/dashboards/${OUTPUT_FILE} 40 | done 41 | fi 42 | 43 | echo "Initialized the pulsar data source." 44 | 45 | exec /run.sh --config /var/lib/grafana/grafana.ini 46 | -------------------------------------------------------------------------------- /private-cloud/provisioning/dashboards.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018-2019 Sijie. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # # config file version 18 | apiVersion: 1 19 | 20 | providers: 21 | - name: 'pulsar' 22 | orgId: 1 23 | folder: '' 24 | type: file 25 | allowUiUpdates: true 26 | options: 27 | path: /etc/grafana/provisioning/dashboards 28 | -------------------------------------------------------------------------------- /private-cloud/provisioning/datasources.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Sijie. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # config file version 18 | apiVersion: 1 19 | 20 | # list of datasources to insert/update depending 21 | # on what's available in the datbase 22 | datasources: 23 | # name of the datasource. Required 24 | - name: "prometheus-server" 25 | # datasource type. Required 26 | type: prometheus 27 | # access mode. direct or proxy. Required 28 | access: proxy 29 | # org id. will default to orgId 1 if not specified 30 | orgId: 1 31 | # url 32 | url: "http://prometheus-server" 33 | # database password, if used 34 | # password: 35 | # database user, if used 36 | # user: 37 | # database name, if used 38 | # database: 39 | # enable/disable basic auth 40 | basicAuth: false 41 | # basic auth username 42 | # basicAuthUser: 43 | # basic auth password 44 | # basicAuthPassword: 45 | # enable/disable with credentials headers 46 | # withCredentials: 47 | # mark as default datasource. Max one per org 48 | # isDefault: 49 | # fields that will be converted to json and stored in json_data 50 | # jsonData: 51 | # graphiteVersion: "1.1" 52 | # tlsAuth: false 53 | # tlsAuthWithCACert: false 54 | # httpHeaderName1: "Authorization" 55 | # json object of data that will be encrypted. 56 | # secureJsonData: 57 | # tlsCACert: "..." 58 | # tlsClientCert: "..." 59 | # tlsClientKey: "..." 60 | # # 61 | # httpHeaderValue1: "Bearer xf5yhfkpsnmgo" 62 | version: 1 63 | # allow users to edit datasources from the UI. 64 | editable: true 65 | -------------------------------------------------------------------------------- /prometheus/cluster.yml.template: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Sijie. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | --- 18 | global: 19 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 20 | evaluation_interval: 15s # By default, scrape targets every 15 seconds. 21 | # scrape_timeout is set to the global default (10s). 22 | external_labels: 23 | # TODO: replace `` with the right cluster name. E.g. 24 | # 25 | # cluster: test-cluster 26 | cluster: 27 | 28 | # Load and evaluate rules in these files every 'evaluation_interval' seconds. 29 | # rule_files: 30 | 31 | scrape_configs: 32 | 33 | - job_name: "proxy" 34 | honor_labels: true # don't overwrite job & instance labels 35 | static_configs: 36 | - targets: 37 | # TODO: add the proxies to monitor 38 | # 39 | # - 'proxy1:8080' 40 | # - 'proxy2:8080' 41 | # - ... 42 | 43 | - job_name: "broker" 44 | honor_labels: true # don't overwrite job & instance labels 45 | static_configs: 46 | - targets: 47 | # TODO: add the brokers to monitor 48 | # 49 | # - 'broker1:8080' 50 | # - 'broker2:8080' 51 | # - ... 52 | 53 | - job_name: "bookie" 54 | honor_labels: true # don't overwrite job & instance labels 55 | static_configs: 56 | - targets: 57 | # TODO: add the bookies to monitor 58 | # 59 | # - 'bookie1:8000' 60 | # - 'bookie2:8000' 61 | # - ... 62 | 63 | - job_name: "zookeeper" 64 | honor_labels: true 65 | static_configs: 66 | - targets: 67 | # TODO: add the zookeeper nodes to monitor 68 | # 69 | # - 'zookeeper1:8000' 70 | # - 'zookeeper2:8000' 71 | # - ... 72 | 73 | - job_name: "node_metrics" 74 | honor_labels: true # don't overwrite job & instance labels 75 | static_configs: 76 | - targets: 77 | # TODO: add the physical machines to monitor 78 | # 79 | # - 'node1:9100' 80 | # - 'node2:9100' 81 | # - ... 82 | -------------------------------------------------------------------------------- /prometheus/standalone.yml.template: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018 Sijie. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | --- 18 | global: 19 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 20 | evaluation_interval: 15s # By default, scrape targets every 15 seconds. 21 | # scrape_timeout is set to the global default (10s). 22 | external_labels: 23 | cluster: 'standalone' 24 | 25 | # Load and evaluate rules in these files every 'evaluation_interval' seconds. 26 | # rule_files: 27 | 28 | scrape_configs: 29 | 30 | - job_name: "proxy" 31 | honor_labels: true # don't overwrite job & instance labels 32 | static_configs: 33 | - targets: 34 | - '{{ STANDALONE_HOST }}:8080' 35 | 36 | - job_name: "broker" 37 | honor_labels: true # don't overwrite job & instance labels 38 | static_configs: 39 | - targets: 40 | - '{{ STANDALONE_HOST }}:8080' 41 | 42 | - job_name: "bookie" 43 | honor_labels: true # don't overwrite job & instance labels 44 | static_configs: 45 | - targets: 46 | - '{{ STANDALONE_HOST }}:8080' 47 | 48 | - job_name: "zookeeper" 49 | honor_labels: true 50 | static_configs: 51 | - targets: 52 | - '{{ STANDALONE_HOST }}:8080' 53 | 54 | # - job_name: "node_metrics" 55 | # honor_labels: true # don't overwrite job & instance labels 56 | # static_configs: 57 | # - targets: 58 | # - ':9100' 59 | # - ... 60 | -------------------------------------------------------------------------------- /publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | 21 | VERSION=0.0.1 22 | 23 | if [ -z "$DOCKER_USER" ]; then 24 | echo "Docker user in variable \$DOCKER_USER was not set. Skipping image publishing" 25 | exit 1 26 | fi 27 | 28 | if [ -z "$DOCKER_PASSWORD" ]; then 29 | echo "Docker password in variable \$DOCKER_PASSWORD was not set. Skipping image publishing" 30 | exit 1 31 | fi 32 | 33 | DOCKER_ORG="${DOCKER_ORG:-streamnative}" 34 | 35 | docker login ${DOCKER_REGISTRY} -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" 36 | if [ $? -ne 0 ]; then 37 | echo "Failed to loging to Docker Hub" 38 | exit 1 39 | fi 40 | 41 | if [[ -z ${DOCKER_REGISTRY} ]]; then 42 | docker_registry_org=${DOCKER_ORG} 43 | else 44 | docker_registry_org=${DOCKER_REGISTRY}/${DOCKER_ORG} 45 | echo "Starting to push images to ${docker_registry_org}..." 46 | fi 47 | 48 | set -x 49 | set -e 50 | 51 | docker build -t streamnative/apache-pulsar-grafana-dashboard:latest . 52 | docker tag streamnative/apache-pulsar-grafana-dashboard:latest ${docker_registry_org}/apache-pulsar-grafana-dashboard:latest 53 | docker tag streamnative/apache-pulsar-grafana-dashboard:latest ${docker_registry_org}/apache-pulsar-grafana-dashboard:${VERSION} 54 | docker push ${docker_registry_org}/apache-pulsar-grafana-dashboard:${VERSION} 55 | docker push ${docker_registry_org}/apache-pulsar-grafana-dashboard:latest 56 | -------------------------------------------------------------------------------- /scripts/generate_dashboards.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | 21 | set -e 22 | 23 | BINDIR=`dirname "$0"` 24 | DASHBOARD_HOME=`cd ${BINDIR}/..;pwd` 25 | 26 | help() { 27 | cat < 37 | 38 | 2. Set environment variables for the following and just run generate_dashboards.sh: 39 | - PULSAR_PROMETHEUS_URL 40 | - PULSAR_CLUSTER 41 | - PULSAR_CUSTOM_PROMETHEUS 42 | - GF_LOKI_URL 43 | - GF_LOKI_DATASOURCE_NAME 44 | 45 | Interactive option: 46 | 47 | Missing any of the above inputs or environment variables will cause a prompt for input 48 | 49 | EOF 50 | } 51 | 52 | env_var_check() { 53 | # Checks if either var script input or env vars are set and prompts 54 | # for interactive input when missing 55 | local VAR=${1} 56 | local INPUT=${2} 57 | if [ -z "$(echo ${VAR})" ] && [ -z "${INPUT}" ]; then 58 | echo "${VAR} is not set!" 59 | DEFAULT_INPUT='' 60 | read -p "Enter a value for ${VAR}: [''] " PROMPT_INPUT 61 | PROMPT_INPUT="${PROMPT_INPUT:-${DEFAULT_INPUT}}" 62 | export $(echo ${VAR})=${PROMPT_INPUT} 63 | echo "${VAR} set to: $(printenv ${VAR})" 64 | elif [ -n "${INPUT}" ]; then 65 | echo "Setting ${VAR} from script input." 66 | export $(echo ${VAR})=${INPUT} 67 | echo "${VAR} set to: $(printenv ${VAR})" 68 | elif [ -n "$(echo ${VAR})" ]; then 69 | echo "Using existing ${VAR} environment variable." 70 | echo "$(echo ${VAR}) set to: $(printenv ${VAR})" 71 | else 72 | echo "Something went wrong trying to set ${VAR}" 73 | help 74 | exit 1 75 | fi 76 | } 77 | 78 | 79 | if [ "${1}" == 'help' ] || [ "${1}" == '--help' ] || [ "${1}" == '-h' ]; then 80 | help 81 | else 82 | # Check for env vars and promt for input if missing 83 | env_var_check PULSAR_PROMETHEUS_URL ${1} 84 | env_var_check PULSAR_CLUSTER ${2} 85 | env_var_check PULSAR_CUSTOM_PROMETHEUS ${3} 86 | env_var_check GF_LOKI_URL ${4} 87 | env_var_check GF_LOKI_DATASOURCE_NAME ${5} 88 | 89 | DASHBOARDS_OUTPUT_DIR="${DASHBOARD_HOME}/target/dashboards" 90 | if [ -d ${DASHBOARDS_OUTPUT_DIR} ]; then 91 | rm -r ${DASHBOARDS_OUTPUT_DIR} 92 | fi 93 | mkdir -p ${DASHBOARDS_OUTPUT_DIR} 94 | 95 | DATASOURCES_OUTPUT_DIR="${DASHBOARD_HOME}/target/datasources" 96 | if [ -d ${DATASOURCES_OUTPUT_DIR} ]; then 97 | rm -r ${DATASOURCES_OUTPUT_DIR} 98 | fi 99 | mkdir -p ${DATASOURCES_OUTPUT_DIR} 100 | 101 | echo 'Generating Datasources ...' 102 | 103 | # apply environment variables to pulsar datasource provisioning yaml file 104 | cp ${DASHBOARD_HOME}/conf/provisioning/datasources.yml ${DASHBOARD_HOME}/target/datasources.yml 105 | j2 ${DASHBOARD_HOME}/target/datasources.yml > ${DATASOURCES_OUTPUT_DIR}/pulsar.yml 106 | 107 | echo "Your pulsar data source is generated as ${DATASOURCES_OUTPUT_DIR}/pulsar.yml" 108 | 109 | # apply environment variables to pulsar dashboards 110 | for item in `ls ${DASHBOARD_HOME}/dashboards.template`; do 111 | # Strip the '.j2' template file exstesion from output file name 112 | OUTPUT_FILE=$(echo ${item} | sed 's/\.j2//') 113 | 114 | # Only attempt to render via jinja2 if the file is a jinja2 template 115 | if [[ "${item}" == *".j2" ]]; then 116 | j2 ${DASHBOARD_HOME}/dashboards.template/${item} > ${DASHBOARDS_OUTPUT_DIR}/${OUTPUT_FILE} 117 | else 118 | sed "s/{{ PULSAR_CLUSTER }}/${PULSAR_CLUSTER}/" ${DASHBOARD_HOME}/dashboards.template/${item} > ${DASHBOARDS_OUTPUT_DIR}/${OUTPUT_FILE} 119 | fi 120 | 121 | done 122 | 123 | echo "Your pulsar dashboards is generarted under ${DASHBOARDS_OUTPUT_DIR}" 124 | fi 125 | -------------------------------------------------------------------------------- /stable.txt: -------------------------------------------------------------------------------- 1 | 0.1.0-SNAPSHOT 2 | --------------------------------------------------------------------------------