Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cross_links:
- ecs-dotnet
- ecs-logging
- elasticsearch
- elastic-otel-dotnet
toc:
- toc: reference
- toc: release-notes
Expand Down
10 changes: 7 additions & 3 deletions docs/reference/configuration-for-windows-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ applies_to:
apm_agent_dotnet: ga
---

# Configuration for Windows Services [configuration-for-windows-services]
# Configuration for Windows services [configuration-for-windows-services]

::::{important}
While the APM agent supports automatic transaction creation for web frameworks such as ASP.NET and ASP.NET Core, it doesn't know where the "unit of work" starts for bespoke services. Therefore, it cannot start a transaction automatically. As a result, spans, such as those for outbound HTTP requests, aren't captured, as they expect a running transaction, and no trace data is generated or exported by default.

To manually create a transaction around the appropriate unit of work for your scenario, instrument your code manually. You can start a custom transaction using the [Public API](/reference/public-api.md). Alternatively, consider using the [Elastic Distribution of OpenTelemetry for .NET](elastic-otel-dotnet://reference/edot-dotnet/index.md), which captures all spans automatically, including those for outbound HTTP requests. The first span without a parent is considered a transaction when ingested into Elastic Observability.
::::

Configuration for Windows services can be provided by setting environment variables for the specific Windows service in the Windows registry. With PowerShell

Expand All @@ -26,10 +32,8 @@ Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\<service-name> -Name Env
1. define the environment variables to use for the Windows service
2. `<service-name>` is the name of the Windows service.


The service must then be restarted for the change to take effect

```powershell
Restart-Service <service-name>
```