#zincobserve

Metrics Feature in ZO 0.4.0 & Telegraf Integration

TLDR Joe asked about using metrics feature in ZO 0.4.0 and Telegraf integration. Prabhat clarified its early implementation and mentioned improvements, including PromQL support and partitioning strategy for data storage.

Powered by Struct AI
👍 1
28
1mo
Solved
Join the chat
Apr 21, 2023 (1 month ago)
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
07:00 PM
I can't seem to find info in the docs on which stream name to use for the metrics feature introduced in ZO 0.4.0,
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
11:43 PM
What you can do with metrics today:

• Ingest metrics usin prometheus remote write endpoint - https://domain.com/api/org_name/prometheus/write.
• Explore metrics using metrics explorer in the UI.
• Build dashboards using SQL or drag and drop in dashboards.
11:44
Prabhat
11:44 PM
It is super early for metrics. Will add docs soon.
Apr 23, 2023 (1 month ago)
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:30 AM
Ah okay, so you can't get metrics in from Telegraf then?
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:32 AM
You can use the standard telegraph stuff to send data as logs and can still run SQL queries on top of it, but can't store that as metrics yet. The idea is to make PromQL work on metrics streams.
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:32 AM
Ah okay
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:32 AM
but getting telegraf data as metrics streams is a good idea. We need to be able to specify that input is coming for metrics stream
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:33 AM
Good to hear it's being thought about 🙂
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:33 AM
I believe you are already using Telegraf. Would PromQL be helpful to you?
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:34 AM
I haven't used PromQL before, I am used to using Flux and InfluxQL. I'm sure it wouldn't be too difficult to learn PromQL though.
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:35 AM
You will still have the option to use SQL. PromQL makes life quite easy.
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:35 AM
Nice!
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:35 AM
but if you have to use SQL then it would not make any difference if it is a log stream or metrics stream
10:36
Prabhat
10:36 AM
What did you expect from metrics stream?
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:36 AM
Ah yep that makes sense. I have been using log streams for metrics for testing. I saw the metrics tab on the side and thought it would be a separate place where metrics are stored instead of mixing it with logs (although I have been using separate streams for this anyway)
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:41 AM
There are some differences in metrics stream and log streams. Metrics has way less data compared to logs and appropriate partioning needs to be done for metrics or the storage will become very inefficient. For logs we partition by hour and are able to get 4-5 MB file size which is ideal file size for storage on s3. For metrics, we get the file size per hour to be 32kb-300kb making it very inefficient. We are thinking about weekly partitioning for metrics data.
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:42 AM
Sounds good
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:44 AM
What is your data size looking like for metrics?
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:44 AM
Currently 5121.78 MB ingested, 149.89 MB compressed
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:45 AM
Are you using object store or local disk? What is the approx size of each parquet file ?
10:46
Prabhat
10:46 AM
also is the systems metrics data or some other metrics data?
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:47 AM
Local disk, and around 300K per parquet. It's systems metrics data.
👍 1
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
10:48 AM
you will be fine using local disk. If you choose to move to object storage this is slightly inefficient and you would want bigger files.
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:48 AM
Ah okay, good to know
Apr 25, 2023 (1 month ago)
Prabhat
Photo of md5-23052f31f8f3c4b1bb3297fbc3a2aec5
Prabhat
02:02 AM
Joe I noticed that telegraf supports prometheus remote write. So I upgraded the documentation to use it - https://docs.zinc.dev/docs/ingestion/telegraf/
02:03
Prabhat
02:03 AM
Using this you can now ingest data from telegraf as metrics and use metrics explorer to see charts like this:
02:03
Prabhat
02:03 AM
Image 1 for
May 03, 2023 (1 month ago)
Joe
Photo of md5-d9ca032e3941589aafa8433269974f96
Joe
10:46 AM
Oh excellent! Thanks 🙂