Support thread pool metric collect#95
Conversation
|
|
|
BTW, I am asking @mrproliu to enhance the plugin test tool, which will be able to verify metrics, like it did for tracing data. |
I have already enhanced it, It could receive the meter data from meter report protocol. If you want to use it, here is the documentation and also have plugin test been used. |
|
the way is to make new thread type add is simple, just get ThreadPoolExecutor instacne and register it, and then, the main metric can be send to the backend |
You just need to create the metric, register it and hold it in the pool object. What we recommended is making your PR easier. |
|
@xu1009 Please take a deep like at our comments. Most things you did have been provided at the core level. Because most of this registration mechanism is a common requirement. |
in this way, every new plugin needs to create metirc, i want to extract these common things to core |
What is the issue of creating a metric? |
|
Please fix the CI and add meter plugin test according to the link above. #95 (comment) |
|
ok, i add it lately |
|
the test seems not work in new mac book with m1 cpu |
Yes, we may not have enough images for m1 testing. As most of the team are still using the intel chip. Could you find a Linux to run this? Or try to locate what is the block(s) in AARM? |
|
Please take a little look at #73, these 2 files should be updated, one for CI, the other for people reading. |
not have image, i will try it in other tomorrow, our company has used M1 widely == |
I see, take a look at https://hub.docker.com/_/eclipse-temurin?tab=tags. AdoptOpenJDK has moved to Eclipse Temurin. I can see AARM images are available there. FYI @dmsolr |
|
If you will submit any pull request about enhancing M1 testing, please submit through another pull request with detailed steps about running which case locally. |
|
Are you going to update this PR? No update for 3 days. |
sorry, very busy with my own job these days, i am lookig this |
…thread-pool # Conflicts: # CHANGES.md
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <parent> | ||
| <artifactId>optional-plugins</artifactId> |
There was a problem hiding this comment.
Questions,
- Should we merge this plugin into the existing undertow tracing plugin?
- Should we make it works in default? I can see this is an optional plugin, but a thread pool plugin should not impact the performance, right?
There was a problem hiding this comment.
About (1), if you want this plugin to be disabled separately from the tracing plugin, I am fine to keep the codes in another plugin jar. But (2) should be considered.
There was a problem hiding this comment.
@xu1009 Please follow this, then we could merge on both sides.
There was a problem hiding this comment.
thread pool plugin may impact performance, because it has lock when java get the metric, so it is optional plugin, peoeple really need can add it
There was a problem hiding this comment.
The fetching period is 20s, I think it's find to keep it in default.
This lock happens in every getting and returning threads from pool. It is not a big impact.
Agree?
There was a problem hiding this comment.
yes, but the fetching period can be modified by user, if it is set 1s, and the service has high qps, it may impact
There was a problem hiding this comment.
Manual setting equals optional plugin. So, don't worry.
There was a problem hiding this comment.
so we make the plugin in default, an add config control it ?
There was a problem hiding this comment.
Moving it to default is enough. Don't need to add a new config.
…' into feature/support-java-thread-pool
| 8.10.0 | ||
| ------------------ | ||
|
|
||
| * Support Java thread pool metric collect. |
There was a problem hiding this comment.
This PR only provides thread pool metrics of Undertow, but the change log makes me (and probably other users) feel that we support JDK's thread pool. WDYT @wu-sheng ?
There was a problem hiding this comment.
Updated, check the latest codes
There was a problem hiding this comment.
I noted that the V9.0.0 just display tomcat thread pool metric. Now I have many customized thread pool which created by "org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor". How can I collect the metric of my thread pool and display it in UI?Is need to write another customized plugins or just need write some config?
There was a problem hiding this comment.
I had checked #146 before i asked and i had read the code. The code does not contains any METRIC about "CorePoolSize","MaximumPoolSize".

I find a plugin more closer I wanted but hard coded[org.apache.skywalking.apm.plugin.undertow.worker.thread.pool.UndertowWorkerThreadPoolConstructorIntercept]. So I want to konw if i have to write some customized plugin which the count is same to the ThreadPool count?Or have some config more convenient?
There was a problem hiding this comment.
Why only including two methods, there was a long discussion on that PR, you could check.
You definitely could write a new plugin to do whatever you want, but you should know, that the discussion context is recommended for you before you take action. There are risks to instrument all, which is why we don't do that.
There was a problem hiding this comment.
@wu-sheng There are many thread pools in my project, such as ThreadPoolA and ThreadPoolB. If I want to monitor the metrics of these two thread pools separately, do I need to add a new plugin to the agent and two rules to the threadpool.ymal of OAP like:
- name: ThreadPoolA
exp: ThreadPoolA.avg(['metric_type', 'pool_name', 'instance', 'service'])
- name: ThreadPoolB
exp: ThreadPoolB.avg(['metric_type', 'pool_name', 'instance', 'service'])
There was a problem hiding this comment.
Learn MAL, your questions are irrelevant



CHANGESlog.