You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@skywalking.apache.org by mandar alate <ma...@gmail.com> on 2021/03/26 06:28:58 UTC

Apache Skywalking - Instrumentation of Application Classes

Hi Team,


I have recently started exploring skywalking as APM tool.

I am interested in looking at the time spent by methods/functions at
application layer. Basically an instrumentation sort of thing for the JAVA
application. With Skywalking I just get 3 spans(methods) that have one root
function and two DB execute functions. I tried adding the property

'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'

But this didnt work. I could still see only 3 spans in the dashboard for
the API being hit. Under Profile feature I can get the thread stack. But i
am only interested with Hotspot methods. Am i missing something in
configuration?

I want classes starting with particular pattern to be instrumented and
captured in trace. How can I achieve this?



Thanks,

Mandar

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by Sheng Wu <wu...@gmail.com>.
Also, how AppDynamic and DynaTrace did are their clarify, we have no
relationship with them.

Sheng Wu <wu...@gmail.com>于2021年4月2日 周五上午12:12写道:

> If you could share some demo codes, we may have more clue.
> When we do profiling, we have this
> https://skywalking.apache.org/blog/2020-04-13-apache-skywalking-profiling/
> You could see we could capture times of nearly all methods.
>
> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午11:46写道:
>
>> Hi Sheng,
>>
>> we are getting this dump of thread only when we profile for particular
>> endpoint.. it does not have the functions of our package.. we want the
>> exact time taken by function calls of our application classes..like how
>> Dynatrace and Appdynamics does
>>
>> Thanks,
>> Mandar
>>
>> On Thu, Apr 1, 2021 at 6:15 PM Sheng Wu <wu...@gmail.com>
>> wrote:
>>
>>> I wonder why do you only have one dump?
>>> Are you choosing the Span of Spring controller to run the analysis?
>>>
>>> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午8:41写道:
>>>
>>>> Please see attached snapshots.. The API is Taking more than 600ms DB
>>>> hardly Taking 2-3 ms.. How do we figure out where is remaining time spent?
>>>> The profiling Feature in skywalking Looks to be just giving stack trace and
>>>> not giving details as to which method is Taking how much time that can help
>>>> identify bottlenecks at app layer methods.
>>>>
>>>> In profiling it is just showing duration, self duration as 0 ms.
>>>>
>>>> Thanks
>>>> Mandar
>>>>
>>>> On Thu, 1 Apr, 2021, 3:36 PM Sheng Wu, <wu...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Most of today's features are focusing to diagnosis the performance in
>>>>> the prod.
>>>>> You could try custom enhance plugin to do what you wants, but
>>>>> eventually, you will notice, this is not practicable.
>>>>> SkyWalking provides profiling to measure the performance of every
>>>>> methods, with reasonable cost, mostly about reasonable extra latency
>>>>> Brandon new idea is focusing on one method performance at a time, in
>>>>> the runtime.
>>>>> Both ways are trying to get method performance.
>>>>>
>>>>> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午5:59写道:
>>>>>
>>>>>> Thanks all for your response. I have dropped mail to
>>>>>>>> dev-subscribe@skywalking.apache.org for subscription.
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>> To be simple, our requirement is we need to instrument and get
>>>>>>>> method time for methods in particular package (say compute balance method
>>>>>>>> in some xyz package). This is something we want to identify application
>>>>>>>> layer methods bottlenecks - essentially to see which method is taking most
>>>>>>>> of the time from response time at application layer. And mostly this wont
>>>>>>>> be used in production env.. this is for dev area.. so some little overhead
>>>>>>>> we are okay with.
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>> Looking forward to hear from you.
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Mandar
>>>>>>>>
>>>>>>> --
>>>>> Sheng Wu 吴晟
>>>>>
>>>>> Apache SkyWalking
>>>>> Apache Incubator
>>>>> Apache ShardingSphere, ECharts, DolphinScheduler podlings
>>>>> Zipkin
>>>>> Twitter, wusheng1108
>>>>>
>>>> --
>>> Sheng Wu 吴晟
>>>
>>> Apache SkyWalking
>>> Apache Incubator
>>> Apache ShardingSphere, ECharts, DolphinScheduler podlings
>>> Zipkin
>>> Twitter, wusheng1108
>>>
>> --
> Sheng Wu 吴晟
>
> Apache SkyWalking
> Apache Incubator
> Apache ShardingSphere, ECharts, DolphinScheduler podlings
> Zipkin
> Twitter, wusheng1108
>
-- 
Sheng Wu 吴晟

