How to integrate APM with windows services .NET

Hi @GregKalapos any idea how to integrate APM in windows services .NET and check logs if it working fine or not.

Hi @wajihrehman,

you'll need the Public Agent API to start the trace manually, docs here.

Regarding checking agent logs: The agent has a public logging interface and you can pass your own logger to it. This is documented here - with that you can e.g. pass a small logger to the agent which logs everything into a file.

So, in short steps to integrate APM into windows services need to follow following steps.

  1. install NuGet packages. elasticaspfullframework.
  2. Set environment variables through PowerShell.
  3. Use the Public API
    am i right or need to add anything else in app.config.

That's correct, only important thing I'd add is that in point 1. you need to install NuGet Gallery | Elastic.Apm 1.15.0 and not the elasticaspfullframework package.

No need to change stuff in app.config. By default the agent will read configs (like server url, which you may need to set) from environment variables. Environment variable names for specific configs can be found in the docs, e.g.: Reporter configuration options | APM .NET Agent Reference [1.12] | Elastic

With that you should be good to go.

Thank you so much really appreciated always get a response from you.

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