chasers

chasers

Telemetry_metrics_logflare - Ship your Telemetry metrics to Logflare

For your review … telemetry_metrics_logflare

You can now easily ship your Telemetry events to Logflare. This setup a bit different in that this reporter does not aggregate metrics in your app. It ships individual events to Logflare so we can store each metric event (plus the metadata) and let BigQuery do the aggregations after the fact. This keeps you from having to create hundreds, thousands or millions of different metrics.

It also lets you do dynamic aggregations on historical data. Imagine sending over the whole Conn as metadata on a duration metric. That might be a bit excessive depending on what you stuff in your Conn but it’s potentially possible and would let you answer just about any unknown unknown in the future.

Examples

Avg response time of 4xx HTTP status code responses by second

Average memory per minute on a specific node

p99 of queries ran against the properties table by second

Most Liked

hauleth

hauleth

Well, it is important to remember that these are still logs not metrics. So while nice addition, in real systems I would beware of using such setup as it can easily fill whole IO with “metrics” alone leaving no bandwidth for the “useful work”. If you want something like that then you should use local aggregator to not overload network with sending all that events one by one.

hauleth

hauleth

It is like pyramid, you measure what you can (metrics), you message where you need some debugging (logs), and trace on the high level. So you end with a lot of metrics, some logs, and few traces. Often you even implement sampling on traces to reduce amount of them, because as you noticed, some traces can be huge.

Each of these is also useful in different situations:

  • metrics are used for “early warning”, we want to know what is going on and be able to react before there is a problem
  • logs are used to find out where is the problem, check out for bugs and sometimes for other finding malicious parties (fail2ban)
  • traces are used for profiling applications, finding bottlenecks, and monitoring how services interact with each other

So you see why it is often important to differentiate between them.

In short:

  • Metrics tell you when is something happening in your application
  • Logs tell you what is happening in your application
  • Traces tell you why and how is something happening in your application

Sometimes it help, sometimes it doesn’t.

I would say that it depends on the amount of data you want to gather. Often, with broad monitoring, it will come to you sooner than later, even before “reaching scale”.

Great.

I meant systems with many metrics and heavy traffic. If we are monitoring only for the HTTP requests then often it will be enough, however, as in article I linked, even if you batch them you are limited by size of each log. See that each one log entry will contain about 28 bytes of data that isn’t really needed there (timestamp) as we are more interested about rate of the events, not exact time when these events happen.

Yeah, for starting projects it may be useful and interesting solution, however if you grow at least a little then you may encounter some problems (AFAIK, please correct me if I am wrong)

  • Logflare UI do not support comparing and looking for correlations in graphs of the metrics
  • There is no way to do more complex analysis like counting derivations, computing trends, etc. in the Logflare queries
  • There is no alerting mechanism built into Logflare, which is the reason for using metrics
  • There is only one graph in the Logflare UI - bar graph, which shows only rate of the events which is useful, but sometimes you need other graphs (heat maps, gauges, etc.). I do not really see how you would check CPU or memory usage using such UI

So as I said, it is useful, but you will very quickly grow out of it and you will need a “real” metrics gathering setup.

chasers

chasers

Sure sure, yeah and there’s no reason why you can’t aggregate metrics on the client and then send them over when you need to.

We have solutions of your examples I think. There is definitely work to do here on the features themselves and surfacing the more advanced use cases.

With BigQuery and the way we implemented it, you get Google Data Studio for free. While not perfect it does let you build out any kind of dashboard you can think of. We will be adding some initial dashboarding features though too.

Mostly true but because we’ve setup BigQuery the way we have if you’re on a paid account you can query your data directly with SQL and include that in your Data Studio reports.

With LQL … you can do like m.inventory.product.color:~"blue|black" and it’ll give you a bar chart of events where the product is blue or black via a regex match. You can then do like m.inventory.product.color:~"blue|black" m.inventory.product.status:"sold" c:sum(m.inventory.product.qty) and the chart will be a timeseries of the sum blue or black sold products moving through your inventory.

You can also use the same LQL queries to route logs to another source and alert when that source gets events. Some examples would be:

m.vm.memory.last_values.total:>8000000000 and you’ll get alerts when you ram usage is over 8GB
m.phx.status:>499 to get alerted about all your 5xx responses
m.level:"error" on a LogflareLogger source and get alerted for all your error logs
m.phx.request_path:~"/signup" and regex match looking for paths with /signup in them for signup alerts
m.phx.endpoint.stop.every.duration:>5000000000 to get all requests over 5 seconds
m.repo_name.repo.query.every.total_time:>5000000000 all ecto queries over 5 seconds

Where Next?

Popular in Announcing Top

Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have ...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
sbs
Only 650 LOC, wrote for fun :slight_smile: https://github.com/sunboshan/qrcode
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement