-
Notifications
You must be signed in to change notification settings - Fork 289
Support a limit on the number of logs #46
Comments
Do you want this implemented exactly as opentracing does it? Second half of the logs used as a circular buffer? |
The MaxLogsPerSpan option limits the number of logs in a Span. Events are dropped as necessary; a log in the finished span indicates how many were dropped. fixes jaegertracing#46 Almost copy of opentracing/basictracer-go@723bb40 Signed-off-by: Sokolov Yura <funny.falcon@gmail.com>
@funny-falcon do you have a specific business reason to want this feature? |
Yes. We duplicate usual logging into tracing, and we have sometime very
long running spans that write informational message in a loop. Span log
records eat memory then.
While we found one of such places, we suppose there could be more. We want
just to not worry about.
|
Nice. Could you share which logging API you are using to fork logs into both stream and spans? Also, logs are usually written with log levels, so if you need to truncate them in the span it would make sense to do in the order of severity. Which makes me think that a plain maxLogs parameter is too crude of a mechanism, we probably need to use some strategy pattern and create some LogTruncator interface. |
We use custom logging library, therefore it were easy to integrate it with tracing: library has concept of exporters that could be added to logger with specified log level, and there were access to context.Context in a log record. Some considerations from our workflow:
Therefore suggested solutions will satisfy our needs completely. And I doubt complication will pay off. |
The MaxLogsPerSpan option limits the number of logs in a Span. Events are dropped as necessary; a log in the finished span indicates how many were dropped. fixes jaegertracing#46 Almost copy of opentracing/basictracer-go@723bb40 Signed-off-by: Sokolov Yura <funny.falcon@gmail.com>
The MaxLogsPerSpan option limits the number of logs in a Span. Events are dropped as necessary; a log in the finished span indicates how many were dropped. fixes #46 Almost copy of opentracing/basictracer-go@723bb40 Signed-off-by: Sokolov Yura <funny.falcon@gmail.com>
Cf. opentracing/basictracer-go#39
The text was updated successfully, but these errors were encountered: