You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users might want to fully control the log message output of distributed traces. To allow for this, SpanLoggingRepresentation should be refactored to an interface (with the existing JSON and KEY_VALUE enums continuing as available options people can use). Then Tracer.completeAndLogSpan() should be refactored to delegate the log message to the interface so that users can fully define the log message and format themselves if desired.
One possible solution:
Rename SpanLoggingRepresentation into an interface named SpanLoggingStrategy.
The SpanLoggingStrategy interface should have a single method: SpanLoggingStrategy.logCompletedSpan(Span completedSpan, Logger loggerToUse, String infoTag).
Tracer.completeAndLogSpan() should delegate to whatever SpanLoggingStrategy is registered with it by replacing the loggerToUse.info(...) line with the new SpanLoggingStrategy method call.
Migrate the existing JSON and KEY_VALUESpanLoggingRepresentation enum values to a different enum named DefaultSpanLoggingStrategyOptions that implements SpanLoggingStrategy and results in the same log messages we see with the current code.
The text was updated successfully, but these errors were encountered:
Users might want to fully control the log message output of distributed traces. To allow for this,
SpanLoggingRepresentation
should be refactored to an interface (with the existingJSON
andKEY_VALUE
enums continuing as available options people can use). ThenTracer.completeAndLogSpan()
should be refactored to delegate the log message to the interface so that users can fully define the log message and format themselves if desired.One possible solution:
SpanLoggingRepresentation
into an interface namedSpanLoggingStrategy
.SpanLoggingStrategy
interface should have a single method:SpanLoggingStrategy.logCompletedSpan(Span completedSpan, Logger loggerToUse, String infoTag)
.Tracer.completeAndLogSpan()
should delegate to whateverSpanLoggingStrategy
is registered with it by replacing theloggerToUse.info(...)
line with the newSpanLoggingStrategy
method call.JSON
andKEY_VALUE
SpanLoggingRepresentation
enum values to a different enum namedDefaultSpanLoggingStrategyOptions
that implementsSpanLoggingStrategy
and results in the same log messages we see with the current code.The text was updated successfully, but these errors were encountered: