-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Enhancement request] micrometer observability for the new StructuredTaskScope api #5761
Comments
Structured Concurrency is still a Preview Feature, even in the upcoming JDK 24 - see JEP 499.
As its name implies,
I wonder if this enhancement request belongs in the Micrometer repo at all. I suppose if we want to instrument all forks in a scope (I'm not sure we would want that - it may be better that users decide specifically what they want instrumented), there may be something to do here. But probably figuring out context propagation is also needed regardless. |
Thank you, @shakuzen, for the clear writing. You are correct the feature is still in preview even for JDK 24 which is around the corner. Would it be possible to leave this enhancement request open and gather some more discussions here about the integration between StructureRaskScope and micrometer while the feature is getting finalized? |
Yes, I think we'd like to hear more feedback about what instrumentation users like yourself would like to see. Maybe if you can give some sample code and explain which parts you want instrumented and how (feel free to propose some API that could exist in the future). |
Shouldn't you start the parent observation, put it in scope and wrap the runnables for both tasks? sth like this?
|
Please describe the feature request.
As of today, following the doc: https://docs.micrometer.io/micrometer/reference/observation/instrumenting.html#instrumentation_of_thread_switching_components
We can find an example with
(small side requests here, would it be possible to enhance this current example with
a - virtual thread
b - the autoclosable try with resource
c - wrap is deprecated, but there is no mention of what should be the replacement
)
However, the doc seems to be missing, as well as the
ContextExecutorService.wrap
api seems to be missing support for the newStructuredTaskScope<>
api.Rationale
As shown in many official Java / Oracle videos and official documentation (here is one for example)
https://www.youtube.com/watch?v=zPhkg8dYysY
Java now offers the new
StructuredTaskScope<>
api.However, the structured concurrent tasks cannot be observed with micrometer.
For instance, ContextExecutorService.wrap cannot take the structured task scope.
It would be great if micrometer could offer a simple and friendly API to support observability for tasks spawning from structured concurrency (showing the parallelism, errors, structures, etc...)
Thank you
The text was updated successfully, but these errors were encountered: