├── .gitignore ├── .travis.yml ├── .travis └── push_container.sh ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── alerts ├── absent-alerts.libsonnet ├── alerts.libsonnet ├── gluster-utilization.libsonnet ├── status.libsonnet └── thinpool-utilization.libsonnet ├── build.sh ├── config.libsonnet ├── dashboards ├── dashboards.libsonnet ├── defaults.libsonnet └── k8s-storage-resources-glusterfs-pv.libsonnet ├── docker └── entry.sh ├── extras ├── README.md ├── build.sh ├── example.jsonnet ├── jsonnetfile.json ├── manifests │ ├── 00namespace-namespace.yaml │ ├── grafana-dashboardDefinitions.yaml │ └── prometheus-rules.yaml └── operator │ └── jsonnet │ ├── grafana.libsonnet │ ├── kube-prometheus.libsonnet │ └── prometheus.libsonnet ├── jsonnetfile.json ├── lib ├── alerts.jsonnet ├── dashboards.jsonnet └── rules.jsonnet ├── mixin.libsonnet ├── rules ├── gluster-volume.libsonnet └── rules.libsonnet ├── runbook.md └── tests.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | *.yaml 2 | dashboards_out 3 | vendor 4 | jsonnetfile.lock.json 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | sudo: true 3 | 4 | addons: 5 | apt: 6 | packages: 7 | - python 8 | - realpath 9 | 10 | env: 11 | global: 12 | CONTAINER_REPO="gluster/gluster-mixins" 13 | language: go 14 | 15 | go: 16 | # Kubernetes minimum_go_version can be found in this file: 17 | # https://github.com/kubernetes/kubernetes/blob/master/hack/lib/golang.sh 18 | - stable 19 | 20 | install: 21 | - go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb 22 | - go get github.com/prometheus/prometheus/cmd/promtool 23 | - git clone https://github.com/google/jsonnet ${TRAVIS_HOME}/jsonnet 24 | - make -C ${TRAVIS_HOME}/jsonnet CC=clang CXX=clang++ 25 | - cp ${TRAVIS_HOME}/jsonnet/jsonnet ${TRAVIS_HOME}/gopath/bin 26 | - jb install 27 | script: 28 | - set -o pipefail && 29 | find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | 30 | while read f; do 31 | jsonnet fmt -n 2 --max-blank-lines 2 --string-style s --comment-style s "$f" | diff -u "$f" -; 32 | done 33 | 34 | - make all 35 | - ./build.sh "${CONTAINER_REPO}" 36 | 37 | deploy: 38 | # Master branch will push the container to :latest 39 | - provider: script 40 | on: # yamllint disable-line rule:truthy 41 | branch: master 42 | script: .travis/push_container.sh ${CONTAINER_REPO} verbatim latest 43 | # Tags of the form v + SEMVER (e.g., v1.2.3) will push to the 44 | # corresponding container version number (e.g., :1.2.3). 45 | - provider: script 46 | on: # yamllint disable-line rule:truthy 47 | tags: true 48 | condition: $TRAVIS_TAG =~ ^v[0-9]+ 49 | script: .travis/push_container.sh ${CONTAINER_REPO} version "$TRAVIS_TAG" 50 | -------------------------------------------------------------------------------- /.travis/push_container.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Usage: push_container.sh 4 | set -e -o pipefail 5 | 6 | image="$1" 7 | 8 | if [[ "x$2" == "xversion" ]]; then 9 | [[ "$3" =~ ^v([0-9]+.*) ]] || exit 1; 10 | tag="${BASH_REMATCH[1]}" 11 | else 12 | tag="$3" 13 | fi 14 | 15 | if [[ "x${QUAY_USERNAME}" != "x" && "x${QUAY_PASSWORD}" != "x" ]]; then 16 | echo "$QUAY_PASSWORD" | docker login -u "$QUAY_USERNAME" --password-stdin quay.io 17 | finalimage="quay.io/$image:$tag" 18 | docker tag "$image" "$finalimage" 19 | docker push "$finalimage" 20 | fi 21 | 22 | if [[ "x${DOCKER_USERNAME}" != "x" && "x${DOCKER_PASSWORD}" != "x" ]]; then 23 | echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.io 24 | finalimage="docker.io/$image:$tag" 25 | docker tag "$image" "$finalimage" 26 | docker push "$finalimage" 27 | fi 28 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Gluster Mixins Authors. 2 | 3 | # Licensed under GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 4 | # You may obtain a copy of the License at 5 | # https://opensource.org/licenses/lgpl-3.0.html 6 | 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | #-- Create build environment 14 | 15 | FROM docker.io/openshift/origin-release:golang-1.10 as build 16 | 17 | MAINTAINER Ankush Behl anbehl@redhat.com 18 | 19 | # install clang and gcc-c++ required for jsonnet to build 20 | RUN yum install -y clang \ 21 | gcc-c++ \ 22 | make 23 | 24 | # get required go packages for building k8s objects 25 | RUN go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb \ 26 | github.com/brancz/gojsontoyaml \ 27 | github.com/prometheus/prometheus/cmd/promtool 28 | 29 | # building jsonnet 30 | RUN git clone https://github.com/google/jsonnet && \ 31 | git --git-dir=jsonnet/.git checkout v0.10.0 && \ 32 | make -C jsonnet CC=clang CXX=clang++ && \ 33 | cp jsonnet/jsonnet /usr/bin 34 | 35 | # cloning the gluster-mixins project and making gluster-mixins as working dir 36 | COPY . /gluster/gluster-mixins/ 37 | WORKDIR /gluster/gluster-mixins/ 38 | 39 | # make will run tests and generate the intermidiate files 40 | RUN make 41 | 42 | WORKDIR /gluster/gluster-mixins/extras 43 | #installing required dependency from jsonnetfile.json and building k8s objects 44 | RUN jb install 45 | RUN ./build.sh example.jsonnet 46 | 47 | # Copy generated files to / 48 | RUN cp -r manifests / 49 | 50 | 51 | #-- Final container 52 | 53 | FROM docker.io/centos:7 as final 54 | 55 | RUN yum update -y \ 56 | && yum clean all 57 | 58 | # install kubectl package in container 59 | RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ 60 | chmod +x ./kubectl && \ 61 | mv ./kubectl /usr/local/bin 62 | 63 | # copy required files from build to final container 64 | COPY --from=build /manifests /manifests 65 | 66 | # shell script to apply the k8s object to underlying cluster 67 | COPY docker/entry.sh / 68 | RUN chmod 755 /entry.sh 69 | 70 | ARG builddate="(unknown)" 71 | ARG version="(unknown)" 72 | 73 | LABEL build-date="${builddate}" \ 74 | io.k8s.description="Mixins will deploy Grafana dashboards and Prometheus alerts for Gluster." \ 75 | name="Gluster Mixins" \ 76 | Summary="Gluster Mixins will deploy Grafana dashboards and Prometheus alerts for Gluster." \ 77 | vcs-type="git" \ 78 | vcs-url="https://github.com/gluster/gluster-mixins" \ 79 | vendor="gluster.org" \ 80 | version="${version}" 81 | 82 | ENTRYPOINT [ "/entry.sh" ] 83 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | (This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.) 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | {description} 474 | Copyright (C) {year} {fullname} 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | {signature of Ty Coon}, 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | JSONNET_FMT := jsonnet fmt -n 2 --max-blank-lines 2 --string-style s --comment-style s 2 | 3 | all: prometheus_alerts.yaml prometheus_rules.yaml dashboards_out lint test 4 | 5 | fmt: 6 | find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ 7 | xargs -n 1 -- $(JSONNET_FMT) -i 8 | 9 | prometheus_alerts.yaml: mixin.libsonnet lib/alerts.jsonnet alerts/*.libsonnet 10 | jsonnet -S lib/alerts.jsonnet > $@ 11 | 12 | prometheus_rules.yaml: mixin.libsonnet lib/rules.jsonnet rules/*.libsonnet 13 | jsonnet -S lib/rules.jsonnet > $@ 14 | 15 | dashboards_out: mixin.libsonnet lib/dashboards.jsonnet dashboards/*.libsonnet 16 | @mkdir -p dashboards_out 17 | jsonnet -J vendor -m dashboards_out lib/dashboards.jsonnet 18 | 19 | lint: prometheus_alerts.yaml prometheus_rules.yaml 20 | find . -name 'vendor' -prune -o -name '*.libsonnet' -print -o -name '*.jsonnet' -print | \ 21 | while read f; do \ 22 | $(JSONNET_FMT) "$$f" | diff -u "$$f" -; \ 23 | done 24 | 25 | promtool check rules prometheus_rules.yaml 26 | promtool check rules prometheus_alerts.yaml 27 | 28 | clean: 29 | rm -rf dashboards_out prometheus_alerts.yaml prometheus_rules.yaml 30 | 31 | test: prometheus_alerts.yaml prometheus_rules.yaml 32 | promtool test rules tests.yaml 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Prometheus Monitoring Mixin for Gluster 2 | 3 | [![Build Status](https://travis-ci.com/gluster/gluster-mixins.svg?branch=master)](https://travis-ci.com/gluster/gluster-mixins) 4 | 5 | A set of Grafana dashboards and Prometheus alerts for Gluster. 6 | 7 | The scope of this project is to provide Gluster specific Grafana dashboard configs and Prometheus rule files using Prometheus Mixins. 8 | 9 | ## Prerequisites 10 | * Jsonnet [[Install Jsonnet]](https://github.com/google/jsonnet#building-jsonnet) 11 | 12 | [Jsonnet](https://jsonnet.org/learning/getting_started.html) is a data templating language for app and tool developers. 13 | 14 | The mixin project uses Jsonnet to provide reusable and configurable configs for Grafana Dashboards and Prometheus Alerts. 15 | * Jsonnet-bundler [[Install Jsonnet-bundler]](https://github.com/jsonnet-bundler/jsonnet-bundler#install) 16 | 17 | [Jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) is a package manager for jsonnet. 18 | * Promtool 19 | 1. [Download](https://golang.org/dl/) Go (>=1.11) and [install](https://golang.org/doc/install) it on your system. 20 | 2. Setup the [GOPATH](http://www.g33knotes.org/2014/07/60-second-count-down-to-go.html) environment. 21 | 3. Run `$ go get -d github.com/prometheus/prometheus/cmd/promtool` 22 | 23 | 24 | ## How to use? 25 | ### Manually generate configs and rules 26 | You can clone this repository and manually generate Grafana Dashboard configs and Prometheus Rules files, and apply it according to your setup. 27 | 28 | ``` 29 | $ git clone https://github.com/gluster/gluster-mixins.git 30 | $ cd gluster-mixins 31 | ``` 32 | 33 | **To get dependencies** 34 | 35 | `$ jb install` 36 | 37 | 38 | **To generate Prometheus Alert file** 39 | 40 | `$ make prometheus_alerts.yaml` 41 | 42 | **To generate Prometheus Rule file** 43 | 44 | `$ make prometheus_rules.yaml` 45 | 46 | **To generate Grafana Dashboard configs** 47 | 48 | `$ make dashboards_out` 49 | 50 | The **prometheus_alerts.yaml** and **prometheus_rules.yaml** files then needs to be passed to your Prometheus Server, and the files in **dashboards_out** needs to be passed to your Grafana server. 51 | 52 | ## Background 53 | * [Prometheus Monitoring Mixin design doc](https://docs.google.com/document/d/1A9xvzwqnFVSOZ5fD3blKODXfsat5fg6ZhnKu9LK3lB4/edit#) 54 | -------------------------------------------------------------------------------- /alerts/absent-alerts.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusAlerts+:: { 3 | groups+: [ 4 | { 5 | name: 'exporter-absent', 6 | rules: [ 7 | { 8 | alert: '%sDown' % name, 9 | expr: ||| 10 | absent(up{%s}==1) 11 | ||| % $._config.jobs[name], 12 | 'for': '15m', 13 | labels: { 14 | severity: 'critical', 15 | }, 16 | annotations: { 17 | message: '%s has disappeared from Prometheus target discovery.' % name, 18 | }, 19 | } 20 | for name in std.objectFields($._config.jobs) 21 | ], 22 | }, 23 | ], 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /alerts/alerts.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'absent-alerts.libsonnet') + 2 | (import 'status.libsonnet') + 3 | (import 'gluster-utilization.libsonnet') + 4 | (import 'thinpool-utilization.libsonnet') 5 | -------------------------------------------------------------------------------- /alerts/gluster-utilization.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusAlerts+:: { 3 | groups+: [ 4 | { 5 | name: 'gluster-utilization', 6 | rules: [ 7 | { 8 | alert: 'GlusterVolumeUtilization', 9 | expr: ||| 10 | 100 * gluster:volume_capacity_used_bytes_total:sum 11 | / gluster:volume_capacity_total_bytes:sum > 80 12 | |||, 13 | 'for': $._config.volumeUtilizationAlertTime, 14 | labels: { 15 | severity: 'warning', 16 | }, 17 | annotations: { 18 | message: 'Gluster Volume {{$labels.volume}} Utilization more than 80%', 19 | }, 20 | }, 21 | { 22 | alert: 'GlusterVolumeUtilization', 23 | expr: ||| 24 | 100 * gluster:volume_capacity_used_bytes_total:sum 25 | / gluster:volume_capacity_total_bytes:sum > 90 26 | |||, 27 | 'for': $._config.volumeUtilizationAlertTime, 28 | labels: { 29 | severity: 'critical', 30 | }, 31 | annotations: { 32 | message: 'Gluster Volume {{$labels.volume}} Utilization more than 90%', 33 | }, 34 | }, 35 | { 36 | alert: 'GlusterBrickUtilization', 37 | expr: ||| 38 | 100 * gluster_brick_capacity_used_bytes{%(glusterExporterSelector)s} 39 | / gluster_brick_capacity_bytes_total{%(glusterExporterSelector)s} > 80 40 | ||| % $._config, 41 | 'for': $._config.volumeUtilizationAlertTime, 42 | labels: { 43 | severity: 'warning', 44 | }, 45 | annotations: { 46 | message: 'Gluster Brick {{$labels.host}}:{{$labels.brick_path}} Utilization more than 80%', 47 | }, 48 | }, 49 | { 50 | alert: 'GlusterBrickUtilization', 51 | expr: ||| 52 | 100 * gluster_brick_capacity_used_bytes{%(glusterExporterSelector)s} 53 | / gluster_brick_capacity_bytes_total{%(glusterExporterSelector)s} > 90 54 | ||| % $._config, 55 | 'for': $._config.volumeUtilizationAlertTime, 56 | labels: { 57 | severity: 'critical', 58 | }, 59 | annotations: { 60 | message: 'Gluster Brick {{$labels.host}}:{{$labels.brick_path}} Utilization more than 90%', 61 | }, 62 | }, 63 | ], 64 | }, 65 | ], 66 | }, 67 | } 68 | -------------------------------------------------------------------------------- /alerts/status.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusAlerts+:: { 3 | groups+: [ 4 | { 5 | name: 'status-alert.rules', 6 | rules: [ 7 | { 8 | alert: 'GlusterBrickStatus', 9 | expr: ||| 10 | gluster_brick_up{%(glusterExporterSelector)s} == 0 11 | ||| % $._config, 12 | 'for': $._config.statusAlertTime, 13 | labels: { 14 | severity: 'critical', 15 | }, 16 | annotations: { 17 | message: 'Gluster Brick {{$labels.hostname}}:{{$labels.brick_path}} is down.', 18 | }, 19 | }, 20 | { 21 | alert: 'GlusterVolumeStatus', 22 | expr: ||| 23 | gluster_volume_up{%(glusterExporterSelector)s} == 0 24 | ||| % $._config, 25 | 'for': $._config.statusAlertTime, 26 | labels: { 27 | severity: 'critical', 28 | }, 29 | annotations: { 30 | message: 'Gluster Volume {{$labels.volume}} is down.', 31 | }, 32 | }, 33 | ], 34 | }, 35 | ], 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /alerts/thinpool-utilization.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusAlerts+:: { 3 | groups+: [ 4 | { 5 | name: 'thinpool-utilization', 6 | rules: [ 7 | { 8 | alert: 'GlusterThinpoolDataUtilization', 9 | expr: ||| 10 | gluster_thinpool_data_used_bytes{%(glusterExporterSelector)s} / gluster_thinpool_data_total_bytes{%(glusterExporterSelector)s} > 0.8 11 | ||| % $._config, 12 | 'for': $._config.thinpoolAlertTriggerTime, 13 | labels: { 14 | severity: 'warning', 15 | }, 16 | annotations: { 17 | message: 'Gluster Thinpool {{ $labels.thinpool_name }} Data Utilization more than 80%', 18 | }, 19 | }, 20 | { 21 | alert: 'GlusterThinpoolDataUtilization', 22 | expr: ||| 23 | gluster_thinpool_data_used_bytes{%(glusterExporterSelector)s} / gluster_thinpool_data_total_bytes{%(glusterExporterSelector)s} > 0.9 24 | ||| % $._config, 25 | 'for': $._config.thinpoolAlertTriggerTime, 26 | labels: { 27 | severity: 'critical', 28 | }, 29 | annotations: { 30 | message: 'Gluster Thinpool {{ $labels.thinpool_name }} Data Utilization more than 90%', 31 | }, 32 | }, 33 | { 34 | alert: 'GlusterThinpoolMetadataUtilization', 35 | expr: ||| 36 | gluster_thinpool_metadata_used_bytes{%(glusterExporterSelector)s} / gluster_thinpool_metadata_total_bytes{%(glusterExporterSelector)s} > 0.8 37 | ||| % $._config, 38 | 'for': $._config.thinpoolAlertTriggerTime, 39 | labels: { 40 | severity: 'warning', 41 | }, 42 | annotations: { 43 | message: 'Gluster Thinpool {{ $labels.thinpool_name }} Metadata Utilization more than 80%', 44 | }, 45 | }, 46 | { 47 | alert: 'GlusterThinpoolMetadataUtilization', 48 | expr: ||| 49 | gluster_thinpool_metadata_used_bytes{%(glusterExporterSelector)s} / gluster_thinpool_metadata_total_bytes{%(glusterExporterSelector)s} > 0.9 50 | ||| % $._config, 51 | 'for': $._config.thinpoolAlertTriggerTime, 52 | labels: { 53 | severity: 'critical', 54 | }, 55 | annotations: { 56 | message: 'Gluster Thinpool {{ $labels.thinpool_name }} Metadata Utilization more than 90%', 57 | }, 58 | }, 59 | ], 60 | }, 61 | ], 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e -o pipefail 4 | 5 | IMAGE=${1-gluster/gluster-mixins} 6 | 7 | # This sets the version variable to (hopefully) a semver compatible string. We 8 | # expect released versions to have a tag of vX.Y.Z (with Y & Z optional), so we 9 | # only look for those tags. For version info on non-release commits, we want to 10 | # include the git commit info as a "build" suffix ("+stuff" at the end). There 11 | # is also special casing here for when no tags match. 12 | VERSION_GLOB="v[:digit:]*" 13 | # Get the nearest "version" tag if one exists. If not, this returns the full 14 | # git hash 15 | NEAREST_TAG="$(git describe --always --tags --match "$VERSION_GLOB" --abbrev=0)" 16 | # Full output of git describe for us to parse: TAG--g- 17 | FULL_DESCRIBE="$(git describe --always --tags --match "$VERSION_GLOB" --dirty)" 18 | # If full matches against nearest, we found a valid tag earlier 19 | if [[ $FULL_DESCRIBE =~ ${NEAREST_TAG}-(.*) ]]; then 20 | # Build suffix is the last part of describe w/ "-" replaced by "." 21 | version="$NEAREST_TAG+${BASH_REMATCH[1]//-/.}" 22 | else 23 | # We didn't find a valid tag, so assume version 0 and everything ends up 24 | # in build suffix. 25 | version="0.0.0+g${FULL_DESCRIBE//-/.}" 26 | fi 27 | builddate="$(date -u '+%Y-%m-%dT%H:%M:%S.%NZ')" 28 | 29 | docker build \ 30 | --build-arg version="$version" \ 31 | --build-arg builddate="$builddate" \ 32 | -t "$IMAGE" \ 33 | -f Dockerfile \ 34 | . 35 | -------------------------------------------------------------------------------- /config.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | _config+:: { 3 | // Selectors are inserted between {} in Prometheus queries. 4 | glusterExporterSelector: 'job="glusterd2-client"', 5 | 6 | // Duration to raise various Alerts 7 | volumeUtilizationAlertTime: '5m', 8 | statusAlertTime: '1m', 9 | thinpoolAlertTriggerTime: '5m', 10 | 11 | // Grafana dashboard IDs are necessary for stable links for dashboards 12 | grafanaDashboardIDs: { 13 | 'k8s-storage-resources-glusterfs-pv.json': 'XnbvYbcXkob7GLqcDPLTj1ZL4MRX87tOh8xdr567', 14 | }, 15 | 16 | // For links between grafana dashboards, you need to tell us if your grafana 17 | // servers under some non-root path. 18 | grafanaPrefix: '', 19 | 20 | // We build alerts for the presence of all these jobs. 21 | jobs: { 22 | GlusterExporter: $._config.glusterExporterSelector, 23 | }, 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /dashboards/dashboards.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'k8s-storage-resources-glusterfs-pv.libsonnet') + 2 | (import 'defaults.libsonnet') 3 | -------------------------------------------------------------------------------- /dashboards/defaults.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | local grafanaDashboards = super.grafanaDashboards, 3 | 4 | // Automatically add a uid to each dashboard based on the base64 encoding 5 | // of the file name and set the timezone to be 'default'. 6 | grafanaDashboards:: { 7 | [filename]: grafanaDashboards[filename] { 8 | uid: std.md5(filename), 9 | timezone: '', 10 | } 11 | for filename in std.objectFields(grafanaDashboards) 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /dashboards/k8s-storage-resources-glusterfs-pv.libsonnet: -------------------------------------------------------------------------------- 1 | local g = import 'grafana-builder/grafana.libsonnet'; 2 | 3 | { 4 | grafanaDashboards+:: { 5 | 'k8s-storage-resources-glusterfs-pv.json': 6 | local tableStyles = { 7 | fop: { 8 | alias: 'File Operations', 9 | }, 10 | }; 11 | local statPanelArgs = { 12 | height: '75px', 13 | span: 3, 14 | }; 15 | local brickStatPanelArgs = { 16 | height: '75px', 17 | span: 4, 18 | }; 19 | local graphPanelArgs = { 20 | span: 6, 21 | }; 22 | 23 | // Following panels to be added in Volume Summary after IOPS panel (Once metrics are availabe) 24 | // .addPanel( 25 | // g.panel('Rebalance-Files') + 26 | // statPanelArgs + 27 | // g.statPanel('') 28 | // ) 29 | // .addPanel( 30 | // g.panel('Rebalance-Size') + 31 | // statPanelArgs + 32 | // g.statPanel('') 33 | // ) 34 | // .addPanel( 35 | // g.panel('Rebalance-Skipped') + 36 | // statPanelArgs + 37 | // g.statPanel('') 38 | // ) 39 | // .addPanel( 40 | // g.panel('Rebalance-Failed') + 41 | // statPanelArgs + 42 | // g.statPanel('') 43 | // ) 44 | // The below variables needs to chanaged when cluster_id is introduced in the metrics 45 | // local queryLabels = "{job='$OCS_Cluster', volume='$Volume'}"; 46 | // local fopQueryLabel = "{job='$OCS_Cluster', volume='$Volume', fop!=''}"; 47 | // Below variables are defined considering that there is only one gluster cluster. 48 | local queryLabels = "{volume='$Volume'}"; 49 | local fopQueryLabel = "{volume='$Volume', fop!=''}"; 50 | local fopLockQueryLabel = "{volume='$Volume',fop='LOCK_OPS'}"; 51 | local fopInodeQueryLabel = "{volume='$Volume',fop='INODE_OPS'}"; 52 | local fopEntryQueryLabel = "{volume='$Volume',fop='ENTRY_OPS'}"; 53 | local fopReadWriteQueryLabel = "{volume='$Volume',fop='READ_WRITE_OPS'}"; 54 | 55 | // g.dashboard( 56 | // 'K8s / Storage Resources / Persistent Volume / glusterfs', 57 | // uid=($._config.grafanaDashboardIDs['k8s-storage-resources-glusterfs-pv.json']), 58 | // ).addTemplate('OCS_Cluster', 'gluster_volume_up', 'job') 59 | // .addTemplate('Volume', 'gluster_volume_up{job = "$OCS_Cluster"}', 'volume') 60 | g.dashboard( 61 | 'K8s / Storage Resources / Persistent Volume / glusterfs', 62 | uid=($._config.grafanaDashboardIDs['k8s-storage-resources-glusterfs-pv.json']), 63 | ) 64 | .addTemplate('Volume', 'gluster_volume_up', 'volume') 65 | .addRow( 66 | (g.row('Volume Summary') + 67 | { 68 | showTitle: false, 69 | panels: self._panels, 70 | }) 71 | .addPanel( 72 | g.panel('Status') + 73 | statPanelArgs + 74 | g.statPanel('gluster_volume_up{volume = "$Volume"}') + 75 | { 76 | valueMaps: [ 77 | { 78 | op: '=', 79 | text: 'DOWN', 80 | value: '0', 81 | }, 82 | { 83 | value: '1', 84 | op: '=', 85 | text: 'UP', 86 | }, 87 | ], 88 | thresholds: '0.9,1.1', 89 | colors: [ 90 | '#cc0000', 91 | '#92d400', 92 | '#FFFFFF', 93 | ], 94 | colorValue: true, 95 | } 96 | ) 97 | .addPanel( 98 | g.panel('Capacity Utilization') + 99 | statPanelArgs + 100 | g.statPanel('gluster:volume_capacity_used_bytes_total:sum%s / gluster:volume_capacity_total_bytes:sum%s' % [queryLabels, queryLabels]) 101 | ) 102 | .addPanel( 103 | g.panel('Available Capacity') + 104 | statPanelArgs + 105 | g.statPanel('gluster:volume_capacity_total_bytes:sum%s - gluster:volume_capacity_used_bytes_total:sum%s' % [queryLabels, queryLabels], 'decbytes') 106 | ) 107 | .addPanel( 108 | g.panel('IOPS') + 109 | statPanelArgs + 110 | g.statPanel('(sum (gluster_volume_profile_total_reads_interval%s) + sum(gluster_volume_profile_total_writes_interval%s))/max(gluster_volume_profile_duration_secs_interval%s)' % [queryLabels, queryLabels, queryLabels], 'none') 111 | ) 112 | .addPanel( 113 | g.panel('Capacity Utilization') + 114 | graphPanelArgs + 115 | g.queryPanel('gluster:volume_capacity_used_bytes_total:sum%s' % queryLabels, '{{$Volume}}') + 116 | g.stack + 117 | { yaxes: g.yaxes('decbytes') }, 118 | ) 119 | .addPanel( 120 | g.panel('IOPS') + 121 | { 122 | span: 6, 123 | legend+: { show: false }, 124 | } + 125 | g.queryPanel('(sum (gluster_volume_profile_total_reads_interval%s) + sum(gluster_volume_profile_total_writes_interval%s))/max(gluster_volume_profile_duration_secs_interval%s)' % [queryLabels, queryLabels, queryLabels], '{{$Volume}}') + 126 | g.stack 127 | ) 128 | ) 129 | .addRow( 130 | g.row('LVM Summary') 131 | .addPanel( 132 | g.panel('LVM Thin Pool Metadata %') + 133 | g.queryPanel('100*(gluster_thinpool_metadata_used_bytes%s / gluster_thinpool_metadata_total_bytes%s)' % [queryLabels, queryLabels], '{{thinpool_name}}') 134 | ) 135 | .addPanel( 136 | g.panel('LVM Thin Pool Data Usage %') + 137 | g.queryPanel('100*(gluster_thinpool_data_used_bytes%s / gluster_thinpool_data_total_bytes%s)' % [queryLabels, queryLabels], '{{thinpool_name}}') 138 | ) 139 | ) 140 | .addRow( 141 | (g.row('Bricks (Volume Subcomponent) Summary') + 142 | { 143 | showTitle: false, 144 | panels: self._panels, 145 | }) 146 | .addPanel( 147 | g.panel('Bricks-Total') + 148 | brickStatPanelArgs + 149 | g.statPanel('gluster_volume_brick_count%s' % queryLabels, 'none') 150 | ) 151 | .addPanel( 152 | g.panel('Bricks-Up') + 153 | brickStatPanelArgs + 154 | g.statPanel('count (gluster_brick_up%s == 1)' % queryLabels, 'none') + 155 | { 156 | thresholds: '0.1,0.9', 157 | colors: [ 158 | '#FFFFFF', 159 | '#FFFFFF', 160 | '#92d400', 161 | ], 162 | colorValue: true, 163 | } 164 | ) 165 | .addPanel( 166 | g.panel('Bricks-Down') + 167 | brickStatPanelArgs + 168 | g.statPanel('count(gluster_brick_up%s) - count (gluster_brick_up%s == 1)' % [queryLabels, queryLabels], 'none') + 169 | { 170 | thresholds: '0.1,0.9', 171 | colors: [ 172 | '#FFFFFF', 173 | '#FFFFFF', 174 | '#cc0000', 175 | ], 176 | colorValue: true, 177 | } 178 | ) 179 | .addPanel( 180 | g.panel('Capacity Utilization-Average') + 181 | brickStatPanelArgs + 182 | g.statPanel('avg (gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s)' % [queryLabels, queryLabels]) 183 | ) 184 | .addPanel( 185 | g.panel('Capacity Utilization-Min') + 186 | brickStatPanelArgs + 187 | g.statPanel('min (gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s)' % [queryLabels, queryLabels]) 188 | ) 189 | .addPanel( 190 | g.panel('Capacity Utilization-Max') + 191 | brickStatPanelArgs + 192 | g.statPanel('max (gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s)' % [queryLabels, queryLabels]) 193 | ) 194 | .addPanel( 195 | g.panel('Brick Usage < 80%') + 196 | brickStatPanelArgs + 197 | g.statPanel('count((gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s) < 0.8)' % [queryLabels, queryLabels], 'none') 198 | ) 199 | .addPanel( 200 | g.panel('Brick Usage > 80% < 90%') + 201 | brickStatPanelArgs + 202 | g.statPanel('count((gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s) < 0.9) - count((gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s) < 0.8)' % [queryLabels, queryLabels, queryLabels, queryLabels], 'none') 203 | ) 204 | .addPanel( 205 | g.panel('Brick Usage > 90%') + 206 | brickStatPanelArgs + 207 | g.statPanel('count(gluster_brick_capacity_used_bytes%s) - count((gluster_brick_capacity_used_bytes%s / gluster_brick_capacity_bytes_total%s) < 0.9)' % [queryLabels, queryLabels, queryLabels], 'none') 208 | ) 209 | .addPanel( 210 | g.panel('IOPS - Avg') + 211 | brickStatPanelArgs + 212 | g.statPanel('avg((gluster_volume_profile_total_reads_interval%s + gluster_volume_profile_total_writes_interval%s) /gluster_volume_profile_duration_secs_interval%s)' % [queryLabels, queryLabels, queryLabels], 'none') 213 | ) 214 | .addPanel( 215 | g.panel('IOPS - Min') + 216 | brickStatPanelArgs + 217 | g.statPanel('min((gluster_volume_profile_total_reads_interval%s + gluster_volume_profile_total_writes_interval%s) /gluster_volume_profile_duration_secs_interval%s)' % [queryLabels, queryLabels, queryLabels], 'none') 218 | ) 219 | .addPanel( 220 | g.panel('IOPS - Max') + 221 | brickStatPanelArgs + 222 | g.statPanel('max((gluster_volume_profile_total_reads_interval%s + gluster_volume_profile_total_writes_interval%s) /gluster_volume_profile_duration_secs_interval%s)' % [queryLabels, queryLabels, queryLabels], 'none') 223 | ) 224 | .addPanel( 225 | g.panel('Heal Counts-Total Files') + 226 | brickStatPanelArgs + { span: 6 } + 227 | g.statPanel('sum (gluster_volume_heal_count%s)' % queryLabels, 'none') 228 | ) 229 | .addPanel( 230 | g.panel('Heal Counts-Files in Split-Brain') + { span: 6 } + 231 | brickStatPanelArgs + { span: 6 } + 232 | g.statPanel('sum (gluster_volume_split_brain_heal_count%s)' % queryLabels, 'none') 233 | ) 234 | ) 235 | .addRow( 236 | (g.row('Volume Profiling') + 237 | { 238 | showTitle: false, 239 | panels: self._panels, 240 | }) 241 | .addPanel( 242 | g.panel('Top file operation') + 243 | { 244 | span: 4, 245 | } + 246 | g.tablePanel([ 247 | 'sort(sum(gluster_volume_profile_fop_avg_latency%s)by (fop))' % fopQueryLabel, 248 | '', 249 | ], tableStyles { 250 | Value: { alias: 'Avg Latency' }, 251 | }) 252 | ) 253 | .addPanel( 254 | g.panel('File Operations For Locks Trends') + 255 | { 256 | span: 4, 257 | legend+: { show: false }, 258 | } + 259 | g.queryPanel('sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops%s) by (volume)' % fopLockQueryLabel, '') + 260 | g.stack 261 | ) 262 | .addPanel( 263 | g.panel('File Operations for Read/Write') + 264 | { 265 | span: 4, 266 | legend+: { show: false }, 267 | } + 268 | g.queryPanel('sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops%s) by (volume)' % fopReadWriteQueryLabel, '') + 269 | g.stack 270 | ) 271 | .addPanel( 272 | g.panel('File Operations for Inode Operations') + 273 | { 274 | span: 6, 275 | legend+: { show: false }, 276 | } + 277 | g.queryPanel('sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops%s) by (volume)' % fopInodeQueryLabel, '') + 278 | g.stack 279 | ) 280 | .addPanel( 281 | g.panel('File Operations for Entry Operations') + 282 | { 283 | span: 6, 284 | legend+: { show: false }, 285 | } + 286 | g.queryPanel('sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops%s) by (volume)' % fopEntryQueryLabel, '') + 287 | g.stack 288 | ) 289 | ), 290 | }, 291 | } 292 | -------------------------------------------------------------------------------- /docker/entry.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sa_dir=/var/run/secrets/kubernetes.io/serviceaccount 4 | 5 | kc_args="--server=https://kubernetes.default.svc.cluster.local --token=$(cat $sa_dir/token) --certificate-authority=$sa_dir/ca.crt" 6 | 7 | kubectl $kc_args apply -f manifests/ 8 | 9 | if [ $? -ne 0 ]; then 10 | echo "Failed to apply manifests/ folder" 11 | fi 12 | -------------------------------------------------------------------------------- /extras/README.md: -------------------------------------------------------------------------------- 1 | ## Prerequisites 2 | * Jsonnet [[Install Jsonnet]](https://github.com/google/jsonnet#building-jsonnet) 3 | 4 | [Jsonnet](https://jsonnet.org/learning/getting_started.html) is a data templating language for app and tool developers. 5 | 6 | The mixin project uses Jsonnet to provide reusable and configurable configs for Grafana Dashboards and Prometheus Alerts. 7 | * Jsonnet-bundler [[Install Jsonnet-bundler]](https://github.com/jsonnet-bundler/jsonnet-bundler#install) 8 | 9 | [Jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler) is a package manager for jsonnet. 10 | * gojsontoyaml 11 | 12 | `$ go get github.com/brancz/gojsontoyaml` 13 | 14 | ## How to generate manifests? 15 | 1. `$ git clone https://github.com/gluster/gluster-mixins.git` 16 | 2. `$ cd gluster-mixins/extras` 17 | 3. `$ jb install` 18 | 4. `$ ./build.sh example.jsonnet` 19 | 20 | Generated files are in `manifests` directory. 21 | 22 | ## How to apply manifests? 23 | * In K8s cluster, 24 | 25 | `$ kubectl create -f manifests/ || true` 26 | 27 | * In OC cluster, 28 | 29 | `$ oc create -f manifests/ || true` 30 | 31 | ## How to teardown? 32 | 33 | * In K8s cluster, 34 | 35 | `$ kubectl delete -f manifests/ || true` 36 | 37 | * In OC cluster, 38 | 39 | `$ oc delete -f manifests/ || true` 40 | -------------------------------------------------------------------------------- /extras/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script uses arg $1 (name of *.jsonnet file to use) to generate the manifests/*.yaml files. 4 | 5 | set -e 6 | set -x 7 | # only exit with zero if all commands of the pipeline exit successfully 8 | set -o pipefail 9 | 10 | # Make sure to start with a clean 'manifests' dir 11 | rm -rf manifests 12 | mkdir manifests 13 | 14 | # optional, but we would like to generate yaml, not json 15 | jsonnet -J vendor -m manifests "${1-example.jsonnet}" | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml; rm -f {}' -- {} 16 | -------------------------------------------------------------------------------- /extras/example.jsonnet: -------------------------------------------------------------------------------- 1 | local kp = (import 'operator/jsonnet/kube-prometheus.libsonnet') + { 2 | _config+:: { 3 | namespace: 'gcs', 4 | }, 5 | }; 6 | 7 | { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + 8 | { ['grafana-' + name]: kp.grafana[name] for name in std.objectFields(kp.grafana) } 9 | -------------------------------------------------------------------------------- /extras/jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "ksonnet", 5 | "source": { 6 | "git": { 7 | "remote": "https://github.com/ksonnet/ksonnet-lib", 8 | "subdir": "" 9 | } 10 | }, 11 | "version": "master" 12 | }, 13 | { 14 | "name": "gluster-mixins", 15 | "source": { 16 | "git": { 17 | "remote": "https://github.com/gluster/gluster-mixins", 18 | "subdir": "" 19 | } 20 | }, 21 | "version": "master" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /extras/manifests/00namespace-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: monitoring 5 | -------------------------------------------------------------------------------- /extras/manifests/grafana-dashboardDefinitions.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | items: 3 | - apiVersion: v1 4 | data: 5 | k8s-storage-resources-glusterfs-pv.json: |- 6 | { 7 | "annotations": { 8 | "list": [ 9 | 10 | ] 11 | }, 12 | "editable": true, 13 | "gnetId": null, 14 | "graphTooltip": 0, 15 | "hideControls": false, 16 | "links": [ 17 | 18 | ], 19 | "refresh": "10s", 20 | "rows": [ 21 | { 22 | "collapse": false, 23 | "height": "250px", 24 | "panels": [ 25 | { 26 | "aliasColors": { 27 | 28 | }, 29 | "bars": false, 30 | "colorValue": true, 31 | "colors": [ 32 | "#cc0000", 33 | "#92d400", 34 | "#FFFFFF" 35 | ], 36 | "dashLength": 10, 37 | "dashes": false, 38 | "datasource": "$datasource", 39 | "fill": 1, 40 | "format": "percentunit", 41 | "height": "75px", 42 | "id": 0, 43 | "legend": { 44 | "avg": false, 45 | "current": false, 46 | "max": false, 47 | "min": false, 48 | "show": true, 49 | "total": false, 50 | "values": false 51 | }, 52 | "lines": true, 53 | "linewidth": 1, 54 | "links": [ 55 | 56 | ], 57 | "nullPointMode": "null as zero", 58 | "percentage": false, 59 | "pointradius": 5, 60 | "points": false, 61 | "renderer": "flot", 62 | "seriesOverrides": [ 63 | 64 | ], 65 | "spaceLength": 10, 66 | "span": 3, 67 | "stack": false, 68 | "steppedLine": false, 69 | "targets": [ 70 | { 71 | "expr": "gluster_volume_up{volume = \"$Volume\"}", 72 | "format": "time_series", 73 | "instant": true, 74 | "intervalFactor": 2, 75 | "refId": "A" 76 | } 77 | ], 78 | "thresholds": "0.9,1.1", 79 | "timeFrom": null, 80 | "timeShift": null, 81 | "title": "Status", 82 | "tooltip": { 83 | "shared": true, 84 | "sort": 0, 85 | "value_type": "individual" 86 | }, 87 | "type": "singlestat", 88 | "valueMaps": [ 89 | { 90 | "op": "=", 91 | "text": "DOWN", 92 | "value": "0" 93 | }, 94 | { 95 | "op": "=", 96 | "text": "UP", 97 | "value": "1" 98 | } 99 | ], 100 | "xaxis": { 101 | "buckets": null, 102 | "mode": "time", 103 | "name": null, 104 | "show": true, 105 | "values": [ 106 | 107 | ] 108 | }, 109 | "yaxes": [ 110 | { 111 | "format": "short", 112 | "label": null, 113 | "logBase": 1, 114 | "max": null, 115 | "min": 0, 116 | "show": true 117 | }, 118 | { 119 | "format": "short", 120 | "label": null, 121 | "logBase": 1, 122 | "max": null, 123 | "min": null, 124 | "show": false 125 | } 126 | ] 127 | }, 128 | { 129 | "aliasColors": { 130 | 131 | }, 132 | "bars": false, 133 | "dashLength": 10, 134 | "dashes": false, 135 | "datasource": "$datasource", 136 | "fill": 1, 137 | "format": "percentunit", 138 | "height": "75px", 139 | "id": 1, 140 | "legend": { 141 | "avg": false, 142 | "current": false, 143 | "max": false, 144 | "min": false, 145 | "show": true, 146 | "total": false, 147 | "values": false 148 | }, 149 | "lines": true, 150 | "linewidth": 1, 151 | "links": [ 152 | 153 | ], 154 | "nullPointMode": "null as zero", 155 | "percentage": false, 156 | "pointradius": 5, 157 | "points": false, 158 | "renderer": "flot", 159 | "seriesOverrides": [ 160 | 161 | ], 162 | "spaceLength": 10, 163 | "span": 3, 164 | "stack": false, 165 | "steppedLine": false, 166 | "targets": [ 167 | { 168 | "expr": "gluster:volume_capacity_used_bytes_total:sum{volume='$Volume'} / gluster:volume_capacity_total_bytes:sum{volume='$Volume'}", 169 | "format": "time_series", 170 | "instant": true, 171 | "intervalFactor": 2, 172 | "refId": "A" 173 | } 174 | ], 175 | "thresholds": "70,80", 176 | "timeFrom": null, 177 | "timeShift": null, 178 | "title": "Capacity Utilization", 179 | "tooltip": { 180 | "shared": true, 181 | "sort": 0, 182 | "value_type": "individual" 183 | }, 184 | "type": "singlestat", 185 | "xaxis": { 186 | "buckets": null, 187 | "mode": "time", 188 | "name": null, 189 | "show": true, 190 | "values": [ 191 | 192 | ] 193 | }, 194 | "yaxes": [ 195 | { 196 | "format": "short", 197 | "label": null, 198 | "logBase": 1, 199 | "max": null, 200 | "min": 0, 201 | "show": true 202 | }, 203 | { 204 | "format": "short", 205 | "label": null, 206 | "logBase": 1, 207 | "max": null, 208 | "min": null, 209 | "show": false 210 | } 211 | ] 212 | }, 213 | { 214 | "aliasColors": { 215 | 216 | }, 217 | "bars": false, 218 | "dashLength": 10, 219 | "dashes": false, 220 | "datasource": "$datasource", 221 | "fill": 1, 222 | "format": "decbytes", 223 | "height": "75px", 224 | "id": 2, 225 | "legend": { 226 | "avg": false, 227 | "current": false, 228 | "max": false, 229 | "min": false, 230 | "show": true, 231 | "total": false, 232 | "values": false 233 | }, 234 | "lines": true, 235 | "linewidth": 1, 236 | "links": [ 237 | 238 | ], 239 | "nullPointMode": "null as zero", 240 | "percentage": false, 241 | "pointradius": 5, 242 | "points": false, 243 | "renderer": "flot", 244 | "seriesOverrides": [ 245 | 246 | ], 247 | "spaceLength": 10, 248 | "span": 3, 249 | "stack": false, 250 | "steppedLine": false, 251 | "targets": [ 252 | { 253 | "expr": "gluster:volume_capacity_total_bytes:sum{volume='$Volume'} - gluster:volume_capacity_used_bytes_total:sum{volume='$Volume'}", 254 | "format": "time_series", 255 | "instant": true, 256 | "intervalFactor": 2, 257 | "refId": "A" 258 | } 259 | ], 260 | "thresholds": "70,80", 261 | "timeFrom": null, 262 | "timeShift": null, 263 | "title": "Available Capacity", 264 | "tooltip": { 265 | "shared": true, 266 | "sort": 0, 267 | "value_type": "individual" 268 | }, 269 | "type": "singlestat", 270 | "xaxis": { 271 | "buckets": null, 272 | "mode": "time", 273 | "name": null, 274 | "show": true, 275 | "values": [ 276 | 277 | ] 278 | }, 279 | "yaxes": [ 280 | { 281 | "format": "short", 282 | "label": null, 283 | "logBase": 1, 284 | "max": null, 285 | "min": 0, 286 | "show": true 287 | }, 288 | { 289 | "format": "short", 290 | "label": null, 291 | "logBase": 1, 292 | "max": null, 293 | "min": null, 294 | "show": false 295 | } 296 | ] 297 | }, 298 | { 299 | "aliasColors": { 300 | 301 | }, 302 | "bars": false, 303 | "dashLength": 10, 304 | "dashes": false, 305 | "datasource": "$datasource", 306 | "fill": 1, 307 | "format": "none", 308 | "height": "75px", 309 | "id": 3, 310 | "legend": { 311 | "avg": false, 312 | "current": false, 313 | "max": false, 314 | "min": false, 315 | "show": true, 316 | "total": false, 317 | "values": false 318 | }, 319 | "lines": true, 320 | "linewidth": 1, 321 | "links": [ 322 | 323 | ], 324 | "nullPointMode": "null as zero", 325 | "percentage": false, 326 | "pointradius": 5, 327 | "points": false, 328 | "renderer": "flot", 329 | "seriesOverrides": [ 330 | 331 | ], 332 | "spaceLength": 10, 333 | "span": 3, 334 | "stack": false, 335 | "steppedLine": false, 336 | "targets": [ 337 | { 338 | "expr": "(sum (gluster_volume_profile_total_reads_interval{volume='$Volume'}) + sum(gluster_volume_profile_total_writes_interval{volume='$Volume'}))/max(gluster_volume_profile_duration_secs_interval{volume='$Volume'})", 339 | "format": "time_series", 340 | "instant": true, 341 | "intervalFactor": 2, 342 | "refId": "A" 343 | } 344 | ], 345 | "thresholds": "70,80", 346 | "timeFrom": null, 347 | "timeShift": null, 348 | "title": "IOPS", 349 | "tooltip": { 350 | "shared": true, 351 | "sort": 0, 352 | "value_type": "individual" 353 | }, 354 | "type": "singlestat", 355 | "xaxis": { 356 | "buckets": null, 357 | "mode": "time", 358 | "name": null, 359 | "show": true, 360 | "values": [ 361 | 362 | ] 363 | }, 364 | "yaxes": [ 365 | { 366 | "format": "short", 367 | "label": null, 368 | "logBase": 1, 369 | "max": null, 370 | "min": 0, 371 | "show": true 372 | }, 373 | { 374 | "format": "short", 375 | "label": null, 376 | "logBase": 1, 377 | "max": null, 378 | "min": null, 379 | "show": false 380 | } 381 | ] 382 | }, 383 | { 384 | "aliasColors": { 385 | 386 | }, 387 | "bars": false, 388 | "dashLength": 10, 389 | "dashes": false, 390 | "datasource": "$datasource", 391 | "fill": 10, 392 | "id": 4, 393 | "legend": { 394 | "avg": false, 395 | "current": false, 396 | "max": false, 397 | "min": false, 398 | "show": true, 399 | "total": false, 400 | "values": false 401 | }, 402 | "lines": true, 403 | "linewidth": 0, 404 | "links": [ 405 | 406 | ], 407 | "nullPointMode": "null as zero", 408 | "percentage": false, 409 | "pointradius": 5, 410 | "points": false, 411 | "renderer": "flot", 412 | "seriesOverrides": [ 413 | 414 | ], 415 | "spaceLength": 10, 416 | "span": 6, 417 | "stack": true, 418 | "steppedLine": false, 419 | "targets": [ 420 | { 421 | "expr": "gluster:volume_capacity_used_bytes_total:sum{volume='$Volume'}", 422 | "format": "time_series", 423 | "intervalFactor": 2, 424 | "legendFormat": "{{$Volume}}", 425 | "legendLink": null, 426 | "step": 10 427 | } 428 | ], 429 | "thresholds": [ 430 | 431 | ], 432 | "timeFrom": null, 433 | "timeShift": null, 434 | "title": "Capacity Utilization", 435 | "tooltip": { 436 | "shared": true, 437 | "sort": 0, 438 | "value_type": "individual" 439 | }, 440 | "type": "graph", 441 | "xaxis": { 442 | "buckets": null, 443 | "mode": "time", 444 | "name": null, 445 | "show": true, 446 | "values": [ 447 | 448 | ] 449 | }, 450 | "yaxes": [ 451 | { 452 | "format": "decbytes", 453 | "label": null, 454 | "logBase": 1, 455 | "max": null, 456 | "min": 0, 457 | "show": true 458 | }, 459 | { 460 | "format": "short", 461 | "label": null, 462 | "logBase": 1, 463 | "max": null, 464 | "min": null, 465 | "show": false 466 | } 467 | ] 468 | }, 469 | { 470 | "aliasColors": { 471 | 472 | }, 473 | "bars": false, 474 | "dashLength": 10, 475 | "dashes": false, 476 | "datasource": "$datasource", 477 | "fill": 10, 478 | "id": 5, 479 | "legend": { 480 | "avg": false, 481 | "current": false, 482 | "max": false, 483 | "min": false, 484 | "show": false, 485 | "total": false, 486 | "values": false 487 | }, 488 | "lines": true, 489 | "linewidth": 0, 490 | "links": [ 491 | 492 | ], 493 | "nullPointMode": "null as zero", 494 | "percentage": false, 495 | "pointradius": 5, 496 | "points": false, 497 | "renderer": "flot", 498 | "seriesOverrides": [ 499 | 500 | ], 501 | "spaceLength": 10, 502 | "span": 6, 503 | "stack": true, 504 | "steppedLine": false, 505 | "targets": [ 506 | { 507 | "expr": "(sum (gluster_volume_profile_total_reads_interval{volume='$Volume'}) + sum(gluster_volume_profile_total_writes_interval{volume='$Volume'}))/max(gluster_volume_profile_duration_secs_interval{volume='$Volume'})", 508 | "format": "time_series", 509 | "intervalFactor": 2, 510 | "legendFormat": "{{$Volume}}", 511 | "legendLink": null, 512 | "step": 10 513 | } 514 | ], 515 | "thresholds": [ 516 | 517 | ], 518 | "timeFrom": null, 519 | "timeShift": null, 520 | "title": "IOPS", 521 | "tooltip": { 522 | "shared": true, 523 | "sort": 0, 524 | "value_type": "individual" 525 | }, 526 | "type": "graph", 527 | "xaxis": { 528 | "buckets": null, 529 | "mode": "time", 530 | "name": null, 531 | "show": true, 532 | "values": [ 533 | 534 | ] 535 | }, 536 | "yaxes": [ 537 | { 538 | "format": "short", 539 | "label": null, 540 | "logBase": 1, 541 | "max": null, 542 | "min": 0, 543 | "show": true 544 | }, 545 | { 546 | "format": "short", 547 | "label": null, 548 | "logBase": 1, 549 | "max": null, 550 | "min": null, 551 | "show": false 552 | } 553 | ] 554 | } 555 | ], 556 | "repeat": null, 557 | "repeatIteration": null, 558 | "repeatRowId": null, 559 | "showTitle": false, 560 | "title": "Volume Summary", 561 | "titleSize": "h6" 562 | }, 563 | { 564 | "collapse": false, 565 | "height": "250px", 566 | "panels": [ 567 | { 568 | "aliasColors": { 569 | 570 | }, 571 | "bars": false, 572 | "dashLength": 10, 573 | "dashes": false, 574 | "datasource": "$datasource", 575 | "fill": 1, 576 | "id": 6, 577 | "legend": { 578 | "avg": false, 579 | "current": false, 580 | "max": false, 581 | "min": false, 582 | "show": true, 583 | "total": false, 584 | "values": false 585 | }, 586 | "lines": true, 587 | "linewidth": 1, 588 | "links": [ 589 | 590 | ], 591 | "nullPointMode": "null as zero", 592 | "percentage": false, 593 | "pointradius": 5, 594 | "points": false, 595 | "renderer": "flot", 596 | "seriesOverrides": [ 597 | 598 | ], 599 | "spaceLength": 10, 600 | "span": 6, 601 | "stack": false, 602 | "steppedLine": false, 603 | "targets": [ 604 | { 605 | "expr": "100*(gluster_thinpool_metadata_used_bytes{volume='$Volume'} / gluster_thinpool_metadata_total_bytes{volume='$Volume'})", 606 | "format": "time_series", 607 | "intervalFactor": 2, 608 | "legendFormat": "{{thinpool_name}}", 609 | "legendLink": null, 610 | "step": 10 611 | } 612 | ], 613 | "thresholds": [ 614 | 615 | ], 616 | "timeFrom": null, 617 | "timeShift": null, 618 | "title": "LVM Thin Pool Metadata %", 619 | "tooltip": { 620 | "shared": true, 621 | "sort": 0, 622 | "value_type": "individual" 623 | }, 624 | "type": "graph", 625 | "xaxis": { 626 | "buckets": null, 627 | "mode": "time", 628 | "name": null, 629 | "show": true, 630 | "values": [ 631 | 632 | ] 633 | }, 634 | "yaxes": [ 635 | { 636 | "format": "short", 637 | "label": null, 638 | "logBase": 1, 639 | "max": null, 640 | "min": 0, 641 | "show": true 642 | }, 643 | { 644 | "format": "short", 645 | "label": null, 646 | "logBase": 1, 647 | "max": null, 648 | "min": null, 649 | "show": false 650 | } 651 | ] 652 | }, 653 | { 654 | "aliasColors": { 655 | 656 | }, 657 | "bars": false, 658 | "dashLength": 10, 659 | "dashes": false, 660 | "datasource": "$datasource", 661 | "fill": 1, 662 | "id": 7, 663 | "legend": { 664 | "avg": false, 665 | "current": false, 666 | "max": false, 667 | "min": false, 668 | "show": true, 669 | "total": false, 670 | "values": false 671 | }, 672 | "lines": true, 673 | "linewidth": 1, 674 | "links": [ 675 | 676 | ], 677 | "nullPointMode": "null as zero", 678 | "percentage": false, 679 | "pointradius": 5, 680 | "points": false, 681 | "renderer": "flot", 682 | "seriesOverrides": [ 683 | 684 | ], 685 | "spaceLength": 10, 686 | "span": 6, 687 | "stack": false, 688 | "steppedLine": false, 689 | "targets": [ 690 | { 691 | "expr": "100*(gluster_thinpool_data_used_bytes{volume='$Volume'} / gluster_thinpool_data_total_bytes{volume='$Volume'})", 692 | "format": "time_series", 693 | "intervalFactor": 2, 694 | "legendFormat": "{{thinpool_name}}", 695 | "legendLink": null, 696 | "step": 10 697 | } 698 | ], 699 | "thresholds": [ 700 | 701 | ], 702 | "timeFrom": null, 703 | "timeShift": null, 704 | "title": "LVM Thin Pool Data Usage %", 705 | "tooltip": { 706 | "shared": true, 707 | "sort": 0, 708 | "value_type": "individual" 709 | }, 710 | "type": "graph", 711 | "xaxis": { 712 | "buckets": null, 713 | "mode": "time", 714 | "name": null, 715 | "show": true, 716 | "values": [ 717 | 718 | ] 719 | }, 720 | "yaxes": [ 721 | { 722 | "format": "short", 723 | "label": null, 724 | "logBase": 1, 725 | "max": null, 726 | "min": 0, 727 | "show": true 728 | }, 729 | { 730 | "format": "short", 731 | "label": null, 732 | "logBase": 1, 733 | "max": null, 734 | "min": null, 735 | "show": false 736 | } 737 | ] 738 | } 739 | ], 740 | "repeat": null, 741 | "repeatIteration": null, 742 | "repeatRowId": null, 743 | "showTitle": true, 744 | "title": "LVM Summary", 745 | "titleSize": "h6" 746 | }, 747 | { 748 | "collapse": false, 749 | "height": "250px", 750 | "panels": [ 751 | { 752 | "aliasColors": { 753 | 754 | }, 755 | "bars": false, 756 | "dashLength": 10, 757 | "dashes": false, 758 | "datasource": "$datasource", 759 | "fill": 1, 760 | "format": "none", 761 | "height": "75px", 762 | "id": 8, 763 | "legend": { 764 | "avg": false, 765 | "current": false, 766 | "max": false, 767 | "min": false, 768 | "show": true, 769 | "total": false, 770 | "values": false 771 | }, 772 | "lines": true, 773 | "linewidth": 1, 774 | "links": [ 775 | 776 | ], 777 | "nullPointMode": "null as zero", 778 | "percentage": false, 779 | "pointradius": 5, 780 | "points": false, 781 | "renderer": "flot", 782 | "seriesOverrides": [ 783 | 784 | ], 785 | "spaceLength": 10, 786 | "span": 4, 787 | "stack": false, 788 | "steppedLine": false, 789 | "targets": [ 790 | { 791 | "expr": "gluster_volume_brick_count{volume='$Volume'}", 792 | "format": "time_series", 793 | "instant": true, 794 | "intervalFactor": 2, 795 | "refId": "A" 796 | } 797 | ], 798 | "thresholds": "70,80", 799 | "timeFrom": null, 800 | "timeShift": null, 801 | "title": "Bricks-Total", 802 | "tooltip": { 803 | "shared": true, 804 | "sort": 0, 805 | "value_type": "individual" 806 | }, 807 | "type": "singlestat", 808 | "xaxis": { 809 | "buckets": null, 810 | "mode": "time", 811 | "name": null, 812 | "show": true, 813 | "values": [ 814 | 815 | ] 816 | }, 817 | "yaxes": [ 818 | { 819 | "format": "short", 820 | "label": null, 821 | "logBase": 1, 822 | "max": null, 823 | "min": 0, 824 | "show": true 825 | }, 826 | { 827 | "format": "short", 828 | "label": null, 829 | "logBase": 1, 830 | "max": null, 831 | "min": null, 832 | "show": false 833 | } 834 | ] 835 | }, 836 | { 837 | "aliasColors": { 838 | 839 | }, 840 | "bars": false, 841 | "colorValue": true, 842 | "colors": [ 843 | "#FFFFFF", 844 | "#FFFFFF", 845 | "#92d400" 846 | ], 847 | "dashLength": 10, 848 | "dashes": false, 849 | "datasource": "$datasource", 850 | "fill": 1, 851 | "format": "none", 852 | "height": "75px", 853 | "id": 9, 854 | "legend": { 855 | "avg": false, 856 | "current": false, 857 | "max": false, 858 | "min": false, 859 | "show": true, 860 | "total": false, 861 | "values": false 862 | }, 863 | "lines": true, 864 | "linewidth": 1, 865 | "links": [ 866 | 867 | ], 868 | "nullPointMode": "null as zero", 869 | "percentage": false, 870 | "pointradius": 5, 871 | "points": false, 872 | "renderer": "flot", 873 | "seriesOverrides": [ 874 | 875 | ], 876 | "spaceLength": 10, 877 | "span": 4, 878 | "stack": false, 879 | "steppedLine": false, 880 | "targets": [ 881 | { 882 | "expr": "count (gluster_brick_up{volume='$Volume'} == 1)", 883 | "format": "time_series", 884 | "instant": true, 885 | "intervalFactor": 2, 886 | "refId": "A" 887 | } 888 | ], 889 | "thresholds": "0.1,0.9", 890 | "timeFrom": null, 891 | "timeShift": null, 892 | "title": "Bricks-Up", 893 | "tooltip": { 894 | "shared": true, 895 | "sort": 0, 896 | "value_type": "individual" 897 | }, 898 | "type": "singlestat", 899 | "xaxis": { 900 | "buckets": null, 901 | "mode": "time", 902 | "name": null, 903 | "show": true, 904 | "values": [ 905 | 906 | ] 907 | }, 908 | "yaxes": [ 909 | { 910 | "format": "short", 911 | "label": null, 912 | "logBase": 1, 913 | "max": null, 914 | "min": 0, 915 | "show": true 916 | }, 917 | { 918 | "format": "short", 919 | "label": null, 920 | "logBase": 1, 921 | "max": null, 922 | "min": null, 923 | "show": false 924 | } 925 | ] 926 | }, 927 | { 928 | "aliasColors": { 929 | 930 | }, 931 | "bars": false, 932 | "colorValue": true, 933 | "colors": [ 934 | "#FFFFFF", 935 | "#FFFFFF", 936 | "#cc0000" 937 | ], 938 | "dashLength": 10, 939 | "dashes": false, 940 | "datasource": "$datasource", 941 | "fill": 1, 942 | "format": "none", 943 | "height": "75px", 944 | "id": 10, 945 | "legend": { 946 | "avg": false, 947 | "current": false, 948 | "max": false, 949 | "min": false, 950 | "show": true, 951 | "total": false, 952 | "values": false 953 | }, 954 | "lines": true, 955 | "linewidth": 1, 956 | "links": [ 957 | 958 | ], 959 | "nullPointMode": "null as zero", 960 | "percentage": false, 961 | "pointradius": 5, 962 | "points": false, 963 | "renderer": "flot", 964 | "seriesOverrides": [ 965 | 966 | ], 967 | "spaceLength": 10, 968 | "span": 4, 969 | "stack": false, 970 | "steppedLine": false, 971 | "targets": [ 972 | { 973 | "expr": "count(gluster_brick_up{volume='$Volume'}) - count (gluster_brick_up{volume='$Volume'} == 1)", 974 | "format": "time_series", 975 | "instant": true, 976 | "intervalFactor": 2, 977 | "refId": "A" 978 | } 979 | ], 980 | "thresholds": "0.1,0.9", 981 | "timeFrom": null, 982 | "timeShift": null, 983 | "title": "Bricks-Down", 984 | "tooltip": { 985 | "shared": true, 986 | "sort": 0, 987 | "value_type": "individual" 988 | }, 989 | "type": "singlestat", 990 | "xaxis": { 991 | "buckets": null, 992 | "mode": "time", 993 | "name": null, 994 | "show": true, 995 | "values": [ 996 | 997 | ] 998 | }, 999 | "yaxes": [ 1000 | { 1001 | "format": "short", 1002 | "label": null, 1003 | "logBase": 1, 1004 | "max": null, 1005 | "min": 0, 1006 | "show": true 1007 | }, 1008 | { 1009 | "format": "short", 1010 | "label": null, 1011 | "logBase": 1, 1012 | "max": null, 1013 | "min": null, 1014 | "show": false 1015 | } 1016 | ] 1017 | }, 1018 | { 1019 | "aliasColors": { 1020 | 1021 | }, 1022 | "bars": false, 1023 | "dashLength": 10, 1024 | "dashes": false, 1025 | "datasource": "$datasource", 1026 | "fill": 1, 1027 | "format": "percentunit", 1028 | "height": "75px", 1029 | "id": 11, 1030 | "legend": { 1031 | "avg": false, 1032 | "current": false, 1033 | "max": false, 1034 | "min": false, 1035 | "show": true, 1036 | "total": false, 1037 | "values": false 1038 | }, 1039 | "lines": true, 1040 | "linewidth": 1, 1041 | "links": [ 1042 | 1043 | ], 1044 | "nullPointMode": "null as zero", 1045 | "percentage": false, 1046 | "pointradius": 5, 1047 | "points": false, 1048 | "renderer": "flot", 1049 | "seriesOverrides": [ 1050 | 1051 | ], 1052 | "spaceLength": 10, 1053 | "span": 4, 1054 | "stack": false, 1055 | "steppedLine": false, 1056 | "targets": [ 1057 | { 1058 | "expr": "avg (gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'})", 1059 | "format": "time_series", 1060 | "instant": true, 1061 | "intervalFactor": 2, 1062 | "refId": "A" 1063 | } 1064 | ], 1065 | "thresholds": "70,80", 1066 | "timeFrom": null, 1067 | "timeShift": null, 1068 | "title": "Capacity Utilization-Average", 1069 | "tooltip": { 1070 | "shared": true, 1071 | "sort": 0, 1072 | "value_type": "individual" 1073 | }, 1074 | "type": "singlestat", 1075 | "xaxis": { 1076 | "buckets": null, 1077 | "mode": "time", 1078 | "name": null, 1079 | "show": true, 1080 | "values": [ 1081 | 1082 | ] 1083 | }, 1084 | "yaxes": [ 1085 | { 1086 | "format": "short", 1087 | "label": null, 1088 | "logBase": 1, 1089 | "max": null, 1090 | "min": 0, 1091 | "show": true 1092 | }, 1093 | { 1094 | "format": "short", 1095 | "label": null, 1096 | "logBase": 1, 1097 | "max": null, 1098 | "min": null, 1099 | "show": false 1100 | } 1101 | ] 1102 | }, 1103 | { 1104 | "aliasColors": { 1105 | 1106 | }, 1107 | "bars": false, 1108 | "dashLength": 10, 1109 | "dashes": false, 1110 | "datasource": "$datasource", 1111 | "fill": 1, 1112 | "format": "percentunit", 1113 | "height": "75px", 1114 | "id": 12, 1115 | "legend": { 1116 | "avg": false, 1117 | "current": false, 1118 | "max": false, 1119 | "min": false, 1120 | "show": true, 1121 | "total": false, 1122 | "values": false 1123 | }, 1124 | "lines": true, 1125 | "linewidth": 1, 1126 | "links": [ 1127 | 1128 | ], 1129 | "nullPointMode": "null as zero", 1130 | "percentage": false, 1131 | "pointradius": 5, 1132 | "points": false, 1133 | "renderer": "flot", 1134 | "seriesOverrides": [ 1135 | 1136 | ], 1137 | "spaceLength": 10, 1138 | "span": 4, 1139 | "stack": false, 1140 | "steppedLine": false, 1141 | "targets": [ 1142 | { 1143 | "expr": "min (gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'})", 1144 | "format": "time_series", 1145 | "instant": true, 1146 | "intervalFactor": 2, 1147 | "refId": "A" 1148 | } 1149 | ], 1150 | "thresholds": "70,80", 1151 | "timeFrom": null, 1152 | "timeShift": null, 1153 | "title": "Capacity Utilization-Min", 1154 | "tooltip": { 1155 | "shared": true, 1156 | "sort": 0, 1157 | "value_type": "individual" 1158 | }, 1159 | "type": "singlestat", 1160 | "xaxis": { 1161 | "buckets": null, 1162 | "mode": "time", 1163 | "name": null, 1164 | "show": true, 1165 | "values": [ 1166 | 1167 | ] 1168 | }, 1169 | "yaxes": [ 1170 | { 1171 | "format": "short", 1172 | "label": null, 1173 | "logBase": 1, 1174 | "max": null, 1175 | "min": 0, 1176 | "show": true 1177 | }, 1178 | { 1179 | "format": "short", 1180 | "label": null, 1181 | "logBase": 1, 1182 | "max": null, 1183 | "min": null, 1184 | "show": false 1185 | } 1186 | ] 1187 | }, 1188 | { 1189 | "aliasColors": { 1190 | 1191 | }, 1192 | "bars": false, 1193 | "dashLength": 10, 1194 | "dashes": false, 1195 | "datasource": "$datasource", 1196 | "fill": 1, 1197 | "format": "percentunit", 1198 | "height": "75px", 1199 | "id": 13, 1200 | "legend": { 1201 | "avg": false, 1202 | "current": false, 1203 | "max": false, 1204 | "min": false, 1205 | "show": true, 1206 | "total": false, 1207 | "values": false 1208 | }, 1209 | "lines": true, 1210 | "linewidth": 1, 1211 | "links": [ 1212 | 1213 | ], 1214 | "nullPointMode": "null as zero", 1215 | "percentage": false, 1216 | "pointradius": 5, 1217 | "points": false, 1218 | "renderer": "flot", 1219 | "seriesOverrides": [ 1220 | 1221 | ], 1222 | "spaceLength": 10, 1223 | "span": 4, 1224 | "stack": false, 1225 | "steppedLine": false, 1226 | "targets": [ 1227 | { 1228 | "expr": "max (gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'})", 1229 | "format": "time_series", 1230 | "instant": true, 1231 | "intervalFactor": 2, 1232 | "refId": "A" 1233 | } 1234 | ], 1235 | "thresholds": "70,80", 1236 | "timeFrom": null, 1237 | "timeShift": null, 1238 | "title": "Capacity Utilization-Max", 1239 | "tooltip": { 1240 | "shared": true, 1241 | "sort": 0, 1242 | "value_type": "individual" 1243 | }, 1244 | "type": "singlestat", 1245 | "xaxis": { 1246 | "buckets": null, 1247 | "mode": "time", 1248 | "name": null, 1249 | "show": true, 1250 | "values": [ 1251 | 1252 | ] 1253 | }, 1254 | "yaxes": [ 1255 | { 1256 | "format": "short", 1257 | "label": null, 1258 | "logBase": 1, 1259 | "max": null, 1260 | "min": 0, 1261 | "show": true 1262 | }, 1263 | { 1264 | "format": "short", 1265 | "label": null, 1266 | "logBase": 1, 1267 | "max": null, 1268 | "min": null, 1269 | "show": false 1270 | } 1271 | ] 1272 | }, 1273 | { 1274 | "aliasColors": { 1275 | 1276 | }, 1277 | "bars": false, 1278 | "dashLength": 10, 1279 | "dashes": false, 1280 | "datasource": "$datasource", 1281 | "fill": 1, 1282 | "format": "none", 1283 | "height": "75px", 1284 | "id": 14, 1285 | "legend": { 1286 | "avg": false, 1287 | "current": false, 1288 | "max": false, 1289 | "min": false, 1290 | "show": true, 1291 | "total": false, 1292 | "values": false 1293 | }, 1294 | "lines": true, 1295 | "linewidth": 1, 1296 | "links": [ 1297 | 1298 | ], 1299 | "nullPointMode": "null as zero", 1300 | "percentage": false, 1301 | "pointradius": 5, 1302 | "points": false, 1303 | "renderer": "flot", 1304 | "seriesOverrides": [ 1305 | 1306 | ], 1307 | "spaceLength": 10, 1308 | "span": 4, 1309 | "stack": false, 1310 | "steppedLine": false, 1311 | "targets": [ 1312 | { 1313 | "expr": "count((gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'}) < 0.8)", 1314 | "format": "time_series", 1315 | "instant": true, 1316 | "intervalFactor": 2, 1317 | "refId": "A" 1318 | } 1319 | ], 1320 | "thresholds": "70,80", 1321 | "timeFrom": null, 1322 | "timeShift": null, 1323 | "title": "Brick Usage < 80%", 1324 | "tooltip": { 1325 | "shared": true, 1326 | "sort": 0, 1327 | "value_type": "individual" 1328 | }, 1329 | "type": "singlestat", 1330 | "xaxis": { 1331 | "buckets": null, 1332 | "mode": "time", 1333 | "name": null, 1334 | "show": true, 1335 | "values": [ 1336 | 1337 | ] 1338 | }, 1339 | "yaxes": [ 1340 | { 1341 | "format": "short", 1342 | "label": null, 1343 | "logBase": 1, 1344 | "max": null, 1345 | "min": 0, 1346 | "show": true 1347 | }, 1348 | { 1349 | "format": "short", 1350 | "label": null, 1351 | "logBase": 1, 1352 | "max": null, 1353 | "min": null, 1354 | "show": false 1355 | } 1356 | ] 1357 | }, 1358 | { 1359 | "aliasColors": { 1360 | 1361 | }, 1362 | "bars": false, 1363 | "dashLength": 10, 1364 | "dashes": false, 1365 | "datasource": "$datasource", 1366 | "fill": 1, 1367 | "format": "none", 1368 | "height": "75px", 1369 | "id": 15, 1370 | "legend": { 1371 | "avg": false, 1372 | "current": false, 1373 | "max": false, 1374 | "min": false, 1375 | "show": true, 1376 | "total": false, 1377 | "values": false 1378 | }, 1379 | "lines": true, 1380 | "linewidth": 1, 1381 | "links": [ 1382 | 1383 | ], 1384 | "nullPointMode": "null as zero", 1385 | "percentage": false, 1386 | "pointradius": 5, 1387 | "points": false, 1388 | "renderer": "flot", 1389 | "seriesOverrides": [ 1390 | 1391 | ], 1392 | "spaceLength": 10, 1393 | "span": 4, 1394 | "stack": false, 1395 | "steppedLine": false, 1396 | "targets": [ 1397 | { 1398 | "expr": "count((gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'}) < 0.9) - count((gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'}) < 0.8)", 1399 | "format": "time_series", 1400 | "instant": true, 1401 | "intervalFactor": 2, 1402 | "refId": "A" 1403 | } 1404 | ], 1405 | "thresholds": "70,80", 1406 | "timeFrom": null, 1407 | "timeShift": null, 1408 | "title": "Brick Usage > 80% < 90%", 1409 | "tooltip": { 1410 | "shared": true, 1411 | "sort": 0, 1412 | "value_type": "individual" 1413 | }, 1414 | "type": "singlestat", 1415 | "xaxis": { 1416 | "buckets": null, 1417 | "mode": "time", 1418 | "name": null, 1419 | "show": true, 1420 | "values": [ 1421 | 1422 | ] 1423 | }, 1424 | "yaxes": [ 1425 | { 1426 | "format": "short", 1427 | "label": null, 1428 | "logBase": 1, 1429 | "max": null, 1430 | "min": 0, 1431 | "show": true 1432 | }, 1433 | { 1434 | "format": "short", 1435 | "label": null, 1436 | "logBase": 1, 1437 | "max": null, 1438 | "min": null, 1439 | "show": false 1440 | } 1441 | ] 1442 | }, 1443 | { 1444 | "aliasColors": { 1445 | 1446 | }, 1447 | "bars": false, 1448 | "dashLength": 10, 1449 | "dashes": false, 1450 | "datasource": "$datasource", 1451 | "fill": 1, 1452 | "format": "none", 1453 | "height": "75px", 1454 | "id": 16, 1455 | "legend": { 1456 | "avg": false, 1457 | "current": false, 1458 | "max": false, 1459 | "min": false, 1460 | "show": true, 1461 | "total": false, 1462 | "values": false 1463 | }, 1464 | "lines": true, 1465 | "linewidth": 1, 1466 | "links": [ 1467 | 1468 | ], 1469 | "nullPointMode": "null as zero", 1470 | "percentage": false, 1471 | "pointradius": 5, 1472 | "points": false, 1473 | "renderer": "flot", 1474 | "seriesOverrides": [ 1475 | 1476 | ], 1477 | "spaceLength": 10, 1478 | "span": 4, 1479 | "stack": false, 1480 | "steppedLine": false, 1481 | "targets": [ 1482 | { 1483 | "expr": "count(gluster_brick_capacity_used_bytes{volume='$Volume'}) - count((gluster_brick_capacity_used_bytes{volume='$Volume'} / gluster_brick_capacity_bytes_total{volume='$Volume'}) < 0.9)", 1484 | "format": "time_series", 1485 | "instant": true, 1486 | "intervalFactor": 2, 1487 | "refId": "A" 1488 | } 1489 | ], 1490 | "thresholds": "70,80", 1491 | "timeFrom": null, 1492 | "timeShift": null, 1493 | "title": "Brick Usage > 90%", 1494 | "tooltip": { 1495 | "shared": true, 1496 | "sort": 0, 1497 | "value_type": "individual" 1498 | }, 1499 | "type": "singlestat", 1500 | "xaxis": { 1501 | "buckets": null, 1502 | "mode": "time", 1503 | "name": null, 1504 | "show": true, 1505 | "values": [ 1506 | 1507 | ] 1508 | }, 1509 | "yaxes": [ 1510 | { 1511 | "format": "short", 1512 | "label": null, 1513 | "logBase": 1, 1514 | "max": null, 1515 | "min": 0, 1516 | "show": true 1517 | }, 1518 | { 1519 | "format": "short", 1520 | "label": null, 1521 | "logBase": 1, 1522 | "max": null, 1523 | "min": null, 1524 | "show": false 1525 | } 1526 | ] 1527 | }, 1528 | { 1529 | "aliasColors": { 1530 | 1531 | }, 1532 | "bars": false, 1533 | "dashLength": 10, 1534 | "dashes": false, 1535 | "datasource": "$datasource", 1536 | "fill": 1, 1537 | "format": "none", 1538 | "height": "75px", 1539 | "id": 17, 1540 | "legend": { 1541 | "avg": false, 1542 | "current": false, 1543 | "max": false, 1544 | "min": false, 1545 | "show": true, 1546 | "total": false, 1547 | "values": false 1548 | }, 1549 | "lines": true, 1550 | "linewidth": 1, 1551 | "links": [ 1552 | 1553 | ], 1554 | "nullPointMode": "null as zero", 1555 | "percentage": false, 1556 | "pointradius": 5, 1557 | "points": false, 1558 | "renderer": "flot", 1559 | "seriesOverrides": [ 1560 | 1561 | ], 1562 | "spaceLength": 10, 1563 | "span": 4, 1564 | "stack": false, 1565 | "steppedLine": false, 1566 | "targets": [ 1567 | { 1568 | "expr": "avg((gluster_volume_profile_total_reads_interval{volume='$Volume'} + gluster_volume_profile_total_writes_interval{volume='$Volume'}) /gluster_volume_profile_duration_secs_interval{volume='$Volume'})", 1569 | "format": "time_series", 1570 | "instant": true, 1571 | "intervalFactor": 2, 1572 | "refId": "A" 1573 | } 1574 | ], 1575 | "thresholds": "70,80", 1576 | "timeFrom": null, 1577 | "timeShift": null, 1578 | "title": "IOPS - Avg", 1579 | "tooltip": { 1580 | "shared": true, 1581 | "sort": 0, 1582 | "value_type": "individual" 1583 | }, 1584 | "type": "singlestat", 1585 | "xaxis": { 1586 | "buckets": null, 1587 | "mode": "time", 1588 | "name": null, 1589 | "show": true, 1590 | "values": [ 1591 | 1592 | ] 1593 | }, 1594 | "yaxes": [ 1595 | { 1596 | "format": "short", 1597 | "label": null, 1598 | "logBase": 1, 1599 | "max": null, 1600 | "min": 0, 1601 | "show": true 1602 | }, 1603 | { 1604 | "format": "short", 1605 | "label": null, 1606 | "logBase": 1, 1607 | "max": null, 1608 | "min": null, 1609 | "show": false 1610 | } 1611 | ] 1612 | }, 1613 | { 1614 | "aliasColors": { 1615 | 1616 | }, 1617 | "bars": false, 1618 | "dashLength": 10, 1619 | "dashes": false, 1620 | "datasource": "$datasource", 1621 | "fill": 1, 1622 | "format": "none", 1623 | "height": "75px", 1624 | "id": 18, 1625 | "legend": { 1626 | "avg": false, 1627 | "current": false, 1628 | "max": false, 1629 | "min": false, 1630 | "show": true, 1631 | "total": false, 1632 | "values": false 1633 | }, 1634 | "lines": true, 1635 | "linewidth": 1, 1636 | "links": [ 1637 | 1638 | ], 1639 | "nullPointMode": "null as zero", 1640 | "percentage": false, 1641 | "pointradius": 5, 1642 | "points": false, 1643 | "renderer": "flot", 1644 | "seriesOverrides": [ 1645 | 1646 | ], 1647 | "spaceLength": 10, 1648 | "span": 4, 1649 | "stack": false, 1650 | "steppedLine": false, 1651 | "targets": [ 1652 | { 1653 | "expr": "min((gluster_volume_profile_total_reads_interval{volume='$Volume'} + gluster_volume_profile_total_writes_interval{volume='$Volume'}) /gluster_volume_profile_duration_secs_interval{volume='$Volume'})", 1654 | "format": "time_series", 1655 | "instant": true, 1656 | "intervalFactor": 2, 1657 | "refId": "A" 1658 | } 1659 | ], 1660 | "thresholds": "70,80", 1661 | "timeFrom": null, 1662 | "timeShift": null, 1663 | "title": "IOPS - Min", 1664 | "tooltip": { 1665 | "shared": true, 1666 | "sort": 0, 1667 | "value_type": "individual" 1668 | }, 1669 | "type": "singlestat", 1670 | "xaxis": { 1671 | "buckets": null, 1672 | "mode": "time", 1673 | "name": null, 1674 | "show": true, 1675 | "values": [ 1676 | 1677 | ] 1678 | }, 1679 | "yaxes": [ 1680 | { 1681 | "format": "short", 1682 | "label": null, 1683 | "logBase": 1, 1684 | "max": null, 1685 | "min": 0, 1686 | "show": true 1687 | }, 1688 | { 1689 | "format": "short", 1690 | "label": null, 1691 | "logBase": 1, 1692 | "max": null, 1693 | "min": null, 1694 | "show": false 1695 | } 1696 | ] 1697 | }, 1698 | { 1699 | "aliasColors": { 1700 | 1701 | }, 1702 | "bars": false, 1703 | "dashLength": 10, 1704 | "dashes": false, 1705 | "datasource": "$datasource", 1706 | "fill": 1, 1707 | "format": "none", 1708 | "height": "75px", 1709 | "id": 19, 1710 | "legend": { 1711 | "avg": false, 1712 | "current": false, 1713 | "max": false, 1714 | "min": false, 1715 | "show": true, 1716 | "total": false, 1717 | "values": false 1718 | }, 1719 | "lines": true, 1720 | "linewidth": 1, 1721 | "links": [ 1722 | 1723 | ], 1724 | "nullPointMode": "null as zero", 1725 | "percentage": false, 1726 | "pointradius": 5, 1727 | "points": false, 1728 | "renderer": "flot", 1729 | "seriesOverrides": [ 1730 | 1731 | ], 1732 | "spaceLength": 10, 1733 | "span": 4, 1734 | "stack": false, 1735 | "steppedLine": false, 1736 | "targets": [ 1737 | { 1738 | "expr": "max((gluster_volume_profile_total_reads_interval{volume='$Volume'} + gluster_volume_profile_total_writes_interval{volume='$Volume'}) /gluster_volume_profile_duration_secs_interval{volume='$Volume'})", 1739 | "format": "time_series", 1740 | "instant": true, 1741 | "intervalFactor": 2, 1742 | "refId": "A" 1743 | } 1744 | ], 1745 | "thresholds": "70,80", 1746 | "timeFrom": null, 1747 | "timeShift": null, 1748 | "title": "IOPS - Max", 1749 | "tooltip": { 1750 | "shared": true, 1751 | "sort": 0, 1752 | "value_type": "individual" 1753 | }, 1754 | "type": "singlestat", 1755 | "xaxis": { 1756 | "buckets": null, 1757 | "mode": "time", 1758 | "name": null, 1759 | "show": true, 1760 | "values": [ 1761 | 1762 | ] 1763 | }, 1764 | "yaxes": [ 1765 | { 1766 | "format": "short", 1767 | "label": null, 1768 | "logBase": 1, 1769 | "max": null, 1770 | "min": 0, 1771 | "show": true 1772 | }, 1773 | { 1774 | "format": "short", 1775 | "label": null, 1776 | "logBase": 1, 1777 | "max": null, 1778 | "min": null, 1779 | "show": false 1780 | } 1781 | ] 1782 | }, 1783 | { 1784 | "aliasColors": { 1785 | 1786 | }, 1787 | "bars": false, 1788 | "dashLength": 10, 1789 | "dashes": false, 1790 | "datasource": "$datasource", 1791 | "fill": 1, 1792 | "format": "none", 1793 | "height": "75px", 1794 | "id": 20, 1795 | "legend": { 1796 | "avg": false, 1797 | "current": false, 1798 | "max": false, 1799 | "min": false, 1800 | "show": true, 1801 | "total": false, 1802 | "values": false 1803 | }, 1804 | "lines": true, 1805 | "linewidth": 1, 1806 | "links": [ 1807 | 1808 | ], 1809 | "nullPointMode": "null as zero", 1810 | "percentage": false, 1811 | "pointradius": 5, 1812 | "points": false, 1813 | "renderer": "flot", 1814 | "seriesOverrides": [ 1815 | 1816 | ], 1817 | "spaceLength": 10, 1818 | "span": 6, 1819 | "stack": false, 1820 | "steppedLine": false, 1821 | "targets": [ 1822 | { 1823 | "expr": "sum (gluster_volume_heal_count{volume='$Volume'})", 1824 | "format": "time_series", 1825 | "instant": true, 1826 | "intervalFactor": 2, 1827 | "refId": "A" 1828 | } 1829 | ], 1830 | "thresholds": "70,80", 1831 | "timeFrom": null, 1832 | "timeShift": null, 1833 | "title": "Heal Counts-Total Files", 1834 | "tooltip": { 1835 | "shared": true, 1836 | "sort": 0, 1837 | "value_type": "individual" 1838 | }, 1839 | "type": "singlestat", 1840 | "xaxis": { 1841 | "buckets": null, 1842 | "mode": "time", 1843 | "name": null, 1844 | "show": true, 1845 | "values": [ 1846 | 1847 | ] 1848 | }, 1849 | "yaxes": [ 1850 | { 1851 | "format": "short", 1852 | "label": null, 1853 | "logBase": 1, 1854 | "max": null, 1855 | "min": 0, 1856 | "show": true 1857 | }, 1858 | { 1859 | "format": "short", 1860 | "label": null, 1861 | "logBase": 1, 1862 | "max": null, 1863 | "min": null, 1864 | "show": false 1865 | } 1866 | ] 1867 | }, 1868 | { 1869 | "aliasColors": { 1870 | 1871 | }, 1872 | "bars": false, 1873 | "dashLength": 10, 1874 | "dashes": false, 1875 | "datasource": "$datasource", 1876 | "fill": 1, 1877 | "format": "none", 1878 | "height": "75px", 1879 | "id": 21, 1880 | "legend": { 1881 | "avg": false, 1882 | "current": false, 1883 | "max": false, 1884 | "min": false, 1885 | "show": true, 1886 | "total": false, 1887 | "values": false 1888 | }, 1889 | "lines": true, 1890 | "linewidth": 1, 1891 | "links": [ 1892 | 1893 | ], 1894 | "nullPointMode": "null as zero", 1895 | "percentage": false, 1896 | "pointradius": 5, 1897 | "points": false, 1898 | "renderer": "flot", 1899 | "seriesOverrides": [ 1900 | 1901 | ], 1902 | "spaceLength": 10, 1903 | "span": 6, 1904 | "stack": false, 1905 | "steppedLine": false, 1906 | "targets": [ 1907 | { 1908 | "expr": "sum (gluster_volume_split_brain_heal_count{volume='$Volume'})", 1909 | "format": "time_series", 1910 | "instant": true, 1911 | "intervalFactor": 2, 1912 | "refId": "A" 1913 | } 1914 | ], 1915 | "thresholds": "70,80", 1916 | "timeFrom": null, 1917 | "timeShift": null, 1918 | "title": "Heal Counts-Files in Split-Brain", 1919 | "tooltip": { 1920 | "shared": true, 1921 | "sort": 0, 1922 | "value_type": "individual" 1923 | }, 1924 | "type": "singlestat", 1925 | "xaxis": { 1926 | "buckets": null, 1927 | "mode": "time", 1928 | "name": null, 1929 | "show": true, 1930 | "values": [ 1931 | 1932 | ] 1933 | }, 1934 | "yaxes": [ 1935 | { 1936 | "format": "short", 1937 | "label": null, 1938 | "logBase": 1, 1939 | "max": null, 1940 | "min": 0, 1941 | "show": true 1942 | }, 1943 | { 1944 | "format": "short", 1945 | "label": null, 1946 | "logBase": 1, 1947 | "max": null, 1948 | "min": null, 1949 | "show": false 1950 | } 1951 | ] 1952 | } 1953 | ], 1954 | "repeat": null, 1955 | "repeatIteration": null, 1956 | "repeatRowId": null, 1957 | "showTitle": false, 1958 | "title": "Bricks (Volume Subcomponent) Summary", 1959 | "titleSize": "h6" 1960 | }, 1961 | { 1962 | "collapse": false, 1963 | "height": "250px", 1964 | "panels": [ 1965 | { 1966 | "aliasColors": { 1967 | 1968 | }, 1969 | "bars": false, 1970 | "dashLength": 10, 1971 | "dashes": false, 1972 | "datasource": "$datasource", 1973 | "fill": 1, 1974 | "id": 22, 1975 | "legend": { 1976 | "avg": false, 1977 | "current": false, 1978 | "max": false, 1979 | "min": false, 1980 | "show": true, 1981 | "total": false, 1982 | "values": false 1983 | }, 1984 | "lines": true, 1985 | "linewidth": 1, 1986 | "links": [ 1987 | 1988 | ], 1989 | "nullPointMode": "null as zero", 1990 | "percentage": false, 1991 | "pointradius": 5, 1992 | "points": false, 1993 | "renderer": "flot", 1994 | "seriesOverrides": [ 1995 | 1996 | ], 1997 | "spaceLength": 10, 1998 | "span": 4, 1999 | "stack": false, 2000 | "steppedLine": false, 2001 | "styles": [ 2002 | { 2003 | "alias": "Time", 2004 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 2005 | "pattern": "Time", 2006 | "type": "hidden" 2007 | }, 2008 | { 2009 | "alias": "Avg Latency", 2010 | "colorMode": null, 2011 | "colors": [ 2012 | 2013 | ], 2014 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 2015 | "decimals": 2, 2016 | "link": false, 2017 | "linkTooltip": "Drill down", 2018 | "linkUrl": "", 2019 | "pattern": "Value", 2020 | "thresholds": [ 2021 | 2022 | ], 2023 | "type": "number", 2024 | "unit": "short" 2025 | }, 2026 | { 2027 | "alias": "File Operations", 2028 | "colorMode": null, 2029 | "colors": [ 2030 | 2031 | ], 2032 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 2033 | "decimals": 2, 2034 | "link": false, 2035 | "linkTooltip": "Drill down", 2036 | "linkUrl": "", 2037 | "pattern": "fop", 2038 | "thresholds": [ 2039 | 2040 | ], 2041 | "type": "number", 2042 | "unit": "short" 2043 | }, 2044 | { 2045 | "alias": "", 2046 | "colorMode": null, 2047 | "colors": [ 2048 | 2049 | ], 2050 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 2051 | "decimals": 2, 2052 | "pattern": "/.*/", 2053 | "thresholds": [ 2054 | 2055 | ], 2056 | "type": "string", 2057 | "unit": "short" 2058 | } 2059 | ], 2060 | "targets": [ 2061 | { 2062 | "expr": "sort(sum(gluster_volume_profile_fop_avg_latency{volume='$Volume', fop!=''})by (fop))", 2063 | "format": "table", 2064 | "instant": true, 2065 | "intervalFactor": 2, 2066 | "legendFormat": "", 2067 | "refId": "A", 2068 | "step": 10 2069 | }, 2070 | { 2071 | "expr": "", 2072 | "format": "table", 2073 | "instant": true, 2074 | "intervalFactor": 2, 2075 | "legendFormat": "", 2076 | "refId": "B", 2077 | "step": 10 2078 | } 2079 | ], 2080 | "thresholds": [ 2081 | 2082 | ], 2083 | "timeFrom": null, 2084 | "timeShift": null, 2085 | "title": "Top file operation", 2086 | "tooltip": { 2087 | "shared": true, 2088 | "sort": 0, 2089 | "value_type": "individual" 2090 | }, 2091 | "transform": "table", 2092 | "type": "table", 2093 | "xaxis": { 2094 | "buckets": null, 2095 | "mode": "time", 2096 | "name": null, 2097 | "show": true, 2098 | "values": [ 2099 | 2100 | ] 2101 | }, 2102 | "yaxes": [ 2103 | { 2104 | "format": "short", 2105 | "label": null, 2106 | "logBase": 1, 2107 | "max": null, 2108 | "min": 0, 2109 | "show": true 2110 | }, 2111 | { 2112 | "format": "short", 2113 | "label": null, 2114 | "logBase": 1, 2115 | "max": null, 2116 | "min": null, 2117 | "show": false 2118 | } 2119 | ] 2120 | }, 2121 | { 2122 | "aliasColors": { 2123 | 2124 | }, 2125 | "bars": false, 2126 | "dashLength": 10, 2127 | "dashes": false, 2128 | "datasource": "$datasource", 2129 | "fill": 10, 2130 | "id": 23, 2131 | "legend": { 2132 | "avg": false, 2133 | "current": false, 2134 | "max": false, 2135 | "min": false, 2136 | "show": false, 2137 | "total": false, 2138 | "values": false 2139 | }, 2140 | "lines": true, 2141 | "linewidth": 0, 2142 | "links": [ 2143 | 2144 | ], 2145 | "nullPointMode": "null as zero", 2146 | "percentage": false, 2147 | "pointradius": 5, 2148 | "points": false, 2149 | "renderer": "flot", 2150 | "seriesOverrides": [ 2151 | 2152 | ], 2153 | "spaceLength": 10, 2154 | "span": 4, 2155 | "stack": true, 2156 | "steppedLine": false, 2157 | "targets": [ 2158 | { 2159 | "expr": "sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops{volume='$Volume',fop='LOCK_OPS'}) by (volume)", 2160 | "format": "time_series", 2161 | "intervalFactor": 2, 2162 | "legendFormat": "", 2163 | "legendLink": null, 2164 | "step": 10 2165 | } 2166 | ], 2167 | "thresholds": [ 2168 | 2169 | ], 2170 | "timeFrom": null, 2171 | "timeShift": null, 2172 | "title": "File Operations For Locks Trends", 2173 | "tooltip": { 2174 | "shared": true, 2175 | "sort": 0, 2176 | "value_type": "individual" 2177 | }, 2178 | "type": "graph", 2179 | "xaxis": { 2180 | "buckets": null, 2181 | "mode": "time", 2182 | "name": null, 2183 | "show": true, 2184 | "values": [ 2185 | 2186 | ] 2187 | }, 2188 | "yaxes": [ 2189 | { 2190 | "format": "short", 2191 | "label": null, 2192 | "logBase": 1, 2193 | "max": null, 2194 | "min": 0, 2195 | "show": true 2196 | }, 2197 | { 2198 | "format": "short", 2199 | "label": null, 2200 | "logBase": 1, 2201 | "max": null, 2202 | "min": null, 2203 | "show": false 2204 | } 2205 | ] 2206 | }, 2207 | { 2208 | "aliasColors": { 2209 | 2210 | }, 2211 | "bars": false, 2212 | "dashLength": 10, 2213 | "dashes": false, 2214 | "datasource": "$datasource", 2215 | "fill": 10, 2216 | "id": 24, 2217 | "legend": { 2218 | "avg": false, 2219 | "current": false, 2220 | "max": false, 2221 | "min": false, 2222 | "show": false, 2223 | "total": false, 2224 | "values": false 2225 | }, 2226 | "lines": true, 2227 | "linewidth": 0, 2228 | "links": [ 2229 | 2230 | ], 2231 | "nullPointMode": "null as zero", 2232 | "percentage": false, 2233 | "pointradius": 5, 2234 | "points": false, 2235 | "renderer": "flot", 2236 | "seriesOverrides": [ 2237 | 2238 | ], 2239 | "spaceLength": 10, 2240 | "span": 4, 2241 | "stack": true, 2242 | "steppedLine": false, 2243 | "targets": [ 2244 | { 2245 | "expr": "sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops{volume='$Volume',fop='READ_WRITE_OPS'}) by (volume)", 2246 | "format": "time_series", 2247 | "intervalFactor": 2, 2248 | "legendFormat": "", 2249 | "legendLink": null, 2250 | "step": 10 2251 | } 2252 | ], 2253 | "thresholds": [ 2254 | 2255 | ], 2256 | "timeFrom": null, 2257 | "timeShift": null, 2258 | "title": "File Operations for Read/Write", 2259 | "tooltip": { 2260 | "shared": true, 2261 | "sort": 0, 2262 | "value_type": "individual" 2263 | }, 2264 | "type": "graph", 2265 | "xaxis": { 2266 | "buckets": null, 2267 | "mode": "time", 2268 | "name": null, 2269 | "show": true, 2270 | "values": [ 2271 | 2272 | ] 2273 | }, 2274 | "yaxes": [ 2275 | { 2276 | "format": "short", 2277 | "label": null, 2278 | "logBase": 1, 2279 | "max": null, 2280 | "min": 0, 2281 | "show": true 2282 | }, 2283 | { 2284 | "format": "short", 2285 | "label": null, 2286 | "logBase": 1, 2287 | "max": null, 2288 | "min": null, 2289 | "show": false 2290 | } 2291 | ] 2292 | }, 2293 | { 2294 | "aliasColors": { 2295 | 2296 | }, 2297 | "bars": false, 2298 | "dashLength": 10, 2299 | "dashes": false, 2300 | "datasource": "$datasource", 2301 | "fill": 10, 2302 | "id": 25, 2303 | "legend": { 2304 | "avg": false, 2305 | "current": false, 2306 | "max": false, 2307 | "min": false, 2308 | "show": false, 2309 | "total": false, 2310 | "values": false 2311 | }, 2312 | "lines": true, 2313 | "linewidth": 0, 2314 | "links": [ 2315 | 2316 | ], 2317 | "nullPointMode": "null as zero", 2318 | "percentage": false, 2319 | "pointradius": 5, 2320 | "points": false, 2321 | "renderer": "flot", 2322 | "seriesOverrides": [ 2323 | 2324 | ], 2325 | "spaceLength": 10, 2326 | "span": 6, 2327 | "stack": true, 2328 | "steppedLine": false, 2329 | "targets": [ 2330 | { 2331 | "expr": "sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops{volume='$Volume',fop='INODE_OPS'}) by (volume)", 2332 | "format": "time_series", 2333 | "intervalFactor": 2, 2334 | "legendFormat": "", 2335 | "legendLink": null, 2336 | "step": 10 2337 | } 2338 | ], 2339 | "thresholds": [ 2340 | 2341 | ], 2342 | "timeFrom": null, 2343 | "timeShift": null, 2344 | "title": "File Operations for Inode Operations", 2345 | "tooltip": { 2346 | "shared": true, 2347 | "sort": 0, 2348 | "value_type": "individual" 2349 | }, 2350 | "type": "graph", 2351 | "xaxis": { 2352 | "buckets": null, 2353 | "mode": "time", 2354 | "name": null, 2355 | "show": true, 2356 | "values": [ 2357 | 2358 | ] 2359 | }, 2360 | "yaxes": [ 2361 | { 2362 | "format": "short", 2363 | "label": null, 2364 | "logBase": 1, 2365 | "max": null, 2366 | "min": 0, 2367 | "show": true 2368 | }, 2369 | { 2370 | "format": "short", 2371 | "label": null, 2372 | "logBase": 1, 2373 | "max": null, 2374 | "min": null, 2375 | "show": false 2376 | } 2377 | ] 2378 | }, 2379 | { 2380 | "aliasColors": { 2381 | 2382 | }, 2383 | "bars": false, 2384 | "dashLength": 10, 2385 | "dashes": false, 2386 | "datasource": "$datasource", 2387 | "fill": 10, 2388 | "id": 26, 2389 | "legend": { 2390 | "avg": false, 2391 | "current": false, 2392 | "max": false, 2393 | "min": false, 2394 | "show": false, 2395 | "total": false, 2396 | "values": false 2397 | }, 2398 | "lines": true, 2399 | "linewidth": 0, 2400 | "links": [ 2401 | 2402 | ], 2403 | "nullPointMode": "null as zero", 2404 | "percentage": false, 2405 | "pointradius": 5, 2406 | "points": false, 2407 | "renderer": "flot", 2408 | "seriesOverrides": [ 2409 | 2410 | ], 2411 | "spaceLength": 10, 2412 | "span": 6, 2413 | "stack": true, 2414 | "steppedLine": false, 2415 | "targets": [ 2416 | { 2417 | "expr": "sum(gluster_volume_profile_fop_total_hits_on_aggregated_fops{volume='$Volume',fop='ENTRY_OPS'}) by (volume)", 2418 | "format": "time_series", 2419 | "intervalFactor": 2, 2420 | "legendFormat": "", 2421 | "legendLink": null, 2422 | "step": 10 2423 | } 2424 | ], 2425 | "thresholds": [ 2426 | 2427 | ], 2428 | "timeFrom": null, 2429 | "timeShift": null, 2430 | "title": "File Operations for Entry Operations", 2431 | "tooltip": { 2432 | "shared": true, 2433 | "sort": 0, 2434 | "value_type": "individual" 2435 | }, 2436 | "type": "graph", 2437 | "xaxis": { 2438 | "buckets": null, 2439 | "mode": "time", 2440 | "name": null, 2441 | "show": true, 2442 | "values": [ 2443 | 2444 | ] 2445 | }, 2446 | "yaxes": [ 2447 | { 2448 | "format": "short", 2449 | "label": null, 2450 | "logBase": 1, 2451 | "max": null, 2452 | "min": 0, 2453 | "show": true 2454 | }, 2455 | { 2456 | "format": "short", 2457 | "label": null, 2458 | "logBase": 1, 2459 | "max": null, 2460 | "min": null, 2461 | "show": false 2462 | } 2463 | ] 2464 | } 2465 | ], 2466 | "repeat": null, 2467 | "repeatIteration": null, 2468 | "repeatRowId": null, 2469 | "showTitle": false, 2470 | "title": "Volume Profiling", 2471 | "titleSize": "h6" 2472 | } 2473 | ], 2474 | "schemaVersion": 14, 2475 | "style": "dark", 2476 | "tags": [ 2477 | 2478 | ], 2479 | "templating": { 2480 | "list": [ 2481 | { 2482 | "current": { 2483 | "text": "Prometheus", 2484 | "value": "Prometheus" 2485 | }, 2486 | "hide": 0, 2487 | "label": null, 2488 | "name": "datasource", 2489 | "options": [ 2490 | 2491 | ], 2492 | "query": "prometheus", 2493 | "refresh": 1, 2494 | "regex": "", 2495 | "type": "datasource" 2496 | }, 2497 | { 2498 | "allValue": null, 2499 | "current": { 2500 | "text": "prod", 2501 | "value": "prod" 2502 | }, 2503 | "datasource": "$datasource", 2504 | "hide": 0, 2505 | "includeAll": false, 2506 | "label": "Volume", 2507 | "multi": false, 2508 | "name": "Volume", 2509 | "options": [ 2510 | 2511 | ], 2512 | "query": "label_values(gluster_volume_up, volume)", 2513 | "refresh": 1, 2514 | "regex": "", 2515 | "sort": 2, 2516 | "tagValuesQuery": "", 2517 | "tags": [ 2518 | 2519 | ], 2520 | "tagsQuery": "", 2521 | "type": "query", 2522 | "useTags": false 2523 | } 2524 | ] 2525 | }, 2526 | "time": { 2527 | "from": "now-1h", 2528 | "to": "now" 2529 | }, 2530 | "timepicker": { 2531 | "refresh_intervals": [ 2532 | "5s", 2533 | "10s", 2534 | "30s", 2535 | "1m", 2536 | "5m", 2537 | "15m", 2538 | "30m", 2539 | "1h", 2540 | "2h", 2541 | "1d" 2542 | ], 2543 | "time_options": [ 2544 | "5m", 2545 | "15m", 2546 | "1h", 2547 | "6h", 2548 | "12h", 2549 | "24h", 2550 | "2d", 2551 | "7d", 2552 | "30d" 2553 | ] 2554 | }, 2555 | "timezone": "", 2556 | "title": "K8s / Storage Resources / Persistent Volume / glusterfs", 2557 | "uid": "47086bc22842dfaacc6eeec2d230e4ab", 2558 | "version": 0 2559 | } 2560 | kind: ConfigMap 2561 | metadata: 2562 | name: grafana-dashboard-k8s-storage-resources-glusterfs-pv 2563 | namespace: monitoring 2564 | kind: ConfigMapList 2565 | -------------------------------------------------------------------------------- /extras/manifests/prometheus-rules.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: PrometheusRule 3 | metadata: 4 | labels: 5 | prometheus: alert 6 | role: alert-rules 7 | name: prometheus-alert-rules 8 | namespace: gcs 9 | spec: 10 | groups: 11 | - name: gluster-volume.rules 12 | rules: 13 | - expr: | 14 | sum(max(gluster_subvol_capacity_used_bytes{job="glusterd2-client"}) BY (volume, subvolume)) BY (volume) 15 | record: gluster:volume_capacity_used_bytes_total:sum 16 | - expr: | 17 | sum(max(gluster_subvol_capacity_total_bytes{job="glusterd2-client"}) BY (volume, subvolume)) BY (volume) 18 | record: gluster:volume_capacity_total_bytes:sum 19 | - name: exporter-absent 20 | rules: 21 | - alert: GlusterExporterDown 22 | annotations: 23 | message: GlusterExporter has disappeared from Prometheus target discovery. 24 | expr: | 25 | absent(up{job="glusterd2-client"}==1) 26 | for: 15m 27 | labels: 28 | severity: critical 29 | - name: status-alert.rules 30 | rules: 31 | - alert: GlusterBrickStatus 32 | annotations: 33 | message: Gluster Brick {{$labels.hostname}}:{{$labels.brick_path}} is down. 34 | expr: | 35 | gluster_brick_up{job="glusterd2-client"} == 0 36 | for: 1m 37 | labels: 38 | severity: critical 39 | - alert: GlusterVolumeStatus 40 | annotations: 41 | message: Gluster Volume {{$labels.volume}} is down. 42 | expr: | 43 | gluster_volume_up{job="glusterd2-client"} == 0 44 | for: 1m 45 | labels: 46 | severity: critical 47 | - name: gluster-utilization 48 | rules: 49 | - alert: GlusterVolumeUtilization 50 | annotations: 51 | message: Gluster Volume {{$labels.volume}} Utilization more than 80% 52 | expr: | 53 | 100 * gluster:volume_capacity_used_bytes_total:sum 54 | / gluster:volume_capacity_total_bytes:sum > 80 55 | for: 5m 56 | labels: 57 | severity: warning 58 | - alert: GlusterVolumeUtilization 59 | annotations: 60 | message: Gluster Volume {{$labels.volume}} Utilization more than 90% 61 | expr: | 62 | 100 * gluster:volume_capacity_used_bytes_total:sum 63 | / gluster:volume_capacity_total_bytes:sum > 90 64 | for: 5m 65 | labels: 66 | severity: critical 67 | - alert: GlusterBrickUtilization 68 | annotations: 69 | message: Gluster Brick {{$labels.host}}:{{$labels.brick_path}} Utilization 70 | more than 80% 71 | expr: | 72 | 100 * gluster_brick_capacity_used_bytes{job="glusterd2-client"} 73 | / gluster_brick_capacity_bytes_total{job="glusterd2-client"} > 80 74 | for: 5m 75 | labels: 76 | severity: warning 77 | - alert: GlusterBrickUtilization 78 | annotations: 79 | message: Gluster Brick {{$labels.host}}:{{$labels.brick_path}} Utilization 80 | more than 90% 81 | expr: | 82 | 100 * gluster_brick_capacity_used_bytes{job="glusterd2-client"} 83 | / gluster_brick_capacity_bytes_total{job="glusterd2-client"} > 90 84 | for: 5m 85 | labels: 86 | severity: critical 87 | - name: thinpool-utilization 88 | rules: 89 | - alert: GlusterThinpoolDataUtilization 90 | annotations: 91 | message: Gluster Thinpool {{ $labels.thinpool_name }} Data Utilization more 92 | than 80% 93 | expr: | 94 | gluster_thinpool_data_used_bytes{job="glusterd2-client"} / gluster_thinpool_data_total_bytes{job="glusterd2-client"} > 0.8 95 | for: 5m 96 | labels: 97 | severity: warning 98 | - alert: GlusterThinpoolDataUtilization 99 | annotations: 100 | message: Gluster Thinpool {{ $labels.thinpool_name }} Data Utilization more 101 | than 90% 102 | expr: | 103 | gluster_thinpool_data_used_bytes{job="glusterd2-client"} / gluster_thinpool_data_total_bytes{job="glusterd2-client"} > 0.9 104 | for: 5m 105 | labels: 106 | severity: critical 107 | - alert: GlusterThinpoolMetadataUtilization 108 | annotations: 109 | message: Gluster Thinpool {{ $labels.thinpool_name }} Metadata Utilization 110 | more than 80% 111 | expr: | 112 | gluster_thinpool_metadata_used_bytes{job="glusterd2-client"} / gluster_thinpool_metadata_total_bytes{job="glusterd2-client"} > 0.8 113 | for: 5m 114 | labels: 115 | severity: warning 116 | - alert: GlusterThinpoolMetadataUtilization 117 | annotations: 118 | message: Gluster Thinpool {{ $labels.thinpool_name }} Metadata Utilization 119 | more than 90% 120 | expr: | 121 | gluster_thinpool_metadata_used_bytes{job="glusterd2-client"} / gluster_thinpool_metadata_total_bytes{job="glusterd2-client"} > 0.9 122 | for: 5m 123 | labels: 124 | severity: critical 125 | -------------------------------------------------------------------------------- /extras/operator/jsonnet/grafana.libsonnet: -------------------------------------------------------------------------------- 1 | local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; 2 | 3 | { 4 | _config+:: { 5 | namespace: 'default', 6 | }, 7 | grafana+:: { 8 | dashboardDefinitions: 9 | local configMap = k.core.v1.configMap; 10 | [ 11 | local dashboardName = 'grafana-dashboard-' + std.strReplace(name, '.json', ''); 12 | configMap.new(dashboardName, { [name]: std.manifestJsonEx($._config.grafana.dashboards[name], ' ') }) + 13 | configMap.mixin.metadata.withNamespace($._config.namespace) 14 | for name in std.objectFields($._config.grafana.dashboards) 15 | ], 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /extras/operator/jsonnet/kube-prometheus.libsonnet: -------------------------------------------------------------------------------- 1 | local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; 2 | local configMapList = k.core.v1.configMapList; 3 | 4 | (import 'grafana.libsonnet') + 5 | (import 'prometheus.libsonnet') + 6 | (import 'gluster-mixins/mixin.libsonnet') + { 7 | kubePrometheus+:: { 8 | namespace: k.core.v1.namespace.new($._config.namespace), 9 | }, 10 | grafana+:: { 11 | dashboardDefinitions: configMapList.new(super.dashboardDefinitions), 12 | }, 13 | } + { 14 | _config+:: { 15 | namespace: 'default', 16 | 17 | prometheus+:: { 18 | rules: $.prometheusRules + $.prometheusAlerts, 19 | }, 20 | grafana+:: { 21 | dashboards: $.grafanaDashboards, 22 | }, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /extras/operator/jsonnet/prometheus.libsonnet: -------------------------------------------------------------------------------- 1 | local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; 2 | 3 | { 4 | _config+:: { 5 | namespace: 'default', 6 | 7 | prometheus+:: { 8 | name: 'alert', 9 | rules: {}, 10 | renderedRules: {}, 11 | namespaces: $._config.namespace, 12 | }, 13 | }, 14 | prometheus+:: { 15 | [if $._config.prometheus.rules != null && $._config.prometheus.rules != {} then 'rules']: 16 | { 17 | apiVersion: 'monitoring.coreos.com/v1', 18 | kind: 'PrometheusRule', 19 | metadata: { 20 | labels: { 21 | prometheus: $._config.prometheus.name, 22 | role: 'alert-rules', 23 | }, 24 | name: 'prometheus-' + $._config.prometheus.name + '-rules', 25 | namespace: $._config.namespace, 26 | }, 27 | spec: { 28 | groups: $._config.prometheus.rules.groups, 29 | }, 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /jsonnetfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | { 4 | "name": "grafonnet", 5 | "source": { 6 | "git": { 7 | "remote": "https://github.com/grafana/grafonnet-lib", 8 | "subdir": "grafonnet" 9 | } 10 | }, 11 | "version": "master" 12 | }, 13 | { 14 | "name": "grafana-builder", 15 | "source": { 16 | "git": { 17 | "remote": "https://github.com/grafana/jsonnet-libs", 18 | "subdir": "grafana-builder" 19 | } 20 | }, 21 | "version": "master" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /lib/alerts.jsonnet: -------------------------------------------------------------------------------- 1 | std.manifestYamlDoc((import '../mixin.libsonnet').prometheusAlerts) 2 | -------------------------------------------------------------------------------- /lib/dashboards.jsonnet: -------------------------------------------------------------------------------- 1 | local dashboards = (import '../mixin.libsonnet').grafanaDashboards; 2 | 3 | { 4 | [name]: dashboards[name] 5 | for name in std.objectFields(dashboards) 6 | } 7 | -------------------------------------------------------------------------------- /lib/rules.jsonnet: -------------------------------------------------------------------------------- 1 | std.manifestYamlDoc((import '../mixin.libsonnet').prometheusRules) 2 | -------------------------------------------------------------------------------- /mixin.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'config.libsonnet') + 2 | (import 'alerts/alerts.libsonnet') + 3 | (import 'dashboards/dashboards.libsonnet') + 4 | (import 'rules/rules.libsonnet') 5 | -------------------------------------------------------------------------------- /rules/gluster-volume.libsonnet: -------------------------------------------------------------------------------- 1 | { 2 | prometheusRules+:: { 3 | groups+: [ 4 | { 5 | name: 'gluster-volume.rules', 6 | rules: [ 7 | { 8 | expr: ||| 9 | sum(max(gluster_subvol_capacity_used_bytes{%(glusterExporterSelector)s}) BY (volume, subvolume)) BY (volume) 10 | ||| % $._config, 11 | record: 'gluster:volume_capacity_used_bytes_total:sum', 12 | }, 13 | { 14 | expr: ||| 15 | sum(max(gluster_subvol_capacity_total_bytes{%(glusterExporterSelector)s}) BY (volume, subvolume)) BY (volume) 16 | ||| % $._config, 17 | record: 'gluster:volume_capacity_total_bytes:sum', 18 | }, 19 | ], 20 | }, 21 | ], 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /rules/rules.libsonnet: -------------------------------------------------------------------------------- 1 | (import 'gluster-volume.libsonnet') 2 | -------------------------------------------------------------------------------- /runbook.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gluster/gluster-mixins/a6a02d24ffe92ee38fcfb80f38fc75c4f952e626/runbook.md -------------------------------------------------------------------------------- /tests.yaml: -------------------------------------------------------------------------------- 1 | rule_files: 2 | - prometheus_alerts.yaml 3 | evaluation_interval: 1m 4 | tests: 5 | - interval: 1m 6 | input_series: 7 | - series: 'gluster_brick_capacity_used_bytes{job="glusterd2-client",host="host1",brick_path="/host1/brick1"}' 8 | values: '100000000+0x5 1717986919+0x15 2040109465+0x10' 9 | - series: 'gluster_brick_capacity_bytes_total{job="glusterd2-client",host="host1",brick_path="/host1/brick1"}' 10 | values: '2147483648+0x30' 11 | alert_rule_test: 12 | - alertname: GlusterBrickUtilization 13 | eval_time: 6m 14 | - alertname: GlusterBrickUtilization 15 | eval_time: 11m 16 | exp_alerts: 17 | - exp_labels: 18 | severity: warning 19 | job: glusterd2-client 20 | host: host1 21 | brick_path: /host1/brick1 22 | exp_annotations: 23 | message: 'Gluster Brick host1:/host1/brick1 Utilization more than 80%' 24 | - interval: 1m 25 | input_series: 26 | - series: 'gluster:volume_capacity_used_bytes_total:sum{job="glusterd2-client",volume="vol1"}' 27 | values: '100000000+0x5 1717986919+0x15 2040109465+0x10' 28 | - series: 'gluster:volume_capacity_total_bytes:sum{job="glusterd2-client",volume="vol1"}' 29 | values: '2147483648+0x30' 30 | alert_rule_test: 31 | - alertname: GlusterVolumeUtilization 32 | eval_time: 6m 33 | - alertname: GlusterVolumeUtilization 34 | eval_time: 11m 35 | exp_alerts: 36 | - exp_labels: 37 | severity: warning 38 | job: glusterd2-client 39 | volume: vol1 40 | exp_annotations: 41 | message: 'Gluster Volume vol1 Utilization more than 80%' 42 | --------------------------------------------------------------------------------