Guance Learn

Observability questions

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

Illustration of software components, data, and application workflows
Explainer

Exclude directories and files from pytest collection

Use explicit ignore paths or directory patterns, and distinguish collection exclusions from deselecting already discovered tests.

Illustration of software components, data, and application workflows
Explainer

Fix ModuleNotFoundError when running pytest

Check the selected interpreter and missing module first, then make the project importable through installation or an intentional import-path configuration.

Python programming and application logging
Explainer

Sort a list of dictionaries by a field in Python

Sort records with a key function, combine multiple fields, choose missing-value behavior, and preserve stable ordering.

Python programming and application logging
Explainer

Sort a dictionary by keys or values in Python

Create sorted item lists or dictionaries, handle ties and mixed types, and distinguish insertion order from automatic sorted order.

Python programming and application logging
Explainer

Split a Python list into chunks

Use slicing or itertools.batched to process fixed-size groups, validate the chunk size, and distinguish chunk size from number of chunks.

Python programming and application logging
Explainer

Start a local HTTP file server with Python

Serve a directory for local testing with http.server, choose the bind address explicitly, and understand version-specific HTTPS support and exposure limits.

Illustration of scheduled jobs, logs and Linux operations
Explainer

Send cron job output to syslog on Ubuntu

Use logger for application output and rsyslog rules for scheduler events, while keeping the job’s exit status visible.

Log monitoring dashboard illustration
Explainer

Control Elasticsearch mappings before Logstash writes data

Define explicit mappings and index templates, distinguish template management from dynamic mapping, and handle unknown fields deliberately.

Illustration of software components, data, and application workflows
Explainer

Run one pytest file, test, or class

Select tests with paths and node IDs, use keyword expressions for broader matches, and inspect collected IDs before filtering parametrized cases.

Illustration of collecting, processing, and monitoring logs
Explainer

Truncate long message fields with a Fluent Bit Lua filter

Limit a Fluent Bit message field in bytes, preserve valid UTF-8 boundaries, and understand why filtered outputs cannot recover the original message.

Illustration of software components, data, and application workflows
Explainer

Upgrade installed Python packages with pip

Review outdated packages, upgrade a compatible set in an isolated environment, and use a reproducible rebuild instead of assuming a freeze file is a complete rollback.

Python programming and application logging
Explainer

Convert strings to uppercase or lowercase in Python

Use Python string case methods, choose casefold for Unicode-aware comparisons, and avoid surprising title-case and whitespace behavior.