Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tmj-90/gaffer --skill structured-logging-and-tracinggit clone --depth 1 https://github.com/tmj-90/gafferWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tmj-90/gaffer/structured-logging-and-tracing)<a href="https://agentmods.dev/skills/tmj-90/gaffer/structured-logging-and-tracing"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/structured-logging-and-tracing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tmj-90/gaffer/structured-logging-and-tracing"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/structured-logging-and-tracing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00101 | $0.01439 |
| Opus 5.5 | $0.00040 | $0.00576 |
| Sonnet 5.5 | $0.00020 | $0.00288 |
| Haiku 4.5 | $0.00010 | $0.00144 |
Grade A, and why
structured-logging-and-tracing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Instrument code with structured logs, metrics and traces
Observability is designed where the code knows what happened. Emit events a machine can filter and a human can read, carry one trace context through every hop, measure the few things an alert needs, and never write a secret or a person's data into a log that lives for ninety days. Sources: W3C Trace Context (Recommendation); OpenTelemetry semantic conventions (HTTP spans and metrics, log data model); OWASP Logging Cheat Sheet; Google SRE book ch. 6 (four golden signals).
Steps
- Use the repo's instrumentation. Find the structured logger, metrics client,
tracing SDK (OpenTelemetry if present) and the correlation convention. Call
search_lorefor standard field names (request_id,ticket,duration_ms). A second logger or tracer is a defect. - Log events, not sentences. One record per meaningful event: stable event name
plus typed fields, e.g.
{"event":"claim.released","ticket":42,"reason":"ttl_expired"}, not"released ticket " + n. Units in field names (duration_ms,size_bytes). The logger's serialiser escapes values, which also stops log injection (CR/LF in user input forging lines); never build log lines by concatenation. - Choose levels deliberately.
error: a failure someone must act on.warn: degraded but handled.info: state transitions an operator follows.debug: the rest. A swallowed exception is logged with its error class and cause, never atdebugonly. - Propagate trace context across every hop. Accept and emit W3C
traceparent(00-<32 hex trace-id>-<16 hex span-id>-<flags>) andtracestateon HTTP; put the same fields in queue message headers and job payloads, and pass them to spawned processes (env or argument). Stamptrace_idandspan_idon every log record in that unit of work (OTel log correlation). If the repo also has arequest_id, carry both. Do not put secrets or personal data inbaggage; it travels to third parties. - Add spans at slow or flaky boundaries — inbound requests, outbound HTTP, DB
queries, queue publish/consume, subprocesses — using the SDK's auto-instrumentation
where it exists. Follow semantic conventions: HTTP span name
{method} {route}(GET /tickets/{id}, never the raw URL with ids), attributeshttp.request.method,http.route,http.response.status_code,server.address,error.type. Status: server spans mark5xxas Error and leave4xxunset; client spans mark both4xxand5xxas Error. Record the exception on the span; never attach payloads. - Measure what an alert would use. The golden signals for the operation: a
duration histogram (OTel:
http.server.request.duration, seconds), a counter of outcomes by result, and saturation gauges (queue depth, pool in-use). Metric labels are low-cardinality (route template, status class, kind); user ids, ticket numbers, URLs and error messages go on spans or logs, never labels. Alert design: theobservability-designerskill. - Log the security-relevant events (OWASP): authentication success and failure, authorisation denials, input-validation failures at trust boundaries, admin and permission changes, with who, what, when, from where and outcome.
- Redact by construction. Never log passwords, tokens, session ids, API keys,
Authorization/Cookieheaders, full request or response bodies, or personal data beyond need. Allow-list emitted fields or use the repo's redaction helper; hash an identifier if correlation is needed (thedata-privacyskill).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 16d ago Changed · +30 lines e9580845826e
- 19d ago First seen · 64 lines · 101 tokens per session scan A af78e0eea290
structured-logging-and-tracing is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 101 tokens to every session and 1,439 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.
Other skills, from other repositories
issue-debugging
Systematic methodology for issue debugging including root cause analysis, impact mapping, tiered validation plans, and confidence assessment. Use when analyzing bugs, fixing issues, or validating fixes.
fix-bug
Run the Fix Validation pipeline to investigate, fix, and validate a bug. Ensures deterministic pipeline execution with IssueAnalyzer, FixWriter, TestWriter (conditional), TestAudit (conditional), and FixValidator stages.
pact-bug
Log a bug investigation using PACT's structured bug tracker.
browser-edge-cases
SOP for debugging browser automation failures on complex websites. Use when browser tools fail on specific sites like LinkedIn, Twitter/X, SPAs, or sites with Shadow DOM.
triage-issue
Analyze a GitHub issue, verify claims against the codebase, and close invalid issues with a technical response.
hive.error-recovery
Follow a structured recovery decision tree when tool calls fail instead of blindly retrying or giving up.