-
Notifications
You must be signed in to change notification settings - Fork 168
declarative config: support Span stacktrace #2262
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
Conversation
|
🔧 The result from spotlessApply was committed to the PR branch. |
| public class StackTraceComponentProvider implements ComponentProvider<SpanProcessor> { | ||
| @Override | ||
| public String getName() { | ||
| return "experimental-stacktrace"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this has been discussed, but when using multi-word names, when should we use hyphens vs underscores? In cloudfoundry we use underscore, hyphen for xray lambda, underscore for Rule based routing sampler
Should we have some consistent convention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, should be underscores
|
@SylvainJuge please check again |
| public SpanProcessor create(DeclarativeConfigProperties config) { | ||
| return StackTraceAutoConfig.create( | ||
| new DeclarativeConfigPropertiesBridgeBuilder() | ||
| .addMapping(StackTraceAutoConfig.CONFIG_MIN_DURATION, "min_duration") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good to me and the comment below is not directly related to it.
When looking at this real life sample use of mappings I have an impression that it is easy to make a mistake in some cases. This is because order of adding mappings matters. If more strict mapping is added after more general, then it will never be executed, like
addMapping("aa.bb", "v1");
addMapping("aa.bb.cc", "v2");
What do you think about adding validation to DeclarativeConfigProperitesBridgeBuilder class to make sure that more specific mapping is always added earlier?
Instead of validation, we could sort the entries automatically in the builder by using TreeMap instead of LinkedHashMap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robsunday can you open an issue for this so we don't lose it?
Fixes #2028