{"id":37205486,"url":"https://github.com/rockset/rockset-grafana-backend","last_synced_at":"2026-01-14T23:40:34.638Z","repository":{"id":38332839,"uuid":"276705395","full_name":"rockset/rockset-grafana-backend","owner":"rockset","description":"Grafana datasource backend plugin for Rockset","archived":false,"fork":false,"pushed_at":"2024-05-28T15:16:32.000Z","size":1701,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":37,"default_branch":"master","last_synced_at":"2024-06-19T13:46:50.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/rockset.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T17:17:19.000Z","updated_at":"2024-05-28T15:16:29.000Z","dependencies_parsed_at":"2024-04-19T14:27:30.072Z","dependency_job_id":"5896db57-2218-4037-b4c9-e2cdadff1066","html_url":"https://github.com/rockset/rockset-grafana-backend","commit_stats":{"total_commits":41,"total_committers":8,"mean_commits":5.125,"dds":0.4878048780487805,"last_synced_commit":"0dc408d8960e45f500baaeebdbf402d05943ba8a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rockset/rockset-grafana-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockset%2Frockset-grafana-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockset%2Frockset-grafana-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockset%2Frockset-grafana-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockset%2Frockset-grafana-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockset","download_url":"https://codeload.github.com/rockset/rockset-grafana-backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockset%2Frockset-grafana-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T23:40:34.060Z","updated_at":"2026-01-14T23:40:34.630Z","avatar_url":"https://github.com/rockset.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grafana Rockset Data Source Backend Plugin\n\nThe Rockset plugin lets you write queries against your Rockset collections and visualize the results as time series in Grafana.\n\nDetailed setup instructions can be found in the [Rockset documentation](https://docs.rockset.com/documentation/docs/grafana).\n\n## Installation\n\nFor a detailed guide on how to install and configure the plugin,\nsee the [Grafana plugin installation documentation](https://grafana.com/docs/grafana/latest/administration/plugin-management/).\n\nThe quckstart is to use the `grafana cli` to install the plugin from the Rockset public S3 bucket:\n```\ngrafana cli \\\n  --pluginUrl https://github.com/rockset/rockset-grafana-backend/releases/download/v0.3.0/rockset-backend-datasource-0.3.0.zip \\\n  plugins install rockset-backend-datasource\n```\n\n⚠️ This requires setting the `GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS` environment variable to `rockset-backend-datasource`.\n\n## Query Types\n\nThe plugin supports three types of queries:\n\n1. Metrics\n2. [Annotations](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/)\n3. [Variables](https://grafana.com/docs/grafana/latest/dashboards/variables/)\n\nThe examples below use the `_events` collection from the `commons` workspace, as it exists in every Rockset organization.\n\n## Metric Queries\n\nThe query has two required query parameters, named :startTime and :endTime by default, \nwhich must be used in a `WHERE` clause to scope the query to the selected time period in Grafana (or you will end up querying your entire collection).\n\nA sample query to graph Rockset events grouped by 5 minute intervals\n\n```SQL\nSELECT\n    TIME_BUCKET(MINUTES(5), _events._event_time) AS _event_time,\n    COUNT(_events.type) AS count\nFROM\n    commons._events\nWHERE\n    _events._event_time \u003e :startTime AND\n    _events._event_time \u003c :stopTime\nGROUP BY\n    _event_time\nORDER BY\n    _event_time DESC\n```\n\n![events](src/img/events.png)\n\nInstead of a fixed interval, it is possible to use `:interval` which is SQL query parameter that the plugin injects into the request,\nand is based on the Grafana variable `$__interval`, which is set to the time range divided by the max number of datapoints.\n\n![events](src/img/query-options.png)\n\nThe `:interval` is in milliseconds, so the bucket should use `MILLISECONDS()`, e.g.\n```SQL\nSELECT \n    TIME_BUCKET(MILLISECONDS(:interval), _events._event_time) AS _event_time,\n```\n\n### Labeling Data\n\nYou can use one column of the result to label the data, e.g. in the below query the type is the label column\n\n```SQL\nSELECT\n    TIME_BUCKET(MINUTES(5), _events._event_time) AS _event_time,\n    COUNT(_events.type) AS count,\n    e.kind AS label\nFROM\n    commons._events\nWHERE\n    _events._event_time \u003e :startTime AND\n    _events._event_time \u003c :stopTime \nGROUP BY\n    _event_time,\n    label\nORDER BY\n    _event_time DESC\n```\nnote that the label column must exist in the SQL query, in this case `label`\n\n![metrics options](src/img/metrics-options.png)\n\n![events by kind](src/img/events-by-kind.png)\n\n## Annotation Queries\n\nYou can also use Rockset to store annotations and display them in Grafana.\n\n```SQL\nSELECT\n    e._event_time as _event_time,\n    CASE\n        WHEN e.message IS NOT NULL THEN e.message\n        ELSE 'no text found'\n    END AS text,\n    FORMAT('type={},kind={}', e.type, e.kind) AS tags\nFROM\n    commons._events e\nWHERE\n  e._event_time \u003e :startTime AND\n  e._event_time \u003c :stopTime AND\n  e.type = 'ERROR'\nORDER BY\n    time DESC\n```\n\n![annotation options](src/img/annotation-options.png)\n\nGrafana only auto-detects the time and text fields, so you need to manually select any other field.\n![annotation fields](src/img/annotation-fields.png)\n\nOnce the annotations are configured, they will appear on the graph.\n\n![events by kind](src/img/events-by-kind-with-annotations.png)\n\n## Variable Queries\n\nYou can extract variables using SQL queries\n\n```SQL\nselect\n  e.kind\nfrom\n  commons._events e\ngroup by\n  kind\nORDER BY\n  kind\n```\n\nand then use them to interpolate variables into queries\n\n```SQL\nSELECT\n    TIME_BUCKET(MINUTES(5), _events._event_time) AS _event_time,\n    COUNT(_events.type) AS count,\n    e.kind AS label\nFROM\n    commons._events\nWHERE\n    _events._event_time \u003e :startTime AND\n    _events._event_time \u003c :stopTime AND\n    e.kind LIKE '$kind'\nGROUP BY\n    _event_time,\n    label\nORDER BY\n    _event_time DESC\n```\n\n![events by kind](src/img/filtered-events.png)\n\nYou can include an `ALL` option using the SQL wildcard character `%`\n\n![all option](src/img/all-option.png)\n\n# Plugin Development\n\n## Backend\n\n1. Update [Grafana plugin SDK for Go](https://grafana.com/developers/plugin-tools/introduction/grafana-plugin-sdk-for-go) dependency to the latest minor version:\n\n   ```bash\n   go get -u github.com/grafana/grafana-plugin-sdk-go\n   go mod tidy\n   ```\n\n2. Build backend plugin binaries for Linux, Windows and Darwin:\n\n   ```bash\n   mage -v\n   ```\n\n3. List all available Mage targets for additional commands:\n\n   ```bash\n   mage -l\n   ```\n\n## Frontend\n\n1. Install dependencies\n\n   ```bash\n   npm install\n   ```\n\n2. Build plugin in development mode and run in watch mode\n\n   ```bash\n   npm run dev\n   ```\n\n3. Build plugin in production mode\n\n   ```bash\n   npm run build\n   ```\n\n4. Run the tests (using Jest)\n\n   ```bash\n   # Runs the tests and watches for changes, requires git init first\n   npm run test\n\n   # Exits after running all the tests\n   npm run test:ci\n   ```\n\n5. Spin up a Grafana instance and run the plugin inside it (using Docker)\n\n   ```bash\n   npm run server\n   ```\n\n6. Run the E2E tests (using Cypress)\n\n   ```bash\n   # Spins up a Grafana instance first that we tests against\n   npm run server\n\n   # Starts the tests\n   npm run e2e\n   ```\n\n7. Run the linter\n\n   ```bash\n   npm run lint\n\n   # or\n\n   npm run lint:fix\n   ```\n## Test-driving the plugin\n\n```bash\ndocker run -d \\\n    -p 3000:3000 \\\n    -e \"GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=rockset-backend-datasource\" \\\n    --name=grafana \\\n    grafana/grafana:10.0.3\ndocker exec grafana \\\n    grafana cli \\\n    --pluginUrl https://github.com/rockset/rockset-grafana-backend/releases/download/v0.3.0/rockset-backend-datasource-0.3.0.zip \\\n    plugins install rockset-backend-datasource\ndocker restart grafana\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockset%2Frockset-grafana-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockset%2Frockset-grafana-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockset%2Frockset-grafana-backend/lists"}