Apache SkyWalking
Apache Incubator
Apache ShardingSphere, ECharts, DolphinScheduler podlings
Zipkin
Twitter, wusheng1108

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by Sheng Wu <wu...@gmail.com>.
If you could share some demo codes, we may have more clue.
When we do profiling, we have this
https://skywalking.apache.org/blog/2020-04-13-apache-skywalking-profiling/
You could see we could capture times of nearly all methods.

mandar alate <ma...@gmail.com>于2021年4月1日 周四下午11:46写道:

> Hi Sheng,
>
> we are getting this dump of thread only when we profile for particular
> endpoint.. it does not have the functions of our package.. we want the
> exact time taken by function calls of our application classes..like how
> Dynatrace and Appdynamics does
>
> Thanks,
> Mandar
>
> On Thu, Apr 1, 2021 at 6:15 PM Sheng Wu <wu...@gmail.com> wrote:
>
>> I wonder why do you only have one dump?
>> Are you choosing the Span of Spring controller to run the analysis?
>>
>> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午8:41写道:
>>
>>> Please see attached snapshots.. The API is Taking more than 600ms DB
>>> hardly Taking 2-3 ms.. How do we figure out where is remaining time spent?
>>> The profiling Feature in skywalking Looks to be just giving stack trace and
>>> not giving details as to which method is Taking how much time that can help
>>> identify bottlenecks at app layer methods.
>>>
>>> In profiling it is just showing duration, self duration as 0 ms.
>>>
>>> Thanks
>>> Mandar
>>>
>>> On Thu, 1 Apr, 2021, 3:36 PM Sheng Wu, <wu...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Most of today's features are focusing to diagnosis the performance in
>>>> the prod.
>>>> You could try custom enhance plugin to do what you wants, but
>>>> eventually, you will notice, this is not practicable.
>>>> SkyWalking provides profiling to measure the performance of every
>>>> methods, with reasonable cost, mostly about reasonable extra latency
>>>> Brandon new idea is focusing on one method performance at a time, in
>>>> the runtime.
>>>> Both ways are trying to get method performance.
>>>>
>>>> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午5:59写道:
>>>>
>>>>> Thanks all for your response. I have dropped mail to
>>>>>>> dev-subscribe@skywalking.apache.org for subscription.
>>>>>>>
>>>>>>
>>>>>
>>>>>> To be simple, our requirement is we need to instrument and get method
>>>>>>> time for methods in particular package (say compute balance method in some
>>>>>>> xyz package). This is something we want to identify application layer
>>>>>>> methods bottlenecks - essentially to see which method is taking most of the
>>>>>>> time from response time at application layer. And mostly this wont be used
>>>>>>> in production env.. this is for dev area.. so some little overhead we are
>>>>>>> okay with.
>>>>>>>
>>>>>>
>>>>>
>>>>>> Looking forward to hear from you.
>>>>>>>
>>>>>>
>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Mandar
>>>>>>>
>>>>>> --
>>>> Sheng Wu 吴晟
>>>>
>>>> Apache SkyWalking
>>>> Apache Incubator
>>>> Apache ShardingSphere, ECharts, DolphinScheduler podlings
>>>> Zipkin
>>>> Twitter, wusheng1108
>>>>
>>> --
>> Sheng Wu 吴晟
>>
>> Apache SkyWalking
>> Apache Incubator
>> Apache ShardingSphere, ECharts, DolphinScheduler podlings
>> Zipkin
>> Twitter, wusheng1108
>>
> --
Sheng Wu 吴晟

Apache SkyWalking
Apache Incubator
Apache ShardingSphere, ECharts, DolphinScheduler podlings
Zipkin
Twitter, wusheng1108

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by mandar alate <ma...@gmail.com>.
Hi Sheng,

we are getting this dump of thread only when we profile for particular
endpoint.. it does not have the functions of our package.. we want the
exact time taken by function calls of our application classes..like how
Dynatrace and Appdynamics does

