Elastic APM with windows services

Hi! I'd like to know if it's possible to implement Elastic APM to Windows Service? I'd like to track all database queries (SQL Server) and HTTP Requests made by app. If yes, could you provide with some tutorial links? Language - C#, .NetFramework 4.7

Hi @Sharcady - welcome to the forum!

It might be possible to monitor Windows service implemented in .NET with Elastic APM .NET Agent but with the following caveats:

  1. Agent won't be able to automatically detect transaction start/end so you will have to use Agent's public API to mark transaction start/end. You can find an example in the docs and in this sample application.
  2. At the moment (as of Agent's version 1.2) Agent automatically creates spans for database queries only if those queries are made by Entity Framework 6/Core. So if your application uses a different mechanism to access database then Agent won't automatically create spans for those database operations. You can still do it manually by using Agent's public API.
  3. Regarding automatically creating spans for HTTP Requests made by app with application being Windows service using .NET Framework - we didn't test this exact use case (the closest one that we test is ASP.NET application using .NET Framework on top of IIS which is a Windows service). So while I think the Agent should automatically create spans for HTTP requests in your use case I cannot say it 100% certainty - if you decide to give it a try please let us know.
1 Like

Thank you very much for your answer! I will try!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.