├── .gitignore ├── .travis.yml ├── CODEOWNERS ├── README.md ├── grafana-puppetserver ├── Dockerfile ├── README.md ├── build │ ├── dashboard-collection-errors.json │ ├── dashboard-puppetdb-activemq.json │ ├── dashboard-puppetdb-performance.json │ ├── dashboard-puppetdb-workload.json │ ├── dashboard-puppetserver-performance.json │ ├── dashboard-puppetserver-workload.json │ ├── datasource-graphite-statsd.json │ └── run.sh ├── conf │ ├── carbon.conf │ └── storage-schemas.conf └── docker-compose.yml ├── images └── grafana.jpg ├── influxdb-grafana ├── docker-compose.yml ├── grafana │ ├── dashboards │ │ └── dashboards.yaml │ └── datasources │ │ └── datasource.yaml └── influxdb │ └── influxdb.conf └── view-in-grafana.sh /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.pyc 3 | *.swp 4 | influxdb-grafana/grafana/imports/* 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | 3 | env: 4 | global: 5 | - COMMIT=${TRAVIS_COMMIT::8} 6 | - REPO=reidmv/grafana-puppetserver 7 | - DOCKER_USERNAME=reidmv 8 | - secure: "NypkuJrbWD/AhZa+YMJQNgjYXvhcdxZTo+6iQAo+M1klbMxftTE5HnKcRjERoQT+aFg9BRXaC1aMcKMswdojfgGo+v9hAAYfpFyh78fX9+Iuomspwawxx0+co1/xygkGaNbR/DTFbmCzCd/gRb+BB/1+JJhELlBZlzwYa7xQWqSeiBspL4D6PcvEciTKTqpgl+grrtZIf5xc1ylFn/QBO9wmSWejSD9Oyn2l5bgZ8bFm0BaBvUreiG9DNa21TyslzvpgUS86moN9cFlyHNIngm0HY6WUC41IpUDuY1cr5MKj/We7XlkXRZX9AaJnVgu30h3O8A0PEtGaqAIRxhb6e6u0H/odsDZlJ2JhPXKC7c7yNorobaHD0ocT1/EH+cdpuugDVZhx0OKzXN7JcnIwzTtGo6d+fX6BVqnPEIDn3GhBy7lHheWJ9UrhVEqRFXQ791IrmEP+WC7e/V0S+PihT791iRyxSpx48hcCYxYtb6MtZ+fUpzxz7S5ZyOTdHxHNG9Bb8r30o0mKK2xd3c5+uucBzymGGAqA/FSGUcOkhJG49BwRmnvoxCifW0SupoBhO1EEaSDZ/nY5qnzI7EBgXHpTj0kFglWwNgH7UQzDKpBEsaLj4e/fO+8PKSUlqdaGOKFBzgTJGr0F2xJabE/V4kSQxfd5cHtjFQCDla+Ppxg=" # DOCKER_PASSWORD 9 | 10 | services: 11 | - docker 12 | 13 | before_install: 14 | - docker build -t $REPO:latest grafana-puppetserver 15 | - docker tag $REPO:latest $REPO:$(docker inspect --format "{{ index .Config.Labels \"org.label-schema.version\"}}" $REPO) 16 | - docker pull hopsoft/graphite-statsd:latest 17 | 18 | script: 19 | - cd grafana-puppetserver 20 | - docker-compose up -d 21 | - ruby -rsocket -e 's=TCPSocket.new("localhost",3000)' 22 | - docker-compose down 23 | 24 | after_success: 25 | - if [ "$TRAVIS_BRANCH" == "master" ]; then 26 | docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; 27 | docker push $REPO; 28 | fi 29 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This will cause the code owners of this repo to be assigned review of any 2 | # opened PRs against the branches containing this file. 3 | # See https://help.github.com/en/articles/about-code-owners for info on how to 4 | # take ownership of parts of the code base that should be reviewed by another 5 | # team. 6 | 7 | * @puppetlabs/support 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # puppet-metrics-viewer 2 | 3 | **This project has been archived and will not recieve any further updates** The functionality within this project has been implemented in the [puppet_metrics_dashboard](https://github.com/puppetlabs/puppet_metrics_dashboard) repository. Please use that repository moving forward. 4 | 5 | This repository contains a command line tool for generating visualizations of your Puppet metrics data in Docker. 6 | 7 | It assumes you have collected the metrics using the [puppetlabs/puppet_metrics_collector](https://forge.puppet.com/puppetlabs/puppet_metrics_collector) module. 8 | 9 | It downloads a script from that module, and Grafana dashboards from the [puppetlabs/puppet_metrics_dashboard](https://github.com/puppetlabs/puppet_metrics_dashboard) module. 10 | 11 | ## Viewing metrics in Grafana 12 | 13 | ![Screen shot](./images/grafana.jpg) 14 | 15 | To use this tool, you will need [docker](https://www.docker.com/products/overview) (and docker-compose) installed. 16 | _Tip:_ If you're using a Mac, use the official Mac packages for Docker instead of installing from Brew. 17 | (If you figure out how to use this with Docker installed from Brew, let us know.) 18 | 19 | With Docker installed, you can run the `view-in-grafana.sh` script, passing it the directory containing the data files to load. 20 | 21 | For example: 22 | 23 | ``` 24 | ./view-in-grafana.sh ~/Downloads/puppet_metrics/puppetserver 25 | ``` 26 | 27 | You can then view the metrics by visiting `http://localhost:3000` in a web browser. 28 | 29 | - username: `admin` 30 | - password: `admin`. 31 | 32 | ## Advanced options for viewing metrics with Grafana 33 | 34 | The `view-in-grafana.sh` script has several options that can change the behavior of the environment. 35 | 36 | ### Limit the data that will be imported 37 | 38 | By default, the script uses a data retention of 30 days. 39 | You can optionally specify a different data retention period. 40 | 41 | For example: 42 | 43 | ``` 44 | ./view-in-grafana.sh ~/Downloads/puppet_metrics/puppetserver 10 45 | ``` 46 | 47 | _Note:_ `.json` files outside the retention period will be deleted, as the assumption is that they exist in the tar archives. 48 | 49 | ### Use Graphite as the backend database 50 | 51 | By default, InfluxDB is used to store data. 52 | You can optionally specify Graphite. 53 | 54 | For example: 55 | 56 | ``` 57 | ./view-in-grafana.sh -d graphite ~/Downloads/puppet_metrics/puppetserver 58 | ``` 59 | 60 | ### Build the local containers instead of from Docker Hub 61 | 62 | To test Grafana updates, you can specify the `-b` option to build the local `grafana-puppetserver` container. 63 | 64 | For example: 65 | 66 | ``` 67 | ./view-in-grafana.sh -b ~/Downloads/puppet_metrics/puppetserver 68 | ``` 69 | 70 | ## Load to a pre-existing InfluxDB or Graphite database backend 71 | 72 | The `json2timeseriesdb` script from [puppetlabs/puppet_metrics_collector](https://forge.puppet.com/puppetlabs/puppet_metrics_collector) module can be used to transform data in the JSON files into a format that can be imported into any InfluxDB or Graphite database backend. 73 | 74 | Usage: 75 | 76 | ``` 77 | ./json2timeseriesdb [--pattern PATTERN] [filename_1 ... filename_n] 78 | ``` 79 | 80 | Output is in Graphite's plain text input format. 81 | The output can be sent to a host running Graphite by passing its hostname to the `--netcat` flag: 82 | 83 | ``` 84 | ./json2timeseriesdb ~/Downloads/logdump/puppetserver/*.json --netcat localhost 85 | ``` 86 | 87 | Data will be sent to port 2003. 88 | A custom port can be used by sending output to `nc`: 89 | 90 | ``` 91 | ./json2timeseriesdb ~/Downloads/logdump/puppetserver/*.json | nc localhost 4242 92 | ``` 93 | 94 | Output in InfluxDB's format can be specified using the `--convert-to` flag: 95 | 96 | ``` 97 | ./json2timeseriesdb ~/Downloads/logdump/puppetserver/*.json --convert-to influxdb 98 | ``` 99 | 100 | When `--netcat` is used with InfluxDB, the `--influx-db` flag must be used to specify an InfluxDB database: 101 | 102 | ``` 103 | ./json2timeseriesdb ~/Downloads/logdump/puppetserver/*.json --convert-to influxdb --netcat localhost --influx-db pe-metrics 104 | ``` 105 | 106 | (Data will be sent to port 8086.) 107 | 108 | The above examples can be used for small numbers of files. 109 | When more files exist than can be referenced as arguments, use `--pattern`: 110 | 111 | ``` 112 | ./json2timeseriesdb --pattern '~/Downloads/logdump/puppetserver/*.json' --netcat localhost 113 | ``` 114 | 115 | The `--pattern` flag accepts a Ruby glob argument, which Ruby will then expand into a list of files to process. 116 | -------------------------------------------------------------------------------- /grafana-puppetserver/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM grafana/grafana 2 | MAINTAINER Reid Vandewiele 3 | USER root 4 | 5 | USER root 6 | 7 | COPY build/* /grafana-puppet/ 8 | RUN apk add curl && \ 9 | rm -rf /tmp/* 10 | 11 | USER grafana 12 | 13 | ENTRYPOINT /grafana-puppet/run.sh 14 | 15 | LABEL org.label-schema.vendor="Reid Vandewiele" \ 16 | org.label-schema.name="Grafana Puppetserver Dashboard" \ 17 | org.label-schema.description="Grafana running a dashboard to display puppetserver metrics captured using npwalker/pe_metric_curl_cron_jobs" \ 18 | org.label-schema.version="1.8.0" \ 19 | org.label-schema.vcs-url="https://github.com/puppetlabs/puppet-metrics-viewer" \ 20 | org.label-schema.build-date="2017-05-26" \ 21 | org.label-schema.docker.schema-version="1.0" 22 | -------------------------------------------------------------------------------- /grafana-puppetserver/README.md: -------------------------------------------------------------------------------- 1 | # grafana-puppetserver 2 | 3 | ## Introduction 4 | 5 | This directory contains Docker tools to build and run a Graphite/Statsd/Grafana 6 | stack configured to consume and display Puppet metrics. 7 | 8 | ## Important Components 9 | 10 | ### Dockerfile 11 | 12 | The included Dockerfile builds the grafana-puppetserver image. This image runs 13 | Grafana, and will be configured with dashboards for viewing Puppet metrics. 14 | 15 | ### docker-compose.yml 16 | 17 | The docker-compose.yml file defines the full stack necessary to view metrics, 18 | which includes the grafana-puppetserver image and the graphite-statsd image. 19 | 20 | ### build/ 21 | 22 | The build/ directory is how to update dashboards or other Grafana configuration 23 | in the graphite-statsd image. Any dashboard json file placed in this directory, 24 | following the naming convention "dashboard-\*.json", will be added to the 25 | grafana-puppetserver image when built. 26 | 27 | Similarly, the datasource(s) are defined here with the naming convention 28 | "datasource-\*.json". 29 | 30 | The run.sh script is the entrypoint for the grafana-puppetserver image and 31 | loads all the defined configuration into Grafana when the image boots. 32 | 33 | Because the official Grafana image uses a volume for /var/lib/grafana, it is 34 | not possible to bake the dashboard configuration into the image without either 35 | modifying the Grafana configuration to use a different directory, or taking an 36 | approach like this one which loads the dashboards on boot. 37 | -------------------------------------------------------------------------------- /grafana-puppetserver/build/dashboard-collection-errors.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_GRAPHITE-STATSD", 5 | "label": "graphite-statsd", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "graphite", 9 | "pluginName": "Graphite" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.2.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "graphite", 28 | "name": "Graphite", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "description": "Errors in collecting metrics for Puppetserver and PuppetDB", 36 | "editable": true, 37 | "gnetId": null, 38 | "graphTooltip": 0, 39 | "hideControls": false, 40 | "id": null, 41 | "links": [ 42 | { 43 | "asDropdown": false, 44 | "icon": "external link", 45 | "includeVars": true, 46 | "keepTime": true, 47 | "tags": [], 48 | "type": "dashboards" 49 | } 50 | ], 51 | "refresh": false, 52 | "rows": [ 53 | { 54 | "collapse": false, 55 | "height": 250, 56 | "panels": [ 57 | { 58 | "aliasColors": {}, 59 | "bars": false, 60 | "datasource": "${DS_GRAPHITE-STATSD}", 61 | "editable": true, 62 | "error": false, 63 | "fill": 1, 64 | "id": 1, 65 | "legend": { 66 | "avg": false, 67 | "current": false, 68 | "hideEmpty": false, 69 | "max": false, 70 | "min": false, 71 | "show": true, 72 | "total": false, 73 | "values": false 74 | }, 75 | "lines": true, 76 | "linewidth": 1, 77 | "links": [ 78 | { 79 | "dashUri": "db/puppetserver-performance", 80 | "dashboard": "Puppetserver Performance", 81 | "includeVars": true, 82 | "keepTime": true, 83 | "title": "Puppetserver Performance", 84 | "type": "dashboard" 85 | }, 86 | { 87 | "dashUri": "db/puppetserver-workload", 88 | "dashboard": "Puppetserver Workload", 89 | "includeVars": true, 90 | "keepTime": true, 91 | "title": "Puppetserver Workload", 92 | "type": "dashboard" 93 | } 94 | ], 95 | "nullPointMode": "connected", 96 | "percentage": false, 97 | "pointradius": 5, 98 | "points": false, 99 | "renderer": "flot", 100 | "seriesOverrides": [], 101 | "span": 6, 102 | "stack": false, 103 | "steppedLine": false, 104 | "targets": [ 105 | { 106 | "refId": "A", 107 | "target": "aliasByNode(servers.$server.puppetserver.error_count, 1, 3)" 108 | } 109 | ], 110 | "thresholds": [], 111 | "timeFrom": null, 112 | "timeShift": null, 113 | "title": "Puppetserver Metric Collection Errors", 114 | "tooltip": { 115 | "msResolution": false, 116 | "shared": true, 117 | "sort": 0, 118 | "value_type": "individual" 119 | }, 120 | "type": "graph", 121 | "xaxis": { 122 | "mode": "time", 123 | "name": null, 124 | "show": true, 125 | "values": [] 126 | }, 127 | "yaxes": [ 128 | { 129 | "format": "short", 130 | "label": null, 131 | "logBase": 1, 132 | "max": null, 133 | "min": null, 134 | "show": true 135 | }, 136 | { 137 | "format": "short", 138 | "label": null, 139 | "logBase": 1, 140 | "max": null, 141 | "min": null, 142 | "show": true 143 | } 144 | ] 145 | }, 146 | { 147 | "aliasColors": {}, 148 | "bars": true, 149 | "datasource": "${DS_GRAPHITE-STATSD}", 150 | "fill": 1, 151 | "id": 2, 152 | "legend": { 153 | "alignAsTable": true, 154 | "avg": false, 155 | "current": false, 156 | "hideEmpty": true, 157 | "hideZero": true, 158 | "max": false, 159 | "min": false, 160 | "rightSide": false, 161 | "show": true, 162 | "sort": "total", 163 | "sortDesc": false, 164 | "total": true, 165 | "values": true 166 | }, 167 | "lines": true, 168 | "linewidth": 1, 169 | "links": [ 170 | { 171 | "dashUri": "db/puppetserver-performance", 172 | "dashboard": "Puppetserver Performance", 173 | "includeVars": true, 174 | "keepTime": true, 175 | "title": "Puppetserver Performance", 176 | "type": "dashboard" 177 | }, 178 | { 179 | "dashUri": "db/puppetserver-workload", 180 | "dashboard": "Puppetserver Workload", 181 | "includeVars": true, 182 | "keepTime": true, 183 | "title": "Puppetserver Workload", 184 | "type": "dashboard" 185 | } 186 | ], 187 | "maxDataPoints": "", 188 | "nullPointMode": "connected", 189 | "percentage": false, 190 | "pointradius": 5, 191 | "points": false, 192 | "renderer": "flot", 193 | "seriesOverrides": [], 194 | "span": 6, 195 | "stack": false, 196 | "steppedLine": false, 197 | "targets": [ 198 | { 199 | "refId": "A", 200 | "target": "aliasByNode(servers.$server.puppetserver.error.*, 1, 4)" 201 | } 202 | ], 203 | "thresholds": [], 204 | "timeFrom": null, 205 | "timeShift": null, 206 | "title": "Puppetserver Metric Collection Error Types", 207 | "tooltip": { 208 | "shared": true, 209 | "sort": 0, 210 | "value_type": "individual" 211 | }, 212 | "type": "graph", 213 | "xaxis": { 214 | "mode": "time", 215 | "name": null, 216 | "show": true, 217 | "values": [] 218 | }, 219 | "yaxes": [ 220 | { 221 | "format": "short", 222 | "label": null, 223 | "logBase": 1, 224 | "max": null, 225 | "min": null, 226 | "show": true 227 | }, 228 | { 229 | "format": "short", 230 | "label": null, 231 | "logBase": 1, 232 | "max": null, 233 | "min": null, 234 | "show": true 235 | } 236 | ] 237 | } 238 | ], 239 | "repeat": null, 240 | "repeatIteration": null, 241 | "repeatRowId": null, 242 | "showTitle": false, 243 | "title": "Dashboard Row", 244 | "titleSize": "h6" 245 | }, 246 | { 247 | "collapse": false, 248 | "height": 250, 249 | "panels": [ 250 | { 251 | "aliasColors": {}, 252 | "bars": false, 253 | "datasource": "${DS_GRAPHITE-STATSD}", 254 | "editable": true, 255 | "error": false, 256 | "fill": 1, 257 | "id": 3, 258 | "legend": { 259 | "avg": false, 260 | "current": false, 261 | "hideEmpty": false, 262 | "max": false, 263 | "min": false, 264 | "show": true, 265 | "total": false, 266 | "values": false 267 | }, 268 | "lines": true, 269 | "linewidth": 1, 270 | "links": [], 271 | "nullPointMode": "connected", 272 | "percentage": false, 273 | "pointradius": 5, 274 | "points": false, 275 | "renderer": "flot", 276 | "seriesOverrides": [], 277 | "span": 6, 278 | "stack": false, 279 | "steppedLine": false, 280 | "targets": [ 281 | { 282 | "refId": "A", 283 | "target": "aliasByNode(servers.$server.puppetdb.error_count, 1, 3)" 284 | } 285 | ], 286 | "thresholds": [], 287 | "timeFrom": null, 288 | "timeShift": null, 289 | "title": "PuppetDB Metric Collection Errors", 290 | "tooltip": { 291 | "msResolution": false, 292 | "shared": true, 293 | "sort": 0, 294 | "value_type": "individual" 295 | }, 296 | "type": "graph", 297 | "xaxis": { 298 | "mode": "time", 299 | "name": null, 300 | "show": true, 301 | "values": [] 302 | }, 303 | "yaxes": [ 304 | { 305 | "format": "short", 306 | "label": null, 307 | "logBase": 1, 308 | "max": null, 309 | "min": null, 310 | "show": true 311 | }, 312 | { 313 | "format": "short", 314 | "label": null, 315 | "logBase": 1, 316 | "max": null, 317 | "min": null, 318 | "show": true 319 | } 320 | ] 321 | }, 322 | { 323 | "aliasColors": {}, 324 | "bars": true, 325 | "datasource": "${DS_GRAPHITE-STATSD}", 326 | "fill": 1, 327 | "id": 4, 328 | "legend": { 329 | "alignAsTable": true, 330 | "avg": false, 331 | "current": false, 332 | "hideEmpty": true, 333 | "hideZero": true, 334 | "max": false, 335 | "min": false, 336 | "rightSide": false, 337 | "show": true, 338 | "sort": "total", 339 | "sortDesc": false, 340 | "total": true, 341 | "values": true 342 | }, 343 | "lines": true, 344 | "linewidth": 1, 345 | "links": [], 346 | "maxDataPoints": "", 347 | "nullPointMode": "connected", 348 | "percentage": false, 349 | "pointradius": 5, 350 | "points": false, 351 | "renderer": "flot", 352 | "seriesOverrides": [], 353 | "span": 6, 354 | "stack": false, 355 | "steppedLine": false, 356 | "targets": [ 357 | { 358 | "refId": "A", 359 | "target": "aliasByNode(servers.$server.puppetdb.error.*, 1, 4)" 360 | } 361 | ], 362 | "thresholds": [], 363 | "timeFrom": null, 364 | "timeShift": null, 365 | "title": "PuppetDB Metric Collection Error Types", 366 | "tooltip": { 367 | "shared": true, 368 | "sort": 0, 369 | "value_type": "individual" 370 | }, 371 | "type": "graph", 372 | "xaxis": { 373 | "mode": "time", 374 | "name": null, 375 | "show": true, 376 | "values": [] 377 | }, 378 | "yaxes": [ 379 | { 380 | "format": "short", 381 | "label": null, 382 | "logBase": 1, 383 | "max": null, 384 | "min": null, 385 | "show": true 386 | }, 387 | { 388 | "format": "short", 389 | "label": null, 390 | "logBase": 1, 391 | "max": null, 392 | "min": null, 393 | "show": true 394 | } 395 | ] 396 | } 397 | ], 398 | "repeat": null, 399 | "repeatIteration": null, 400 | "repeatRowId": null, 401 | "showTitle": false, 402 | "title": "Dashboard Row", 403 | "titleSize": "h6" 404 | } 405 | ], 406 | "schemaVersion": 14, 407 | "style": "dark", 408 | "tags": [], 409 | "templating": { 410 | "list": [ 411 | { 412 | "allValue": null, 413 | "current": {}, 414 | "datasource": "${DS_GRAPHITE-STATSD}", 415 | "hide": 0, 416 | "includeAll": true, 417 | "label": "Server", 418 | "multi": false, 419 | "name": "server", 420 | "options": [], 421 | "query": "servers.*", 422 | "refresh": 1, 423 | "regex": "", 424 | "sort": 0, 425 | "tagValuesQuery": null, 426 | "tags": [], 427 | "tagsQuery": null, 428 | "type": "query", 429 | "useTags": false 430 | } 431 | ] 432 | }, 433 | "time": { 434 | "from": "now-30d", 435 | "to": "now" 436 | }, 437 | "timepicker": { 438 | "refresh_intervals": [ 439 | "5s", 440 | "10s", 441 | "30s", 442 | "1m", 443 | "5m", 444 | "15m", 445 | "30m", 446 | "1h", 447 | "2h", 448 | "1d" 449 | ], 450 | "time_options": [ 451 | "5m", 452 | "15m", 453 | "1h", 454 | "6h", 455 | "12h", 456 | "24h", 457 | "2d", 458 | "7d", 459 | "30d" 460 | ] 461 | }, 462 | "timezone": "browser", 463 | "title": "Metric Collection Errors", 464 | "version": 7 465 | } -------------------------------------------------------------------------------- /grafana-puppetserver/build/dashboard-puppetdb-activemq.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_GRAPHITE-STATSD", 5 | "label": "graphite-statsd", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "graphite", 9 | "pluginName": "Graphite" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.2.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "graphite", 28 | "name": "Graphite", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "editable": true, 36 | "gnetId": null, 37 | "graphTooltip": 0, 38 | "hideControls": false, 39 | "id": null, 40 | "links": [ 41 | { 42 | "icon": "external link", 43 | "includeVars": true, 44 | "keepTime": true, 45 | "tags": [], 46 | "type": "dashboards" 47 | } 48 | ], 49 | "refresh": false, 50 | "rows": [ 51 | { 52 | "collapse": false, 53 | "height": "250px", 54 | "panels": [ 55 | { 56 | "aliasColors": {}, 57 | "bars": false, 58 | "datasource": "${DS_GRAPHITE-STATSD}", 59 | "fill": 1, 60 | "id": 1, 61 | "legend": { 62 | "avg": false, 63 | "current": false, 64 | "max": false, 65 | "min": false, 66 | "show": true, 67 | "total": false, 68 | "values": false 69 | }, 70 | "lines": true, 71 | "linewidth": 1, 72 | "links": [ 73 | { 74 | "dashUri": "db/puppetdb-performance", 75 | "dashboard": "PuppetDB Performance", 76 | "title": "PuppetDB Performance", 77 | "type": "dashboard" 78 | }, 79 | { 80 | "dashUri": "db/puppetdb-workload", 81 | "dashboard": "PuppetDB Workload", 82 | "title": "PuppetDB Workload", 83 | "type": "dashboard" 84 | } 85 | ], 86 | "nullPointMode": "connected", 87 | "percentage": false, 88 | "pointradius": 5, 89 | "points": false, 90 | "renderer": "flot", 91 | "seriesOverrides": [], 92 | "span": 12, 93 | "stack": false, 94 | "steppedLine": false, 95 | "targets": [ 96 | { 97 | "refId": "A", 98 | "target": "alias(servers.$server.puppetdb.select metric, 'Dequeue')" 99 | }, 100 | { 101 | "refId": "B", 102 | "target": "alias(servers.$server.puppetdb.select metric, 'Enqueue')" 103 | }, 104 | { 105 | "refId": "C", 106 | "target": "alias(servers.$server.puppetdb.select metric, 'Dispatch')" 107 | } 108 | ], 109 | "thresholds": [], 110 | "timeFrom": null, 111 | "timeShift": null, 112 | "title": "Dequeue / Enqueue / Dispatch Counts", 113 | "tooltip": { 114 | "shared": true, 115 | "sort": 0, 116 | "value_type": "individual" 117 | }, 118 | "type": "graph", 119 | "xaxis": { 120 | "mode": "time", 121 | "name": null, 122 | "show": true, 123 | "values": [] 124 | }, 125 | "yaxes": [ 126 | { 127 | "format": "short", 128 | "label": null, 129 | "logBase": 1, 130 | "max": null, 131 | "min": null, 132 | "show": true 133 | }, 134 | { 135 | "format": "short", 136 | "label": null, 137 | "logBase": 1, 138 | "max": null, 139 | "min": null, 140 | "show": true 141 | } 142 | ] 143 | } 144 | ], 145 | "repeat": null, 146 | "repeatIteration": null, 147 | "repeatRowId": null, 148 | "showTitle": false, 149 | "title": "Dashboard Row", 150 | "titleSize": "h6" 151 | }, 152 | { 153 | "collapse": false, 154 | "height": 250, 155 | "panels": [ 156 | { 157 | "aliasColors": {}, 158 | "bars": false, 159 | "datasource": "${DS_GRAPHITE-STATSD}", 160 | "fill": 1, 161 | "id": 2, 162 | "legend": { 163 | "avg": false, 164 | "current": false, 165 | "max": false, 166 | "min": false, 167 | "show": true, 168 | "total": false, 169 | "values": false 170 | }, 171 | "lines": true, 172 | "linewidth": 1, 173 | "links": [], 174 | "nullPointMode": "connected", 175 | "percentage": false, 176 | "pointradius": 5, 177 | "points": false, 178 | "renderer": "flot", 179 | "seriesOverrides": [], 180 | "span": 12, 181 | "stack": false, 182 | "steppedLine": false, 183 | "targets": [ 184 | { 185 | "refId": "A", 186 | "target": "alias(servers.$server.puppetdb.select metric, 'Max message size')" 187 | }, 188 | { 189 | "refId": "B", 190 | "target": "alias(servers.$server.puppetdb.select metric, 'Ave message size')" 191 | } 192 | ], 193 | "thresholds": [], 194 | "timeFrom": null, 195 | "timeShift": null, 196 | "title": "Max / Ave message Size", 197 | "tooltip": { 198 | "shared": true, 199 | "sort": 0, 200 | "value_type": "individual" 201 | }, 202 | "type": "graph", 203 | "xaxis": { 204 | "mode": "time", 205 | "name": null, 206 | "show": true, 207 | "values": [] 208 | }, 209 | "yaxes": [ 210 | { 211 | "format": "decbytes", 212 | "label": null, 213 | "logBase": 1, 214 | "max": null, 215 | "min": null, 216 | "show": true 217 | }, 218 | { 219 | "format": "short", 220 | "label": null, 221 | "logBase": 1, 222 | "max": null, 223 | "min": null, 224 | "show": true 225 | } 226 | ] 227 | } 228 | ], 229 | "repeat": null, 230 | "repeatIteration": null, 231 | "repeatRowId": null, 232 | "showTitle": false, 233 | "title": "Dashboard Row", 234 | "titleSize": "h6" 235 | }, 236 | { 237 | "collapse": false, 238 | "height": 250, 239 | "panels": [ 240 | { 241 | "aliasColors": {}, 242 | "bars": false, 243 | "datasource": "${DS_GRAPHITE-STATSD}", 244 | "fill": 1, 245 | "id": 3, 246 | "legend": { 247 | "avg": false, 248 | "current": false, 249 | "max": false, 250 | "min": false, 251 | "show": true, 252 | "total": false, 253 | "values": false 254 | }, 255 | "lines": true, 256 | "linewidth": 1, 257 | "links": [], 258 | "nullPointMode": "connected", 259 | "percentage": false, 260 | "pointradius": 5, 261 | "points": false, 262 | "renderer": "flot", 263 | "seriesOverrides": [], 264 | "span": 12, 265 | "stack": false, 266 | "steppedLine": false, 267 | "targets": [ 268 | { 269 | "refId": "A", 270 | "target": "alias(servers.$server.puppetdb.select metric, 'ave. enqueue time')", 271 | "textEditor": true 272 | } 273 | ], 274 | "thresholds": [], 275 | "timeFrom": null, 276 | "timeShift": null, 277 | "title": "Ave enqueue time", 278 | "tooltip": { 279 | "shared": true, 280 | "sort": 0, 281 | "value_type": "individual" 282 | }, 283 | "type": "graph", 284 | "xaxis": { 285 | "mode": "time", 286 | "name": null, 287 | "show": true, 288 | "values": [] 289 | }, 290 | "yaxes": [ 291 | { 292 | "format": "ms", 293 | "label": null, 294 | "logBase": 1, 295 | "max": null, 296 | "min": null, 297 | "show": true 298 | }, 299 | { 300 | "format": "short", 301 | "label": null, 302 | "logBase": 1, 303 | "max": null, 304 | "min": null, 305 | "show": true 306 | } 307 | ] 308 | } 309 | ], 310 | "repeat": null, 311 | "repeatIteration": null, 312 | "repeatRowId": null, 313 | "showTitle": false, 314 | "title": "Dashboard Row", 315 | "titleSize": "h6" 316 | }, 317 | { 318 | "collapse": false, 319 | "height": 250, 320 | "panels": [ 321 | { 322 | "aliasColors": {}, 323 | "bars": false, 324 | "datasource": "${DS_GRAPHITE-STATSD}", 325 | "fill": 1, 326 | "id": 4, 327 | "legend": { 328 | "avg": false, 329 | "current": false, 330 | "max": false, 331 | "min": false, 332 | "show": true, 333 | "total": false, 334 | "values": false 335 | }, 336 | "lines": true, 337 | "linewidth": 1, 338 | "links": [], 339 | "nullPointMode": "connected", 340 | "percentage": false, 341 | "pointradius": 5, 342 | "points": false, 343 | "renderer": "flot", 344 | "seriesOverrides": [], 345 | "span": 12, 346 | "stack": false, 347 | "steppedLine": false, 348 | "targets": [ 349 | { 350 | "refId": "A", 351 | "target": "alias(servers.$server.puppetdb.select metric, 'Mem usage byte count')", 352 | "textEditor": true 353 | }, 354 | { 355 | "refId": "B", 356 | "target": "alias(servers.$server.puppetdb.amq_metrics.mem.select metric, 'Mem usage byte count')", 357 | "textEditor": true 358 | } 359 | ], 360 | "thresholds": [], 361 | "timeFrom": null, 362 | "timeShift": null, 363 | "title": "Memory usage byte count", 364 | "tooltip": { 365 | "shared": true, 366 | "sort": 0, 367 | "value_type": "individual" 368 | }, 369 | "type": "graph", 370 | "xaxis": { 371 | "mode": "time", 372 | "name": null, 373 | "show": true, 374 | "values": [] 375 | }, 376 | "yaxes": [ 377 | { 378 | "format": "decbytes", 379 | "label": null, 380 | "logBase": 1, 381 | "max": null, 382 | "min": null, 383 | "show": true 384 | }, 385 | { 386 | "format": "short", 387 | "label": null, 388 | "logBase": 1, 389 | "max": null, 390 | "min": null, 391 | "show": true 392 | } 393 | ] 394 | } 395 | ], 396 | "repeat": null, 397 | "repeatIteration": null, 398 | "repeatRowId": null, 399 | "showTitle": false, 400 | "title": "Dashboard Row", 401 | "titleSize": "h6" 402 | }, 403 | { 404 | "collapse": false, 405 | "height": 250, 406 | "panels": [ 407 | { 408 | "aliasColors": {}, 409 | "bars": false, 410 | "datasource": "${DS_GRAPHITE-STATSD}", 411 | "fill": 1, 412 | "id": 5, 413 | "legend": { 414 | "avg": false, 415 | "current": false, 416 | "max": false, 417 | "min": false, 418 | "show": true, 419 | "total": false, 420 | "values": false 421 | }, 422 | "lines": true, 423 | "linewidth": 1, 424 | "links": [], 425 | "nullPointMode": "connected", 426 | "percentage": false, 427 | "pointradius": 5, 428 | "points": false, 429 | "renderer": "flot", 430 | "seriesOverrides": [], 431 | "span": 12, 432 | "stack": false, 433 | "steppedLine": false, 434 | "targets": [ 435 | { 436 | "refId": "A", 437 | "target": "alias(servers.$server.puppetdb.select metric, 'Queue size')" 438 | }, 439 | { 440 | "refId": "B", 441 | "target": "alias(servers.$server.puppetdb.select metric, 'Queue size')" 442 | } 443 | ], 444 | "thresholds": [], 445 | "timeFrom": null, 446 | "timeShift": null, 447 | "title": "Queue size", 448 | "tooltip": { 449 | "shared": true, 450 | "sort": 0, 451 | "value_type": "individual" 452 | }, 453 | "type": "graph", 454 | "xaxis": { 455 | "mode": "time", 456 | "name": null, 457 | "show": true, 458 | "values": [] 459 | }, 460 | "yaxes": [ 461 | { 462 | "format": "short", 463 | "label": null, 464 | "logBase": 1, 465 | "max": null, 466 | "min": null, 467 | "show": true 468 | }, 469 | { 470 | "format": "short", 471 | "label": null, 472 | "logBase": 1, 473 | "max": null, 474 | "min": null, 475 | "show": true 476 | } 477 | ] 478 | } 479 | ], 480 | "repeat": null, 481 | "repeatIteration": null, 482 | "repeatRowId": null, 483 | "showTitle": false, 484 | "title": "Dashboard Row", 485 | "titleSize": "h6" 486 | } 487 | ], 488 | "schemaVersion": 14, 489 | "style": "dark", 490 | "tags": [], 491 | "templating": { 492 | "list": [ 493 | { 494 | "allValue": null, 495 | "current": {}, 496 | "datasource": "${DS_GRAPHITE-STATSD}", 497 | "hide": 0, 498 | "includeAll": true, 499 | "label": "Server", 500 | "multi": false, 501 | "name": "server", 502 | "options": [], 503 | "query": "servers.*", 504 | "refresh": 1, 505 | "regex": "", 506 | "sort": 0, 507 | "tagValuesQuery": "", 508 | "tags": [], 509 | "tagsQuery": "", 510 | "type": "query", 511 | "useTags": false 512 | } 513 | ] 514 | }, 515 | "time": { 516 | "from": "now-30d", 517 | "to": "now" 518 | }, 519 | "timepicker": { 520 | "refresh_intervals": [ 521 | "5s", 522 | "10s", 523 | "30s", 524 | "1m", 525 | "5m", 526 | "15m", 527 | "30m", 528 | "1h", 529 | "2h", 530 | "1d" 531 | ], 532 | "time_options": [ 533 | "5m", 534 | "15m", 535 | "1h", 536 | "6h", 537 | "12h", 538 | "24h", 539 | "2d", 540 | "7d", 541 | "30d" 542 | ] 543 | }, 544 | "timezone": "browser", 545 | "title": "PuppetDB Activemq", 546 | "version": 6 547 | } -------------------------------------------------------------------------------- /grafana-puppetserver/build/dashboard-puppetdb-performance.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_GRAPHITE-STATSD", 5 | "label": "graphite-statsd", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "graphite", 9 | "pluginName": "Graphite" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.2.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "graphite", 28 | "name": "Graphite", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "description": "Performance of the PuppetDB server", 36 | "editable": true, 37 | "gnetId": null, 38 | "graphTooltip": 0, 39 | "hideControls": false, 40 | "id": null, 41 | "links": [ 42 | { 43 | "asDropdown": false, 44 | "icon": "external link", 45 | "includeVars": true, 46 | "keepTime": true, 47 | "tags": [], 48 | "title": "Linked Dashboards", 49 | "type": "dashboards" 50 | } 51 | ], 52 | "refresh": false, 53 | "rows": [ 54 | { 55 | "collapse": false, 56 | "height": 250, 57 | "panels": [ 58 | { 59 | "aliasColors": {}, 60 | "bars": false, 61 | "datasource": "${DS_GRAPHITE-STATSD}", 62 | "description": "The number of commands per second", 63 | "fill": 1, 64 | "id": 2, 65 | "legend": { 66 | "avg": false, 67 | "current": false, 68 | "max": false, 69 | "min": false, 70 | "show": true, 71 | "total": false, 72 | "values": false 73 | }, 74 | "lines": true, 75 | "linewidth": 1, 76 | "links": [ 77 | { 78 | "dashUri": "db/puppetdb-workload", 79 | "dashboard": "PuppetDB Workload", 80 | "includeVars": true, 81 | "keepTime": true, 82 | "title": "PuppetDB Workload", 83 | "type": "dashboard" 84 | }, 85 | { 86 | "dashUri": "db/puppetserver-workload", 87 | "dashboard": "Puppetserver Workload", 88 | "includeVars": true, 89 | "keepTime": true, 90 | "title": "Puppetserver Workload", 91 | "type": "dashboard" 92 | } 93 | ], 94 | "nullPointMode": "connected", 95 | "percentage": false, 96 | "pointradius": 5, 97 | "points": false, 98 | "renderer": "flot", 99 | "seriesOverrides": [], 100 | "span": 6, 101 | "stack": false, 102 | "steppedLine": false, 103 | "targets": [ 104 | { 105 | "refId": "A", 106 | "target": "aliasByNode(servers.$server.puppetdb.global_processed.FiveMinuteRate, 1, 3)" 107 | } 108 | ], 109 | "thresholds": [], 110 | "timeFrom": null, 111 | "timeShift": null, 112 | "title": "Commands Per Second", 113 | "tooltip": { 114 | "shared": true, 115 | "sort": 0, 116 | "value_type": "individual" 117 | }, 118 | "type": "graph", 119 | "xaxis": { 120 | "mode": "time", 121 | "name": null, 122 | "show": true, 123 | "values": [] 124 | }, 125 | "yaxes": [ 126 | { 127 | "format": "short", 128 | "label": null, 129 | "logBase": 1, 130 | "max": null, 131 | "min": null, 132 | "show": true 133 | }, 134 | { 135 | "format": "short", 136 | "label": null, 137 | "logBase": 1, 138 | "max": null, 139 | "min": null, 140 | "show": true 141 | } 142 | ] 143 | }, 144 | { 145 | "aliasColors": {}, 146 | "bars": false, 147 | "datasource": "${DS_GRAPHITE-STATSD}", 148 | "description": "The amount of time spent processing commands", 149 | "fill": 1, 150 | "id": 3, 151 | "legend": { 152 | "avg": false, 153 | "current": false, 154 | "max": false, 155 | "min": false, 156 | "show": true, 157 | "total": false, 158 | "values": false 159 | }, 160 | "lines": true, 161 | "linewidth": 1, 162 | "links": [ 163 | { 164 | "dashUri": "db/puppetdb-workload", 165 | "dashboard": "PuppetDB Workload", 166 | "includeVars": true, 167 | "keepTime": true, 168 | "title": "PuppetDB Workload", 169 | "type": "dashboard" 170 | }, 171 | { 172 | "dashUri": "db/puppetserver-performance", 173 | "dashboard": "Puppetserver Performance", 174 | "includeVars": true, 175 | "keepTime": true, 176 | "title": "Puppetserver Performance", 177 | "type": "dashboard" 178 | } 179 | ], 180 | "nullPointMode": "connected", 181 | "percentage": false, 182 | "pointradius": 5, 183 | "points": false, 184 | "renderer": "flot", 185 | "seriesOverrides": [], 186 | "span": 6, 187 | "stack": false, 188 | "steppedLine": false, 189 | "targets": [ 190 | { 191 | "refId": "A", 192 | "target": "aliasByNode(servers.$server.puppetdb.global_processing-time.FiveMinuteRate, 1, 3)" 193 | } 194 | ], 195 | "thresholds": [], 196 | "timeFrom": null, 197 | "timeShift": null, 198 | "title": "Command Processing Time", 199 | "tooltip": { 200 | "shared": true, 201 | "sort": 0, 202 | "value_type": "individual" 203 | }, 204 | "type": "graph", 205 | "xaxis": { 206 | "mode": "time", 207 | "name": null, 208 | "show": true, 209 | "values": [] 210 | }, 211 | "yaxes": [ 212 | { 213 | "format": "short", 214 | "label": null, 215 | "logBase": 1, 216 | "max": null, 217 | "min": null, 218 | "show": true 219 | }, 220 | { 221 | "format": "short", 222 | "label": null, 223 | "logBase": 1, 224 | "max": null, 225 | "min": null, 226 | "show": true 227 | } 228 | ] 229 | } 230 | ], 231 | "repeat": null, 232 | "repeatIteration": null, 233 | "repeatRowId": null, 234 | "showTitle": false, 235 | "title": "Dashboard Row", 236 | "titleSize": "h6" 237 | }, 238 | { 239 | "collapse": false, 240 | "height": "250px", 241 | "panels": [ 242 | { 243 | "aliasColors": {}, 244 | "bars": false, 245 | "datasource": "${DS_GRAPHITE-STATSD}", 246 | "description": "PuppetDB Queue Depth", 247 | "fill": 1, 248 | "id": 1, 249 | "legend": { 250 | "avg": false, 251 | "current": false, 252 | "max": false, 253 | "min": false, 254 | "show": true, 255 | "total": false, 256 | "values": false 257 | }, 258 | "lines": true, 259 | "linewidth": 1, 260 | "links": [], 261 | "nullPointMode": "connected", 262 | "percentage": false, 263 | "pointradius": 5, 264 | "points": false, 265 | "renderer": "flot", 266 | "seriesOverrides": [], 267 | "span": 12, 268 | "stack": false, 269 | "steppedLine": false, 270 | "targets": [ 271 | { 272 | "refId": "A", 273 | "target": "aliasByNode(servers.$server.puppetdb.puppetdb-status.status.queue_depth, 1, 5)" 274 | } 275 | ], 276 | "thresholds": [], 277 | "timeFrom": null, 278 | "timeShift": null, 279 | "title": "Queue Depth", 280 | "tooltip": { 281 | "shared": true, 282 | "sort": 0, 283 | "value_type": "individual" 284 | }, 285 | "type": "graph", 286 | "xaxis": { 287 | "mode": "time", 288 | "name": null, 289 | "show": true, 290 | "values": [] 291 | }, 292 | "yaxes": [ 293 | { 294 | "format": "short", 295 | "label": null, 296 | "logBase": 1, 297 | "max": null, 298 | "min": null, 299 | "show": true 300 | }, 301 | { 302 | "format": "short", 303 | "label": null, 304 | "logBase": 1, 305 | "max": null, 306 | "min": null, 307 | "show": true 308 | } 309 | ] 310 | } 311 | ], 312 | "repeat": null, 313 | "repeatIteration": null, 314 | "repeatRowId": null, 315 | "showTitle": false, 316 | "title": "Dashboard Row", 317 | "titleSize": "h6" 318 | }, 319 | { 320 | "collapse": false, 321 | "height": 250, 322 | "panels": [ 323 | { 324 | "aliasColors": {}, 325 | "bars": false, 326 | "datasource": "${DS_GRAPHITE-STATSD}", 327 | "fill": 1, 328 | "id": 4, 329 | "legend": { 330 | "avg": false, 331 | "current": false, 332 | "max": false, 333 | "min": false, 334 | "show": true, 335 | "total": false, 336 | "values": false 337 | }, 338 | "lines": true, 339 | "linewidth": 1, 340 | "links": [], 341 | "nullPointMode": "connected", 342 | "percentage": false, 343 | "pointradius": 5, 344 | "points": false, 345 | "renderer": "flot", 346 | "seriesOverrides": [], 347 | "span": 4, 348 | "stack": false, 349 | "steppedLine": false, 350 | "targets": [ 351 | { 352 | "refId": "A", 353 | "target": "aliasByNode(servers.$server.puppetdb.storage_replace-catalog-time.95thPercentile, 1, 3)" 354 | } 355 | ], 356 | "thresholds": [], 357 | "timeFrom": null, 358 | "timeShift": null, 359 | "title": "Replace Catalog Time", 360 | "tooltip": { 361 | "shared": true, 362 | "sort": 0, 363 | "value_type": "individual" 364 | }, 365 | "type": "graph", 366 | "xaxis": { 367 | "mode": "time", 368 | "name": null, 369 | "show": true, 370 | "values": [] 371 | }, 372 | "yaxes": [ 373 | { 374 | "format": "ms", 375 | "label": null, 376 | "logBase": 1, 377 | "max": null, 378 | "min": null, 379 | "show": true 380 | }, 381 | { 382 | "format": "short", 383 | "label": null, 384 | "logBase": 1, 385 | "max": null, 386 | "min": null, 387 | "show": true 388 | } 389 | ] 390 | }, 391 | { 392 | "aliasColors": {}, 393 | "bars": false, 394 | "datasource": "${DS_GRAPHITE-STATSD}", 395 | "fill": 1, 396 | "id": 5, 397 | "legend": { 398 | "avg": false, 399 | "current": false, 400 | "max": false, 401 | "min": false, 402 | "show": true, 403 | "total": false, 404 | "values": false 405 | }, 406 | "lines": true, 407 | "linewidth": 1, 408 | "links": [], 409 | "nullPointMode": "connected", 410 | "percentage": false, 411 | "pointradius": 5, 412 | "points": false, 413 | "renderer": "flot", 414 | "seriesOverrides": [], 415 | "span": 4, 416 | "stack": false, 417 | "steppedLine": false, 418 | "targets": [ 419 | { 420 | "refId": "A", 421 | "target": "aliasByNode(servers.$server.puppetdb.storage_replace-facts-time.95thPercentile, 1, 3)" 422 | } 423 | ], 424 | "thresholds": [], 425 | "timeFrom": null, 426 | "timeShift": null, 427 | "title": "Replace Facts Time", 428 | "tooltip": { 429 | "shared": true, 430 | "sort": 0, 431 | "value_type": "individual" 432 | }, 433 | "type": "graph", 434 | "xaxis": { 435 | "mode": "time", 436 | "name": null, 437 | "show": true, 438 | "values": [] 439 | }, 440 | "yaxes": [ 441 | { 442 | "format": "ms", 443 | "label": null, 444 | "logBase": 1, 445 | "max": null, 446 | "min": null, 447 | "show": true 448 | }, 449 | { 450 | "format": "short", 451 | "label": null, 452 | "logBase": 1, 453 | "max": null, 454 | "min": null, 455 | "show": true 456 | } 457 | ] 458 | }, 459 | { 460 | "aliasColors": {}, 461 | "bars": false, 462 | "datasource": "${DS_GRAPHITE-STATSD}", 463 | "fill": 1, 464 | "id": 6, 465 | "legend": { 466 | "avg": false, 467 | "current": false, 468 | "max": false, 469 | "min": false, 470 | "show": true, 471 | "total": false, 472 | "values": false 473 | }, 474 | "lines": true, 475 | "linewidth": 1, 476 | "links": [], 477 | "nullPointMode": "connected", 478 | "percentage": false, 479 | "pointradius": 5, 480 | "points": false, 481 | "renderer": "flot", 482 | "seriesOverrides": [], 483 | "span": 4, 484 | "stack": false, 485 | "steppedLine": false, 486 | "targets": [ 487 | { 488 | "refId": "A", 489 | "target": "aliasByNode(servers.$server.puppetdb.storage_store-report-time.95thPercentile, 1, 3)" 490 | } 491 | ], 492 | "thresholds": [], 493 | "timeFrom": null, 494 | "timeShift": null, 495 | "title": "Store Report Time", 496 | "tooltip": { 497 | "shared": true, 498 | "sort": 0, 499 | "value_type": "individual" 500 | }, 501 | "type": "graph", 502 | "xaxis": { 503 | "mode": "time", 504 | "name": null, 505 | "show": true, 506 | "values": [] 507 | }, 508 | "yaxes": [ 509 | { 510 | "format": "ms", 511 | "label": null, 512 | "logBase": 1, 513 | "max": null, 514 | "min": null, 515 | "show": true 516 | }, 517 | { 518 | "format": "short", 519 | "label": null, 520 | "logBase": 1, 521 | "max": null, 522 | "min": null, 523 | "show": true 524 | } 525 | ] 526 | } 527 | ], 528 | "repeat": null, 529 | "repeatIteration": null, 530 | "repeatRowId": null, 531 | "showTitle": false, 532 | "title": "Dashboard Row", 533 | "titleSize": "h6" 534 | } 535 | ], 536 | "schemaVersion": 14, 537 | "style": "dark", 538 | "tags": [], 539 | "templating": { 540 | "list": [ 541 | { 542 | "allValue": null, 543 | "current": {}, 544 | "datasource": "${DS_GRAPHITE-STATSD}", 545 | "hide": 0, 546 | "includeAll": true, 547 | "label": "Server", 548 | "multi": false, 549 | "name": "server", 550 | "options": [], 551 | "query": "servers.*", 552 | "refresh": 1, 553 | "regex": "", 554 | "sort": 0, 555 | "tagValuesQuery": "", 556 | "tags": [], 557 | "tagsQuery": "", 558 | "type": "query", 559 | "useTags": false 560 | } 561 | ] 562 | }, 563 | "time": { 564 | "from": "now-30d", 565 | "to": "now" 566 | }, 567 | "timepicker": { 568 | "refresh_intervals": [ 569 | "5s", 570 | "10s", 571 | "30s", 572 | "1m", 573 | "5m", 574 | "15m", 575 | "30m", 576 | "1h", 577 | "2h", 578 | "1d" 579 | ], 580 | "time_options": [ 581 | "5m", 582 | "15m", 583 | "1h", 584 | "6h", 585 | "12h", 586 | "24h", 587 | "2d", 588 | "7d", 589 | "30d" 590 | ] 591 | }, 592 | "timezone": "browser", 593 | "title": "PuppetDB Performance", 594 | "version": 1 595 | } 596 | -------------------------------------------------------------------------------- /grafana-puppetserver/build/dashboard-puppetdb-workload.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_GRAPHITE-STATSD", 5 | "label": "graphite-statsd", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "graphite", 9 | "pluginName": "Graphite" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.2.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "graphite", 28 | "name": "Graphite", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "editable": true, 36 | "gnetId": null, 37 | "graphTooltip": 0, 38 | "hideControls": false, 39 | "id": null, 40 | "links": [ 41 | { 42 | "icon": "external link", 43 | "includeVars": true, 44 | "keepTime": true, 45 | "tags": [], 46 | "type": "dashboards" 47 | } 48 | ], 49 | "rows": [ 50 | { 51 | "collapse": false, 52 | "height": "250px", 53 | "panels": [ 54 | { 55 | "aliasColors": {}, 56 | "bars": false, 57 | "datasource": "${DS_GRAPHITE-STATSD}", 58 | "fill": 1, 59 | "id": 1, 60 | "legend": { 61 | "avg": false, 62 | "current": false, 63 | "max": false, 64 | "min": false, 65 | "show": true, 66 | "total": false, 67 | "values": false 68 | }, 69 | "lines": true, 70 | "linewidth": 1, 71 | "links": [ 72 | { 73 | "dashUri": "db/puppetdb-performance", 74 | "dashboard": "PuppetDB Performance", 75 | "includeVars": true, 76 | "keepTime": true, 77 | "title": "PuppetDB Performance", 78 | "type": "dashboard" 79 | }, 80 | { 81 | "dashUri": "db/puppetserver-workload", 82 | "dashboard": "Puppetserver Workload", 83 | "includeVars": true, 84 | "keepTime": true, 85 | "title": "Puppetserver Workload", 86 | "type": "dashboard" 87 | } 88 | ], 89 | "nullPointMode": "connected", 90 | "percentage": false, 91 | "pointradius": 5, 92 | "points": false, 93 | "renderer": "flot", 94 | "seriesOverrides": [], 95 | "span": 12, 96 | "stack": false, 97 | "steppedLine": false, 98 | "targets": [ 99 | { 100 | "refId": "A", 101 | "target": "aliasByNode(servers.$server.puppetdb.global_message-persistence-time.FiveMinuteRate, 1, 3)" 102 | } 103 | ], 104 | "thresholds": [], 105 | "timeFrom": null, 106 | "timeShift": null, 107 | "title": "Command Persistence Time", 108 | "tooltip": { 109 | "shared": true, 110 | "sort": 0, 111 | "value_type": "individual" 112 | }, 113 | "type": "graph", 114 | "xaxis": { 115 | "mode": "time", 116 | "name": null, 117 | "show": true, 118 | "values": [] 119 | }, 120 | "yaxes": [ 121 | { 122 | "format": "short", 123 | "label": null, 124 | "logBase": 1, 125 | "max": null, 126 | "min": null, 127 | "show": true 128 | }, 129 | { 130 | "format": "short", 131 | "label": null, 132 | "logBase": 1, 133 | "max": null, 134 | "min": null, 135 | "show": true 136 | } 137 | ] 138 | } 139 | ], 140 | "repeat": null, 141 | "repeatIteration": null, 142 | "repeatRowId": null, 143 | "showTitle": false, 144 | "title": "Dashboard Row", 145 | "titleSize": "h6" 146 | }, 147 | { 148 | "collapse": false, 149 | "height": 250, 150 | "panels": [ 151 | { 152 | "aliasColors": {}, 153 | "bars": false, 154 | "datasource": "${DS_GRAPHITE-STATSD}", 155 | "fill": 1, 156 | "id": 2, 157 | "legend": { 158 | "avg": false, 159 | "current": false, 160 | "max": false, 161 | "min": false, 162 | "show": true, 163 | "total": false, 164 | "values": false 165 | }, 166 | "lines": true, 167 | "linewidth": 1, 168 | "links": [], 169 | "nullPointMode": "connected", 170 | "percentage": false, 171 | "pointradius": 5, 172 | "points": false, 173 | "renderer": "flot", 174 | "seriesOverrides": [], 175 | "span": 4, 176 | "stack": false, 177 | "steppedLine": false, 178 | "targets": [ 179 | { 180 | "refId": "A", 181 | "target": "aliasByNode(servers.$server.puppetdb.PDBReadPool_pool_Usage.50thPercentile, 1, 3)" 182 | } 183 | ], 184 | "thresholds": [], 185 | "timeFrom": null, 186 | "timeShift": null, 187 | "title": "Read Pool Usage", 188 | "tooltip": { 189 | "shared": true, 190 | "sort": 0, 191 | "value_type": "individual" 192 | }, 193 | "type": "graph", 194 | "xaxis": { 195 | "mode": "time", 196 | "name": null, 197 | "show": true, 198 | "values": [] 199 | }, 200 | "yaxes": [ 201 | { 202 | "format": "short", 203 | "label": null, 204 | "logBase": 1, 205 | "max": null, 206 | "min": null, 207 | "show": true 208 | }, 209 | { 210 | "format": "short", 211 | "label": null, 212 | "logBase": 1, 213 | "max": null, 214 | "min": null, 215 | "show": true 216 | } 217 | ] 218 | }, 219 | { 220 | "aliasColors": {}, 221 | "bars": false, 222 | "datasource": "${DS_GRAPHITE-STATSD}", 223 | "fill": 1, 224 | "id": 3, 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 | "nullPointMode": "connected", 238 | "percentage": false, 239 | "pointradius": 5, 240 | "points": false, 241 | "renderer": "flot", 242 | "seriesOverrides": [], 243 | "span": 4, 244 | "stack": false, 245 | "steppedLine": false, 246 | "targets": [ 247 | { 248 | "refId": "A", 249 | "target": "aliasByNode(servers.$server.puppetdb.PDBReadPool_pool_Wait.FifteenMinuteRate, 1, 3)" 250 | } 251 | ], 252 | "thresholds": [], 253 | "timeFrom": null, 254 | "timeShift": null, 255 | "title": "Read Pool Wait", 256 | "tooltip": { 257 | "shared": true, 258 | "sort": 0, 259 | "value_type": "individual" 260 | }, 261 | "type": "graph", 262 | "xaxis": { 263 | "mode": "time", 264 | "name": null, 265 | "show": true, 266 | "values": [] 267 | }, 268 | "yaxes": [ 269 | { 270 | "format": "short", 271 | "label": null, 272 | "logBase": 1, 273 | "max": null, 274 | "min": null, 275 | "show": true 276 | }, 277 | { 278 | "format": "short", 279 | "label": null, 280 | "logBase": 1, 281 | "max": null, 282 | "min": null, 283 | "show": true 284 | } 285 | ] 286 | }, 287 | { 288 | "aliasColors": {}, 289 | "bars": false, 290 | "datasource": "${DS_GRAPHITE-STATSD}", 291 | "fill": 1, 292 | "id": 4, 293 | "legend": { 294 | "avg": false, 295 | "current": false, 296 | "max": false, 297 | "min": false, 298 | "show": true, 299 | "total": false, 300 | "values": false 301 | }, 302 | "lines": true, 303 | "linewidth": 1, 304 | "links": [], 305 | "nullPointMode": "connected", 306 | "percentage": false, 307 | "pointradius": 5, 308 | "points": false, 309 | "renderer": "flot", 310 | "seriesOverrides": [], 311 | "span": 4, 312 | "stack": false, 313 | "steppedLine": false, 314 | "targets": [ 315 | { 316 | "refId": "A", 317 | "target": "aliasByNode(servers.$server.puppetdb.PDBReadPool_pool_PendingConnections.Value, 1, 3)" 318 | } 319 | ], 320 | "thresholds": [], 321 | "timeFrom": null, 322 | "timeShift": null, 323 | "title": "Read Pool Pending Connections", 324 | "tooltip": { 325 | "shared": true, 326 | "sort": 0, 327 | "value_type": "individual" 328 | }, 329 | "type": "graph", 330 | "xaxis": { 331 | "mode": "time", 332 | "name": null, 333 | "show": true, 334 | "values": [] 335 | }, 336 | "yaxes": [ 337 | { 338 | "format": "short", 339 | "label": null, 340 | "logBase": 1, 341 | "max": null, 342 | "min": null, 343 | "show": true 344 | }, 345 | { 346 | "format": "short", 347 | "label": null, 348 | "logBase": 1, 349 | "max": null, 350 | "min": null, 351 | "show": true 352 | } 353 | ] 354 | } 355 | ], 356 | "repeat": null, 357 | "repeatIteration": null, 358 | "repeatRowId": null, 359 | "showTitle": false, 360 | "title": "Dashboard Row", 361 | "titleSize": "h6" 362 | }, 363 | { 364 | "collapse": false, 365 | "height": 250, 366 | "panels": [ 367 | { 368 | "aliasColors": {}, 369 | "bars": false, 370 | "datasource": "${DS_GRAPHITE-STATSD}", 371 | "fill": 1, 372 | "id": 5, 373 | "legend": { 374 | "avg": false, 375 | "current": false, 376 | "max": false, 377 | "min": false, 378 | "show": true, 379 | "total": false, 380 | "values": false 381 | }, 382 | "lines": true, 383 | "linewidth": 1, 384 | "links": [], 385 | "nullPointMode": "connected", 386 | "percentage": false, 387 | "pointradius": 5, 388 | "points": false, 389 | "renderer": "flot", 390 | "seriesOverrides": [], 391 | "span": 4, 392 | "stack": false, 393 | "steppedLine": false, 394 | "targets": [ 395 | { 396 | "refId": "A", 397 | "target": "aliasByNode(servers.$server.puppetdb.PDBWritePool_pool_Usage.50thPercentile, 1, 3)" 398 | } 399 | ], 400 | "thresholds": [], 401 | "timeFrom": null, 402 | "timeShift": null, 403 | "title": "Write Pool Usage", 404 | "tooltip": { 405 | "shared": true, 406 | "sort": 0, 407 | "value_type": "individual" 408 | }, 409 | "type": "graph", 410 | "xaxis": { 411 | "mode": "time", 412 | "name": null, 413 | "show": true, 414 | "values": [] 415 | }, 416 | "yaxes": [ 417 | { 418 | "format": "short", 419 | "label": null, 420 | "logBase": 1, 421 | "max": null, 422 | "min": null, 423 | "show": true 424 | }, 425 | { 426 | "format": "short", 427 | "label": null, 428 | "logBase": 1, 429 | "max": null, 430 | "min": null, 431 | "show": true 432 | } 433 | ] 434 | }, 435 | { 436 | "aliasColors": {}, 437 | "bars": false, 438 | "datasource": "${DS_GRAPHITE-STATSD}", 439 | "fill": 1, 440 | "id": 6, 441 | "legend": { 442 | "avg": false, 443 | "current": false, 444 | "max": false, 445 | "min": false, 446 | "show": true, 447 | "total": false, 448 | "values": false 449 | }, 450 | "lines": true, 451 | "linewidth": 1, 452 | "links": [], 453 | "nullPointMode": "connected", 454 | "percentage": false, 455 | "pointradius": 5, 456 | "points": false, 457 | "renderer": "flot", 458 | "seriesOverrides": [], 459 | "span": 4, 460 | "stack": false, 461 | "steppedLine": false, 462 | "targets": [ 463 | { 464 | "refId": "A", 465 | "target": "aliasByNode(servers.$server.puppetdb.PDBWritePool_pool_Wait.FifteenMinuteRate, 1, 3)" 466 | } 467 | ], 468 | "thresholds": [], 469 | "timeFrom": null, 470 | "timeShift": null, 471 | "title": "Write Pool Wait", 472 | "tooltip": { 473 | "shared": true, 474 | "sort": 0, 475 | "value_type": "individual" 476 | }, 477 | "type": "graph", 478 | "xaxis": { 479 | "mode": "time", 480 | "name": null, 481 | "show": true, 482 | "values": [] 483 | }, 484 | "yaxes": [ 485 | { 486 | "format": "short", 487 | "label": null, 488 | "logBase": 1, 489 | "max": null, 490 | "min": null, 491 | "show": true 492 | }, 493 | { 494 | "format": "short", 495 | "label": null, 496 | "logBase": 1, 497 | "max": null, 498 | "min": null, 499 | "show": true 500 | } 501 | ] 502 | }, 503 | { 504 | "aliasColors": {}, 505 | "bars": false, 506 | "datasource": "${DS_GRAPHITE-STATSD}", 507 | "fill": 1, 508 | "id": 7, 509 | "legend": { 510 | "avg": false, 511 | "current": false, 512 | "max": false, 513 | "min": false, 514 | "show": true, 515 | "total": false, 516 | "values": false 517 | }, 518 | "lines": true, 519 | "linewidth": 1, 520 | "links": [], 521 | "nullPointMode": "connected", 522 | "percentage": false, 523 | "pointradius": 5, 524 | "points": false, 525 | "renderer": "flot", 526 | "seriesOverrides": [], 527 | "span": 4, 528 | "stack": false, 529 | "steppedLine": false, 530 | "targets": [ 531 | { 532 | "refId": "A", 533 | "target": "aliasByNode(servers.$server.puppetdb.PDBWritePool_pool_PendingConnections.Value, 1, 3)" 534 | } 535 | ], 536 | "thresholds": [], 537 | "timeFrom": null, 538 | "timeShift": null, 539 | "title": "Write Pool Pending Connections", 540 | "tooltip": { 541 | "shared": true, 542 | "sort": 0, 543 | "value_type": "individual" 544 | }, 545 | "type": "graph", 546 | "xaxis": { 547 | "mode": "time", 548 | "name": null, 549 | "show": true, 550 | "values": [] 551 | }, 552 | "yaxes": [ 553 | { 554 | "format": "short", 555 | "label": null, 556 | "logBase": 1, 557 | "max": null, 558 | "min": null, 559 | "show": true 560 | }, 561 | { 562 | "format": "short", 563 | "label": null, 564 | "logBase": 1, 565 | "max": null, 566 | "min": null, 567 | "show": true 568 | } 569 | ] 570 | } 571 | ], 572 | "repeat": null, 573 | "repeatIteration": null, 574 | "repeatRowId": null, 575 | "showTitle": false, 576 | "title": "Dashboard Row", 577 | "titleSize": "h6" 578 | }, 579 | { 580 | "collapse": false, 581 | "height": 250, 582 | "panels": [ 583 | { 584 | "aliasColors": {}, 585 | "bars": false, 586 | "datasource": "${DS_GRAPHITE-STATSD}", 587 | "fill": 1, 588 | "id": 8, 589 | "legend": { 590 | "avg": false, 591 | "current": false, 592 | "max": false, 593 | "min": false, 594 | "show": true, 595 | "total": false, 596 | "values": false 597 | }, 598 | "lines": true, 599 | "linewidth": 1, 600 | "links": [], 601 | "nullPointMode": "connected", 602 | "percentage": false, 603 | "pointradius": 5, 604 | "points": false, 605 | "renderer": "flot", 606 | "seriesOverrides": [], 607 | "span": 6, 608 | "stack": false, 609 | "steppedLine": false, 610 | "targets": [ 611 | { 612 | "refId": "A", 613 | "target": "aliasByNode(servers.$server.puppetdb.global_discarded.FiveMinuteRate, 1, 3)" 614 | } 615 | ], 616 | "thresholds": [], 617 | "timeFrom": null, 618 | "timeShift": null, 619 | "title": "Global Discards", 620 | "tooltip": { 621 | "shared": true, 622 | "sort": 0, 623 | "value_type": "individual" 624 | }, 625 | "type": "graph", 626 | "xaxis": { 627 | "mode": "time", 628 | "name": null, 629 | "show": true, 630 | "values": [] 631 | }, 632 | "yaxes": [ 633 | { 634 | "format": "short", 635 | "label": null, 636 | "logBase": 1, 637 | "max": null, 638 | "min": null, 639 | "show": true 640 | }, 641 | { 642 | "format": "short", 643 | "label": null, 644 | "logBase": 1, 645 | "max": null, 646 | "min": null, 647 | "show": true 648 | } 649 | ] 650 | }, 651 | { 652 | "aliasColors": {}, 653 | "bars": false, 654 | "datasource": "${DS_GRAPHITE-STATSD}", 655 | "fill": 1, 656 | "id": 9, 657 | "legend": { 658 | "avg": false, 659 | "current": false, 660 | "max": false, 661 | "min": false, 662 | "show": true, 663 | "total": false, 664 | "values": false 665 | }, 666 | "lines": true, 667 | "linewidth": 1, 668 | "links": [], 669 | "nullPointMode": "connected", 670 | "percentage": false, 671 | "pointradius": 5, 672 | "points": false, 673 | "renderer": "flot", 674 | "seriesOverrides": [], 675 | "span": 6, 676 | "stack": false, 677 | "steppedLine": false, 678 | "targets": [ 679 | { 680 | "refId": "A", 681 | "target": "aliasByNode(servers.$server.puppetdb.global_fatal.FiveMinuteRate, 1, 3)" 682 | } 683 | ], 684 | "thresholds": [], 685 | "timeFrom": null, 686 | "timeShift": null, 687 | "title": "Global Fatals", 688 | "tooltip": { 689 | "shared": true, 690 | "sort": 0, 691 | "value_type": "individual" 692 | }, 693 | "type": "graph", 694 | "xaxis": { 695 | "mode": "time", 696 | "name": null, 697 | "show": true, 698 | "values": [] 699 | }, 700 | "yaxes": [ 701 | { 702 | "format": "short", 703 | "label": null, 704 | "logBase": 1, 705 | "max": null, 706 | "min": null, 707 | "show": true 708 | }, 709 | { 710 | "format": "short", 711 | "label": null, 712 | "logBase": 1, 713 | "max": null, 714 | "min": null, 715 | "show": true 716 | } 717 | ] 718 | } 719 | ], 720 | "repeat": null, 721 | "repeatIteration": null, 722 | "repeatRowId": null, 723 | "showTitle": false, 724 | "title": "Dashboard Row", 725 | "titleSize": "h6" 726 | } 727 | ], 728 | "schemaVersion": 14, 729 | "style": "dark", 730 | "tags": [], 731 | "templating": { 732 | "list": [ 733 | { 734 | "allValue": null, 735 | "current": {}, 736 | "datasource": "${DS_GRAPHITE-STATSD}", 737 | "hide": 0, 738 | "includeAll": true, 739 | "label": "Server", 740 | "multi": false, 741 | "name": "server", 742 | "options": [], 743 | "query": "servers.*", 744 | "refresh": 1, 745 | "regex": "", 746 | "sort": 0, 747 | "tagValuesQuery": "", 748 | "tags": [], 749 | "tagsQuery": "", 750 | "type": "query", 751 | "useTags": false 752 | } 753 | ] 754 | }, 755 | "time": { 756 | "from": "now-30d", 757 | "to": "now" 758 | }, 759 | "timepicker": { 760 | "refresh_intervals": [ 761 | "5s", 762 | "10s", 763 | "30s", 764 | "1m", 765 | "5m", 766 | "15m", 767 | "30m", 768 | "1h", 769 | "2h", 770 | "1d" 771 | ], 772 | "time_options": [ 773 | "5m", 774 | "15m", 775 | "1h", 776 | "6h", 777 | "12h", 778 | "24h", 779 | "2d", 780 | "7d", 781 | "30d" 782 | ] 783 | }, 784 | "timezone": "browser", 785 | "title": "PuppetDB Workload", 786 | "version": 6 787 | } -------------------------------------------------------------------------------- /grafana-puppetserver/build/dashboard-puppetserver-performance.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_GRAPHITE-STATSD", 5 | "label": "graphite-statsd", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "graphite", 9 | "pluginName": "Graphite" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.2.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "graphite", 28 | "name": "Graphite", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "editable": true, 36 | "gnetId": null, 37 | "graphTooltip": 0, 38 | "hideControls": false, 39 | "id": null, 40 | "links": [ 41 | { 42 | "icon": "external link", 43 | "includeVars": true, 44 | "keepTime": true, 45 | "tags": [], 46 | "type": "dashboards" 47 | } 48 | ], 49 | "refresh": false, 50 | "rows": [ 51 | { 52 | "collapse": false, 53 | "height": "450px", 54 | "panels": [ 55 | { 56 | "alerting": {}, 57 | "aliasColors": {}, 58 | "bars": false, 59 | "datasource": "${DS_GRAPHITE-STATSD}", 60 | "editable": true, 61 | "error": false, 62 | "fill": 1, 63 | "id": 2, 64 | "legend": { 65 | "avg": false, 66 | "current": false, 67 | "max": false, 68 | "min": false, 69 | "show": true, 70 | "total": false, 71 | "values": false 72 | }, 73 | "lines": true, 74 | "linewidth": 2, 75 | "links": [ 76 | { 77 | "dashUri": "db/puppetserver-workload", 78 | "dashboard": "Puppetserver Workload", 79 | "includeVars": true, 80 | "keepTime": true, 81 | "title": "Puppetserver Workload", 82 | "type": "dashboard" 83 | }, 84 | { 85 | "dashUri": "db/metric-collection-errors", 86 | "dashboard": "Metric Collection Errors", 87 | "includeVars": true, 88 | "keepTime": true, 89 | "title": "Metric Collection Errors", 90 | "type": "dashboard" 91 | } 92 | ], 93 | "nullPointMode": "connected", 94 | "percentage": false, 95 | "pointradius": 5, 96 | "points": false, 97 | "renderer": "flot", 98 | "seriesOverrides": [ 99 | { 100 | "alias": "/.*\\.average-borrow-time/", 101 | "yaxis": 2 102 | }, 103 | { 104 | "alias": "/.*\\.average-wait-time/", 105 | "yaxis": 2 106 | } 107 | ], 108 | "span": 12, 109 | "stack": false, 110 | "steppedLine": false, 111 | "targets": [ 112 | { 113 | "hide": false, 114 | "refId": "A", 115 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-free-jrubies, 1, -1)", 116 | "textEditor": false 117 | }, 118 | { 119 | "refId": "B", 120 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-requested-jrubies, 1, -1)", 121 | "textEditor": false 122 | }, 123 | { 124 | "refId": "C", 125 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-wait-time, 1, -1)", 126 | "textEditor": false 127 | }, 128 | { 129 | "refId": "D", 130 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-borrow-time, 1, -1)", 131 | "textEditor": false 132 | } 133 | ], 134 | "thresholds": [], 135 | "timeFrom": null, 136 | "timeShift": null, 137 | "title": "Puppetserver Performance", 138 | "tooltip": { 139 | "msResolution": false, 140 | "shared": true, 141 | "sort": 0, 142 | "value_type": "cumulative" 143 | }, 144 | "transparent": false, 145 | "type": "graph", 146 | "xaxis": { 147 | "mode": "time", 148 | "name": null, 149 | "show": true, 150 | "values": [] 151 | }, 152 | "yaxes": [ 153 | { 154 | "format": "short", 155 | "label": "jrubies - free, requested", 156 | "logBase": 1, 157 | "max": null, 158 | "min": null, 159 | "show": true 160 | }, 161 | { 162 | "format": "ms", 163 | "label": "time - wait, borrow", 164 | "logBase": 1, 165 | "max": null, 166 | "min": null, 167 | "show": true 168 | } 169 | ] 170 | } 171 | ], 172 | "repeat": null, 173 | "repeatIteration": null, 174 | "repeatRowId": null, 175 | "showTitle": false, 176 | "title": "New row", 177 | "titleSize": "h6" 178 | }, 179 | { 180 | "collapse": false, 181 | "height": "180", 182 | "panels": [ 183 | { 184 | "aliasColors": {}, 185 | "bars": false, 186 | "datasource": "${DS_GRAPHITE-STATSD}", 187 | "editable": true, 188 | "error": false, 189 | "fill": 4, 190 | "id": 6, 191 | "legend": { 192 | "avg": false, 193 | "current": false, 194 | "max": false, 195 | "min": false, 196 | "show": true, 197 | "total": false, 198 | "values": false 199 | }, 200 | "lines": true, 201 | "linewidth": 1, 202 | "links": [], 203 | "nullPointMode": "connected", 204 | "percentage": false, 205 | "pointradius": 5, 206 | "points": false, 207 | "renderer": "flot", 208 | "seriesOverrides": [ 209 | { 210 | "alias": "/up-time-ms/", 211 | "yaxis": 2 212 | }, 213 | { 214 | "alias": "/up-time-ms/", 215 | "fill": 0 216 | }, 217 | { 218 | "alias": "/committed/", 219 | "fill": 1 220 | } 221 | ], 222 | "span": 12, 223 | "stack": false, 224 | "steppedLine": false, 225 | "targets": [ 226 | { 227 | "refId": "A", 228 | "target": "aliasByNode(servers.$server.puppetserver.status-service.status.experimental.jvm-metrics.heap-memory.used, 1, -1)" 229 | }, 230 | { 231 | "refId": "B", 232 | "target": "aliasByNode(servers.$server.puppetserver.status-service.status.experimental.jvm-metrics.up-time-ms, 1, -1)" 233 | }, 234 | { 235 | "refId": "C", 236 | "target": "aliasByNode(servers.$server.puppetserver.status-service.status.experimental.jvm-metrics.heap-memory.committed, 1, -1)" 237 | } 238 | ], 239 | "thresholds": [], 240 | "timeFrom": null, 241 | "timeShift": null, 242 | "title": "Heap Memory and Uptime", 243 | "tooltip": { 244 | "msResolution": false, 245 | "shared": true, 246 | "sort": 0, 247 | "value_type": "individual" 248 | }, 249 | "type": "graph", 250 | "xaxis": { 251 | "mode": "time", 252 | "name": null, 253 | "show": true, 254 | "values": [] 255 | }, 256 | "yaxes": [ 257 | { 258 | "format": "decbytes", 259 | "label": "heap-memory-used", 260 | "logBase": 1, 261 | "max": null, 262 | "min": "0", 263 | "show": true 264 | }, 265 | { 266 | "format": "ms", 267 | "label": "uptime", 268 | "logBase": 1, 269 | "max": null, 270 | "min": "0", 271 | "show": true 272 | } 273 | ] 274 | } 275 | ], 276 | "repeat": null, 277 | "repeatIteration": null, 278 | "repeatRowId": null, 279 | "showTitle": false, 280 | "title": "Dashboard Row", 281 | "titleSize": "h6" 282 | }, 283 | { 284 | "collapse": false, 285 | "height": "200", 286 | "panels": [ 287 | { 288 | "alerting": {}, 289 | "aliasColors": {}, 290 | "bars": false, 291 | "datasource": "${DS_GRAPHITE-STATSD}", 292 | "editable": true, 293 | "error": false, 294 | "fill": 1, 295 | "id": 3, 296 | "legend": { 297 | "avg": false, 298 | "current": false, 299 | "max": false, 300 | "min": false, 301 | "show": true, 302 | "total": false, 303 | "values": false 304 | }, 305 | "lines": true, 306 | "linewidth": 2, 307 | "links": [], 308 | "nullPointMode": "connected", 309 | "percentage": false, 310 | "pointradius": 5, 311 | "points": false, 312 | "renderer": "flot", 313 | "seriesOverrides": [], 314 | "span": 6, 315 | "stack": false, 316 | "steppedLine": false, 317 | "targets": [ 318 | { 319 | "hide": false, 320 | "refId": "A", 321 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-requested-jrubies, 1)", 322 | "textEditor": false 323 | } 324 | ], 325 | "thresholds": [], 326 | "timeFrom": null, 327 | "timeShift": null, 328 | "title": "average-requested-jrubies", 329 | "tooltip": { 330 | "msResolution": false, 331 | "shared": true, 332 | "sort": 0, 333 | "value_type": "cumulative" 334 | }, 335 | "type": "graph", 336 | "xaxis": { 337 | "mode": "time", 338 | "name": null, 339 | "show": true, 340 | "values": [] 341 | }, 342 | "yaxes": [ 343 | { 344 | "format": "short", 345 | "label": null, 346 | "logBase": 1, 347 | "max": null, 348 | "min": null, 349 | "show": true 350 | }, 351 | { 352 | "format": "short", 353 | "label": null, 354 | "logBase": 1, 355 | "max": null, 356 | "min": null, 357 | "show": true 358 | } 359 | ] 360 | }, 361 | { 362 | "alerting": {}, 363 | "aliasColors": {}, 364 | "bars": false, 365 | "datasource": "${DS_GRAPHITE-STATSD}", 366 | "editable": true, 367 | "error": false, 368 | "fill": 1, 369 | "hideTimeOverride": false, 370 | "id": 1, 371 | "legend": { 372 | "avg": false, 373 | "current": false, 374 | "max": false, 375 | "min": false, 376 | "show": true, 377 | "total": false, 378 | "values": false 379 | }, 380 | "lines": true, 381 | "linewidth": 2, 382 | "links": [], 383 | "nullPointMode": "connected", 384 | "percentage": false, 385 | "pointradius": 5, 386 | "points": false, 387 | "renderer": "flot", 388 | "seriesOverrides": [], 389 | "span": 6, 390 | "stack": false, 391 | "steppedLine": false, 392 | "targets": [ 393 | { 394 | "refId": "A", 395 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-borrow-time, 1)", 396 | "textEditor": false 397 | } 398 | ], 399 | "thresholds": [], 400 | "timeFrom": null, 401 | "timeShift": null, 402 | "title": "average-borrow-time", 403 | "tooltip": { 404 | "msResolution": false, 405 | "shared": true, 406 | "sort": 0, 407 | "value_type": "cumulative" 408 | }, 409 | "type": "graph", 410 | "xaxis": { 411 | "mode": "time", 412 | "name": null, 413 | "show": true, 414 | "values": [] 415 | }, 416 | "yaxes": [ 417 | { 418 | "format": "short", 419 | "label": null, 420 | "logBase": 1, 421 | "max": null, 422 | "min": null, 423 | "show": true 424 | }, 425 | { 426 | "format": "short", 427 | "label": null, 428 | "logBase": 1, 429 | "max": null, 430 | "min": null, 431 | "show": true 432 | } 433 | ] 434 | } 435 | ], 436 | "repeat": null, 437 | "repeatIteration": null, 438 | "repeatRowId": null, 439 | "showTitle": false, 440 | "title": "New row", 441 | "titleSize": "h6" 442 | }, 443 | { 444 | "collapse": false, 445 | "height": "200", 446 | "panels": [ 447 | { 448 | "alerting": {}, 449 | "aliasColors": {}, 450 | "bars": false, 451 | "datasource": "${DS_GRAPHITE-STATSD}", 452 | "editable": true, 453 | "error": false, 454 | "fill": 1, 455 | "id": 5, 456 | "legend": { 457 | "avg": false, 458 | "current": false, 459 | "max": false, 460 | "min": false, 461 | "show": true, 462 | "total": false, 463 | "values": false 464 | }, 465 | "lines": true, 466 | "linewidth": 2, 467 | "links": [], 468 | "nullPointMode": "connected", 469 | "percentage": false, 470 | "pointradius": 5, 471 | "points": false, 472 | "renderer": "flot", 473 | "seriesOverrides": [], 474 | "span": 6, 475 | "stack": false, 476 | "steppedLine": false, 477 | "targets": [ 478 | { 479 | "refId": "A", 480 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-free-jrubies, 1)", 481 | "textEditor": false 482 | } 483 | ], 484 | "thresholds": [], 485 | "timeFrom": null, 486 | "timeShift": null, 487 | "title": "average-free-jrubies", 488 | "tooltip": { 489 | "msResolution": false, 490 | "shared": true, 491 | "sort": 0, 492 | "value_type": "cumulative" 493 | }, 494 | "type": "graph", 495 | "xaxis": { 496 | "mode": "time", 497 | "name": null, 498 | "show": true, 499 | "values": [] 500 | }, 501 | "yaxes": [ 502 | { 503 | "format": "short", 504 | "label": null, 505 | "logBase": 1, 506 | "max": null, 507 | "min": null, 508 | "show": true 509 | }, 510 | { 511 | "format": "short", 512 | "label": null, 513 | "logBase": 1, 514 | "max": null, 515 | "min": null, 516 | "show": true 517 | } 518 | ] 519 | }, 520 | { 521 | "alerting": {}, 522 | "aliasColors": {}, 523 | "bars": false, 524 | "datasource": "${DS_GRAPHITE-STATSD}", 525 | "editable": true, 526 | "error": false, 527 | "fill": 1, 528 | "id": 4, 529 | "legend": { 530 | "avg": false, 531 | "current": false, 532 | "max": false, 533 | "min": false, 534 | "show": true, 535 | "total": false, 536 | "values": false 537 | }, 538 | "lines": true, 539 | "linewidth": 2, 540 | "links": [], 541 | "nullPointMode": "connected", 542 | "percentage": false, 543 | "pointradius": 5, 544 | "points": false, 545 | "renderer": "flot", 546 | "seriesOverrides": [], 547 | "span": 6, 548 | "stack": false, 549 | "steppedLine": false, 550 | "targets": [ 551 | { 552 | "refId": "A", 553 | "target": "aliasByNode(servers.$server.puppetserver.pe-jruby-metrics.status.experimental.metrics.average-wait-time, 1)", 554 | "textEditor": false 555 | } 556 | ], 557 | "thresholds": [], 558 | "timeFrom": null, 559 | "timeShift": null, 560 | "title": "average-wait-time", 561 | "tooltip": { 562 | "msResolution": false, 563 | "shared": true, 564 | "sort": 0, 565 | "value_type": "cumulative" 566 | }, 567 | "type": "graph", 568 | "xaxis": { 569 | "mode": "time", 570 | "name": null, 571 | "show": true, 572 | "values": [] 573 | }, 574 | "yaxes": [ 575 | { 576 | "format": "short", 577 | "label": null, 578 | "logBase": 1, 579 | "max": null, 580 | "min": null, 581 | "show": true 582 | }, 583 | { 584 | "format": "short", 585 | "label": null, 586 | "logBase": 1, 587 | "max": null, 588 | "min": null, 589 | "show": true 590 | } 591 | ] 592 | } 593 | ], 594 | "repeat": null, 595 | "repeatIteration": null, 596 | "repeatRowId": null, 597 | "showTitle": false, 598 | "title": "Dashboard Row", 599 | "titleSize": "h6" 600 | } 601 | ], 602 | "schemaVersion": 14, 603 | "style": "dark", 604 | "tags": [], 605 | "templating": { 606 | "list": [ 607 | { 608 | "allValue": null, 609 | "current": {}, 610 | "datasource": "${DS_GRAPHITE-STATSD}", 611 | "hide": 0, 612 | "includeAll": true, 613 | "label": "Server", 614 | "multi": false, 615 | "name": "server", 616 | "options": [], 617 | "query": "servers.*", 618 | "refresh": 1, 619 | "regex": "", 620 | "sort": 0, 621 | "tagValuesQuery": null, 622 | "tags": [], 623 | "tagsQuery": null, 624 | "type": "query", 625 | "useTags": false 626 | } 627 | ] 628 | }, 629 | "time": { 630 | "from": "now-30d", 631 | "to": "now" 632 | }, 633 | "timepicker": { 634 | "refresh_intervals": [ 635 | "5s", 636 | "10s", 637 | "30s", 638 | "1m", 639 | "5m", 640 | "15m", 641 | "30m", 642 | "1h", 643 | "2h", 644 | "1d" 645 | ], 646 | "time_options": [ 647 | "5m", 648 | "15m", 649 | "1h", 650 | "6h", 651 | "12h", 652 | "24h", 653 | "2d", 654 | "7d", 655 | "30d" 656 | ] 657 | }, 658 | "timezone": "browser", 659 | "title": "Puppetserver Performance", 660 | "version": 5 661 | } -------------------------------------------------------------------------------- /grafana-puppetserver/build/dashboard-puppetserver-workload.json: -------------------------------------------------------------------------------- 1 | { 2 | "__inputs": [ 3 | { 4 | "name": "DS_GRAPHITE-STATSD", 5 | "label": "graphite-statsd", 6 | "description": "", 7 | "type": "datasource", 8 | "pluginId": "graphite", 9 | "pluginName": "Graphite" 10 | } 11 | ], 12 | "__requires": [ 13 | { 14 | "type": "grafana", 15 | "id": "grafana", 16 | "name": "Grafana", 17 | "version": "4.2.0" 18 | }, 19 | { 20 | "type": "panel", 21 | "id": "graph", 22 | "name": "Graph", 23 | "version": "" 24 | }, 25 | { 26 | "type": "datasource", 27 | "id": "graphite", 28 | "name": "Graphite", 29 | "version": "1.0.0" 30 | } 31 | ], 32 | "annotations": { 33 | "list": [] 34 | }, 35 | "editable": true, 36 | "gnetId": null, 37 | "graphTooltip": 0, 38 | "hideControls": false, 39 | "id": null, 40 | "links": [ 41 | { 42 | "icon": "external link", 43 | "includeVars": true, 44 | "keepTime": true, 45 | "tags": [], 46 | "type": "dashboards" 47 | } 48 | ], 49 | "rows": [ 50 | { 51 | "collapse": false, 52 | "height": "250", 53 | "panels": [ 54 | { 55 | "aliasColors": {}, 56 | "bars": false, 57 | "datasource": "${DS_GRAPHITE-STATSD}", 58 | "editable": true, 59 | "error": false, 60 | "fill": 1, 61 | "id": 2, 62 | "legend": { 63 | "avg": false, 64 | "current": false, 65 | "max": false, 66 | "min": false, 67 | "show": true, 68 | "total": false, 69 | "values": false 70 | }, 71 | "lines": true, 72 | "linewidth": 1, 73 | "links": [ 74 | { 75 | "dashUri": "db/puppetserver-performance", 76 | "dashboard": "Puppetserver Performance", 77 | "includeVars": true, 78 | "keepTime": true, 79 | "title": "Puppetserver Performance", 80 | "type": "dashboard" 81 | }, 82 | { 83 | "dashUri": "db/metric-collection-errors", 84 | "dashboard": "Metric Collection Errors", 85 | "includeVars": true, 86 | "keepTime": true, 87 | "title": "Metric Collection Errors", 88 | "type": "dashboard" 89 | } 90 | ], 91 | "nullPointMode": "connected", 92 | "percentage": false, 93 | "pointradius": 5, 94 | "points": false, 95 | "renderer": "flot", 96 | "seriesOverrides": [], 97 | "span": 12, 98 | "stack": false, 99 | "steppedLine": false, 100 | "targets": [ 101 | { 102 | "refId": "A", 103 | "target": "aliasByNode(servers.$server.puppetserver.pe-master.status.experimental.http-metrics.*.mean, 1, -2)", 104 | "textEditor": false 105 | } 106 | ], 107 | "thresholds": [], 108 | "timeFrom": null, 109 | "timeShift": null, 110 | "title": "Average request time by type", 111 | "tooltip": { 112 | "msResolution": false, 113 | "shared": true, 114 | "sort": 0, 115 | "value_type": "individual" 116 | }, 117 | "type": "graph", 118 | "xaxis": { 119 | "mode": "time", 120 | "name": null, 121 | "show": true, 122 | "values": [] 123 | }, 124 | "yaxes": [ 125 | { 126 | "format": "ms", 127 | "label": null, 128 | "logBase": 1, 129 | "max": null, 130 | "min": "0", 131 | "show": true 132 | }, 133 | { 134 | "format": "short", 135 | "label": null, 136 | "logBase": 1, 137 | "max": null, 138 | "min": null, 139 | "show": false 140 | } 141 | ] 142 | } 143 | ], 144 | "repeat": null, 145 | "repeatIteration": null, 146 | "repeatRowId": null, 147 | "showTitle": false, 148 | "title": "Dashboard Row", 149 | "titleSize": "h6" 150 | }, 151 | { 152 | "collapse": false, 153 | "height": 250, 154 | "panels": [ 155 | { 156 | "aliasColors": {}, 157 | "bars": false, 158 | "datasource": "${DS_GRAPHITE-STATSD}", 159 | "editable": true, 160 | "error": false, 161 | "fill": 1, 162 | "id": 1, 163 | "legend": { 164 | "avg": false, 165 | "current": false, 166 | "max": false, 167 | "min": false, 168 | "show": true, 169 | "total": false, 170 | "values": false 171 | }, 172 | "lines": true, 173 | "linewidth": 1, 174 | "links": [], 175 | "nullPointMode": "connected", 176 | "percentage": false, 177 | "pointradius": 5, 178 | "points": false, 179 | "renderer": "flot", 180 | "seriesOverrides": [], 181 | "span": 12, 182 | "stack": false, 183 | "steppedLine": false, 184 | "targets": [ 185 | { 186 | "refId": "A", 187 | "target": "aliasByNode(smartSummarize(perSecond(keepLastValue(servers.$server.puppetserver.pe-master.status.experimental.http-metrics.*.count, 100)), '5m', 'sum'), 1, -2)", 188 | "textEditor": false 189 | }, 190 | { 191 | "refId": "B", 192 | "target": "", 193 | "textEditor": false 194 | } 195 | ], 196 | "thresholds": [], 197 | "timeFrom": null, 198 | "timeShift": null, 199 | "title": "Approx. request rate by type", 200 | "tooltip": { 201 | "msResolution": false, 202 | "shared": false, 203 | "sort": 0, 204 | "value_type": "individual" 205 | }, 206 | "type": "graph", 207 | "xaxis": { 208 | "mode": "time", 209 | "name": null, 210 | "show": true, 211 | "values": [ 212 | "total" 213 | ] 214 | }, 215 | "yaxes": [ 216 | { 217 | "format": "short", 218 | "label": "Requests per second", 219 | "logBase": 1, 220 | "max": null, 221 | "min": "0", 222 | "show": true 223 | }, 224 | { 225 | "format": "short", 226 | "label": null, 227 | "logBase": 1, 228 | "max": null, 229 | "min": null, 230 | "show": false 231 | } 232 | ] 233 | } 234 | ], 235 | "repeat": null, 236 | "repeatIteration": null, 237 | "repeatRowId": null, 238 | "showTitle": false, 239 | "title": "Dashboard Row", 240 | "titleSize": "h6" 241 | }, 242 | { 243 | "collapse": false, 244 | "height": "350", 245 | "panels": [ 246 | { 247 | "aliasColors": {}, 248 | "bars": false, 249 | "datasource": "${DS_GRAPHITE-STATSD}", 250 | "editable": true, 251 | "error": false, 252 | "fill": 1, 253 | "id": 3, 254 | "legend": { 255 | "avg": false, 256 | "current": false, 257 | "max": false, 258 | "min": false, 259 | "show": true, 260 | "total": false, 261 | "values": false 262 | }, 263 | "lines": true, 264 | "linewidth": 1, 265 | "links": [], 266 | "nullPointMode": "connected", 267 | "percentage": false, 268 | "pointradius": 5, 269 | "points": false, 270 | "renderer": "flot", 271 | "seriesOverrides": [], 272 | "span": 12, 273 | "stack": false, 274 | "steppedLine": false, 275 | "targets": [ 276 | { 277 | "refId": "A", 278 | "target": "aliasByNode(servers.$server.puppetserver.pe-puppet-profiler.status.experimental.function-metrics.*.mean, 7)" 279 | } 280 | ], 281 | "thresholds": [], 282 | "timeFrom": null, 283 | "timeShift": null, 284 | "title": "Function Performance", 285 | "tooltip": { 286 | "msResolution": false, 287 | "shared": true, 288 | "sort": 0, 289 | "value_type": "individual" 290 | }, 291 | "type": "graph", 292 | "xaxis": { 293 | "mode": "time", 294 | "name": null, 295 | "show": true, 296 | "values": [] 297 | }, 298 | "yaxes": [ 299 | { 300 | "format": "ms", 301 | "label": null, 302 | "logBase": 1, 303 | "max": null, 304 | "min": null, 305 | "show": true 306 | }, 307 | { 308 | "format": "short", 309 | "label": null, 310 | "logBase": 1, 311 | "max": null, 312 | "min": null, 313 | "show": true 314 | } 315 | ] 316 | } 317 | ], 318 | "repeat": null, 319 | "repeatIteration": null, 320 | "repeatRowId": null, 321 | "showTitle": false, 322 | "title": "Dashboard Row", 323 | "titleSize": "h6" 324 | } 325 | ], 326 | "schemaVersion": 14, 327 | "style": "dark", 328 | "tags": [], 329 | "templating": { 330 | "list": [ 331 | { 332 | "allValue": null, 333 | "current": {}, 334 | "datasource": "${DS_GRAPHITE-STATSD}", 335 | "hide": 0, 336 | "includeAll": true, 337 | "label": "Server", 338 | "multi": false, 339 | "name": "server", 340 | "options": [], 341 | "query": "servers.*", 342 | "refresh": 1, 343 | "regex": "", 344 | "sort": 0, 345 | "tagValuesQuery": null, 346 | "tags": [], 347 | "tagsQuery": null, 348 | "type": "query", 349 | "useTags": false 350 | } 351 | ] 352 | }, 353 | "time": { 354 | "from": "now-30d", 355 | "to": "now" 356 | }, 357 | "timepicker": { 358 | "refresh_intervals": [ 359 | "5s", 360 | "10s", 361 | "30s", 362 | "1m", 363 | "5m", 364 | "15m", 365 | "30m", 366 | "1h", 367 | "2h", 368 | "1d" 369 | ], 370 | "time_options": [ 371 | "5m", 372 | "15m", 373 | "1h", 374 | "6h", 375 | "12h", 376 | "24h", 377 | "2d", 378 | "7d", 379 | "30d" 380 | ] 381 | }, 382 | "timezone": "browser", 383 | "title": "Puppetserver Workload", 384 | "version": 4 385 | } -------------------------------------------------------------------------------- /grafana-puppetserver/build/datasource-graphite-statsd.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"graphite-statsd", 3 | "type":"graphite", 4 | "url":"http://graphite-statsd:81", 5 | "access":"proxy", 6 | "basicAuth":false 7 | } 8 | -------------------------------------------------------------------------------- /grafana-puppetserver/build/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | datasource_name="graphite-statsd" 4 | g_id=1 5 | 6 | configure() { 7 | until curl -s http://127.0.0.1:3000 >/dev/null; do sleep 1; done 8 | 9 | for datasource in /grafana-puppet/datasource-*.json; do 10 | post_datasource $datasource 11 | done 12 | 13 | for dashboard in /grafana-puppet/dashboard-*.json; do 14 | post_dashboard $dashboard 15 | done 16 | } 17 | 18 | post_dashboard() { 19 | dashboard=$(cat "$1" | sed "s/\\\${DS_GRAPHITE-STATSD}/$datasource_name/") 20 | json="{\"overwrite\": true, \"dashboard\": $dashboard }" 21 | post "/api/dashboards/db" "$json" 22 | post "/api/user/stars/dashboard/$g_id" 23 | g_id=$(expr "$g_id" + 1) 24 | } 25 | 26 | post_datasource() { 27 | json=$(cat "$1") 28 | post "/api/datasources" "$json" 29 | } 30 | 31 | post() { 32 | curl -X POST \ 33 | -H "Accept: application/json" \ 34 | -H "Content-Type: application/json" \ 35 | -d "$2" \ 36 | "http://admin:admin@127.0.0.1:3000${1}" 37 | } 38 | 39 | configure & 40 | exec /run.sh 41 | -------------------------------------------------------------------------------- /grafana-puppetserver/conf/carbon.conf: -------------------------------------------------------------------------------- 1 | [cache] 2 | # Configure carbon directories. 3 | # 4 | # OS environment variables can be used to tell carbon where graphite is 5 | # installed, where to read configuration from and where to write data. 6 | # 7 | # GRAPHITE_ROOT - Root directory of the graphite installation. 8 | # Defaults to ../ 9 | # GRAPHITE_CONF_DIR - Configuration directory (where this file lives). 10 | # Defaults to $GRAPHITE_ROOT/conf/ 11 | # GRAPHITE_STORAGE_DIR - Storage directory for whipser/rrd/log/pid files. 12 | # Defaults to $GRAPHITE_ROOT/storage/ 13 | # 14 | # To change other directory paths, add settings to this file. The following 15 | # configuration variables are available with these default values: 16 | # 17 | # STORAGE_DIR = $GRAPHITE_STORAGE_DIR 18 | # LOCAL_DATA_DIR = STORAGE_DIR/whisper/ 19 | # WHITELISTS_DIR = STORAGE_DIR/lists/ 20 | # CONF_DIR = STORAGE_DIR/conf/ 21 | # LOG_DIR = STORAGE_DIR/log/ 22 | # PID_DIR = STORAGE_DIR/ 23 | # 24 | # For FHS style directory structures, use: 25 | # 26 | # STORAGE_DIR = /var/lib/carbon/ 27 | # CONF_DIR = /etc/carbon/ 28 | # LOG_DIR = /var/log/carbon/ 29 | # PID_DIR = /var/run/ 30 | # 31 | #LOCAL_DATA_DIR = /opt/graphite/storage/whisper/ 32 | 33 | # Enable daily log rotation. If disabled, a kill -HUP can be used after a manual rotate 34 | ENABLE_LOGROTATION = True 35 | 36 | # Specify the user to drop privileges to 37 | # If this is blank carbon runs as the user that invokes it 38 | # This user must have write access to the local data directory 39 | USER = 40 | # 41 | # NOTE: The above settings must be set under [relay] and [aggregator] 42 | # to take effect for those daemons as well 43 | 44 | # Limit the size of the cache to avoid swapping or becoming CPU bound. 45 | # Sorts and serving cache queries gets more expensive as the cache grows. 46 | # Use the value "inf" (infinity) for an unlimited cache size. 47 | MAX_CACHE_SIZE = 40000 48 | 49 | # Limits the number of whisper update_many() calls per second, which effectively 50 | # means the number of write requests sent to the disk. This is intended to 51 | # prevent over-utilizing the disk and thus starving the rest of the system. 52 | # When the rate of required updates exceeds this, then carbon's caching will 53 | # take effect and increase the overall throughput accordingly. 54 | MAX_UPDATES_PER_SECOND = 500 55 | 56 | # If defined, this changes the MAX_UPDATES_PER_SECOND in Carbon when a 57 | # stop/shutdown is initiated. This helps when MAX_UPDATES_PER_SECOND is 58 | # relatively low and carbon has cached a lot of updates; it enables the carbon 59 | # daemon to shutdown more quickly. 60 | # MAX_UPDATES_PER_SECOND_ON_SHUTDOWN = 1000 61 | 62 | # Softly limits the number of whisper files that get created each minute. 63 | # Setting this value low (like at 50) is a good way to ensure your graphite 64 | # system will not be adversely impacted when a bunch of new metrics are 65 | # sent to it. The trade off is that it will take much longer for those metrics' 66 | # database files to all get created and thus longer until the data becomes usable. 67 | # Setting this value high (like "inf" for infinity) will cause graphite to create 68 | # the files quickly but at the risk of slowing I/O down considerably for a while. 69 | MAX_CREATES_PER_MINUTE = inf 70 | 71 | LINE_RECEIVER_INTERFACE = 0.0.0.0 72 | LINE_RECEIVER_PORT = 2003 73 | 74 | # Set this to True to enable the UDP listener. By default this is off 75 | # because it is very common to run multiple carbon daemons and managing 76 | # another (rarely used) port for every carbon instance is not fun. 77 | ENABLE_UDP_LISTENER = False 78 | UDP_RECEIVER_INTERFACE = 0.0.0.0 79 | UDP_RECEIVER_PORT = 2003 80 | 81 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 82 | PICKLE_RECEIVER_PORT = 2004 83 | 84 | # Set to false to disable logging of successful connections 85 | LOG_LISTENER_CONNECTIONS = True 86 | 87 | # Per security concerns outlined in Bug #817247 the pickle receiver 88 | # will use a more secure and slightly less efficient unpickler. 89 | # Set this to True to revert to the old-fashioned insecure unpickler. 90 | USE_INSECURE_UNPICKLER = False 91 | 92 | CACHE_QUERY_INTERFACE = 0.0.0.0 93 | CACHE_QUERY_PORT = 7002 94 | 95 | # Set this to False to drop datapoints received after the cache 96 | # reaches MAX_CACHE_SIZE. If this is True (the default) then sockets 97 | # over which metrics are received will temporarily stop accepting 98 | # data until the cache size falls below 95% MAX_CACHE_SIZE. 99 | USE_FLOW_CONTROL = True 100 | 101 | # By default, carbon-cache will log every whisper update and cache hit. This can be excessive and 102 | # degrade performance if logging on the same volume as the whisper data is stored. 103 | LOG_UPDATES = False 104 | LOG_CACHE_HITS = False 105 | LOG_CACHE_QUEUE_SORTS = True 106 | 107 | # The thread that writes metrics to disk can use on of the following strategies 108 | # determining the order in which metrics are removed from cache and flushed to 109 | # disk. The default option preserves the same behavior as has been historically 110 | # available in version 0.9.10. 111 | # 112 | # sorted - All metrics in the cache will be counted and an ordered list of 113 | # them will be sorted according to the number of datapoints in the cache at the 114 | # moment of the list's creation. Metrics will then be flushed from the cache to 115 | # disk in that order. 116 | # 117 | # max - The writer thread will always pop and flush the metric from cache 118 | # that has the most datapoints. This will give a strong flush preference to 119 | # frequently updated metrics and will also reduce random file-io. Infrequently 120 | # updated metrics may only ever be persisted to disk at daemon shutdown if 121 | # there are a large number of metrics which receive very frequent updates OR if 122 | # disk i/o is very slow. 123 | # 124 | # naive - Metrics will be flushed from the cache to disk in an unordered 125 | # fashion. This strategy may be desirable in situations where the storage for 126 | # whisper files is solid state, CPU resources are very limited or deference to 127 | # the OS's i/o scheduler is expected to compensate for the random write 128 | # pattern. 129 | # 130 | CACHE_WRITE_STRATEGY = sorted 131 | 132 | # On some systems it is desirable for whisper to write synchronously. 133 | # Set this option to True if you'd like to try this. Basically it will 134 | # shift the onus of buffering writes from the kernel into carbon's cache. 135 | WHISPER_AUTOFLUSH = False 136 | 137 | # By default new Whisper files are created pre-allocated with the data region 138 | # filled with zeros to prevent fragmentation and speed up contiguous reads and 139 | # writes (which are common). Enabling this option will cause Whisper to create 140 | # the file sparsely instead. Enabling this option may allow a large increase of 141 | # MAX_CREATES_PER_MINUTE but may have longer term performance implications 142 | # depending on the underlying storage configuration. 143 | # WHISPER_SPARSE_CREATE = False 144 | 145 | # Only beneficial on linux filesystems that support the fallocate system call. 146 | # It maintains the benefits of contiguous reads/writes, but with a potentially 147 | # much faster creation speed, by allowing the kernel to handle the block 148 | # allocation and zero-ing. Enabling this option may allow a large increase of 149 | # MAX_CREATES_PER_MINUTE. If enabled on an OS or filesystem that is unsupported 150 | # this option will gracefully fallback to standard POSIX file access methods. 151 | WHISPER_FALLOCATE_CREATE = True 152 | 153 | # Enabling this option will cause Whisper to lock each Whisper file it writes 154 | # to with an exclusive lock (LOCK_EX, see: man 2 flock). This is useful when 155 | # multiple carbon-cache daemons are writing to the same files 156 | # WHISPER_LOCK_WRITES = False 157 | 158 | # Set this to True to enable whitelisting and blacklisting of metrics in 159 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 160 | # empty, all metrics will pass through 161 | # USE_WHITELIST = False 162 | 163 | # By default, carbon itself will log statistics (such as a count, 164 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 165 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 166 | # CARBON_METRIC_PREFIX = carbon 167 | # CARBON_METRIC_INTERVAL = 60 168 | 169 | # Enable AMQP if you want to receve metrics using an amqp broker 170 | # ENABLE_AMQP = False 171 | 172 | # Verbose means a line will be logged for every metric received 173 | # useful for testing 174 | # AMQP_VERBOSE = False 175 | 176 | # AMQP_HOST = localhost 177 | # AMQP_PORT = 5672 178 | # AMQP_VHOST = / 179 | # AMQP_USER = guest 180 | # AMQP_PASSWORD = guest 181 | # AMQP_EXCHANGE = graphite 182 | # AMQP_METRIC_NAME_IN_BODY = False 183 | 184 | # The manhole interface allows you to SSH into the carbon daemon 185 | # and get a python interpreter. BE CAREFUL WITH THIS! If you do 186 | # something like time.sleep() in the interpreter, the whole process 187 | # will sleep! This is *extremely* helpful in debugging, assuming 188 | # you are familiar with the code. If you are not, please don't 189 | # mess with this, you are asking for trouble :) 190 | # 191 | # ENABLE_MANHOLE = False 192 | # MANHOLE_INTERFACE = 127.0.0.1 193 | # MANHOLE_PORT = 7222 194 | # MANHOLE_USER = admin 195 | # MANHOLE_PUBLIC_KEY = ssh-rsa AAAAB3NzaC1yc2EAAAABiwAaAIEAoxN0sv/e4eZCPpi3N3KYvyzRaBaMeS2RsOQ/cDuKv11dlNzVeiyc3RFmCv5Rjwn/lQ79y0zyHxw67qLyhQ/kDzINc4cY41ivuQXm2tPmgvexdrBv5nsfEpjs3gLZfJnyvlcVyWK/lId8WUvEWSWHTzsbtmXAF2raJMdgLTbQ8wE= 196 | 197 | # Patterns for all of the metrics this machine will store. Read more at 198 | # http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Bindings 199 | # 200 | # Example: store all sales, linux servers, and utilization metrics 201 | # BIND_PATTERNS = sales.#, servers.linux.#, #.utilization 202 | # 203 | # Example: store everything 204 | # BIND_PATTERNS = # 205 | 206 | # To configure special settings for the carbon-cache instance 'b', uncomment this: 207 | #[cache:b] 208 | #LINE_RECEIVER_PORT = 2103 209 | #PICKLE_RECEIVER_PORT = 2104 210 | #CACHE_QUERY_PORT = 7102 211 | # and any other settings you want to customize, defaults are inherited 212 | # from [carbon] section. 213 | # You can then specify the --instance=b option to manage this instance 214 | 215 | 216 | 217 | [relay] 218 | LINE_RECEIVER_INTERFACE = 0.0.0.0 219 | LINE_RECEIVER_PORT = 2013 220 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 221 | PICKLE_RECEIVER_PORT = 2014 222 | 223 | # Set to false to disable logging of successful connections 224 | LOG_LISTENER_CONNECTIONS = True 225 | 226 | # Carbon-relay has several options for metric routing controlled by RELAY_METHOD 227 | # 228 | # Use relay-rules.conf to route metrics to destinations based on pattern rules 229 | #RELAY_METHOD = rules 230 | # 231 | # Use consistent-hashing for even distribution of metrics between destinations 232 | #RELAY_METHOD = consistent-hashing 233 | # 234 | # Use consistent-hashing but take into account an aggregation-rules.conf shared 235 | # by downstream carbon-aggregator daemons. This will ensure that all metrics 236 | # that map to a given aggregation rule are sent to the same carbon-aggregator 237 | # instance. 238 | # Enable this for carbon-relays that send to a group of carbon-aggregators 239 | #RELAY_METHOD = aggregated-consistent-hashing 240 | RELAY_METHOD = rules 241 | 242 | # If you use consistent-hashing you can add redundancy by replicating every 243 | # datapoint to more than one machine. 244 | REPLICATION_FACTOR = 1 245 | 246 | # This is a list of carbon daemons we will send any relayed or 247 | # generated metrics to. The default provided would send to a single 248 | # carbon-cache instance on the default port. However if you 249 | # use multiple carbon-cache instances then it would look like this: 250 | # 251 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 252 | # 253 | # The general form is IP:PORT:INSTANCE where the :INSTANCE part is 254 | # optional and refers to the "None" instance if omitted. 255 | # 256 | # Note that if the destinations are all carbon-caches then this should 257 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 258 | # instances listed (order matters!). 259 | # 260 | # If using RELAY_METHOD = rules, all destinations used in relay-rules.conf 261 | # must be defined in this list 262 | DESTINATIONS = 127.0.0.1:2004 263 | 264 | # This defines the maximum "message size" between carbon daemons. 265 | # You shouldn't need to tune this unless you really know what you're doing. 266 | MAX_DATAPOINTS_PER_MESSAGE = 500 267 | MAX_QUEUE_SIZE = 10000 268 | 269 | # Set this to False to drop datapoints when any send queue (sending datapoints 270 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 271 | # default) then sockets over which metrics are received will temporarily stop accepting 272 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 273 | USE_FLOW_CONTROL = True 274 | 275 | # Set this to True to enable whitelisting and blacklisting of metrics in 276 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 277 | # empty, all metrics will pass through 278 | # USE_WHITELIST = False 279 | 280 | # By default, carbon itself will log statistics (such as a count, 281 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 282 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 283 | # CARBON_METRIC_PREFIX = carbon 284 | # CARBON_METRIC_INTERVAL = 60 285 | 286 | 287 | [aggregator] 288 | LINE_RECEIVER_INTERFACE = 0.0.0.0 289 | LINE_RECEIVER_PORT = 2023 290 | 291 | PICKLE_RECEIVER_INTERFACE = 0.0.0.0 292 | PICKLE_RECEIVER_PORT = 2024 293 | 294 | # Set to false to disable logging of successful connections 295 | LOG_LISTENER_CONNECTIONS = True 296 | 297 | # If set true, metric received will be forwarded to DESTINATIONS in addition to 298 | # the output of the aggregation rules. If set false the carbon-aggregator will 299 | # only ever send the output of aggregation. 300 | FORWARD_ALL = True 301 | 302 | # This is a list of carbon daemons we will send any relayed or 303 | # generated metrics to. The default provided would send to a single 304 | # carbon-cache instance on the default port. However if you 305 | # use multiple carbon-cache instances then it would look like this: 306 | # 307 | # DESTINATIONS = 127.0.0.1:2004:a, 127.0.0.1:2104:b 308 | # 309 | # The format is comma-delimited IP:PORT:INSTANCE where the :INSTANCE part is 310 | # optional and refers to the "None" instance if omitted. 311 | # 312 | # Note that if the destinations are all carbon-caches then this should 313 | # exactly match the webapp's CARBONLINK_HOSTS setting in terms of 314 | # instances listed (order matters!). 315 | DESTINATIONS = 127.0.0.1:2004 316 | 317 | # If you want to add redundancy to your data by replicating every 318 | # datapoint to more than one machine, increase this. 319 | REPLICATION_FACTOR = 1 320 | 321 | # This is the maximum number of datapoints that can be queued up 322 | # for a single destination. Once this limit is hit, we will 323 | # stop accepting new data if USE_FLOW_CONTROL is True, otherwise 324 | # we will drop any subsequently received datapoints. 325 | MAX_QUEUE_SIZE = 10000 326 | 327 | # Set this to False to drop datapoints when any send queue (sending datapoints 328 | # to a downstream carbon daemon) hits MAX_QUEUE_SIZE. If this is True (the 329 | # default) then sockets over which metrics are received will temporarily stop accepting 330 | # data until the send queues fall below 80% MAX_QUEUE_SIZE. 331 | USE_FLOW_CONTROL = True 332 | 333 | # This defines the maximum "message size" between carbon daemons. 334 | # You shouldn't need to tune this unless you really know what you're doing. 335 | MAX_DATAPOINTS_PER_MESSAGE = 500 336 | 337 | # This defines how many datapoints the aggregator remembers for 338 | # each metric. Aggregation only happens for datapoints that fall in 339 | # the past MAX_AGGREGATION_INTERVALS * intervalSize seconds. 340 | MAX_AGGREGATION_INTERVALS = 5 341 | 342 | # By default (WRITE_BACK_FREQUENCY = 0), carbon-aggregator will write back 343 | # aggregated data points once every rule.frequency seconds, on a per-rule basis. 344 | # Set this (WRITE_BACK_FREQUENCY = N) to write back all aggregated data points 345 | # every N seconds, independent of rule frequency. This is useful, for example, 346 | # to be able to query partially aggregated metrics from carbon-cache without 347 | # having to first wait rule.frequency seconds. 348 | # WRITE_BACK_FREQUENCY = 0 349 | 350 | # Set this to True to enable whitelisting and blacklisting of metrics in 351 | # CONF_DIR/whitelist and CONF_DIR/blacklist. If the whitelist is missing or 352 | # empty, all metrics will pass through 353 | # USE_WHITELIST = False 354 | 355 | # By default, carbon itself will log statistics (such as a count, 356 | # metricsReceived) with the top level prefix of 'carbon' at an interval of 60 357 | # seconds. Set CARBON_METRIC_INTERVAL to 0 to disable instrumentation 358 | # CARBON_METRIC_PREFIX = carbon 359 | # CARBON_METRIC_INTERVAL = 60 360 | -------------------------------------------------------------------------------- /grafana-puppetserver/conf/storage-schemas.conf: -------------------------------------------------------------------------------- 1 | # Schema definitions for Whisper files. Entries are scanned in order, 2 | # and first match wins. This file is scanned for changes every 60 seconds. 3 | # 4 | # [name] 5 | # pattern = regex 6 | # retentions = timePerPoint:timeToStore, timePerPoint:timeToStore, ... 7 | 8 | # Carbon's internal metrics. This entry should match what is specified in 9 | # CARBON_METRIC_PREFIX and CARBON_METRIC_INTERVAL settings 10 | 11 | [carbon] 12 | pattern = ^carbon\. 13 | retentions = 10s:6h,1min:90d 14 | 15 | [default] 16 | pattern = .* 17 | retentions = 1m:90d,5m:1y 18 | -------------------------------------------------------------------------------- /grafana-puppetserver/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | graphite-statsd: 4 | image: hopsoft/graphite-statsd:latest 5 | container_name: graphite-statsd 6 | ports: 7 | - "2003:2003" 8 | volumes: 9 | - "./conf/carbon.conf:/opt/graphite/conf/carbon.conf:ro" 10 | - "./conf/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf:ro" 11 | 12 | grafana-puppetserver: 13 | image: reidmv/grafana-puppetserver:latest 14 | container_name: grafana-puppetserver 15 | ports: 16 | - "3000:3000" 17 | links: 18 | - "graphite-statsd" 19 | build: . 20 | -------------------------------------------------------------------------------- /images/grafana.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/puppetlabs/puppet-metrics-viewer/02ae191efe91022d0fa17c1f35365c658c18fd28/images/grafana.jpg -------------------------------------------------------------------------------- /influxdb-grafana/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | influxdb: 4 | image: influxdb 5 | container_name: influxdb 6 | ports: 7 | - "8086:8086" 8 | - "2003:2003" 9 | volumes: 10 | - "./influxdb/influxdb.conf:/etc/influxdb/influxdb.conf:ro" 11 | environment: 12 | - INFLUXDB_GRAPHITE_ENABLED=true 13 | - INFLUXDB_DB=archive 14 | - INFLUXDB_ADMIN_USER=admin 15 | - INFLUXDB_ADMIN_PASSWORD=admin 16 | 17 | grafana: 18 | image: grafana/grafana:master 19 | container_name: grafana 20 | ports: 21 | - "3000:3000" 22 | volumes: 23 | - "./grafana:/etc/grafana/provisioning" 24 | environment: 25 | - GF_AUTH_ANONYMOUS_ENABLED=true 26 | -------------------------------------------------------------------------------- /influxdb-grafana/grafana/dashboards/dashboards.yaml: -------------------------------------------------------------------------------- 1 | - name: 'default' 2 | org_id: 1 3 | folder: '' 4 | type: file 5 | options: 6 | folder: /etc/grafana/provisioning/imports 7 | editable: true 8 | -------------------------------------------------------------------------------- /influxdb-grafana/grafana/datasources/datasource.yaml: -------------------------------------------------------------------------------- 1 | # list of datasources to insert/update depending 2 | # whats available in the datbase 3 | datasources: 4 | # name of the datasource. Required 5 | - name: influxdb_puppet_metrics 6 | # datasource type. Required 7 | type: influxdb 8 | # access mode. direct or proxy. Required 9 | access: proxy 10 | # org id. will default to org_id 1 if not specified 11 | org_id: 1 12 | # url 13 | url: http://influxdb:8086 14 | # database password, if used 15 | password: admin 16 | # database user, if used 17 | user: admin 18 | # database name, if used 19 | database: archive 20 | # enable/disable basic auth 21 | basic_auth: 22 | # basic auth username 23 | basic_auth_user: 24 | # basic auth password 25 | basic_auth_password: 26 | # enable/disable with credentials headers 27 | with_credentials: 28 | # mark as default datasource. Max one per org 29 | is_default: true 30 | # fields that will be converted to json and stored in json_data 31 | editable: true 32 | 33 | - name: Graphite 34 | # datasource type. Required 35 | type: influxdb 36 | # access mode. direct or proxy. Required 37 | access: proxy 38 | # org id. will default to org_id 1 if not specified 39 | org_id: 1 40 | # url 41 | url: http://influxdb:8086 42 | # database password, if used 43 | password: admin 44 | # database user, if used 45 | user: admin 46 | # database name, if used 47 | database: graphite 48 | # enable/disable basic auth 49 | basic_auth: 50 | # basic auth username 51 | basic_auth_user: 52 | # basic auth password 53 | basic_auth_password: 54 | # enable/disable with credentials headers 55 | with_credentials: 56 | # mark as default datasource. Max one per org 57 | is_default: false 58 | # fields that will be converted to json and stored in json_data 59 | editable: true 60 | -------------------------------------------------------------------------------- /influxdb-grafana/influxdb/influxdb.conf: -------------------------------------------------------------------------------- 1 | [meta] 2 | dir = "/var/lib/influxdb/meta" 3 | 4 | [data] 5 | dir = "/var/lib/influxdb/data" 6 | engine = "tsm1" 7 | wal-dir = "/var/lib/influxdb/wal" 8 | 9 | [[graphite]] 10 | enabled = true 11 | bind-address = ":2003" 12 | database = "graphite" 13 | retention-policy = "" 14 | protocol = "tcp" 15 | batch-size = 5000 16 | batch-pending = 10 17 | batch-timeout = "1s" 18 | consistency-level = "one" 19 | separator = "." 20 | udp-read-buffer = 0 21 | templates = [ 22 | ".server.service.measurement*" 23 | ] 24 | -------------------------------------------------------------------------------- /view-in-grafana.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage() { 4 | cat < [directory] 6 | Options: -d [influxdb|graphite] Enable InfluxDB or Graphite as the back end database. Defaults to InfluxDB 7 | -b Build local containers from docker-compose 8 | EOF 9 | } 10 | 11 | finish() { 12 | docker-compose down --volumes 13 | } 14 | 15 | download_file() { 16 | curl -O --silent -k "$1" || { echo "ERROR: Unable to download file from ${1}."; exit 1; } 17 | } 18 | 19 | download_dashboards() { 20 | mkdir -p ./grafana/imports 21 | cd ./grafana/imports || exit 22 | download_file https://raw.githubusercontent.com/puppetlabs/puppet_metrics_dashboard/master/files/PuppetDB_Performance.json 23 | download_file https://raw.githubusercontent.com/puppetlabs/puppet_metrics_dashboard/master/files/PuppetDB_Workload.json 24 | download_file https://raw.githubusercontent.com/puppetlabs/puppet_metrics_dashboard/master/files/Puppetserver_Performance.json 25 | download_file https://raw.githubusercontent.com/puppetlabs/puppet_metrics_dashboard/master/files/Archive_File_Sync.json 26 | cd - || exit > /dev/null 27 | } 28 | 29 | get_latest_containers() { 30 | if [[ $BUILDLOCAL ]]; then 31 | echo "Building local containers" 32 | docker-compose build &>/dev/null 33 | else 34 | echo "Downloading latest containers" 35 | docker-compose pull --ignore-pull-failures &>/dev/null 36 | fi 37 | if [[ $DATABASE == "influxdb" ]]; then 38 | echo "Getting the latest graphs" 39 | download_dashboards 40 | fi 41 | 42 | } 43 | 44 | BUILDLOCAL=false 45 | DATABASE="influxdb" 46 | CONTAINERPATH="influxdb-grafana" 47 | NETCATARGS=(--netcat 127.0.0.1 --convert-to influxdb --influx-db archive) 48 | # Default to 30 if $2 is empty/unset 49 | RETENTION_DAYS="${2:-30}" 50 | 51 | while getopts ":bd:" opt; do 52 | case "$opt" in 53 | b) 54 | BUILDLOCAL=true 55 | ;; 56 | d) 57 | if [[ $OPTARG == "graphite" ]]; then 58 | echo "Using Graphite" 59 | DATABASE="graphite" 60 | CONTAINERPATH="grafana-puppetserver" 61 | NETCATARGS=(--netcat 127.0.0.1) 62 | elif [[ $OPTARG == "influxdb" ]]; then 63 | echo "Using InfluxDB" 64 | else 65 | echo "Invalid database: $OPTARG" >&2 66 | usage 67 | exit 1 68 | fi 69 | ;; 70 | \?) 71 | echo "Invalid option: -$OPTARG" >&2 72 | usage 73 | exit 1 74 | ;; 75 | :) 76 | echo "Option -$OPTARG requires an argument." >&2 77 | exit 1 78 | ;; 79 | esac 80 | done 81 | shift $((OPTIND-1)) 82 | 83 | # VALIDATION 84 | [[ ! -d $1 ]] && { echo "ERROR: First argument must be a directory."; usage; exit 1; } 85 | 86 | type docker-compose >/dev/null 2>&1 || { 87 | echo >&2 "ERROR: docker-compose required. Please install docker-compose." 88 | exit 1 89 | } 90 | 91 | # Portable way of getting the full path to a directory 92 | datadir="$(cd "$1" || exit; echo "$PWD")" 93 | 94 | # Download json2timeseriesdb to the directory containing this script. 95 | cd "${BASH_SOURCE[0]%/*}" || exit 96 | download_file https://raw.githubusercontent.com/puppetlabs/puppetlabs-puppet_metrics_collector/master/files/json2timeseriesdb 97 | chmod +x json2timeseriesdb 98 | 99 | # Change to the directory containing this script. 100 | cd "${BASH_SOURCE[0]%/*}/${CONTAINERPATH}" || exit 101 | 102 | # MAIN SCRIPT 103 | trap finish EXIT INT ERR 104 | 105 | echo "Getting the latest container images" 106 | get_latest_containers 107 | echo "Starting Containers" 108 | docker-compose up -d 109 | 110 | echo "Extracting data from tarballs..." 111 | find "$datadir" -type f -ctime -"${RETENTION_DAYS}" -name "*.bz2" -execdir tar jxf "{}" \; 2>/dev/null 112 | find "$datadir" -type f -ctime -"${RETENTION_DAYS}" -name "*.gz" -execdir tar xf "{}" \; 2>/dev/null 113 | 114 | echo "Waiting for database to be ready..." 115 | type nc >/dev/null 2>&1 || { 116 | echo >&2 "ERROR: nc required. Please install ncat/netcat." 117 | exit 1 118 | } 119 | timeout=60 120 | until nc -zv 127.0.0.1 2003 &>/dev/null || (( timeout <= 0 )); do 121 | (( timeout-- )) 122 | sleep 1 123 | done 124 | (( timeout <= 0 )) && { 125 | echo "ERROR: Unable to connect to the database. Is docker running?" 126 | exit 1 127 | } 128 | echo "ready" 129 | 130 | echo "Deleting json files past ${RETENTION_DAYS} retention_days..." 131 | NUM_DEL=$(find "$datadir" -type f -mtime +"${RETENTION_DAYS}" -iname "*.json" -delete -print | wc -l) 132 | echo "Deleted $NUM_DEL files past retention_days" 133 | 134 | echo "Loading data..." 135 | ../json2timeseriesdb --pattern "$datadir/**/*.json" "${NETCATARGS[@]}" 2>/dev/null 136 | 137 | cat <