Skip to content
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

Instrument spring batch chunk #1850

Merged

Conversation

mateuszrzeszutek
Copy link
Member

@mateuszrzeszutek mateuszrzeszutek commented Dec 8, 2020

Continuation of #1843, #1852

@mateuszrzeszutek mateuszrzeszutek force-pushed the instrument-spring-batch-chunk branch 6 times, most recently from 45c007f to 01125de Compare December 15, 2020 12:10
@mateuszrzeszutek mateuszrzeszutek force-pushed the instrument-spring-batch-chunk branch 5 times, most recently from ba12145 to 5585abe Compare December 16, 2020 11:33
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Just small comment but ok either way

String stepName = chunkContext.getStepContext().getStepName();
SpanBuilder spanBuilder =
tracer.spanBuilder("BatchJob " + jobName + "." + stepName + ".Chunk").setSpanKind(INTERNAL);
if (shouldCreateRootSpanForChunk()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the use case for this flag by the way? It seems like it'd be nice if we can decide one or the other is better and stick with it

Copy link
Member Author

Choose a reason for hiding this comment

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

That one's controversial, I know - Spring Batch jobs can get veeery large, like millions of spans in a trace. We are still in the middle of experimenting with how to treat traces like these, one option was to split them into many smaller traces. Personally, I don't think that having a separate trace for each chunk makes sense from a semantic perspective (since it's still a single job execution), but I added this here just to be able to experiment with this. It's highly probable that it'll get removed in one of the future PRs.

@iNikem iNikem merged commit 5ef9158 into open-telemetry:master Dec 18, 2020
@mateuszrzeszutek mateuszrzeszutek deleted the instrument-spring-batch-chunk branch February 5, 2021 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants