Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Pricing

John Gallagher

👤 Person
314 total appearances

Appearances Over Time

Podcast Appearances

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And that event, if you don't capture enough data, that is it. The data is lost forever if you're not in an event. Assuming you're not doing event sourcing and assuming you're not in an event-driven system. So the way I think about it at the most core fundamental level is whether it's logs, traces, metrics, whatever it is, we need a way of capturing those events.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And that event, if you don't capture enough data, that is it. The data is lost forever if you're not in an event. Assuming you're not doing event sourcing and assuming you're not in an event-driven system. So the way I think about it at the most core fundamental level is whether it's logs, traces, metrics, whatever it is, we need a way of capturing those events.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And more importantly, ideally, we need to link the events together. And this is really, really, really important. So if somebody create, let's say somebody hits our app and it creates the token. Well, there's two parts to that. They hit the app. There was a request to our app. And then in the call stack somewhere, the token is created. Those two things are two separate events, but they're nested.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And more importantly, ideally, we need to link the events together. And this is really, really, really important. So if somebody create, let's say somebody hits our app and it creates the token. Well, there's two parts to that. They hit the app. There was a request to our app. And then in the call stack somewhere, the token is created. Those two things are two separate events, but they're nested.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

We want to capture that causal relationship. One calls the other. One is a subset of the other. One is a parent, a child, however you want to put it. Without that causal link, We're lost again. We don't know what's caused what. So there are some three or four ideas here. Number one, events. Number two, contextual data with each of those events.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

We want to capture that causal relationship. One calls the other. One is a subset of the other. One is a parent, a child, however you want to put it. Without that causal link, We're lost again. We don't know what's caused what. So there are some three or four ideas here. Number one, events. Number two, contextual data with each of those events.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And number three, nested events, if you like, causal relationships between events. And with those three things, you can debug any problem that you would like, is my claim. And so if you just keep that model in mind, let's examine traces, logs, and metrics and see where they fall short, see which one meets those criteria. So tracing gives us all three.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And number three, nested events, if you like, causal relationships between events. And with those three things, you can debug any problem that you would like, is my claim. And so if you just keep that model in mind, let's examine traces, logs, and metrics and see where they fall short, see which one meets those criteria. So tracing gives us all three.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

So for those of you, I should explain what tracing is because I was confused about what tracing even was for absolutely years. So tracing allows you to, when somebody hits your app, a trace is started. So there are two concepts in tracing. There's traces and there are spans. And then there's the data associated with spans. But let's just leave that to one side.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

So for those of you, I should explain what tracing is because I was confused about what tracing even was for absolutely years. So tracing allows you to, when somebody hits your app, a trace is started. So there are two concepts in tracing. There's traces and there are spans. And then there's the data associated with spans. But let's just leave that to one side.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

So when somebody hits your app with a request, a trace is started. And so the trace will be like, okay, I've started. Here I am. You can append any data that you want to me whilst I'm open. It's like opening the cupboard door, and then you keep putting stuff in the cupboard, and then once the cupboard door's closed, you can't put any more stuff in it. Very simple analogy.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

So when somebody hits your app with a request, a trace is started. And so the trace will be like, okay, I've started. Here I am. You can append any data that you want to me whilst I'm open. It's like opening the cupboard door, and then you keep putting stuff in the cupboard, and then once the cupboard door's closed, you can't put any more stuff in it. Very simple analogy.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

So we open the door, we start the trace, and so it goes down to the controller level. And the controller says, oh, I'm going to glom on some data into whatever the existing trace is about the method, the post body, the request, blah, blah, blah, blah, blah, headers, whatever it is. I'm going to glom that on to the current trace. And then we get down into maybe you've got a service object.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

So we open the door, we start the trace, and so it goes down to the controller level. And the controller says, oh, I'm going to glom on some data into whatever the existing trace is about the method, the post body, the request, blah, blah, blah, blah, blah, headers, whatever it is. I'm going to glom that on to the current trace. And then we get down into maybe you've got a service object.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

I know some people hate them. I love them. Blah, blah, blah, whatever. That's not the podcast about job. So you get into a service object and the service object says, oh, whatever is in the current trace, I want you to know you hit me and you hit me with these arguments. Cool. I'm going to append that to the trace as well. And then we enqueue a background job. That event gets added onto the trace.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

I know some people hate them. I love them. Blah, blah, blah, whatever. That's not the podcast about job. So you get into a service object and the service object says, oh, whatever is in the current trace, I want you to know you hit me and you hit me with these arguments. Cool. I'm going to append that to the trace as well. And then we enqueue a background job. That event gets added onto the trace.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And then even more excitingly, there's a setting in OpenTelemetry where when the job is picked up and performed, the trace is kept open. And there's a whole load of debate about whether this is a good idea or not. But you can do it. You can keep the trace open until that job is started. And so the job says, ah, I've kicked off now. It gloms a whole load more stuff.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

And then even more excitingly, there's a setting in OpenTelemetry where when the job is picked up and performed, the trace is kept open. And there's a whole load of debate about whether this is a good idea or not. But you can do it. You can keep the trace open until that job is started. And so the job says, ah, I've kicked off now. It gloms a whole load more stuff.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

Maybe you make an API request in the job. It gloms a whole load more stuff into the trace. And then it comes all the way back up the stack. And you have this trace with all this nested context. And when it's saying, I'm going to glom this data onto the trace, that's called a span. And a span is nested. So you can have spans nested inside spans inside spans.

Ruby Rogues
Practical Observability: Logging, Tracing, and Metrics for Better Debugging - RUBY 656

Maybe you make an API request in the job. It gloms a whole load more stuff into the trace. And then it comes all the way back up the stack. And you have this trace with all this nested context. And when it's saying, I'm going to glom this data onto the trace, that's called a span. And a span is nested. So you can have spans nested inside spans inside spans.