Skip to content

Commit 16b1f0d

Browse files
Add important note for windows services regarding transaction creation (#2695)
Adds a note describing why transactions are not automatically created for Windows services and how to resolve this. @theletterf Is there a better way to reference the EDOT .NET docs without a hardcoded URL here? Closes #2685 --------- Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]> Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]>
1 parent f325aee commit 16b1f0d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

docs/docset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cross_links:
99
- ecs-dotnet
1010
- ecs-logging
1111
- elasticsearch
12+
- elastic-otel-dotnet
1213
toc:
1314
- toc: reference
1415
- toc: release-notes

docs/reference/configuration-for-windows-services.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ applies_to:
99
apm_agent_dotnet: ga
1010
---
1111

12-
# Configuration for Windows Services [configuration-for-windows-services]
12+
# Configuration for Windows services [configuration-for-windows-services]
13+
14+
::::{important}
15+
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.
16+
17+
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.
18+
::::
1319

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

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

29-
3035
The service must then be restarted for the change to take effect
3136

3237
```powershell
3338
Restart-Service <service-name>
3439
```
35-

0 commit comments

Comments
 (0)