Thanks,
Mandar

On Thu, Apr 1, 2021 at 6:15 PM Sheng Wu <wu...@gmail.com> wrote:

> I wonder why do you only have one dump?
> Are you choosing the Span of Spring controller to run the analysis?
>
> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午8:41写道:
>
>> Please see attached snapshots.. The API is Taking more than 600ms DB
>> hardly Taking 2-3 ms.. How do we figure out where is remaining time spent?
>> The profiling Feature in skywalking Looks to be just giving stack trace and
>> not giving details as to which method is Taking how much time that can help
>> identify bottlenecks at app layer methods.
>>
>> In profiling it is just showing duration, self duration as 0 ms.
>>
>> Thanks
>> Mandar
>>
>> On Thu, 1 Apr, 2021, 3:36 PM Sheng Wu, <wu...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Most of today's features are focusing to diagnosis the performance in
>>> the prod.
>>> You could try custom enhance plugin to do what you wants, but
>>> eventually, you will notice, this is not practicable.
>>> SkyWalking provides profiling to measure the performance of every
>>> methods, with reasonable cost, mostly about reasonable extra latency
>>> Brandon new idea is focusing on one method performance at a time, in the
>>> runtime.
>>> Both ways are trying to get method performance.
>>>
>>> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午5:59写道:
>>>
>>>> Thanks all for your response. I have dropped mail to
>>>>>> dev-subscribe@skywalking.apache.org for subscription.
>>>>>>
>>>>>
>>>>
>>>>> To be simple, our requirement is we need to instrument and get method
>>>>>> time for methods in particular package (say compute balance method in some
>>>>>> xyz package). This is something we want to identify application layer
>>>>>> methods bottlenecks - essentially to see which method is taking most of the
>>>>>> time from response time at application layer. And mostly this wont be used
>>>>>> in production env.. this is for dev area.. so some little overhead we are
>>>>>> okay with.
>>>>>>
>>>>>
>>>>
>>>>> Looking forward to hear from you.
>>>>>>
>>>>>
>>>>
>>>>> Thanks,
>>>>>
>>>>> Mandar
>>>>>>
>>>>> --
>>> Sheng Wu 吴晟
>>>
>>> Apache SkyWalking
>>> Apache Incubator
>>> Apache ShardingSphere, ECharts, DolphinScheduler podlings
>>> Zipkin
>>> Twitter, wusheng1108
>>>
>> --
> Sheng Wu 吴晟
>
> Apache SkyWalking
> Apache Incubator
> Apache ShardingSphere, ECharts, DolphinScheduler podlings
> Zipkin
> Twitter, wusheng1108
>

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by Sheng Wu <wu...@gmail.com>.
I wonder why do you only have one dump?
Are you choosing the Span of Spring controller to run the analysis?

mandar alate <ma...@gmail.com>于2021年4月1日 周四下午8:41写道:

> Please see attached snapshots.. The API is Taking more than 600ms DB
> hardly Taking 2-3 ms.. How do we figure out where is remaining time spent?
> The profiling Feature in skywalking Looks to be just giving stack trace and
> not giving details as to which method is Taking how much time that can help
> identify bottlenecks at app layer methods.
>
> In profiling it is just showing duration, self duration as 0 ms.
>
> Thanks
> Mandar
>
> On Thu, 1 Apr, 2021, 3:36 PM Sheng Wu, <wu...@gmail.com> wrote:
>
>> Hi,
>>
>> Most of today's features are focusing to diagnosis the performance in the
>> prod.
>> You could try custom enhance plugin to do what you wants, but eventually,
>> you will notice, this is not practicable.
>> SkyWalking provides profiling to measure the performance of every
>> methods, with reasonable cost, mostly about reasonable extra latency
>> Brandon new idea is focusing on one method performance at a time, in the
>> runtime.
>> Both ways are trying to get method performance.
>>
>> mandar alate <ma...@gmail.com>于2021年4月1日 周四下午5:59写道:
>>
>>> Thanks all for your response. I have dropped mail to
>>>>> dev-subscribe@skywalking.apache.org for subscription.
>>>>>
>>>>
>>>
>>>> To be simple, our requirement is we need to instrument and get method
>>>>> time for methods in particular package (say compute balance method in some
>>>>> xyz package). This is something we want to identify application layer
>>>>> methods bottlenecks - essentially to see which method is taking most of the
>>>>> time from response time at application layer. And mostly this wont be used
>>>>> in production env.. this is for dev area.. so some little overhead we are
>>>>> okay with.
>>>>>
>>>>
>>>
>>>> Looking forward to hear from you.
>>>>>
>>>>
>>>
>>>> Thanks,
>>>>
>>>> Mandar
>>>>>
>>>> --
>> Sheng Wu 吴晟
>>
>> Apache SkyWalking
>> Apache Incubator
>> Apache ShardingSphere, ECharts, DolphinScheduler podlings
>> Zipkin
>> Twitter, wusheng1108
>>
> --
Sheng Wu 吴晟

