Altinity / clickhouse-grafana

Altinity Grafana datasource plugin for ClickHouse®
MIT License
715 stars 120 forks source link

Inquiry on how to make a custom macro #592

Closed mjohal3 closed 2 months ago

mjohal3 commented 2 months ago

Hi all! I am currently working on a project involving Clickhouse and Grafana, and using this plugin a lot to help display metrics from Clickhouse in Grafana. All parts of the functionality are working great, I can seamlessly write queries and seamlessly check on my processes as well. However, one subsectionn of the SQL queries that I am writing requires hashing a few variables, leading to a very long hashing section addition to each of my SQL queries. Knowing that there are macros that can also perform tasks on parameters (like $unescape), how could I go about adding a new macro of my own to perform this on a fork of this repo? I'm a bit of a beginner in relation to typescript and plugins in general, so any guidance on files/areas to focus on for my changes would be greatly appreciated!

Slach commented 2 months ago

look to https://github.com/Altinity/clickhouse-grafana/pull/541/files for example how new marco function implementing

you also need implements unit tests in typescript and golang