Posts

Showing posts with the label Logging

Logging as an Anti-Pattern

Image
“ You can use logging for everything! ”  —  #CowboyDeveloper Well, technically speaking, the resident  #CowboyDeveloper  is correct, you  can  use logging for everything • Metrics : Print out your data, and cut/paste them from the terminal into Google Sheets. Voila! You can now generate all the charts you need from this data! ( I’m not joking. I know a dude that actually did this! ) • Alerting :  tail -f | grep  on your logs, and if anything  bad  happens, pipe it to sendmail. ( Yes. sendmail was a thing. Don’t ask ) • Monitoring :  tail -f | grep  on your logs across many, many terms. ( One for each server, times the number of things you are looking for ) • Debugging : You know the drill. Throw enough  print()  statements in there, and, with enough hair-pulling, you can figure out the problem. • Tracing : Uhhh, what’s that? ( And, once explained, “solved” by sticking unique IDs into each log statement. Again, don’...

The Joy Of Cryptic Log Messages

Image
“ *I* understand the log message, and that’s good enough. After all, I’m the only one that can fix it. ”  —  #CowboyDeveloper Here’s a thing that actually happened in my past (details of the story changed to protect the guilty parties) One of my developers, call her Alice, got assigned an issue (accompanied by a sinister laugh. I can vouch for this). She started analyzing it, and discovered — with sinking heart — that it was in a component built by one of the resident  #CowboyDevelopers  (•). What’s worse is that when she replicated the issue, the component crapped out a log message that kinda looked like  Heap count out of scope. So, the funny thing here is that the component actually doesn’t have any  Heaps  in it. And this wasn’t about the memory either — the log was being thrown by, essentially, the following if self.count == 19: return self else: print "Heap count out of scope" Anyhow, Alice eventually figured out that • This particular...

What Time Is It?

Image
You’re ingesting measures (not metrics.  Measures aren’t Metrics — know the difference !), and, clearly, you’re time-stamping stuff, right? Well, let’s think about that for a moment. What exactly  does  “time-stamping” mean? More to the point,  what exactly are you time-stamping ? Consider the following Creation Time : Theoretically, the time at which that data was created. Question is,  whose wall-clock are we looking at ? Unless this is a single monolith (and even there, you might be screwing up time measurements 😱), you’re looking at a distributed system, and, well, everything is relative at that point. (•) Ingestion Time : The time  you  received the data. Again, this is true for a given value of “you”, after all, “you” might be a distributed system too. Storage Time : The time when you actually stored the data that you ingested. And the reason you might care about this is because you might make, or have made, decisions based on data,...