Skip to content

Feat/tracer#21

Open
rafinharamos wants to merge 2 commits intomainfrom
feat/tracer
Open

Feat/tracer#21
rafinharamos wants to merge 2 commits intomainfrom
feat/tracer

Conversation

@rafinharamos
Copy link

Este pr tem como objetivo inserir id em cada requisição visando rastreamento e criar logs de request e response de forma modular

@rafinharamos rafinharamos self-assigned this Oct 3, 2025
extra = {
"tags": _logger_tags.get(),
"contexts": _logger_contexts.get(),
"trace_id": ensure_current_trace_id(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acredito que seja interessante o trace_id estar dentro de contexts, para que todos os handlers possam enviar contendo essa informação.

Não somente nos logs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Além disso, estar no core do Tracker, mas fazer de uma forma modularizada. Quem está implementando na biblioteca escolhe o que quer implementar.

@@ -0,0 +1,35 @@
import types
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vale mover os testes para onde o Tracker tem os testes.
Uma outra coisa, nesse projeto tem testes de mutação e uma cobertura 100% nos testes unitários

from __future__ import annotations
from typing import Any, Iterable, Optional

def attach_framework(app: Any, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eu penso que vale o desenvolvedor da aplicação definir do que tentarmos adivinhar.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mas é ele que define. Da uma olhada no Readme de implementação para cada framework

out[kl] = "***REDACTED***" if kl in self.redact_headers else str(v)
return out

self.logger.info("http_request",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acredito que essa parte não devesse estar aqui

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.

2 participants