Transcript 0:00 Right. You have metrics, logs, and traces, and at 3:00 in the morning you still can't answer one question that really matters, and that is which exact function in production right now is consuming all that CPU? 0:12 Your, your dashboards are telling you that the box is hot. They don't really tell you why. Um, and today I'm gonna help you close that gap. You're listening to Tech Tuesday from Metrics and Mayhem. 0:23 10 minutes to make sense of one thing that landed in my inbox this week. Whether you're in the pit or you're at the table, this is for you. [percussive music] So here's where we are. Picture the incident. It's late. 0:40 Something is degraded and, and you go hunting. You go looking. You- your metrics is telling you the box is hot. The CPU's been sustained for over 20 minutes. It's pinned. 0:50 And the logs tell you what the application has decided to say about itself, which is generally, you know, you know, whatever someone had coded in the log 18 months ago, so it may not be that relevant. 1:02 And your traces tell you which service is slow and which span to look at at the time. All very, very generally useful. It's, it's the, it's the mainstay of observability, the three signals. 1:13 Between them, you've narrowed down the whole of your estate down to one service and one operation generally quite quickly. And, and then you hit a wall because none of those three can really tell you the next thing. 1:23 And the next thing is the thing that actually helps you fix it quicker. Which function? Which line? What specifically inside that service is eating the machine alive? So what do people do at that point? 1:36 I can tell you what I've done and what sometimes I continue to do is, or what I've watched loads of good engineers do, is you tend to make some assumptions based on your experience, and fundamentally you're guessing. 1:47 You look at possibly what was recently deployed, and then you assume that that was the problem because there, you know, there may be some type of correlation in time or something. 1:57 So you restart the service, you know, because obviously restarting it makes it go away, and you go back to bed. Or you're brave. 2:03 You have the support to attach a profiler to production, to production process in the middle of an issue, middle of an incident under pressure, and you hope you don't make it even worse by doing so. 2:14 And here's the part that should bother you. The gap between the box is hot and the function why is where we spend all the hours of our incident. 2:22 It's also where a surprising amount of our money goes because when you can't find that bit of expensive code, you've only got one thing left. 2:30 You just scale up, and you throw another instance at it or you buy your way around the problem and it ends up being never diagnosed. 2:38 And that hardware bill, that hardware bill just becomes a permanent part of your, of your, of your invoice. So here is one sentence I want you to keep from today. Continuous profiling is now the fourth signal. 2:53 In 2026 it's stopped being a vendor add-on and has now become a standard. That second half is the part that makes a Tech Tuesday and not a wish list. Profiling's been around for decades. 3:04 What has changed is that it's become a part of the same open plumbing you already run today. Now let me give you a picture to hold onto. Think about the difference between a medical checkup and a fitness band. 3:16 Generally the, the checkup is what profiling used to be. You, you book it once when you don't feel very well. 3:23 Somebody attaches a profiler to a struggling process, grabs 30 seconds of data and then tries to work out from that snapshot what's wrong. And the problem with a checkup model is obvious as soon as you say it out loud. 3:35 You're only measuring after the trouble has started and only for as long as you continuously watch it. Production problems are not that polite. They're not that friendly. 3:44 There plenty of them are spiky and transient and they will hate you. And by, by the time you've attached something, you know, the spike has gone and the system looks fine again. The issue's gone away. 3:54 A fitness tracker is the, a different proposition. It's always on. It sits there quietly at low overhead recording where the effort actually goes every day, day in, day out, whether something's wrong or not. 4:07 And it changes then what you ask. You stop saying, "Let me measure how ill I am," but you start asking, "What's changed?" Because that's the real value. Because the real value is never one reading. It is a comparison. 4:21 This function used to take 2% of CPU, now it takes 30, and it started doing that on Tuesday afternoon. That's continuous profiling, an always-on fitness tracker for your code in your environment. 4:33 And hold onto that statement 'cause I'm gonna come back to that in the end. Right. Named parts. There are four and learn them in this order. One, the profile itself. 4:41 Profile is a statistical sample of what your code is actually doing. Many times a second something asks everything running in a thread the same question. "What function are you in right now and what called you?" 4:54 Do that a thousand times, aggregate it, and you get a very accurate picture of where the time went broken down by the function. You will usually read it as a flame graph. A flame graph is a sim- is simpler than it looks. 5:07 Width is time. The wider the bar, the more CPU your function is being consumed. Stack upwards is the call chain so you can see what called what. So you look for the widest bar that's eating your machine. 5:20 Two, continuous versus demand. On demand is the checkup. You, you attach when there's a problem. Continuous is the fitness tracker. 5:28 It's always sampling at an overhead low enough you can just leave in production and let it fly and not even think about it. And the reason this distinction matters so much is that it changes the direction you look. 5:40 On demand you only ever look forwards from the moment you attached it. 5:44 Continuous makes you look backwards and, and at 3:00 in the morning you can ask the service what it was doing at 10 past 2 the previous day when the incident actually started without having you to pretend what that is. 5:58 Three, the eBPF connector. Now this is the part That makes always on realistic and it's a genuine unlock. 6:05 Historically, profiling meant language-specific agents, a different one for Java, Go, Python, code changes, or at least configuration changes, and usually at the restart of the thing you're trying to observe. 6:18 eBPF changes the arrangement. It lets you safely run small programs in the kernel, which means the sampling happens at system level underneath your applications across every process on the box. 6:29 So you get whole system profiling, every process, most common runtimes, no code changes, no restarts, low, low overhead. 6:36 And the piece of news that matters here, Elastic donated its eBPF profiling agent to OpenTelemetry and is now runs, and it now runs as a receiver inside the OTel connector, shipped as an official distribution now. 6:49 It's fantastic. Which means profiling data goes down the same pipe through the same collector with the same processing and the same Kubernetes metadata as everything you already send. 6:59 Four, the profiles, signals itself, and the trace correlation. Profile, profiles is now a signal in OpenTelemetry, standing alongside traces, metrics, and logs. 7:10 The project took it in public alpha in March this year, and GA is targeted for the end of this year. So the fourth signal is not a metaphor anymore. 7:19 It's a specification of what, it's a specification with a data model going down the standard pipe. And here's the bit I want you to actually remember, because it is the capability no one's had before. 7:29 Profile samples can carry the trace ID and the span ID. Think about what that gives you for a second. Find a slow trace. 7:36 You, you click into the span that took the time, and instead of guessing what happened in the span, you see a flame graph of that exact request. 7:45 You go from the request is, this request was slow to this request was slow because of this function in one single movement with no guessing in between. 7:55 That join between the trace and the code is something that's been missing, and it's why this is worth your attention now and not in two years' time. Okay, are you still with me? Because now we've gotta lay it down. 8:07 We've gotta, we've gotta say where we really are right now. So there is three things I wanna want you to, I wanna be honest about with you is firstly, it is an alpha, first and foremost. It's a public alpha, yes. 8:19 With a GA targeted, yes. It's not the same as being fully complete or fully adopted. The specification is stable enough to build on, and everyone is using it. 8:27 Backends and tooling are still catching up, and of course, our ecosystem is always moving, even more so with this. If you wire this up this month, expect to rewire it a bit later. 8:36 That's the price we all pay to being early to a standard, a bit like MCP, and you should, should play with it with your eyes open rather than just be surprised by it. Second is always on does not mean free. 8:49 The CPU overhead of a modern sampling is generally low. It's not the cost that I'm worried about. The cost is with the data. 8:56 Continuous profiles across estates is a lot of information, and information has storage and cardinality, and we all know there's a bill attached to that. 9:05 And here is where I correct my own advice, because the rule I used given earlier was simply turn it on, the overhead is low. That rule has a failure mode, and I've watched it play out. 9:15 Teams turn it on everywhere at once. The storage bill lands two months later, everyone's screaming, and it's switched off as an expensive experiment before it's really had a chance to prove itself. 9:26 So the rule updated, turn it on where the money already hurts. Decide the retention before you switch it on, not after, and let it earn the next service you deploy it. Scope first, then spread. 9:39 Scope first, then spread, yeah? Because this is the same mistake we all, we, the whole industry did for logs, right? We turned it on and now we're in a right state. So remember that. 9:47 Third, and this is the one people always skip. The profile tells you where it went wrong. It doesn't tell you whether it's wrong. A function still sitting at 40% of CPU might be completely correct. 9:59 It might be the actual work your service is, is, is there to do. The flame graph is a map. It's not a verdict. 10:06 So you still have to know your own system well enough to read it and to tell the difference between expensive and wasteful. Profiling makes the invisible visible. It doesn't make the judgment for you. 10:20 So what, so what do you actually do with this today? If you're in the pit, so if you're at the coalface, SRE, et cetera, here is what I want you to do this week. Don't turn it on everywhere. 10:30 This is how these type of projects die very quickly. 10:33 Pick one service, specifically one where a hot path or a cost spike is already hurting you and hurting your business, the one you've already scaled up once without really knowing why. 10:43 Turn on continuous profiling for just that one service, just the one. Then wait for a generally slow request, take the trace, line the flame graph up against it. You will get one of two outcomes. 10:55 Either you find something surprising, some function you had no idea was expensive, or you confirm the thing you already suspect, already suspected but could never prove. Both are worth your hour. 11:05 Give it, one gives you a fix, the other gives you an argument you can actually win. 11:10 If you're sitting at the table, here is a question I would take into your next review with your head of observability or, or your vendor, because this is where the cost story has been hiding all along. 11:20 For years, the standard response to a service that's running hot is, okay, it's, has been just give it more compute. It's already fast. It works, and it's the, and it's invisible on a dashboard 11:32 like that you never look afterwards. But scaling up to cover code you've never measured is not a capacity decision. It's a diagnosis you've skipped, and you're paying for it every month indefinitely going forward. 11:44 So ask one question and watch the room is, "Do we, do we know which functions we're actually consuming the most compute that we're paying for?" If no one can answer that, then 11:56 then you're probably buying capacity and you're buying hardware to hide a big software problem, and you'll keep buying it year on year until someone looks. 12:03 And if you took this properly, seriously, then here is what you would actually build. Not a dashboard, you're building a loop. 12:11 You would put continuous profiling on the paths that cost you real money, and you would wire the profile straight into the trace so that any slow request in production can be opened with the exact function that made it slow by anyone without needing a specialist in the room. 12:26 You would scope it deliberately, decide the retention up front, and put the flame graph in front of people who sign the infrastructure bill and not just the people who read the dashboards. That's important. 12:36 And then you would close the loop. Every time someone wants to scale a service up, you'd show them the profile first. 12:42 Not to block it, not to block it, but just, just so the buying more machine and compute is a decision someone's actually made rather than just a reflect that was never questioned. 12:52 Build that and profiling stops becoming a debugging tool and starts becoming how you run your estate. You know what I'm all about. Observability, not as a cost center, but as a profit center. 13:03 Take this analogy with you because it's the whole thing in one line. Do you wear... You do not wear a fitness tracker to find out how ill you are. You wear it so that when something changes, you already know the history. 13:19 That's it. An always-on fitness tracker for your code. Your dashboards tell you the box is hot. Profiling tells you why. Use that in your next architecture review. You don't have to credit me. And that's Tech Tuesday. 13:34 I'm Alan Mann. If you like this, the book is out, Metrics of Mayhem, A CTO's Guide to Observability That Actually Works. It's, it's on all formats. You can get a free chapter at Amazon. 13:45 You can also get another free chapter on my website at masteringobservability.com/subscribe. And if you like this, then please like and share it. Please send comments. I look at all the comments. 13:59 You can send me an email via the website. And I look forward to seeing you all in the next Tech Tuesday. Much love. Look after yourselves. [upbeat music]