Adds Micrometer Observation instrumentation#401
Conversation
|
The only thing to look at is the e2e plugin tests and modify the Also I see that we're currently in Spring naming spans in a different way than skywalking does. Should we leave it like this or rename the spans in the way that Skywalking does it? |
It is your call. URI style or |
|
Ok, the user can rename the observations at runtime by providing their own So the only thing that remains is to make the e2e pass and we're done. |
|
I've managed to finally set up the e2e scenario with Spring Framework 6, jdk 17. In Skywalking got the following graph: The headers get propagated And the metrics are collected |
|
@mrproliu Could you recheck this as an enhancement of the Micrometer? BTW, from @marcingrzejszczak , the sleuth is not there, but micrometer still is. https://skywalking.apache.org/docs/main/next/en/setup/backend/spring-sleuth-setup/ the doc should be updated. @marcingrzejszczak What is your suggestion for this part of the doc? Are these metrics still valid?
|
|
Skywalking has nothing to do with Sleuth. There is no Sleuth meter config, there's only micrometer meter config. |
| /** | ||
| * A {@link ThreadLocalAccessor} to put and restore current {@code ContextSnapshot} from APM agent. | ||
| */ | ||
| public class SkywalkingContextSnapshotThreadLocalAccessor implements ThreadLocalAccessor<Object> { |
There was a problem hiding this comment.
When do we need this? I see the agent code, it used to continue the context when cross process? But there also have some TODO not finished.
There was a problem hiding this comment.
Actually I would need some feedback from you. When we continue a span between threads, what should be the name of that continued span? Also how can you reset the thread local with a span (how can I remove the active span from thread local)
There was a problem hiding this comment.
Usually, we don't continue a span in a new thread. We only support finishing a span in a new thread, or continuous tracing context(capture and continuous snapshot from ContextManager)
There was a problem hiding this comment.
When we continue a span between threads, what should be the name of that continued span?
It's usually decided by when you need to cross-thread. Such as when we submit a new thread, we called Thread/{thread_name}/{running_function}.
Also how can you reset the thread local with a span (how can I remove the active span from thread local)
Here has a good demo, you could check this out. In this demo, we capture a snapshot from the tracing context and continue the snapshot in other thread.
|
|
||
| public static final String INTERCEPT_EVENT_POINT_METHOD = "onEvent"; | ||
|
|
||
| public static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.micrometer.MicrometerDefaultTracingHandlerInterceptor"; |
There was a problem hiding this comment.
The interceptor classes of all instrumentation are not correct, please help to fix it.
In this case, it should be: org.apache.skywalking.apm.toolkit.activation.micrometer.MicrometerDefaultTracingHandlerInterceptor
There was a problem hiding this comment.
I guess I'll need to move the classes around again after talking to @wu-sheng but thanks for pointing this out
|
@marcingrzejszczak We have 8.14.0 released now. Could you try to make your plugin test back to the CI pipeline? |
|
I will do it asap, thanks :) |

Add an agent plugin to support
CHANGESlog.