Skip to content

support dynamic IoTDB table-model variables - #126

Merged
JackieTien97 merged 3 commits into
apache:masterfrom
CoollZzz:feat/table-model-template-variables
Aug 21, 2026
Merged

support dynamic IoTDB table-model variables#126
JackieTien97 merged 3 commits into
apache:masterfrom
CoollZzz:feat/table-model-template-variables

Conversation

@CoollZzz

@CoollZzzCoollZzz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

This pull request adds table-model template variable query support to the IoTDB Grafana plugin.

Changes

  • Added support for variable queries using:

    table:<database>:<SQL>
    
  • Executed these queries through the native IoTDB table-model RPC client.

  • Added validation and error handling for malformed queries, missing database or SQL values, execution failures, and multi-column results.

  • Converted valid single-column results into Grafana-compatible string arrays while preserving order and skipping NULL values.

  • Preserved existing legacy REST-based variable queries.

Dynamic node discovery

  • Added the $__activeFrom macro for table-model variable queries.
  • The plugin expands it to the current time minus five minutes, as an ISO 8601 UTC timestamp literal.
  • This lets dashboards discover recently active nodes dynamically.
  • Nodes that stop producing samples disappear from the variable list after the liveness window, without modifying historical data.

Testing

  • Added dependency injection for the table executor and clock to support unit testing without a live IoTDB service.
  • go test ./..., go vet ./..., and go build ./... passed.

@CoollZzz
CoollZzzforce-pushed the feat/table-model-template-variables branch from c18d7bc to 15cf5a1CompareAugust 21, 2026 03:23
@JackieTien97
JackieTien97 merged commit d11e1c0 into apache:masterAug 21, 2026
13 of 14 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@CoollZzz@JackieTien97