{"id":20564343,"url":"https://github.com/tarantool/grafana-dashboard","last_synced_at":"2025-08-20T18:18:15.840Z","repository":{"id":37846391,"uuid":"276045559","full_name":"tarantool/grafana-dashboard","owner":"tarantool","description":"Dashboard for Tarantool application and database server monitoring with Grafana","archived":false,"fork":false,"pushed_at":"2024-12-06T13:24:02.000Z","size":8079,"stargazers_count":38,"open_issues_count":13,"forks_count":12,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-12-06T14:33:32.777Z","etag":null,"topics":["grafana","grafana-dashboard","grafonnet","jsonnet","prometheus","tarantool"],"latest_commit_sha":null,"homepage":"","language":"Jsonnet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarantool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"supported_metrics.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-30T08:45:38.000Z","updated_at":"2024-12-06T13:24:05.000Z","dependencies_parsed_at":"2024-07-08T17:46:46.446Z","dependency_job_id":"ef1e0243-09d2-4fce-96c5-57f589084afe","html_url":"https://github.com/tarantool/grafana-dashboard","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgrafana-dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgrafana-dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgrafana-dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgrafana-dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarantool","download_url":"https://codeload.github.com/tarantool/grafana-dashboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230537062,"owners_count":18241515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grafana","grafana-dashboard","grafonnet","jsonnet","prometheus","tarantool"],"created_at":"2024-11-16T04:25:52.103Z","updated_at":"2024-12-20T05:09:05.435Z","avatar_url":"https://github.com/tarantool.png","language":"Jsonnet","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tarantool Grafana dashboard\n\nDashboard for Tarantool application and database server monitoring, based on [grafonnet](https://github.com/grafana/grafonnet-lib) library.\n\nOur pages on Grafana Official \u0026 community built dashboards:\n- Tarantool 3:\n  - [Prometheus](https://grafana.com/grafana/dashboards/21474),\n  - [InfluxDB](https://grafana.com/grafana/dashboards/21484);\n- Tarantool Cartridge and 1.10—2.x:\n  - [Prometheus](https://grafana.com/grafana/dashboards/13054),\n  - [InfluxDB](https://grafana.com/grafana/dashboards/12567);\n- Tarantool Data Grid 2:\n  - [Prometheus](https://grafana.com/grafana/dashboards/16406),\n  - [InfluxDB](https://grafana.com/grafana/dashboards/16405).\n\nRefer to dashboard [documentation page](https://www.tarantool.io/en/doc/latest/book/monitoring/grafana_dashboard/) for prerequirements and installation guide.\n\n\u003cimg src=\"./doc/monitoring/images/Prometheus_dashboard_1.png\" width=\"250\"/\u003e \u003cimg src=\"./doc/monitoring/images/Prometheus_dashboard_2.png\" width=\"250\"/\u003e \u003cimg src=\"./doc/monitoring/images/Prometheus_dashboard_3.png\" width=\"250\"/\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of contents\n\n- [Installation](#installation)\n- [Monitoring cluster](#monitoring-cluster)\n  - [Example app](#example-app)\n  - [Monitoring local app](#monitoring-local-app)\n- [Manual build](#manual-build)\n- [Adding your panels](#adding-your-panels)\n- [Contacts](#contacts)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\n1. Open Grafana import menu.\n\n    ![Grafana import menu](doc/monitoring/images/grafana_import.png)\n\n2. To import a specific dashboard, choose one of the following options:\n\n    - paste the dashboard id (for example, ``21474`` for Prometheus Tarantool 3 dashboard), or\n    - paste a link to the dashboard (for example, \n      https://grafana.com/grafana/dashboards/21474 for Prometheus Tarantool 3 dashboard), or\n    - paste the dashboard JSON file contents, or\n    - upload the dashboard JSON file.\n\n3. Set dashboard name, folder and uid (if needed).\n\n    ![Dashboard import variables](doc/monitoring/images/grafana_import_setup.png)\n\n4. Choose datasource and datasource variables on the dashboard.\n\n    ![Dashboard datasource variables](doc/monitoring/images/grafana_variables_setup.png)\n\n\n## Monitoring cluster\n\nFor guide on setting up your monitoring stack refer to [documentation page](https://www.tarantool.io/en/doc/latest/book/monitoring/grafana_dashboard/).\n\n### Example app\n\nThis repository provides preconfigured monitoring cluster with example Tarantool app and load generatior for local dashboard development and tests.\n\n```bash\ndocker compose up -d\n```\nwill start 6 containers: Tarantool App, Tarantool Load Generator, Telegraf, InfluxDB, Prometheus and Grafana, which build cluster with two fully operational metrics datasources (InfluxDB and Prometheus), extracting metrics from Tarantool App example project.\nWe recommend using the exact versions we use in experimental cluster (e.g. Grafana v8.1.5).\nAfter start, Grafana UI will be available at [localhost:3000](http://localhost:3000/).\nYou can also interact with Prometheus at [localhost:9090](http://localhost:9090/) and InfluxDB at [localhost:8086](http://localhost:8086/).\n\n### Monitoring local app\n\nIf you want to monitor Tarantool cluster deployed on your local host, you can use monitoring cluster similar to example app one.\n\nConfigure Telegraf/Prometheus to monitor your own app in `example_cluster/telegraf/telegraf.localapp.conf` and `example_cluster/prometheus/prometheus.localapp.yml`.\nUse `host.docker.internal` as your machine host in configuration and set cluster instances ports as targets and correct metrics HTTP path.\nSee more setup tips in [documentation](https://www.tarantool.io/en/doc/latest/book/monitoring/grafana_dashboard/).\n\nStart cluster with \n```bash\ndocker compose -f docker-compose.localapp.yml -p localapp-monitoring up -d\n```\nAfter start, Grafana UI will be available at [localhost:3000](http://localhost:3000/).\nYou can also interact with Prometheus at [localhost:9090](http://localhost:9090/) and InfluxDB at [localhost:8086](http://localhost:8086/).\n\n## Manual build\n\n`go` v.1.14 or greater is required to install build and test dependencies.\nRun\n```bash\nmake build-deps\n```\nto install dependencies that are required to build dashboards.\n\nRun\n```bash\nmake test-deps\n```\nto install build dependencies and dependencies that are required to run tests locally.\n\nTo build a custom dashboard, run `make build` command with your specific configuration.\n\n```bash\nmake CONFIG=config.yml OUTPUT=mydashboard.json build\n```\n\nSee repository example config [config.yml](config.yml) for detailed info about supported options.\n\nYou can run tests with\n```bash\nmake run-tests\n```\n\nCompiled dashboard test files can be updated with\n```bash\nmake update-tests\n```\nIt also formats all source files with `jsonnetfmt`.\n\n\n## Adding your panels\n\nIf you're interested in building grafonnet dashboards or custom panels,\nI suggest you to start with reading our grafonnet tutorial:\n[in English](https://medium.com/@tarantool/grafana-as-code-b642cac9ae75),\n[in Russian](https://habr.com/ru/company/vk/blog/577230/).\n\nYou can add your own custom panels to the bottom of the template dashboard.\n\n1. Add tarantool/grafana-dashboard as a dependency in your project with jsonnet-bundler.\n    Run\n    ```bash\n    jb init\n    ```\n    to initialize jsonnet-bundler and add this repo to `jsonnetfile.json` as a dependency:\n    ```json\n    {\n      \"version\": 1,\n      \"dependencies\": [\n        {\n          \"source\": {\n            \"git\": {\n              \"remote\": \"https://github.com/tarantool/grafana-dashboard\"\n            }\n          },\n          \"version\": \"master\"\n        }\n      ],\n      \"legacyImports\": true\n    }\n    ```\n    Run\n    ```bash\n    jb install\n    ```\n    to install dependencies. [`grafonnet`](https://github.com/grafana/grafonnet-lib) library will also be installed as a transitive dependency.\n\n2. Load a configuration, same as in [\"Manual build\"](#manual-build) section. (You can build it as a dictionary in code instead of parsing a YAML file.)\n    ```jsonnet\n    # my_dashboard.jsonnet\n    local config = import 'grafana-dashboard/dashboard/build/config.libsonnet';\n    local raw_cfg = importstr 'config.yml';\n\n    local cfg = config.prepare(std.parseYaml(raw_cfg));\n    ```\n\n3. Import the main template.\n    ```jsonnet\n    # my_dashboard.jsonnet\n    local dashboard = import 'grafana-dashboard/dashboard/build/dashboard.libsonnet';\n    ```\n\n4. To add your custom panels to a dashboard template, you must create panel objects.\n\n    A row panel can be created by using the following script:\n    ```jsonnet\n    # my_dashboard.jsonnet\n    local common = import 'grafana-dashboard/dashboard/panels/common.libsonnet';\n\n    local my_row = common_panels.row('My custom metrics')\n    ```\n\n    Panel with metrics data consists of a visualisation base (graph, table, stat etc.) and one or several datasource queries called \"targets\". To build a simple visualization graph, you may use `common.default_graph` util.\n\n    ```jsonnet\n    # vendor/grafana-dashboard/dashboard/panels/common.libsonnet\n\n    default_graph( # graph panel shortcut\n      cfg, # Dashboard configuration\n      title, # The title of the graph panel\n      description, # (optional) The description of the panel\n      format, # (default 'none') Unit of the Y axes\n      min, # (optional) Min of the Y axes\n      max, # (optional) Max of the Y axes\n      labelY1, # (optional) Label of the left Y axis\n      decimals, # (default null) Override automatic decimal precision for legend and tooltip\n      decimalsY1, # (default null) Override automatic decimal precision for the left Y axis\n      legend_avg, # (default true) Show average in legend\n      legend_max, # (default true) Show max in legend\n      panel_height, # (default 8) Panel heigth in grid units\n      panel_width, # (default 8) Panel width in grid units, max is 24\n    )\n    ```\n    Panel size is set with grid units. Grafana uses square-type grid where dashboard width is 24 units. For example, row size is 24 x 1 units and Grafana new panel size is 12 x 9 units.\n\n    If you want to build non-graph panel or a graph panel with more complicated configuration, use `grafonnet` templates.\n    You must set a size of each panel before adding it to our dashboard template.\n    For each `grafonnet` panel, add `{ gridPos: { w: width, h: height } }` to it.\n    For example,\n    ```jsonnet\n    local grafana = import 'grafonnet/grafana.libsonnet';\n\n    local my_graph = grafana.graphPanel.new(\n      title='My custom panel',\n      points=true,\n    ) { gridPos: { w: 6, h: 4 } };\n    ```\n\n    To build a target, you should use `common` utils.\n    ```jsonnet\n    # vendor/grafana-dashboard/dashboard/panels/common.libsonnet\n\n    target( # plain \"select metric\" shortcut\n      cfg, # Dashboard configuration\n      metric_name, # Target metric name to select\n      additional_filters, # (optional) Query additional filter conditions. The structure is{ prometheus: filters, influxdb: filters }, filters have the same format as in cfg\n      legend, # (optional) Target result legend. The structure is{ prometheus: legend_str, influxdb: legend_str }\n      group_tags, # (InfluxDB only, optional). Target result group rules. All tags used in legend are expected to be here too\n      converter, # (InfluxDB only, default 'mean') InfluxDB metrics converter (aggregation, selector, etc.)\n      rate, # (default false) Whether to transform the metrics as rate\n    ),\n    ```\n\n    To build more compound targets, use `grafonnet` library `prometheus` and `influxdb` templates.\n\n    To add a target to a panel, call `addTarget(target)`.\n\n    To summarise, you can build a simple 'select metric' panel with\n    ```jsonnet\n    local common = import 'grafana-dashboard/dashboard/panels/common.libsonnet';\n    local variable = import 'grafana-dashboard/dashboard/variable.libsonnet';\n\n    local my_custom_component_memory_graph = common.default_graph(\n      cfg,\n      title='My custom component memory',\n      description=|||\n        My custom component used memory.\n        Shows mean value.\n      |||,\n      format='bytes',\n      panel_width=12,\n      panel_height=6,\n    ).addTarget(common.target(cfg, 'my_component_memory'))\n    ```\n    and a simple rps panel with\n    ```jsonnet\n    local common = import 'grafana-dashboard/dashboard/panels/common.libsonnet';\n    local variable = import 'grafana-dashboard/dashboard/variable.libsonnet';\n\n    local my_custom_component_rps_graph = common.default_graph(\n      cfg,\n      title='My custom component load',\n      description=|||\n        My custom component processes requests\n        and collects info on process to summary collector\n        'my_component_load_metric'.\n      |||,\n      labelY1='requests per second',\n      panel_width=18,\n      panel_height=6,\n    ).addTarget(common.target(cfg, my_component_load_metric_count', rate=true))\n    ```\n    For more panel tips and examples, please examine this template dashboard source code and test cases.\n\n    To add your custom panels, call `addPanel(panel)` or `addPanels(panel_array)` in dashboard template:\n    ```jsonnet\n    # my_dashboard.jsonnet\n    local dashboard = import 'grafana-dashboard/dashboard/build/dashboard.libsonnet';\n\n    ...\n    \n    local my_dashboard_template = dashboard.addPanels([\n      my_row, my_custom_component_memory_graph, my_custom_component_rps_graph\n    ]);\n    ```\n\n    Finally, call `build()` to compute panels positions and build a resulting dashboard:\n    ```jsonnet\n    # my_dashboard.jsonnet\n    ...\n    my_dashboard_template.build()\n    ```\n    Do not use `;` in the end of your script so resulting dashboard will be returned as output.\n\n4. To save resulting dashboard into `output.json` file, use\n    ```bash\n    jsonnet -J ./vendor/ my_dashboard.jsonnet -o ./output.json\n    ```\n    and to save output into clipboard, use\n    ```bash\n    jsonnet -J ./vendor/ my_dashboard.jsonnet -o ./output.json | xclip -selection clipboard\n    ```\n\n## Contacts\n\nIf you have questions, please ask it on [StackOverflow](https://stackoverflow.com/questions/tagged/tarantool) or contact us in Telegram:\n\n- [Russian-speaking chat](https://t.me/tarantoolru)\n- [English-speaking chat](https://t.me/tarantool)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Fgrafana-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarantool%2Fgrafana-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Fgrafana-dashboard/lists"}