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: item-level spans #2047

Conversation

mateuszrzeszutek
Copy link
Member

Another part of spring batch instrumentation, last level of span hierarchy - item-level spans.
This time I couldn't use any listeners for instrumentation, so I'm instrumenting spring batch internal classes. And the item level instrumentation is very chatty, so perhaps it should stay an optional instrumentation even if spring batch ends up being enabled by default.

String stepName = chunkContext.getStepContext().getStepName();
Span span =
tracer
.spanBuilder("BatchJob " + jobName + "." + stepName + "." + itemOperationName)
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd definitely be nice to get some spec issues going for this batch processing stuff

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, definitely - I've filed a spec issue about that (now that my vacation is over I can start working on that 😄 ).

@trask
Copy link
Member

trask commented Jan 15, 2021

Thanks for calling this out:

the item level instrumentation is very chatty, so perhaps it should stay an optional instrumentation even if spring batch ends up being enabled by default

It sounds like otel.instrumentation.spring-batch.item.enabled should be false by default even now then?

@mateuszrzeszutek
Copy link
Member Author

It sounds like otel.instrumentation.spring-batch.item.enabled should be false by default even now then?

Yes, definitely -- done.

@mateuszrzeszutek
Copy link
Member Author

By the way I ran into an interesting issue with muzzle here: when item level instrumentation was disabled and type instrumentations were not added to the list, by default the byteBuddyjava task didn't see advice classes used by those instrumentations - and thus did not register helper classes. I've changed the way those instrumentations are disabled, and now every type instrumentation is always active, but the configuration switch is moved to the advice class.

@trask trask merged commit b78a38f into open-telemetry:master Jan 26, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the instrument-spring-batch-item-spans 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

4 participants