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

That will format in JSON for you. There are some notable missing defaults in semantic logger. And I'm working on a gem at the moment that will add some even more sensible defaults into it. So, for example, I believe that request headers do not get logged out of the box. Certainly request body does not get logged out of the box. Request headers might be.

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

That will format in JSON for you. There are some notable missing defaults in semantic logger. And I'm working on a gem at the moment that will add some even more sensible defaults into it. So, for example, I believe that request headers do not get logged out of the box. Certainly request body does not get logged out of the box. Request headers might be.

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

The user agent doesn't get logged out of the box. I mean, this is just crazy. Pretty basic stuff, right? So I have a setup that I use that logs a whole load of things about the requests out of the box. I like to add in user ID out of the box. It depends what kind of setup you have for authentication, but at the very, very least, if somebody's logged in,

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

The user agent doesn't get logged out of the box. I mean, this is just crazy. Pretty basic stuff, right? So I have a setup that I use that logs a whole load of things about the requests out of the box. I like to add in user ID out of the box. It depends what kind of setup you have for authentication, but at the very, very least, if somebody's logged in,

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

The ID of them should be logged in every single request. That is absolutely, you know, absolutely basic stuff. A request ID is also a really, really useful one. I have a complex relationship with logs and tracing because tracing is essentially the pinnacle of observability. I hear a lot of people say logging, like logging is a be all and end all.

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

The ID of them should be logged in every single request. That is absolutely, you know, absolutely basic stuff. A request ID is also a really, really useful one. I have a complex relationship with logs and tracing because tracing is essentially the pinnacle of observability. I hear a lot of people say logging, like logging is a be all and end all.

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

Logging is a great place to start, but tracing is really where it's at. And I can go into that, why that is in a bit. But logging is a great default. Logging is a good place to start. Start with semantic logger. Basically, every single thing that's important in any request should be logged. So that's every header.

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

Logging is a great place to start, but tracing is really where it's at. And I can go into that, why that is in a bit. But logging is a great default. Logging is a good place to start. Start with semantic logger. Basically, every single thing that's important in any request should be logged. So that's every header.

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

Obviously, you need to be careful with sensitive data in headers, like do your Rails active logs. I can't remember what it's called, but there's the filtering module that you can add in. And sometimes semantic logger doesn't give you that by default, so you need to be a bit careful. A good default as well is logging all background jobs. Background jobs are one of the most painful things

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

Obviously, you need to be careful with sensitive data in headers, like do your Rails active logs. I can't remember what it's called, but there's the filtering module that you can add in. And sometimes semantic logger doesn't give you that by default, so you need to be a bit careful. A good default as well is logging all background jobs. Background jobs are one of the most painful things

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

areas of observability that I've experienced, and we still haven't really cracked it. We have some very, very basic logging out the box in Semantic Logger. I believe it logs the job class, the job ID, and a few other things, but it doesn't log the latency, which is a Huge, huge missed opportunity. And it also, I don't believe it logs the request ID from whence it was enqueued.

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

areas of observability that I've experienced, and we still haven't really cracked it. We have some very, very basic logging out the box in Semantic Logger. I believe it logs the job class, the job ID, and a few other things, but it doesn't log the latency, which is a Huge, huge missed opportunity. And it also, I don't believe it logs the request ID from whence it was enqueued.

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

So when a job is enqueued, it will, by default, semantic logger will trigger a little entry in the logs, this job is enqueued, and it will tell you what request it came from. But on the other side, when it's picked up and the job is performed, that request ID is missing. So you need to kind of go into the request ID, find the enqueued job, find the job ID, and then take that next leap.

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

So when a job is enqueued, it will, by default, semantic logger will trigger a little entry in the logs, this job is enqueued, and it will tell you what request it came from. But on the other side, when it's picked up and the job is performed, that request ID is missing. So you need to kind of go into the request ID, find the enqueued job, find the job ID, and then take that next leap.

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

So, I mean, it's a bit clunky, but it's manageable. So in short, semantic logging gives you some okay defaults out of the box, but there's some really basics that it still misses. And so background jobs, requests, those are the two really, really big ones to start out with. But as you can imagine, there are a ton more.

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

So, I mean, it's a bit clunky, but it's manageable. So in short, semantic logging gives you some okay defaults out of the box, but there's some really basics that it still misses. And so background jobs, requests, those are the two really, really big ones to start out with. But as you can imagine, there are a ton more.

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

Yeah. There's so many things you touched on there I want to come back to. To answer your question, first of all, it's the five steps that I walked through. And that's the short answer is if you have a specific question that you cannot answer, what we're really talking about is the implementation details of how you answer that question.

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

Yeah. There's so many things you touched on there I want to come back to. To answer your question, first of all, it's the five steps that I walked through. And that's the short answer is if you have a specific question that you cannot answer, what we're really talking about is the implementation details of how you answer that question.

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

So what question you pick determines a whole load of, a whole load of stuff. I can't just give you a bog standard answer because it just, it depends. I hate saying that, but it does. So I think, yeah, The first question is to ask the question, figure out what data is missing, and then choose the right piece to add into your logs. I feel like I've maybe not understood your question maybe.

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

So what question you pick determines a whole load of, a whole load of stuff. I can't just give you a bog standard answer because it just, it depends. I hate saying that, but it does. So I think, yeah, The first question is to ask the question, figure out what data is missing, and then choose the right piece to add into your logs. I feel like I've maybe not understood your question maybe.