Conditioned math formula in add field from calculation as new transofmation subfunction

Hi GrafanaLabs community team,

based on my message send through official Grafana site, Zoom meeting with @ThibaudDupra and his friendly recommendations i would like to kindly ask few specific questions within this community forum. First of all I am not realy sure if i am using the best approach but at this moment seems to be reasonable one.

The scope/background:
As a user within Grafana dashboard in table visualization view I would like to work with data gathered through Prometheus query in kind of “life mode”. Some data columns as table fields will need to be calculated as result of formulas consisting of mathematical operations including conditions [simplified example: if (field1 - time_now > variable_constant) { field3 + field4 } ].
Related data in table view will be automatically updated (exactly same way as using Binary Operation Calculation component from transformation function, only little bit more complex formula).
For component Gauge i would like to have possibility to display data without any units (just raw data or custom formatting no overrides might be involved).

Questions/ideas regarding above mentioned:

  • i am considering to write own plugin (Grafana 9 introduces a lot of promissing changes) to add kind of new operation under “Add field from calculation” as “Formula / conditioned calculation” → it this reasonable approach ? i am not sure about related possibilities to achieve this (if there is availability to access related layers, …)
  • how to handle custom formatting or raw data without units for Gauge without need to apply chain of overrides (do i need to also cover this through plugin ?)
  • may I kindly ask community members for friendly recommendations (docs, examples, code suggestions/hints) or assistance what would be the best possible approach to fulfill described use case from long term point of view (ideally to have such as feature available in some release)

Datasource: Prometheus
Data gathering: through Pushgateway

Thank you for your time and assistance/support/cooperation in advance.

Have a nice day.

Stefan