Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: Sampling request logger #1135

Open
bt-justtrack opened this issue Jul 24, 2024 · 1 comment
Open

log: Sampling request logger #1135

bt-justtrack opened this issue Jul 24, 2024 · 1 comment
Labels
enhancement New feature or request refinement

Comments

@bt-justtrack
Copy link
Contributor

bt-justtrack commented Jul 24, 2024

We want / need a logger which can sample request log traces. The following requirements apply:

  • logs for failing requests are always emitted
  • logs for successful requests are sampled based on a configurable percentage
  • limit trace length such that we dont spend excessive resources on a single trace
@bt-justtrack bt-justtrack added enhancement New feature or request refinement labels Jul 24, 2024
@bt-justtrack
Copy link
Contributor Author

bt-justtrack commented Aug 14, 2024

This logger should work on a per service basis. Eg:
Service A processes successfully and samples the logs, hands over to Service B
Service B processing fails, emits logs.
Doing the sampling decision cross service is not the goal.
We want to pass a sampling decision inside of context based on a sampler that is run eg for httpserver on request receive.
This sampling decision can later be overridden based on eg a failure.
For eg the http server this can be implemented through a middleware injecting the sampling info into the context.
The logger can register a hook with the sampling span on first encounter of it and collect the log messages for that span.
Once the sampling middleware returns it can close the span and call the hook, which causes the logger to emit or drop the log statements.

This means we want to have as first argument the context.Context for all log statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refinement
Projects
None yet
Development

No branches or pull requests

1 participant