Monitoring & Reporting Tools Flashcards
7 cards from real POC practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Monitoring & Reporting Tools flashcards as text
Which function in Python's `logging` module sets the root logger's level and adds a default `StreamHandler` if no handlers are configured?
Answer: logging.basicConfig()
`logging.basicConfig()` performs one-call setup of the root logger with optional level, format, and handler arguments.
In `pytest`, which command-line flag generates an XML report compatible with Jenkins and other CI tools?
Answer: --junitxml=report.xml
`--junitxml=` tells pytest to write a JUnit-format XML file that CI servers can parse.
Which `logging.Handler` subclass sends log records to a remote syslog server?
Answer: SysLogHandler
`logging.handlers.SysLogHandler` connects to a syslog daemon over UDP or TCP.
In OpenTelemetry for Python, what term describes a named unit of work used to represent a single operation within a distributed trace?
Answer: Span
A Span represents one named, timed operation within a trace and can be nested to form a trace tree.
Which Python library provides `Counter`, `Gauge`, `Histogram`, and `Summary` metric types out of the box for Prometheus integration?
Answer: prometheus_client
`prometheus_client` implements all four core Prometheus metric types and exposes them via an HTTP endpoint.
What is the purpose of a `logging.Filter` object attached to a handler?
Answer: To allow or block records based on custom criteria
A `Filter` provides fine-grained control by accepting or rejecting records before the handler emits them.
Which method would you call on a `prometheus_client.Counter` object to increment it by a custom amount?
Answer: .inc(n)
`Counter.inc(amount)` increments the counter by the given value (default 1); `observe()` is for Histograms/Summaries.