text stringlengths 0 2.35k |
|---|
**Mat Ryer:** Yeah, we had an interesting question in the Slack channel... Erik is back, and Erik says "What about logs and testing? Do you ever include assertions about should be logged out?" Have you ever done anything like that? |
**Jon Calhoun:** Jumping back to your previous question, can we say that when you're logging and testing them, maybe you should write `os.standard` there. I'm just kidding, but... Just split it up that way. We never did answer that question, if you wanna go back to it later. |
**Mat Ryer:** Oh, yeah. |
**Jon Calhoun:** But Ed, logging and testing. |
**Ed Welch:** I don't know, I mean... It happens from time to time. It always feels a little weird when you're validating a log line, I guess. I'm trying to think of an application where I've seen that done. Usually, it's in catching like an error message or something, like a sort of specific error you would catch, whi... |
**Mat Ryer:** Yeah, I've done it once where it mattered what was printed out from the program; it was very important. And so, this is -- Because I always do this little abstraction where I have a run method, and main only just calls out to a run method, and passes the dependencies in. And I include STDOUT and STDERR if... |
**Ed Welch:** It could be interesting if you have downstream processing under your log lines. It is interesting, because you build dependencies, and now you're logging - you're talking about it being kind of an API of your application, and... Maybe API is not the right term, but it's an interface that... |
**Mat Ryer:** It kind of is. |
**Ed Welch:** ...goes out to. So you could do testing on it to make sure you're not making breaking changes to the downstream systems. It's interesting if you find yourself in that world where you have those tight couplings. But if you're using JSON or even logfmt, you could have tests to make sure that certain values ... |
**Jon Calhoun:** It seems like it comes down to the point where if not having it there and it changing could break something, then you probably need to test it. |
**Mat Ryer:** Yeah, if it's part of your API... |
**Jon Calhoun:** But if it's not something that's gonna be broken and it's just gonna be like a visual difference, then you're probably okay getting by without it. |
**Mat Ryer:** Yeah, by the way - Jon, you won't believe this, but the little elves in the Slack channel have found the episode that Scott Mansfield talked about Go at Netflix on Go Time episode \#9. |
**Jon Calhoun:** Was it \#9? |
**Mat Ryer:** So if anyone wants to go back... |
**Jon Calhoun:** I swear there was one that I was in as well that got mentioned... So maybe it's been in multiple. |
**Mat Ryer:** It's possible. |
**Jon Calhoun:** I swear it was one of the episodes we did on metrics and things like that with a company that did metrics software... |
**Mat Ryer:** Yeah. |
**Jon Calhoun:** But I swear they had like a similar opinion, along the lines of like "If there's a log message, somebody should be getting paged right now." So it's just interesting to see the different approaches that people take to writing software. |
**Mat Ryer:** Yeah, and that's what I wonder also, is whether this sort of depends in each case. Anytime you have people with really strong opinions about tech, often they're working on something different. That's why I try to be -- you know, unpopular opinions loosely held. |
**Ed Welch:** \[51:49\] One area that I think could matter in that argument of metrics versus logs is that logs aren't events; they have a distinct timestamp that's very accurate. Metrics do not have that kind of accuracy, at least most of the time. You're sort of forced to do a roll-up, because that's the optimization... |
We were gonna talk a little bit more about Loki - I think the reason Loki exists is because of how ubiquitous logging and some of the problems are with it. We talk about the variety of formats that exist for logs. You know, do you pre-process or post-process those to try to make them useful? How do you catalog and stor... |
So when it comes to logging, that's the real question of "Where does it go?" You had that question in there, "Where did the logs go?" \[laughs\] It's a good question, because that's usually a disconnect between the person that writes code and the system and infrastructure that runs it. So it becomes a little bit more i... |
**Mat Ryer:** I can't imagine petabytes of logs... I mean, knip through and delete some log lines, surely. |
**Jon Calhoun:** I can't imagine how you'd use those at all. I feel like you just end up with so many -- either that, or you're like a crazy busy service, or something... And then it's like, we need to do something different. |
**Mat Ryer:** Or you use a technology that then works in some abstract way on that data. That must be the answer. I'm not gonna keep promoting Loki; other log platforms are available... |
**Ed Welch:** So the way you could approach that that would fit with Loki is -- what Loki does is a little different from other systems is the indexing model. So the idea is to index a relatively small -- we don't index the content of the logs themselves, we index metadata; think about where the logs come from, typical... |
You were gonna ask the question of like where would I go to find the logs... Maybe like a table of contents a little bit... You keep a relatively small index because an index in a database tends to be one of the more expensive operational pieces. So you keep a small index. So for that petabytes, you would chunk that up... |
So you use those labels to narrow down that result set. But one of the things that computing is generally really good at now is parallelism. Loki optimizes around object stores, so it's basically a strings database that's built against object stores, which also support parallelization really well, and take a lot of the... |
**Mat Ryer:** \[56:02\] Okay. I'm gonna have to return an error to you though, Ed... Too many mentions of Loki. |
**Ed Welch:** Done, and done. |
**Jon Calhoun:** I thought you were gonna tell him deadline exceeded. |
**Mat Ryer:** Yeah. Unfortunately, we're coming up to deadline exceeded is on the minute. But, there's still got time, so Ed, Jon, shut your faces, it's time for Unpopular Opinions. |
**Jingle:** \[56:19\] to \[56:35\] |
**Mat Ryer:** Okay, whooooo's gonna -- it's not Halloween, I don't know why I'm doing the spooky voice... Who's gonna start us off with an unpopular opinion today? I notice you've got six, Ed. |
**Ed Welch:** \[laughs\] I think it's funny, because I laugh every time I think about the goal is to have an opinion that people don't agree with. |
**Jon Calhoun:** So like if we had a KKK member, he would probably win. I hope he would win. |
**Mat Ryer:** Yeah, yeah. |
**Jon Calhoun:** Not in a good winning way. |
**Mat Ryer:** Yeah, but we don't have them on. |
**Jon Calhoun:** No. |
**Ed Welch:** Right. So I'll phrase this -- this is my favorite unpopular opinion. I'll phrase it in a way that's likely to be received as it's most unpopular, but it's a nuanced conversation. My experience is that integration testing is usually a net loss, and I would largely recommend not doing it. |
**Mat Ryer:** Oh, that is an interesting one. |
**Jon Calhoun:** I have such mixed feelings on integration tests... |
**Ed Welch:** I've definitely fixed and found bugs in integration tests. I've definitely caught significant bugs. However, the tremendous amount of anxiety and time that I spend and have spent looking at CI builds running for minutes or tens of minutes or more, combined with just the propensity for integration tests to... |
**Mat Ryer:** Hm. Interesting one. |
**Jon Calhoun:** See, I agree with you fully about the fact that integration tests or tests that cover more scope -- like, integration or larger is how I'd put it in scope, tend to be the ones in applications that I've worked on that just break and then nobody has time to fix them, for some reason, and then you just co... |
**Ed Welch:** Yeah. |
**Jon Calhoun:** But I could see value in not being a hard requirement whereas a lot of times unit tests - it's very clear, this should be passing; if it's not, something's broken or the test needs fixed. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.