Apache SkyWalking
Apache Incubator
Apache ShardingSphere, ECharts, DolphinScheduler podlings
Zipkin
Twitter, wusheng1108

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by Sheng Wu <wu...@gmail.com>.
Hi,

Most of today's features are focusing to diagnosis the performance in the
prod.
You could try custom enhance plugin to do what you wants, but eventually,
you will notice, this is not practicable.
SkyWalking provides profiling to measure the performance of every methods,
with reasonable cost, mostly about reasonable extra latency
Brandon new idea is focusing on one method performance at a time, in the
runtime.
Both ways are trying to get method performance.

mandar alate <ma...@gmail.com>于2021年4月1日 周四下午5:59写道:

> Thanks all for your response. I have dropped mail to
>>> dev-subscribe@skywalking.apache.org for subscription.
>>>
>>
>
>> To be simple, our requirement is we need to instrument and get method
>>> time for methods in particular package (say compute balance method in some
>>> xyz package). This is something we want to identify application layer
>>> methods bottlenecks - essentially to see which method is taking most of the
>>> time from response time at application layer. And mostly this wont be used
>>> in production env.. this is for dev area.. so some little overhead we are
>>> okay with.
>>>
>>
>
>> Looking forward to hear from you.
>>>
>>
>
>> Thanks,
>>
>> Mandar
>>>
>> --
Sheng Wu 吴晟

Apache SkyWalking
Apache Incubator
Apache ShardingSphere, ECharts, DolphinScheduler podlings
Zipkin
Twitter, wusheng1108

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by Brandon Fergerson <fe...@gmail.com>.
I wrote code for https://github.com/apache/skywalking/issues/4841 which
does what Mandar is looking for.
I could submit a PR for that but I'm curious what type of disasters are
expected from this type of functionality.
The code I'm using skips getters/setters, methods added by AOP, etc as
those can be sensibly skipped.
Do you think that makes it less disastrous or does the issue stem from
possibly monitoring user code which is called too frequently?


On Fri, Mar 26, 2021 at 5:16 AM kezhenxu94@apache <ke...@apache.org>
wrote:

> Did you move the plugin jar to the `plugin` folder? I remember it is an
> optional plugin.
>
> > On Mar 26, 2021, at 17:10, Sheng Wu <wu...@gmail.com> wrote:
> >
> > Hi
> >
> > You haven't subscribed to the mail list, you need to send mail to
> > dev-subscribe@skywalking.apache.org. Otherwise, you could miss the
> reply. I
> > added you in the reply list manually this time.
> >
> >>
> >
> 'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'
> > I am not sure why you are using this configuration, this seems strange.
> >
> >> But i am only interested with Hotspot methods
> > I am not sure what do you mean hotspot methods? Are you meaning some
> > specific methods?
> > But you mentioned this
> >> my.package
> > Are you trying to instrument all of your own codes? That would be a
> > disaster, even technically it is possible.
> >
> > Sheng Wu 吴晟
> > Twitter, wusheng1108
> >
> >
> > mandar alate <ma...@gmail.com> 于2021年3月26日周五 下午5:04写道:
> >
> >> Hi Team,
> >>
> >>
> >> I have recently started exploring skywalking as APM tool.
> >>
> >> I am interested in looking at the time spent by methods/functions at
> >> application layer. Basically an instrumentation sort of thing for the
> JAVA
> >> application. With Skywalking I just get 3 spans(methods) that have one
> root
> >> function and two DB execute functions. I tried adding the property
> >>
> >>
> >>
> 'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'
> >>
> >> But this didnt work. I could still see only 3 spans in the dashboard for
> >> the API being hit. Under Profile feature I can get the thread stack.
> But i
> >> am only interested with Hotspot methods. Am i missing something in
> >> configuration?
> >>
> >> I want classes starting with particular pattern to be instrumented and
> >> captured in trace. How can I achieve this?
> >>
> >>
> >>
> >> Thanks,
> >>
> >> Mandar
> >>
>
> —————————
> Zhenxu Ke (柯振旭)
> GitHub @kezhenxu94
>
>

