Guance Learn

Observability questions

Focused answers for definitions, architecture choices, troubleshooting, pricing, and evaluation.

Illustration of software components, data, and application workflows
Technical guide

Find slow tests with pytest durations

Measure setup, call, and teardown separately, then improve the expensive work without weakening isolation or confusing parallel throughput with individual latency.

Python programming and application logging
Explainer

Profile a Python script with cProfile

Find expensive functions with cProfile, sort saved statistics with pstats, and choose line profiling or timeit for more focused analysis.

Illustration of Git branches and version history
Technical guide

Force-push a Git branch with an explicit lease

Publish rewritten history with a scoped force-with-lease check, inspect the expected remote tip, and understand what a lease does not protect.

Illustration of Git branches and version history
Technical guide

Clean up stale Git remote-tracking branches

Prune obsolete remote-tracking refs, inspect local branches whose upstream is gone, and delete only history you have verified is no longer needed.

Place a Matplotlib legend outside the plot
Technical guide

Place a Matplotlib legend outside the plot

Position a legend to the right or below a plot with bbox_to_anchor, and prevent clipping when displaying or saving the figure.

Python programming and application logging
Explainer

Raise and re-raise exceptions in Python

Choose appropriate Python exception types, preserve causes with raise from, and re-raise failures without relying on assertions for input validation.

Illustration of an event loop and asynchronous tasks
Technical guide

Read environment variables in Node.js

Load and validate environment variables, use .env files deliberately, and keep credentials out of logs and browser bundles.

Illustration of files, modules, and their dependencies
Technical guide

Read a package version from Node.js code

Read your package metadata with CommonJS or ESM, account for deployment paths, and inject the version at build time when appropriate.

Illustration of Git branches and version history
Technical guide

Rebase a local branch onto the latest remote main

Fetch the target branch, replay your feature commits, resolve conflicts, and publish rewritten history with an explicit understanding of the remote state.

Illustration of Git branches and version history
Technical guide

Bring detached HEAD work back onto a Git branch

Save detached commits with a branch, integrate them into the intended target, and distinguish committed recovery from uncommitted work.

Illustration of a Linux server and log data
Explainer

Send a Postfix domain catch-all to one mailbox

Use a domain-scoped virtual alias map, keep the destination outside the catch-all, and verify routing without creating loops or unintended forwarding.

Illustration of server operations and request logs
Explainer

Redirect one domain to another with Nginx

Preserve paths and query strings in a domain redirect, rewrite changed paths, and retain valid TLS on the old hostname.