Skip to main content

add-structured-logging

Add stable, privacy-safe structured events that explain important application decisions and failures without flooding storage. Use when logs are free-form, production behavior is hard to trace, or a service needs searchable events before launch or incident response.

Informações da origem

Repositório
protosphinx/sphinxstack
Última atividade na origem
29 de julho de 2026 às 13:55
Idioma detectado do SKILL.md
inglês
Estrelas
3
Forks
0

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Explorador de arquivos
2 arquivos

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
add-structured-logging
category
code
description
Add stable, privacy-safe structured events that explain important application decisions and failures without flooding storage. Use when logs are free-form, production behavior is hard to trace, or a service needs searchable events before launch or incident response.
# add-structured-logging Log the decisions and state changes an operator must explain. Give events stable names and fields, connect work across boundaries, and verify that sensitive data stays out. ## Inputs - Name the user journey, operational questions, service owner, retention rules, and log destination. - Gather current logs, incident examples, data classification, and correlation mechanisms. - Identify cost, volume, and access constraints before adding events. ## Procedure 1. Write the questions the logs must answer, such as what failed, for whom, at which boundary, and after which change. 2. Inventory existing events and remove or consolidate lines that answer no operational question. 3. Define a small event schema: event name, timestamp, severity, service, version, environment, correlation id, outcome, and approved domain fields. 4. Establish naming, types, required fields, null handling, schema versioning, and ownership. 5. Add events at request acceptance, important decisions, external boundaries, state transitions, rejection, retry, and completion. 6. Keep exception type and safe diagnostic context while excluding credentials, tokens, message bodies, and unnecessary personal data. 7. Propagate one correlation identifier through requests, jobs, queues, and provider calls without using it as authorization. 8. Define sampling and rate limits for high-volume success events. Never sample away rare severe failures by default. 9. Test representative success, validation failure, dependency failure, retry, and cancellation paths. 10. Query the emitted events to reconstruct one journey and verify field types, redaction, retention, and access. 11. Measure event volume and cost, then publish the event dictionary and owner. ## Boundaries Never log passwords, secrets, authorization headers, full request bodies, payment data, or private user content by default. Do not increase severity to make dashboards look active. Treat logs as sensitive data with explicit access and deletion rules. ## Done - An event dictionary defines stable names, fields, types, severity, owner, retention, and redaction - Tests verify success and failure events, correlation, field shape, and absence of prohibited data - A diagnostic query reconstructs one real or safely simulated journey across boundaries - Volume and cost are measured, with sampling and rate limits checked against operational needs Then use design-observability to connect events to metrics, traces, alerts, and runbooks.
Ver no GitHub