News for hackers. Stuff that matters.
Re:We Built a 19 PiB Logging Platform with ClickHouse and Sa... by BigAl7070 on Wednesday April 03, 2024 @05:31PM (#39923444)
Can you share some details of how you implemented the cross region routing in Grafana? I think the article mentioned that you created your own plugin, is that plugin open sourced?

We would like to do something similar, but not sure where to start.

Re:We Built a 19 PiB Logging Platform with ClickHouse and Sa... by rorycrispin on Thursday April 04, 2024 @05:24AM (#39928201)
Sure, the plugin is built on top of Scenes https://grafana.com/developers/scenes

Add all of your required data sources will well known UIDs https://grafana.com/docs/grafana/latest/administration/provi... Then you can create a query panel and update the state with the desired query SQL and data source ID like so;

    const logsQuery = new SceneQueryRunner({queries: []});
    logsQuery.setState({
        datasource: { uid: dataSourceID},
        queries: [
            {
                "datasource": {
                    "type": "grafana-clickhouse-datasource",
                    "uid": dataSourceID,
                },
                "queryType": "sql",
                "rawSql": logsQuerySQL,
    ...
        ],
    });