Menu

Post image 1
Post image 2
1 / 2
0

Log every dependency version at startup. That's it. That's the post.

DEV Community·Matthew·24 days ago
#qw88LQ8D
Reading 0:00
15s threshold

I have one piece of advice that has paid for itself, in debugging hours saved, more times than I can count. When your service starts up, log the version of every external dependency you can identify. That's it. That's the whole tip. Database client version. HTTP client version. Major library versions. The runtime version. The OS kernel version, if you can get it. Whatever specific cloud SDK version is loaded. Print it all to your structured log under an application_startup event the first time the process boots. Why? Because every single time something works in staging and breaks in production, the very first question I want answered is "what is different about the running binary in those two environments?" And nine times out of ten, the answer is buried in a transitive dependency that resolved to a different version under different lockfiles, base images, or build environments.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More