{"id":13671936,"url":"https://github.com/sd2k/grafana-tokio-console-datasource","last_synced_at":"2025-10-14T15:13:43.910Z","repository":{"id":40468816,"uuid":"434252770","full_name":"sd2k/grafana-tokio-console-datasource","owner":"sd2k","description":"Tokio Console Datasource for Grafana","archived":false,"fork":false,"pushed_at":"2023-02-06T08:50:26.000Z","size":1416,"stargazers_count":135,"open_issues_count":5,"forks_count":4,"subscribers_count":67,"default_branch":"main","last_synced_at":"2025-10-14T15:13:43.084Z","etag":null,"topics":["grafana-plugin","hacktoberfest","rust","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sd2k.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":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-12-02T14:28:41.000Z","updated_at":"2025-06-12T05:51:05.000Z","dependencies_parsed_at":"2023-02-08T13:45:36.726Z","dependency_job_id":null,"html_url":"https://github.com/sd2k/grafana-tokio-console-datasource","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sd2k/grafana-tokio-console-datasource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sd2k%2Fgrafana-tokio-console-datasource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sd2k%2Fgrafana-tokio-console-datasource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sd2k%2Fgrafana-tokio-console-datasource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sd2k%2Fgrafana-tokio-console-datasource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sd2k","download_url":"https://codeload.github.com/sd2k/grafana-tokio-console-datasource/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sd2k%2Fgrafana-tokio-console-datasource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019301,"owners_count":26086709,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-plugin","hacktoberfest","rust","tokio"],"created_at":"2024-08-02T09:01:22.421Z","updated_at":"2025-10-14T15:13:43.893Z","avatar_url":"https://github.com/sd2k.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Grafana Tokio Console Data Source\n\nThis is a streaming Grafana data source which can connect to the Tokio [`console`] subscriber. It provides similar functionality to the `console` [TUI frontend][console-frontend] (albeit more limited at the moment!).\n\n## Screenshots\n\n![image](https://user-images.githubusercontent.com/5464991/146618978-16a094cf-f313-46c3-86ca-c364b7865130.png)\n\n![image](https://user-images.githubusercontent.com/5464991/146619018-bc1bbe41-7bf3-4a20-8732-a4855ad29bcc.png)\n\n## Try it out\n\n### Docker\n\n    # On Linux or MacOS\n    docker run --rm -p 3000:3000 sd2k/grafana:with-tokio-console-datasource\n    # Or, on Linux, if you want to access console-enabled processes running on the host\n    docker run --rm --net=host sd2k/grafana:with-tokio-console-datasource\n\nThis will start a custom-built Grafana build serving on port 3000 with the Console datasource already installed.\n\nThree datasources will already be configured:\n\n- **Tokio Console - Grafana plugin** - connects to the console-enabled Grafana plugin backend itself, as an example. Note that the plugin serves on `localhost:6668`.\n- **Tokio Console - localhost:6669** - connects to a console-enabled process at `localhost:6669`, the default address\n- **Tokio Console - host.docker.internal:6669** - connects to a console-enabled process at `host.docker.internal:6669`. On MacOS (and possibly Windows - untested) this lets the Grafana process running inside Docker communicate with processes running _outside_ Docker using the special `host.docker.internal` address.\n\n### Installing the plugin on an existing Grafana instance\n\nThe plugin is available on the [Grafana plugin marketplace](https://grafana.com/grafana/plugins/) so can be installed from there similarly to any other plugin.\n\n## Development\n\n### Plugin frontend\n\nAt the repository root:\n\n1. Install dependencies\n\n   ```bash\n   yarn install\n   ```\n\n2. Build plugin in development mode or run in watch mode\n\n   ```bash\n   yarn dev\n   ```\n\n   or\n\n   ```bash\n   yarn watch\n   ```\n\n3. Build plugin in production mode\n\n   ```bash\n   yarn build\n   ```\n\n### Plugin backend\n\nMake sure you have a recent version of Rust (run `rustup update stable`), and install [`cargo-watch`].\n\nThen run:\n\n```bash\ncargo xtask watch\n```\n\nThis will run the `watch` task using the [`cargo-xtask`] pattern, which rebuilds the backend component on changes, copies the binary into the correct location, and restarts the plugin process (which Grafana subsequently restarts).\n\n### Running Grafana\n\nYou'll need to clone a fork Grafana and run a specific branch to get some nice extra things working (namely the poll time histograms inside the main task list table):\n\n1. Clone Grafana\n\n   ```bash\n   git clone git@github.com/sd2k/grafana\n   ```\n\n2. Check out the custom branch\n\n   ```bash\n   git checkout table-charts\n   ```\n\n3. Build the frontend\n\n   ```bash\n   yarn \u0026\u0026 yarn dev\n   ```\n\n   or, to watch for changes\n\n   ```bash\n   yarn \u0026\u0026 yarn watch\n   ```\n\n4. Change some config - make sure to change the 'plugins' path to the parent directory of this\n   repo.\n\n   ```bash\n   cat \u003c\u003cEOF \u003e conf/custom.ini\n   app_mode = development\n   [log]\n   level = debug\n\n   [paths]\n   plugins = /Users/ben/repos/grafana-plugins  # or wherever you cloned this repo\n   \n   [plugins]\n   plugin_admin_enabled = true\n   ```\n\n5. Run the Grafana backend\n\n   ```bash\n   make run\n   ```\n\n6. Add a Tokio Console datasource\n\n   In your browser, navigate to http://localhost:3000/datasources/new, find the 'Tokio Console' datasource, and add a new instance Using the placeholder value of http://127.0.0.1:6669 should work; this datasource instance will connect to the plugin backend process itself, which is serving the console subscriber service.\n\n   You can then head to the datasource's Dashboards tab and import the provided dashboards.\n\n## Cross compiling\n\n### From MacOS\n\n1. Install the relevant cross compiler toolchains. Using Homebrew:\n\n   ```bash\n   brew tap messense/macos-cross-toolchains\n   brew install armv7-unknown-linux-musleabihf\n   brew install aarch64-unknown-linux-musl\n   brew install x86_64-unknown-linux-musl\n   brew install mingw-w64\n   ```\n\n2. Install the relevant Rust targets. Using `rustup`:\n\n   ```bash\n   rustup target add armv7-unknown-linux-musleabihf\n   rustup target add aarch64-apple-darwin\n   rustup target add x86_64-apple-darwin\n   rustup target add aarch64-unknown-linux-musl\n   rustup target add x86_64-unknown-linux-musl\n   rustup target add x86_64-pc-windows-gnu\n   ```\n\n3. Run the following to compile the plugin in release mode for each target:\n\n   ```bash\n   CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=armv7-unknown-linux-musleabihf-ld cargo build --release --target armv7-unknown-linux-musleabihf\n   cargo build --release --target aarch64-apple-darwin\n   cargo build --release --target x86_64-apple-darwin\n   CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc cargo build --release --target aarch64-unknown-linux-gnu\n   CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-unknown-linux-musl-gcc cargo build --release --target aarch64-unknown-linux-musl\n   CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc cargo build --release --target x86_64-pc-windows-gnu\n   ```\n\n[`console`]: https://github.com/tokio-rs/console\n[console-frontend]: https://github.com/tokio-rs/console#extremely-cool-and-amazing-screenshots\n[`cargo-xtask`]: https://github.com/matklad/cargo-xtask\n[`cargo-watch`]: https://github.com/watchexec/cargo-watch/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsd2k%2Fgrafana-tokio-console-datasource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsd2k%2Fgrafana-tokio-console-datasource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsd2k%2Fgrafana-tokio-console-datasource/lists"}