Re: Apache Skywalking - Instrumentation of Application Classes

Posted by "kezhenxu94@apache" <ke...@apache.org>.
Did you move the plugin jar to the `plugin` folder? I remember it is an optional plugin.

> On Mar 26, 2021, at 17:10, Sheng Wu <wu...@gmail.com> wrote:
> 
> Hi
> 
> You haven't subscribed to the mail list, you need to send mail to
> dev-subscribe@skywalking.apache.org. Otherwise, you could miss the reply. I
> added you in the reply list manually this time.
> 
>> 
> 'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'
> I am not sure why you are using this configuration, this seems strange.
> 
>> But i am only interested with Hotspot methods
> I am not sure what do you mean hotspot methods? Are you meaning some
> specific methods?
> But you mentioned this
>> my.package
> Are you trying to instrument all of your own codes? That would be a
> disaster, even technically it is possible.
> 
> Sheng Wu 吴晟
> Twitter, wusheng1108
> 
> 
> mandar alate <ma...@gmail.com> 于2021年3月26日周五 下午5:04写道:
> 
>> Hi Team,
>> 
>> 
>> I have recently started exploring skywalking as APM tool.
>> 
>> I am interested in looking at the time spent by methods/functions at
>> application layer. Basically an instrumentation sort of thing for the JAVA
>> application. With Skywalking I just get 3 spans(methods) that have one root
>> function and two DB execute functions. I tried adding the property
>> 
>> 
>> 'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'
>> 
>> But this didnt work. I could still see only 3 spans in the dashboard for
>> the API being hit. Under Profile feature I can get the thread stack. But i
>> am only interested with Hotspot methods. Am i missing something in
>> configuration?
>> 
>> I want classes starting with particular pattern to be instrumented and
>> captured in trace. How can I achieve this?
>> 
>> 
>> 
>> Thanks,
>> 
>> Mandar
>> 

————————— 
Zhenxu Ke (柯振旭)
GitHub @kezhenxu94


Re: Apache Skywalking - Instrumentation of Application Classes

Posted by Sheng Wu <wu...@gmail.com>.
Hi

You haven't subscribed to the mail list, you need to send mail to
dev-subscribe@skywalking.apache.org. Otherwise, you could miss the reply. I
added you in the reply list manually this time.

>
'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'
I am not sure why you are using this configuration, this seems strange.

> But i am only interested with Hotspot methods
I am not sure what do you mean hotspot methods? Are you meaning some
specific methods?
But you mentioned this
> my.package
Are you trying to instrument all of your own codes? That would be a
disaster, even technically it is possible.

Sheng Wu 吴晟
Twitter, wusheng1108


mandar alate <ma...@gmail.com> 于2021年3月26日周五 下午5:04写道:

> Hi Team,
>
>
> I have recently started exploring skywalking as APM tool.
>
> I am interested in looking at the time spent by methods/functions at
> application layer. Basically an instrumentation sort of thing for the JAVA
> application. With Skywalking I just get 3 spans(methods) that have one root
> function and two DB execute functions. I tried adding the property
>
>
> 'plugin.jdkthreading.threading_class_prefixes=${THREADING_CLASS_PREFIX=my.package}'
>
> But this didnt work. I could still see only 3 spans in the dashboard for
> the API being hit. Under Profile feature I can get the thread stack. But i
> am only interested with Hotspot methods. Am i missing something in
> configuration?
>
> I want classes starting with particular pattern to be instrumented and
> captured in trace. How can I achieve this?
>
>
>
> Thanks,
>
> Mandar
>