Skip to content

QFw: let the logs tier carry the client's story lines - #136

Merged
DougSO merged 1 commit into
mainfrom
telemetry-logs-client
Oct 10, 2026
Merged

DougSO merged 1 commit into
mainfrom
telemetry-logs-client

Conversation

@DougSO

@DougSO DougSO commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

What

The QFw Trace page's "Log lines of this job" panel showed only the QPM's half of a job's story. The client's two lines (submitted job ..., job ... completed after ...) never left the client process.

Why

A record is dropped at its logger when it is below the logger's effective level, before any handler sees it, and a logger with no level of its own takes the root's. A DEFw service opens its root logger, a Qiskit client out of the box has it at Python's default WARNING, and the story lines are debug.

How

  • The logs tier opens QFw's own qfw namespace to its level when the root logger would not, re-asserts it from logs_enabled() (a later DEFw level change can raise the root again), and restores the namespace's level on shutdown.
  • Nothing else changes: every other logger still answers to the root logger's level, so turning the tier on does not start exporting a library's debug output from a client.
  • Two unit tests: a quiet root (the client line is exported, other loggers stay local, the root is untouched, the namespace is restored) and an open root (the namespace is left alone). The mock fixture no longer opens the root logger, so tests/mock/test_instrumentation.py exercises the path a real client takes.
  • One sentence in docs/design/benchmarking.md.

Checks

ci-syntax clean; tests/test_qfw_telemetry.py 19 passed; tests/mock/test_instrumentation.py 8 passed. A live check on the cluster (client lines under the trace in Grafana) follows in a comment.

A record is dropped at its logger when it sits below the logger's
effective level, before any handler sees it, and a logger with no level
of its own takes the root's. A DEFw service opens its root logger, so
the QPM's lines left; a Qiskit client out of the box has the root at
Python's default, WARNING, and the story lines are debug, so the
client's two lines (submitted, completed) never reached the tier's
handler and a trace's log panel showed only the QPM's half.

The tier now opens QFw's own "qfw" namespace to its level when the
root logger would not, keeps it open from logs_enabled() (a DEFw level
change can raise the root above the tier again), and gives the
namespace its level back on shutdown. Everything else in the process
still answers to the root logger's level, so no library's debug output
starts leaving a client because the tier is on.

The mock fixture no longer opens the root logger for the story lines,
so the suite exercises the quiet-root path a real client has.

Signed-off-by: Doug Oucharek <dougso@me.com>
@DougSO

DougSO commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Live check on the reference cluster: the telemetry install rebuilt from this branch, 30 site-mode fake-IQM jobs (qfw_job_stream.sh --service-mode site --backend fake-iqm --jobs 30) with QFW_TELEMETRY_LOGS=debug, the client a plain srun Python process with nothing configuring its logging.

In Loki, this run
qfw-client lines 60, all stitched to a trace (2 per job: submitted, completed)
qfw-qpm lines 332, 238 stitched
Traces with both halves 30 of 30
Client lines other than the story 0 (the root logger's WARNING still gates everything else)
DEFw internals at debug 0

One trace (afac6eba93b241b0859cbd8d8f59cea2) on the QFw Trace page now reads: client submitted job ..., QPM received circuit ..., executing circuit ... on fake-iqm-20q via simulator, circuit ... completed ... after 1.2 ms, the QPM's run-path debug lines, then client job ... completed after 41.8 ms.

@DougSO
DougSO merged commit f2c8e93 into main Oct 10, 2026
6 checks passed
@DougSO
DougSO deleted the telemetry-logs-client branch October 10, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant