# 💠 Altinity Cloud Observability with qryn

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727167481993/e21c28eb-ec6d-4b3a-af2b-5a932958c73d.png align="left")

*Earlier this week our friends at* [*Altinity*](https://altinity.com) *released a* [*guide*](https://altinity.com/blog/how-to-monitor-metrics-and-logs-from-altinity-cloud-in-grafana-cloud) *on configuring Altinity Cloud stack observability using Grafana Cloud. Since qryn is a drop-in Grafana Cloud replacement (and so much more) with native ClickHouse storage, this is our redemption guide for Altinity Ops* 😉

### ▶️ Altinity Cloud Observability with qryn

In this blog post, we’ll show you how to keep an eye on your **Altinity-managed ClickHouse** clusters using the **qryn** polyglot observability stack (or **Gigapipe Cloud)**

With the [*Altinity*](https://altinity.com) Cloud Manager, you can quickly configure your ClickHouse environment to send observability signals into qryn using Prometheus and Loki APIs and instantly use Grafana to create and share real-time visualizations and alerts.

We’ll walk you through the steps to:

* Setup [**qryn**](https://qryn.dev) or sign-up for [Gigapipe Cloud](https://qryn.cloud)
    
* Send **Prometheus** metrics to **qryn**
    
* Send **ClickHouse Logs** to **qryn**
    
* Visualize and Explore data with **Grafana** and **qryn**
    

> <mark>GOAL: Store qryn data in Altinity Cloud to kill Observability costs!</mark>

[![](https://github.com/metrico/qryn-docs/assets/1423657/a5164f98-d3ed-4638-afe5-c87d252c74af align="left")](https://qryn.dev)

### ▶️ Get Polyglot

If you already have a [**qryn** setup](https://qryn.metrico.in/#/installation), *you’re ready to go!*

⚙️ If you’re using K8s: [https://github.com/metrico/qryn-helm](https://github.com/metrico/qryn-helm)

⚙️ If you’d like a quick local setup use our [qryn-demo](https://github.com/metrico/qryn-oss-demo) bundle.

⚙️ If you’d like to keep things cloudy, [signup for an Account on Gigapipe](https://gigapipe.com/)

### ▶️ Setup Prometheus + qryn

The **qryn** stack supports the **Prometheus API** out of the box, including **remote\_write** capabilities. Using qryn and/or Gigapipe cloud, all you need is the **qryn service URL** and *optional Authentication and Partitioning tokens*:

* From your **Altinity Cloud Manager** browse your list of **environments**, selecting the one you want to monitor and use the three-dot menu to **edit the settings**.
    
* In the **Environment Configuration** dialog select the **Metrics** tab to configure
    
* Once there, find the **External Prometheus** section and enter the **qryn ingestions URL** into the **Remote URL** field. *When using Gigapipe, remember to add the API-Key as the* ***Auth User*** *and finally add the API-Secret as the* ***Auth Password***\*.\*
    
    ```plaintext
    https://qryn.local:3100/api/v1/prom/remote/write
    -- OR -- 
    https://qryn.gigapipe.com/api/v1/prom/remote/write
    ```
    
* ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727118943043/70be8ef8-e6cb-47bc-9422-65ce2d8009fd.png align="center")
    
    Click the **OK** button to save the changes. This will **activate** the required connections and initiate metrics generation towards your qryn instance
    

### ▶️ Setup Loki Logs + qryn

Let’s perform the same operation to emit our Logs using the **qryn Loki API**

* From your **Altinity Cloud Manager** browse your list of **environments**, selecting the one you want to monitor and use the three-dot menu to **edit the settings**.
    
* In the **Environment Configuration** dialog select the **Metrics** tab to configure
    
* Once there, find the **External Loki URL** field, where you provide the qryn API URL
    
    ```plaintext
    https://qryn.local:3100/loki/api/v1/push
    -- OR --
    https://API-KEY:API-SECRET@qryn.gigapipe.com/loki/api/v1/push
    ```
    
* ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727118969291/b944e3f5-d366-4980-b314-9cfa9b296716.png align="center")
    
    Click the **OK** button to save the changes, which will **activate** the connection and send logs to your qryn or Gigapipe Cloud instance. *We’re all set!*
    

### 🔎 Exploring Metrics

Let’s open our qryn **Grafana** or **Gigapipe Grafana** to browse our datasources.

Navigate to the **Explore** tab and use the **New Metric Exploration** application to see an overview of all the received **Altinity Cloud Metrics**:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727119036074/dbd46faf-c573-421b-8417-fafce4076252.png align="center")

The **labels** will help you select the correct parts of your cluster and to generate queries to observe our stack from multiple angles. Each of these label based queries can be added into a dashboard or used for alerting, right from inside Grafana using the **Select** button to start. Each visualization is labeled with the name of the metric itself

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeFE2ZojDiQaMvqXXzS_2BdVhwyHXjsBd_jSDoOPBPzXBHRNiXJyOEvzLhC7B6keclW_f8GY__C47ELrhprGxiRch5aFGFU0cTXJXydZHVnimRnb5Hzv6wiIHAA-X9D73ryLlFvKRZSIRh8Je2WTETNiHA?key=6FY221Nv0HBmhbq4R2Ye6Q align="left")

Every metric sent to the Prometheus server has one or more labels attached to it. We can filter what we see by selecting one or more labels. Click the **Add label** button to add a label to the query. When you click the button, you’ll see a dropdown list of labels from all the metrics sent to this server:

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdMN1l0tRQ2muu9APv21r6dFEtDFeGjIPIXLABWH1j5dxJSZaiJM4p8RUol-I8SgfqPeBceyGDidYrU9JN5RLqrJUJJo0PJBaguHGcbXWs129KDDfPQ4ml2_gIsKXMenUD0WaO8XyhTeyb9OFYkLNG7_G_t?key=6FY221Nv0HBmhbq4R2Ye6Q align="left")

### 🔎 Exploring Logs

Click the **Label browser** button to see the labels available in your qryn instance:

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfIcvP2xFoP6HrkeTjjRlNEabn_iNedIRNN01hZ4PilxMXD3p_1MS3-xM_pNLH4B8UNqbxHqGGlXyg3JfcYCLCjTW0w96k75vy-f3bt7l_9vsHqOkRRiHXbaQgw-NHtMUCC9W9bgvvW0SkPTi7og0zwWPo?key=6FY221Nv0HBmhbq4R2Ye6Q align="left")

Let’s start with some well known labels: `namespace` and `pod`.

Browse and select the available values to see logs produced by them:

`{namespace="altinity-maddie-na",pod="clickhouse-operator-7778d7cfb6-9q8ml"}`

Click the **Show Logs** button to see all the matching messages from those services.

*<mark>That’s it! You’re ready to use LogQL features to filter, extract and transform logs!</mark>*

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe-P-tzadEcpenr0cagTg7SBXg26fAzZMiyDPJ627OqGcWsyT4AoexLsc8kn6hi3G4p2eQ6HU_sCWi-Hn-Q6puaA_BPF17TLT3Jx6pmRYEEey8CWQDaUiz48zrxKsmj6beQog9gV7H04rja568W6Iid_Yd8?key=6FY221Nv0HBmhbq4R2Ye6Q align="left")

### 🎱 Advanced Techniques

Logs can be used to create ad hoc statistics about rates of errors or count of ‘query types’ over time, to allow alerting or monitoring of important health related status logs.

To make ad hoc statistics, we can use a query that filters the logs to something interesting (e.g. Logs that contain the word ‘Error’) and then use a counter query to see the amount of occurrences of the Error logs over time.

```plaintext
count_over_time({job="dummy-server"} |~ `Error` [$__auto])
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727211745563/1074bf42-e0c8-4bd5-95e4-32aee411a466.png align="center")

This allows us to see how many Errors are occurring and if they increase over time. Using this query, we can also set an alert to detect if Errors pass a threshold.

To add an alert, we can navigate to the **Alerting** Menu inside Grafana and select **Manage Alert Rules**. Once there, we click **New Alert rule** to create a new rule.

Now we can use the above query to create an Alert for ‘Error’ log lines. Using this alert we can now get notified by Grafana when our cumulative ‘Error’ count goes above 100 in a 10 minutes span.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727212164510/7da47011-54ff-4ccf-918a-0b2ea871e846.png align="center")

Through the power of qryn and Grafana, you can be alerted on Metric spikes, Log rates and Occurrences. Making it faster to find and resolve issues in your system.

### 👁️‍🗨️ Conclusion

*If you use Clickhouse, use it all the way and store your observability in OLAP!*

With [qryn](https://qryn.dev) you get the same APIs and features as Grafana Cloud as a thin overlay on top of your existing ClickHouse storage, retaining control of costs, storage and without dependencies on third-party providers and their usage based plans…

> Don’t drop your data to save. Drop your expensive Observability provider!

[![](https://cdn.hashnode.com/res/hashnode/image/upload/v1727275637837/d1d81bd3-f337-46ec-b23a-8e5ace8178f0.png align="center")](https://gigapipe.com)
