text
stringlengths
0
1.8k
**Break:** \[23:11\]
**Gerhard Lazu:** That was a really interesting point that you've made, Alex, just before the break, and I would like to dig into it a little bit more. I would like to hear more about PromEx, the hopes and goals, because I think there's more to unpack there... But I find it very interesting how the exemplars that you h...
In our Changelog app, just to give that example, we have a lot of logs - actually, most logs are still in the standard, unstructured format. So you have long lines of text, and that's okay, but that's where the regex are needed, to extract meaning from those lines.
So the thing which i've found to work a lot better, for example Ingress NGINX, which we also run, is to use JSON logging. So we put all the different information, which you can think of them as metrics, in that one very wide event which is the log line.
For example, status 200, how many bytes, how long it took, which was the refer, stuff like that. And that information, when it ends up in Loki, writing LogQL queries, which are very similar to PromQL queries, makes it easy to derive graphs, which we would typically get from metrics, from your logs.
So then the boundaries between metrics and logs are blurry. You don't really know whether "Was this a log, or was this a metric?" Does this really matter? It's what your understanding is from metrics and logs.
So that makes me wonder, how are logs and metrics different if you use logs as JSON, and you have this arbitrarily wide metric, if you wish - because it's a kind of metric, right? You have all these metrics like status, as I said, bytes, time taken - all those are metrics, and they all appear in a single line. So what ...
**Alex Koutmos:** Yeah, I think in the spirit of just-in-time/JIT, I think that's effectively what we're doing with logs when we try to extrapolate the metrics out of them, is through this event into the ether with a whole bunch of data associated with it. Maybe we don't know what we wanna do with it at the end, but gi...
I think that for some scenarios that may be your only option. Let's say you're running an external service, and all it's giving you is structured logs out. There's no way to tie in maybe an agent inside of there, or get internal events and hook in your own Prometheus exporter... For some scenarios, that may be your onl...
But for when you can control those things, I think storing them in a time-series database will be beneficial for the team, because it's less stress on the infrastructure, it'll be far more performant... So that's, again, a bit of a trade-off there as to what route you go down.
**Gerhard Lazu:** That's interesting. Okay. So PromEx - big on metrics. Maybe logs? Are you thinking maybe log?
**Alex Koutmos:** \[28:07\] Perhaps... I think the extent of the log support out of PromEx will be just the shipping mechanism, given that the plan is to have Grafana Agent as part of PromEx's optional download. You can target that Grafana Agent for exporting logs to Loki. But I don't think PromEx will transform into a...
**Gerhard Lazu:** Okay, that makes sense. What about events?
**Alex Koutmos:** So like traces, for example?
**Gerhard Lazu:** I'm thinking events we have from the Erlang library and the Erlang ecosystem. It's very rich, in that it can expose all sorts of events, and I think this is where we are touching on the OpenTelemetry and the sort of things that the Erlang and Elixir ecosystem have going for them, which I think is a ve...
**Alex Koutmos:** Yes, yes. So let's rewind a little bit out of PromEx and talk about what you're hinting at here... So there are a couple projects in the Elixir and Erlang ecosystem. OpenTelemetry as far as I understand right now is an implementation of the OpenTelemetry spec. I think it's solely just for tracing. I t...
So every library can surface events, and you as the consumer of that library can say "Okay, I wanna pull out these measurements from the event, and maybe this metadata from the event." A perfect example would be the Phoenix web framework will surface an event when it's completed a request, when it's serviced a request....
That's effectively how PromEx works. All these libraries that I attach to are emitting these telemetry events. I just so happen to hook into all these telemetry events, and then generate Prometheus metrics out of them.
I think the story there in Elixir and Erlang is very unique, because the ecosystem has kind of said, "Okay, we're all gonna use these foundational building blocks." And I think -- the last time I looked on hex.pm, I think there were like 140 libraries using telemetry, which means now across the ecosystem we have this u...
**Gerhard Lazu:** \[31:45\] That explains why PromEx was such a -- I wouldn't say straightforward, but almost like it was obvious how to put it together. It was obvious what users want and need, because you have all these libraries that expose these events; they're there, you can consume them. So Ecto this week, Oban n...
**Alex Koutmos:** Yeah, that's exactly right. It is quite a bit simplified...
**Gerhard Lazu:** It's an oversimplification, of course.
**Alex Koutmos:** Because a lot of times I'll sit down to write a PromEx plugin, and as I'm writing plugin, I'm like "Hm, I need some more data here." So I'll make a PR to the library author, and say "Hey, I think we need some additional metadata here, some additional measurements", and then we have to go through that ...
**Gerhard Lazu:** That's a good one, actually. I like that, especially the last part. Especially the ship it part.
**Alex Koutmos:** Yeah, I thought you'd like that.
**Gerhard Lazu:** Okay. So you have all these events... So I'm wondering if - you're ingesting events, you're translating them into metrics... Is there a point where you could just expose those events raw, and then something like for example Honeycomb, which loves events, could just consume them. I think that's how the...
**Alex Koutmos:** I'd have to play around with that and see... Some of these events have a lot of metadata associated with them. Again, let's say that Honeycomb is infinitely scalable, and it doesn't take any compute time - yeah, sure thing; just dump a couple thousand lines of metadata per event into Honeycomb. But ye...
**Gerhard Lazu:** I'm also fascinated by it, because I think the take is very interesting, and I can see the uniqueness, I would like to understand it more, how they make that possible, for sure... And the challenges -- I mean, if they pulled it off, which apparently they have, that's impressive. And I think it takes a...
So we telemetry, we have PromEx, you mentioned about plugins... Is there anything specific that you would like to add to PromEx next, anything that users are maybe asking for, anything that you would like to ship, which you know would be a hit?
**Alex Koutmos:** Yeah, so aside from Grafana Agent, which I think some people are excited about...
**Gerhard Lazu:** I am. Big fan. Please...
**Alex Koutmos:** \[laughs\] So one thing I forgot to mention was -- so in addition to supporting all these first-party plugins and Grafana dashboards (and you kind of hinted at this before), users of PromEx are encouraged to make their own PromEx plugins and their own Grafana dashboards... And those plugins and dashbo...
So the idea is that you use PromEx for all the shared libraries in the ecosystem, and then you write your own plugins and Grafana dashboards for things that are specific to your business, that obviously are not gonna be supported in PromEx. So that's one thing I forgot to touch on. And then what was the original questi...
**Gerhard Lazu:** I was asking if there are any specific libraries that you are looking to integrate with. And I'm looking at the available plugins list, and I can see which ones are stable. This is, by the way, on github.com/akoutmos/prom\_ex. And there's a list of available plugins. A bunch of them are stable: Phoeni...
**Alex Koutmos:** Yeah, yeah. Just like the booze.
**Gerhard Lazu:** Right. I don't know... I really don't know.
**Alex Koutmos:** \[36:17\] Yeah, me neither.
**Gerhard Lazu:** Okay.
**Alex Koutmos:** So Broadway - that plugin is more or less done. I've made some changes to Broadway itself, and those changes were accepted and merged into the Broadway project. I don't think there's been a release cut as of us recording right now. So that plugin is kind of on hold until a release gets cut, and then I...
**Gerhard Lazu:** The idea is to get Broadway wrapped up. For those who don't know what Broadway is - it's a really nifty library where you can drop it into your project and you could read from various queue implementations, and it takes care of a lot of the boilerplate in setting up a concurrent and parallelized worke...
But yeah, Broadway is on the list... And then Absinth is on the list after that, because that's the Elixir GraphQL framework. So that seems to be pretty popular. Yeah, after those two are wrapped up, I'm just gonna go on hex.pm, see which one has the most downloads after that, and just -- think of that as a priority qu...
**Gerhard Lazu:** That makes so much sense. Of course. The way you put it, it's obvious. What's the most popular? That thing. Okay... Well, that will have the most users and will be the most successful, and people will find it the most useful. So yeah, that makes perfect sense. I like that. Very sensible.
**Break:** \[38:00\]
**Gerhard Lazu:** So one of the things that we wanted to do - I think we were mentioning this towards the beginning of the show... We were saying how Erlang 24 just shipped. It was a few weeks ago, the final 24 release. We have the first patch release... And we wanted to upgrade the Changelog app to use Erlang 24. So h...
\[39:40\] PromEx is obviously instrumental, all the metrics and all the logs get shipped to Grafana Cloud, so that's how we will be observing things, and we will be commenting out what is different, what is better, what is worse. So with that in mind, I'm wondering if there's any assumptions or expectations that we can...
**Alex Koutmos:** Yeah, so I've been thinking about this for a little while... Because measuring things before and after changes - it just excites me, to see that you've made a change and you have some measurable differences between how it was before and how it is afterwards. So I've been thinking about this, and some ...
**Gerhard Lazu:** I'm thinking that the end result that the users will see, because of those serialization speed-ups, is a lower latency. So responses will be quicker. Now, if you have listened to the Changelog 2021 setup, you will know that if you're accessing Changelog, you're going through the CDN. So every single r...
So the website is already very fast, because it's served from Fastly. What we will see, however - we have probes that also hit the website directly. So expect the response latency, if you go directly to the backend - or to the origin, as the CDN calls it - it will be slightly lower. I also expect the PostgreSQL - maybe...
I'm very curious what happens with context switches. Are we going to have fewer context switches, so less work on the CPU, or more? Obviously context switches are not just like the work the CPU does, but I think things will be a lot less work to do, so fewer context switches. CPU utilization - I think it will go slight...
That's what I expect to see... So will it make a difference for the users? I don't think it will, because they have the CDN. So everything is already super-quick, as fast as it can be. You have TLS optimizations, you have data locality of all the good stuff, because the CDN just serves requests from where you are.