grafana/devenv
Joey 8c2f439cd7
Table: Support display of multiple sub tables (#71953)
* Add nested option to DataFrame. Refactor Table to use nested dataframes for sub-tables

* Use nested frames for TraceQL response

* debugging

* Fix cell text and table position

* Update getItemSize

* noHeader size

* Update sub table renderer

* Update table container height

* Cleanup and fix RawPrometheusContainer height

* Update resultTransformer and docker script

* Updates to TableContainer, resultTransformer after merge

* Fixes for table pagination in dashboards

* Cell height and show footer enhancement/fix

* Sub table links

* Update RawPrometheusContainer

* Remove console log

* Update tests

* Update storybook

* Remove Tempo demo

* Store nested data in single field via its values

* Move nested prop into custom

* Tempo demo

* Add field type & update incorrect logic

* Update docker compose image for Tempo

* Update packages/grafana-data/src/field/fieldOverrides.ts

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Simplify logic for getting nestedFrames and rendering sub tables

* Update docs for table

* Update nested table bg color

* Lighten nested table bg color

* Renames

* Migrate frames using parentRowIndex and add deprecation notice

* Update title

* Align expander icon size between Table and interactive table

* Table: Refactor out the expanded rows bits

* fix spacing

* Add line along left side for expanded rows

* Disable hover row background when expanded

---------

Co-authored-by: André Pereira <adrapereira@gmail.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-08-10 12:33:46 +01:00
..
bulk_alerting_dashboards Support using multiple datasources for testing bulk alerting. (#23258) 2020-04-01 20:55:37 +02:00
bulk-dashboards Fix bulk-dashboards path (#12978) 2018-08-20 19:21:31 +02:00
dev-dashboards Trend: Support disconnect values and connect nulls options (#70616) 2023-07-13 19:28:58 -07:00
dev-dashboards-without-uid Units: Add events/messages/records/rows throughput units (#70726) 2023-06-28 14:11:46 +02:00
docker Table: Support display of multiple sub tables (#71953) 2023-08-10 12:33:46 +01:00
jsonnet Dashboard: Add test dashboard for Flame Graph (#70685) 2023-07-07 18:15:47 +02:00
local-npm Build: Improve NPM publishing (#65171) 2023-04-18 10:19:37 +02:00
vscode Add documentation for setting up debugging in VSCode (#29987) 2021-08-19 12:08:43 +02:00
create_docker_compose.sh Build: allow dynamically change docker image (#18112) 2019-07-16 08:16:10 +02:00
dashboards.yaml Allow saving of provisioned dashboards (#19820) 2019-10-31 14:27:31 +01:00
datasources_docker.yaml Elasticsearch: Deprecate the usage of the database field in provisioning (#66828) 2023-04-19 14:13:53 +01:00
datasources.yaml Devenv: add exemplar to self-instrumentation (#72069) 2023-07-21 18:02:20 +02:00
README.md Email: Use MJML email templates (#57751) 2022-11-17 21:41:46 +01:00
setup.sh devenv: Fix typo (#31589) 2021-03-02 17:09:27 +01:00

Set up your development environment

This folder contains useful scripts and configuration so you can:

  • Configure data sources in Grafana for development.
  • Configure dashboards for development and test scenarios.
  • Set up an SMTP Server + Web Interface for viewing and testing emails.
  • Create docker-compose file with databases and fake data.

Install Docker

Grafana uses Docker to make the task of setting up databases a little easier. If you do not have it already, make sure you install Docker before proceeding to the next step.

Developer dashboards and data sources

./setup.sh

After restarting the Grafana server, there should be a number of data sources named gdev-<type> provisioned as well as a dashboard folder named gdev dashboards. This folder contains dashboard and panel features tests dashboards.

Please update these dashboards or make new ones as new panels and dashboards features are developed or new bugs are found. The dashboards are located in the devenv/dev-dashboards folder.

docker-compose with databases

This command creates a docker-compose file with specified databases configured and ready to run. Each database has a prepared image with some fake data ready to use. For available databases, see docker/blocks directory. Notice that for some databases there are multiple images with different versions. Some blocks such as slow_proxy_mac or apache_proxy_mac are specifically for Macs.

make devenv sources=influxdb,prometheus,elastic5

Some of the blocks support dynamic change of the image version used in the Docker file. The signature looks like this:

make devenv sources=postgres,auth/openldap,grafana postgres_version=9.2 grafana_version=6.7.0-beta1

Notes per block

Grafana

The grafana block is pre-configured with the dev-datasources and dashboards.

Tempo

The tempo block runs loki and prometheus as well and should not be ran with prometheus as a separate source. You need to install a docker plugin for the self logging to work, without it the container won't start. See https://grafana.com/docs/loki/latest/clients/docker-driver/#installing for installation instructions.

Jaeger

Jaeger block runs both Jaeger and Loki container. Loki container sends traces to Jaeger and also logs its own logs into itself so it is possible to setup derived field for traceID from Loki to Jaeger. You need to install a docker plugin for the self logging to work, without it the container won't start. See https://grafana.com/docs/loki/latest/clients/docker-driver/#installing for installation instructions.

Graphite

version source name graphite-web port plaintext port pickle port
1.1 graphite 8180 2103 2103
1.0 graphite1 8280 2203 2203
0.9 graphite09 8380 2303 2303

MailDev

MailDev block runs an SMTP server and a web UI to test and view emails. This is useful for testing your email notifications locally.

Make sure you configure your .ini file with the following settings:

[smtp]
enabled = true
skip_verify = true
host = "localhost:1025"

You can access the web UI at http://localhost:12080/#/

Debugging setup in VS Code

An example of launch.json is provided in devenv/vscode/launch.json. It basically does what Makefile and .bra.toml do. The 'program' field is set to the folder name so VS Code loads all *.go files in it instead of just main.go.

Troubleshooting

Containers that read from log files fail to start (Mac OS)

If you are running Mac OSX, containers that read from the log files (e.g. Telegraf, Fileabeat, Promtail) can fail to start. This is because the default Docker for Mac does not have permission to create grafana folder at the /var/log location, as it runs as the current user. To solve this issue, manually create the folder /var/log/grafana, then start the containers again.

sudo mkdir /var/log/grafana