Skip to content

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Sep 15, 2025

Fixes #2028

@otelbot-java-contrib
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@zeitlinger zeitlinger mentioned this pull request Sep 15, 2025
@zeitlinger zeitlinger added this to the v1.49.0 milestone Sep 15, 2025
public class StackTraceComponentProvider implements ComponentProvider<SpanProcessor> {
@Override
public String getName() {
return "experimental-stacktrace";
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, should be underscores

@zeitlinger zeitlinger moved this to Awaiting Review in Declarative Configuration: Java Sep 18, 2025
@zeitlinger
Copy link
Member Author

@SylvainJuge please check again

public SpanProcessor create(DeclarativeConfigProperties config) {
return StackTraceAutoConfig.create(
new DeclarativeConfigPropertiesBridgeBuilder()
.addMapping(StackTraceAutoConfig.CONFIG_MIN_DURATION, "min_duration")
Copy link
Contributor

@robsunday robsunday Sep 22, 2025

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.

Copy link
Member

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?

@trask trask added this pull request to the merge queue Sep 22, 2025
Merged via the queue into open-telemetry:main with commit a6941c1 Sep 22, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Declarative Configuration: Java Sep 22, 2025
@zeitlinger zeitlinger deleted the span-stacktrace branch September 23, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

declarative config: span stacktrace

5 participants