cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

How can I get exception/Error data from a Windows Service?

scott_pouliot
Newcomer

I'm new to Dynatrace. Our company has been running it for awhile to monitor web processes and such, and it collects a great amount of detail for us to troubleshoot any errors/issues that pop up.

We currently have a home grown windows service, written in C#, and running on a windows server that is multi-threaded...and crashing somewhere in the threading areas of the .NET library without much error details being bubbled up from the error handling we have built in.

Is there a way to use Dynatrace to help us collect more information about the .NET code that is running within this windows service? I have setup an Agent on the server, selected my process to monitor, and it has connected and is showing that it has collected events...but not much else.

I have spoken to our in-house Dynatrace guy, and he's really good with web monitoring, but windows services as a bit out of his realm. Can anyone offer any assistance here? Do I need to be running an additional plugin to get this type of detailed data from a non-Web .NET process?

7 REPLIES 7

dave_mauney
Dynatrace Champion
Dynatrace Champion

Hi Scott,

You will likely have to define some entry point sensors to start PurePaths.

There are a few ways to go about this.

In order of ease:

1. Ask a developer that knows the code.

2. Take a CPU sample and look for methods high enough up the food chain that consume a significant portion of the CPU, and are "in house" methods ideally.

3. Do a quick "shotgun" instrumentation of some packages that seem to be likely candidates.

You are usually going to be looking for methods high on the call stack (but not too high, like Thread.run, and usually "in house" methods are ideal rather than framework methods).

#3 can have high overhead, so do it only in Non-Prod environments where you will not impact others.

#2 can work in Prod or Non-Prod, but Non-Prod is always preferred, if possible.

This may get you pointed in the right direction, along with some additional forum searches and/or maybe some additional questions and answers on this thread.

HTH,

dave

scott_pouliot
Newcomer

Dave,

Thanks for the reply!

1. Luckily *I* am the developer of the code for this service....so I did add some methods for all the main methods that kick off "stuff" to do on the sensors page here. Still not having any luck on that front though.

I added these Sensors:

I also setup some Entry Points on the Application setup of the system profile that looks like this:

These methods are the 3 mains methods that get called when the service is running and actively "doing" stuff.

I'm in process of setting up another Dynatrace server on a utility box that I have full control over to test some setup stuff. I have a feeling our team may have stuff locked down too tight, so I'm trying to rule that out with a trial install on a secondary box here. I've used Dynatrace in the past, and adding agents was a snap! This is giving me a headache 😉

dave_mauney
Dynatrace Champion
Dynatrace Champion

It looks like your sensors are just "active" and not "active and start purepaths". Can you try toggling this AND setting it where you place the sensor also?

scott_pouliot
Newcomer

"AND setting it where you place the sensor also?"

What do you mean by this? I did just toggle it to active and start PurePaths, but maybe I'm setting up sensors and not placing them properly?

scott_pouliot
Newcomer

Found what you're talking about 😉 Just swapped it...we'll see what happens here. Thanks!

scott_pouliot
Newcomer

Well after fiddling around and adding every class I could find...and a few entry points...I finally have some data pumping in it looks like. So I'll let this collect for awhile and see where it leads me.

Thanks for the help Dave!

dave_mauney
Dynatrace Champion
Dynatrace Champion

Glad you were able to figure it out with the limited guidance!