Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Added Configuration.WithExpandExceptionLogs #72

Closed
wants to merge 2 commits into from

Conversation

Falco20019
Copy link
Collaborator

Right now, when using Configuration, it's not possible to call WithExpandExceptionLogs() on the TraceBuilder without using GetTracerBuilder() and Build it directly instead of using GetTracer(). It seems, that this is nearly the only flag that can not be set by environment.

I assume this should be discussed and proposed in the meta repo? But I first wanted to hear if @cwe1ss or @yurishkuro already have an opionion on that.

@yurishkuro
Copy link
Member

is there a situation where we'd want to not capture the stacktrace? Maybe it should be the default behavior without requiring additional configuration.

@Falco20019
Copy link
Collaborator Author

I assume this is mostly a compromise between having redundant data to search tags or only have all the information not searchable in error.object

How is this handled in Java?

@yurishkuro
Copy link
Member

we don't have a well defined process for this at the moment in any client library. I was not thinking of making the stack traces searchable, but just to capture the stacktrace fully. Other tracing formats (e.g. x-ray and census) have a well defined structure in the span for capturing exceptions. We may want to extend the upcoming protobuf format with that as well.

@Falco20019
Copy link
Collaborator Author

@yurishkuro Just checked the java implementation and it's the same there. Default seems to be using error.object and copy the full exception/throwable and if WithExpandExceptionLogs() is called on the Tracer.Builder, it's decomposed into error.kind, message and stack. The stack is never decomposed any further, but I think that's fine for now.

So even in Java, it's currently not possible to set WithExpandExceptionLogs directly on Configuration without having to get the Tracer.Builder and call it on that instead of getting the Tracer directly from Configuration.

@Falco20019
Copy link
Collaborator Author

Maybe we could add this to v0.2.0 since we are already want to make changes to Configuration.

@Falco20019 Falco20019 requested a review from cwe1ss June 21, 2018 11:25
@Falco20019 Falco20019 added this to the v0.2.0 milestone Jul 19, 2018
@Falco20019
Copy link
Collaborator Author

@yurishkuro This is the only configuration flag right now that is not settable through environment. We added JAEGER_TRACEID_128BIT yesterday, so maybe we could also add JAEGER_EXPAND_EXCEPTION_LOGS. At least Java also has the WithExpandExceptionLogs so it's not just a C# feature. As written above, default behaviour is to not expand to reduce redundant logs for the costs of it being harder filterable. Maybe also relates to jaegertracing/documentation#105

@yurishkuro
Copy link
Member

what would be a situation when someone would not want to expand exceptions this way?

@Falco20019
Copy link
Collaborator Author

Already part of the Tracer.Builder API. So both ways are supported then

@yurishkuro
Copy link
Member

I realize that, my question is on the broader scope of this being a standard env var across languages, do we have enough justification for this behavior to be configurable rather than "always expand"?

@Falco20019
Copy link
Collaborator Author

Falco20019 commented Jul 19, 2018

I assume it’s a legitimate decision to choose between non-redundant storage (not expanded) and searchability (expanded) and a decision the developer has to make. Searchability may also be limited even with expanded enabled since stack traces are usually language specific. So the only benefit would be the unified error.message

@yurishkuro
Copy link
Member

If you look at opencensus (and probably x-ray) span data models, they have explicit data structure for exceptions and the stack trace.

I assume it’s a legitimate decision to choose between non-redundant storage (not expanded) and searchability (expanded)

Is it fair to rephrase this as a trade-off between expressiveness of the captured data and overhead of collecting & storing it (I'd argue mainly collecting since it's a client library). In this case, what concerns me with an explicit option for just a single aspect that affects this trade-off is where it ends. For example, I remember Lightstep tracer has an option on the max number of logs to keep in a span. Does the user actually care? If the only concern here is the performance trade-off, as a user I might simply want a single knob that I can turn from 0 to 1 for min overhead to max expressiveness. In other words, the user defines a certain overhead threshold, and it's up to the tracer to decide how it achieves that. Maybe one span has 100 logs and so there's no space for the stacktrace, while the other has a single log and a stracktrace would be perfectly fine to capture.

@Falco20019
Copy link
Collaborator Author

@yurishkuro Is this already solved in any of the other libraries?

@Falco20019 Falco20019 modified the milestones: v0.2.0, v0.3.0 Aug 14, 2018
@yurishkuro
Copy link
Member

Is this already solved in any of the other libraries?

no

@Falco20019 Falco20019 force-pushed the Falco20019/configuration-expand-exceptions branch from 8b96586 to 08cc444 Compare October 4, 2018 16:51
@Falco20019
Copy link
Collaborator Author

Falco20019 commented Oct 4, 2018

I will keep that for now that way since we should at least have the full API configurable. But I would add the discussion above into a separate issue for the future. I think you have a point that the user should not have to care about low-level flags but about behaviour. This will need some adjustments to the Tracer and maybe some other classes, which is definetly not the focus of this Configuration enhancement.

@cwe1ss @grounded042 Would be good if someone could have a look over it.

@@ -272,6 +284,12 @@ public Configuration WithTracerTags(Dictionary<string, string> tracerTags)
return this;
}

public Configuration WithExpandExceptionLogs(bool expandExceptionLogs=true)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if we should do it using the default value. The idea was to keep it similar to Tracer.Builder.WithExpandExceptionLogs(), but also have it resettable.

@Falco20019 Falco20019 modified the milestones: v0.3.0, v0.4.0 Mar 1, 2019
@Falco20019 Falco20019 modified the milestones: v0.4.0, 0.5.0 Jun 23, 2020
@@ -101,6 +101,11 @@ public class Configuration
/// </summary>
public const string JaegerTraceId128Bit = JaegerPrefix + "TRACEID_128BIT";

/// <summary>
/// Whether the tracer should expand exception logs.
Copy link
Member

Choose a reason for hiding this comment

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

Could use a better description, it's not clear to me what this actually does.

@Falco20019 Falco20019 removed this from the v1.1.0 milestone Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants