0. Intro đ
It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of light, it was the season of darkness, it was the spring of hope, it was the winter of despair.
â Charles Dickens, A Tale of Two Cities
Check those avid aficionados above on the craggy ocean shoreâthis just might be the place where Kool and the Gang used to hang outâand see how they go about the time-honored pastime of spotting microservices, complete with a tripod-mounted camera, positively trained in a promising direction. Oh my, some of our aficionados can be seen excitedly pointing toward a fine (microservice) specimen that theyâve just spotted, amirite?
Hold up a sec!
Lest we get ahead of ourselves, letâs backtrack and pick things right up from where we left them (in Part 1 of this two-part series) when, among other pointsâincluding (1) the wisdom of âsmart endpoints and dumb pipesâ, and (2) the âadvisability of instrumenting your microservices before putting them in production,â and so onâwe had made a play by bidding farewell to your once-glorious monolithic applications, even as we cruised through the startlingly newfangled, (microservices) observability landscape.
Hence the Dickens quote above, which, in turn, warrants a deeper look into the ins and outs of the âGoodbye, Monolith, and Hello Whodunitâ notion, if you recall the hilariousâthough altogether trueâobservation that âboringâ got replaced by the âmysterious,â because
We replaced our monolith with micro services so that every outage could be more like a murder mystery.
@honest_update (on Twitter â Oct 7, 2015)
Do we have too much of a good thing on our hands here?
I say we sally forth and find exactly that out.
The alert readerâthatâs you, of courseâwill have noted Charles Dickens make another marquee appearance on our blog, twice in a row most recently, in the previous essay with his much-maligned âFog everywhereâŠâ quote (from his direly-named novel Bleak House) and in this essay with his much-beloved âIt was the best of timesâŠâ quote (from his noble novel named A Tale of Two Cities.)
1. We Emerge From The Mists Of Fog đł
A person with a new idea is a crank until the idea succeeds.
â Mark Twain
If the novelty of a tech idea be an indicator ofâin the sense of being inversely proportional toâthe adoption of that idea, I say we consider the following proposition: Ideas lose their novelty; some sooner, others after a while. And the notion of observability (as applied to microservices) falls squarely in the second camp. Put another way, while microservices themselves are mainstream, observing them isnât. At least, not yet.
But to emerge from the potentially protracted fog of less-than-optimally managing microservicesâclearly, nobody wants to be in that spot, with or without the headlights onâwe clearly need to think outside the box instead of remaining reflexively hemmed-in, amirite?
Oh, and as we concluded last time (in Part 1), tend to their instrumentation (i.e. add spans, tag, and all, to your marvelous microservices), and youâll have a decent chance of keeping tabs on what theyâre up to at any given time during their whizzbang happenings.
So yes, ditching that monolith made all the sense, but remember, too, to capitalize on making your software system observable. Do so and youâll reap the rewards in spades.
With that, letâs haul in the catch, mate?
2. Did We Cast Our Net Too Wide? đ
Success is a science; if you have the conditions, you get the result.
â Oscar Wilde
Oh my, perhaps we shouldâve kept our feet planted on the ground and not sidestepped extravagance. See that humongous net above? Yeah, the better part of reasonâhad it prevailed, that isâwould surely have had us instead proceed with more focus and a smaller scope.
All is not lost, though. We learn from our mistakes, we all do; some of us, motivated by the impulse to memorialize, go one step further and commit our foibles, in the spirit of full disclosure. But I digress.
Refocusing, letâs just say that our current dilemma is no exception: Go for the low-hanging fruits first, and only then widen your net to catch bigger fish.
Lest this sound too abstract, allow me to bring it down to earth, because a fishy story this is not: Instrument away (the code that powers your microservices) at the highest levelâthink public-facing APIsâand youâll get the biggest bang for the buck.
And even though the inimitable Wilde was likely not thinking microservices when he had opined as aboveââSuccess is a science; if you have the conditions, you get the resultââthe same principle is hard at work here.
And with that, we continue here in Part 2 what we had begun last time, in Part 1: You can expect to see, overlaid on the accompanying pictures, a layer of one or the other, the frolicking rain drops or those tiny, endearing bricks. (Oh, the trouble yours truly goes to in order to keep you inspired, this time with the metaphor of rain drops and bricks, to better symbolize the fine-grained nature of the crittersâmicroservicesâthat we got on our hands.)
3. Goodbye Spaghetti Code, Hello Whodunit đŠ
Memory is deceptive because it is colored by todayâs events.
â Albert Einstein
Anyone remember a harangue or two about âspaghetti codeâ? I do, at least from some readings I did of admittedly lesser recency.
But hey, Einstein sure got this one, too, exactly right (âMemory is deceptive because it is colored by todayâs eventsâ) yet again in that it wasnât too long ago that microservicesâalbeit in a more primitive formâwere all the rage of our industry under the banner of the SOA (Service-Oriented Architecture) buzzword. (Buzz-phrase, I reckon: These buzzwords, and others, become eventually consistent; thatâs my theory, anyway.)
What Iâm getting at is this: Powers of memory notwithstanding, shifts in industry signifyâor at least they shouldâshifts in our operating stance. Put another way, if âspaghetti codeâ was at least easily observable (though definitely not pretty to work with, or even to look at), distributed code is pretty to work with (but hard to observe!)
So if we donât want to have an unending series of whodunits on our hands, it behooves us toâyou guessed it!âmake our distributed code ever more observable. Weâll all sleep better at night.
Trust me on this one.
Onward.
4. Tech Gridlocks (And How To Extricate) đ§
When our vices leave us, we like to imagine it is we who are leaving them.
â Francois de La Rochefoucauld
I donât know about you, but Iâd rather not be in the driving seatâor the passenger seat, for that matterâof the bright-red car above, mirthlessly gridlocked as it is in a flock of spunky sheep who have clearly declared strong intentions of meandering in totally random directions and as they see fit; nothing sheepish there about their designs on driving cars.
Me, I prefer the linear route: Start at departure point âAâ, arrive at point âB.â Sheep, not so much. Result: Gridlock.
âAkram, can you, like, stop speaking in parables?â, I hear someone as they sound a polite note or two of civilized demurral.
Sigh. (I pursueâand loveâtech stuff all day long, for crying out loud. Canât I so much as slip in a metaphor or two, and that too edgewise, on the rare occasion? Heh.)
So I was going to say: Pay special attention to structuring your application with observability in mindâremember, weâre in observability centralâand while the (unique) twists and turns of your own journey will invariably unfold and run their course, at least youâll be far likelier to get to your destination âlinearly.â
Next, you might ask: What do you mean, âlinearly?â
I could say, letâs start with âlinearizable.â
Then there would be trouble; and thatâs stuff I donât want. So yeah, weâre not going there; at least not this time.
Onward.
5. Running Like Clockwork, Eh â©
Time destroys the speculation of men, but it confirms nature.
â Cicero
I love trains. And donât anyone get me started on the fabulous Island of Sodor, an island where trains ruledâŠ
But that image of slick trains above caught my attention. In turn, I wished to share it to better portray the clockwork rhythms of machinesâmechanical or digitalârunning smoothly.
Talk of NTP notwithstandingâthose time-synchronization undertakings sure can at times turn into the stuff of nightmaresâthis stuff (i.e. making microservices run like clockwork) can be cajoled into tractability. They can be mastered into submission; not a walk in the park by any means, but doable.
We humans are visual creatures, which begs the question: âWhy arenât we making the management of microservices (far) more visual?â
Put another way, letâs assume that youâve done the legwork of putting in those crucial âspansâ in your codeâaka youâve instrumented the glorious code that powers your marvelous microservices. Once you got that, itâs off to the observability races, amirite?
Youâre off the hook, yay?!
Not so fast, pal. Thereâs still that soulful matter of some additional automation. But hey, Rome wasnât built in a day, was it?
Heh, letâs just say that Cicero nailed it on the head in observing that âTime destroys the speculation of men, but it confirms nature.â So yeah, which shall it be: Our speculations on the one hand, or the juggernaut-like heft of nature (think here to the laws of Physics here) on the other?
6. Peering Up The Complexity Tower đ
Joy in looking and comprehending is natureâs most beautiful gift.
â Albert Einstein
Itâs getting closer to parting time, and we havenât even brought in a tower or two or three. (No, not that, you computer science aficionado, you: Itâs not the Towers of Hanoiâthe toy of choice for a countably infinite generations of budding computer scientists grappling with the concept of recursion for the first timeâthat we have in mind here.)
Itâs the good oldâor bad old, depending on your perspectiveâtower of complexity that weâre after. And why a tower? Why not a high rise, or, for that matter, why not a pyramid? Darn. (I sense a punitive tinge in thine tone.)
Before anyone makes me feel sorry for having quoted Einstein aboveââJoy in looking and comprehending is natureâs most beautiful giftââallow me to set matters straight: Complexity will smolder and rage, eventually blazing out of control, if not smothered while itâs merely kindling. Or, we gotta nip it in the bud, at its foundation, should you prefer the metaphor of structures.
Lest I tire you with this revel in metaphorsâme, I never metaphor I didnât likeâthink of it this way: A software application (or a system) is useful only insofar as it remains tractable, one that we can reason through with confidence. The moment your application starts to slip on the cloak of opaqueness, operationally speakingâbye bye, observability of application behaviorâchances are that trouble is brewing.
Slay complexityâand it comes in many guisesâand you emerge victorious, having, but of course, gloriously parted the fog of confusion while you were at it, amirite?
7. But Do We Have Telemetry? đ°
In the case of news, we should always wait for the sacrament of confirmation.
â Voltaire
Check that shiny observatory above, that of course after wiping away those water-drops, to witness it the better, and in all its glory. (Surely you remember our running metaphor of rain drops and bricks to symbolize the fine-grained nature of the crittersâmicroservicesâthat weâre finessing?)
With that, I urge you to mark the words of Voltaire, who happened to be a really smart dude from yesteryear: âIn the case of news, we should always wait for the sacrament of confirmation.â
Telemetry is what happens, IMHO, when you got a channelâunidirectional or bidirectional or whateverâover which data is being streamed. Once you get the data on your end, this being Voltaireâs vaunted âsacrament of confirmation,â we make hay while the sun shines, so to say.
And exactly how do we know weâve been made privy to that oh-so-gravitas-smacking âsacrament of confirmationâ?
Enter, one more time, the powers of visualizing your splendid software system in actionâthat, too, in real-timeâfellow observability aficionados.
We got this.
8. Keep Those Container-laden Ships Chugging Along đș
We must cultivate our own garden. When man was put in the garden of Eden he was put there so that he should work, which proves that man was not born to rest.
â Voltaire
Goodness, this Voltaire guy is oh-so quotable; for one thing, he sure has the right metaphors when it comes to making microservices observable! Bro, thatâs for sure: âManââand woman, Iâm sure he meant to say, hehââwas not born to rest.â
I mean, ask the poor sysadmin whoâs up at 2:00 AM, feverishly deploying a fistful of rapidly-assembled bash scripts to prevent a cascading meltdown of the software system, all because some service downstream was being recalcitrant, being stubbornly unresponsiveness. Sigh. You get the picture, right?
(And just between you and me: That hapless sysadmin will have a thing or two to tell you about toil. Chaos engineering, anyone? But I digress. Wow, I havenât done that in a while, have I?)
In the end, do your bit to keep those âcontainerizedââgiven the prevalence of a certain containerization tech, âDockerizedââmicroservices well-orchestrated and observable. Kubernetes will help with the former; and OpenTracing with the former.Â
All right then, this is where we part ways, for now anyway, our journey drawing to a close.
So come visit us again. Soon.
Meanwhile, please do your part and stay safe; you and I, weâll all be glad we did the right thing during the global pandemic.
Meanwhile, farewell, and be well.