Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ The version of the `Elastic.Apm` nuget package used

**Operating system and version:**

**.NET Framework/Core name and version** (e.g. .NET 4.6.2, NET Core 3.1.100) :
**.NET Framework/Core name and version** (e.g. .NET 4.6.2, NET 8) :

**Application Target Framework(s)** (e.g. net462, netcoreapp3.1):
**Application Target Framework(s)** (e.g. net462, net8.0):

### Describe the bug
A clear and concise description of what the bug is.
Expand Down
5 changes: 4 additions & 1 deletion docs/reference/config-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Sets the minimum duration of exit spans. Exit spans with a duration lesser than
apm_agent_dotnet: ga 1.13
```

Setting this option to `false` will disable the [OpenTelemetry Bridge](/reference/opentelemetry-bridge.md). This will disable the use of the vendor-neutral OpenTelemetry Tracing API (the [Activity API](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activity?view=net-5.0) in .NET) to manually instrument your code, and have the Elastic .NET APM agent handle those API calls.
Setting this option to `false` will disable the [OpenTelemetry Bridge](/reference/opentelemetry-bridge.md). This will disable the use of the vendor-neutral OpenTelemetry Tracing API (the [Activity API](https://learn.microsoft.com/dotnet/api/system.diagnostics.activity) in .NET) to manually instrument your code, and have the Elastic .NET APM agent handle those API calls.

| Environment variable name | IConfiguration key |
| --- | --- |
Expand All @@ -375,3 +375,6 @@ Setting this option to `false` will disable the [OpenTelemetry Bridge](/referenc
| --- | --- |
| `true` | Boolean |

::::{note}
The OpenTelemetry Bridge is not supported on .NET Framework.
::::
2 changes: 1 addition & 1 deletion docs/reference/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ These metrics will be sent regularly to the APM Server and from there to Elastic

The metrics will be stored in the `apm-*` index and have the `processor.event` property set to `metric`.

"Platform: all" means that the metric is available on every platform where .NET Core is supported.
"Platform: all" means that the metric is available on every platform where .NET (i.e. not .NET Framework) is supported.


## System metrics [metrics-system]
Expand Down
14 changes: 10 additions & 4 deletions docs/reference/opentelemetry-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ applies_to:

The OpenTelemetry Bridge in the Elastic .NET APM Agent bridges OpenTelemetry spans into Elastic APM transactions and spans. The Elastic APM OpenTelemetry bridge allows you to use the vendor-neutral OpenTelemetry Tracing API to manually instrument your code and have the Elastic .NET APM agent handle those API calls. This means you can use the Elastic APM agent for tracing, without any vendor lock-in from adding manual tracing using the APM agent’s own [Public API](/reference/public-api.md).

::::{note}
The OpenTelemetry Bridge is not supported on .NET Framework.
::::


## Getting started [otel-getting-started]

Expand All @@ -21,11 +25,11 @@ The OpenTelemetry bridge is part of the core agent package ([`Elastic.Apm`](http

### Disabling the OpenTelemetry Bridge [otel-enable-bridge]

The OpenTelemetry bridge is enabled out of the box starting version `1.23.0`.
The OpenTelemetry bridge is enabled by default since version `1.23.0`.

This allows you to instrument code through `ActivitySource` and `StartActivity()` without any additional configuration.

If you want to disable the bridge you can disable it for now through the [OpenTelemetryBridgeEnabled](/reference/config-core.md#config-opentelemetry-bridge-enabled) configuration setting.
If you want to disable the bridge you can disable it for using the [OpenTelemetryBridgeEnabled](/reference/config-core.md#config-opentelemetry-bridge-enabled) configuration setting.

If you configured the agent via environment variables, set the `ELASTIC_APM_OPENTELEMETRY_BRIDGE_ENABLED` environment variable to `false`.

Expand Down Expand Up @@ -106,15 +110,17 @@ Furthermore, the agent offers the [BaggageToAttach](/reference/config-http.md#co

### Supported OpenTelemetry implementations [supported-opentelemetry-implementations]

OpenTelemetry in .NET is implemented via the [Activity API](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activity?view=net-6.0) and there is an [OpenTelemetry shim](https://opentelemetry.io/docs/instrumentation/net/shim/) which follows the OpenTelemetry specification more closer. This shim is built on top of the Activity API.
OpenTelemetry in .NET is implemented via the [Activity API](https://learn.microsoft.com/dotnet/api/system.diagnostics.activity) and there is an [OpenTelemetry shim](https://opentelemetry.io/docs/instrumentation/net/shim/) which follows the OpenTelemetry specification more closer. This shim is built on top of the Activity API.

The OpenTelemetry bridge in the Elastic .NET APM Agent targets the [Activity API](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activity?view=net-6.0). Since the [OpenTelemetry .NET shim](https://opentelemetry.io/docs/instrumentation/net/shim/) builds on top of the [Activity API](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.activity?view=net-6.0), the shim is implicitly supported as well, although we don’t directly test it, because the Activity API is the recommended OpenTelemetry API for .NET.
The OpenTelemetry bridge in the Elastic .NET APM Agent targets the [Activity API](https://learn.microsoft.com/dotnet/api/system.diagnostics.activity). Since the [OpenTelemetry .NET shim](https://opentelemetry.io/docs/instrumentation/net/shim/) builds on top of the [Activity API](https://learn.microsoft.com/dotnet/api/system.diagnostics.activity), the shim is implicitly supported as well, although we don’t directly test it, because the Activity API is the recommended OpenTelemetry API for .NET.


## Caveats [otel-caveats]

Not all features of the OpenTelemetry API are supported.

The OpenTelemetry Bridge is not supported on .NET Framework.


#### Metrics [otel-metrics]

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/set-up-apm-net-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ NuGet packages
: The agent ships as a set of [NuGet packages](/reference/nuget-packages.md) available on [nuget.org](https://nuget.org). You can add the Agent and specific instrumentations to a .NET application by referencing one or more of these packages and following the package documentation.

Host startup hook
: On **.NET Core 3.0+ or .NET 5+**, the agent supports auto instrumentation without any code change and without any recompilation of your projects. See [Zero code change setup on .NET Core](/reference/setup-dotnet-net-core.md#zero-code-change-setup) for more details.
: On **.NET**, the agent supports auto instrumentation without any code change and without any recompilation of your projects. See [Zero code change setup on .NET](/reference/setup-dotnet-net-core.md#zero-code-change-setup) for more details.


## Get started [_get_started]

* [Profiler Auto instrumentation](/reference/setup-auto-instrumentation.md)
* [ASP.NET Core](/reference/setup-asp-net-core.md)
* [.NET Core and .NET 5+](/reference/setup-dotnet-net-core.md)
* [.NET](/reference/setup-dotnet-net-core.md)
* [ASP.NET](/reference/setup-asp-dot-net.md)
* [Azure Functions](/reference/setup-azure-functions.md)
* [Manual instrumentation](/reference/setup-general.md)
15 changes: 9 additions & 6 deletions docs/reference/setup-auto-instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,27 @@ applies_to:

### Quick start [_quick_start]

The agent can automatically instrument .NET Framework, .NET Core, and .NET applications using the [.NET CLR Profiling APIs](https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/profiling-overview#the-profiling-api). The Profiling APIs provide a way to instrument an application or dependency code without code changes.
The agent can automatically instrument .NET Framework and .NET applications using the [.NET CLR Profiling APIs](https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/profiling-overview#the-profiling-api). The Profiling APIs provide a way to instrument an application or dependency code without code changes.

This approach works with the following

| | |
| --- | --- |
| | **Operating system** |
| **Architecture*** | ***Windows*** | ***Linux** ** |
| x64 | .NET Framework 4.6.2+*<br>.NET Core 2.1+<br>.NET 5+ | .NET Core 2.1+<br>.NET 5+ |
| **Architecture** | **Windows** | **Linux** \*\* |
| x64 | .NET Framework 4.6.2+\*<br>.NET 8+ | .NET 8+ |

** Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility.*
\* Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility.*

*** Minimum GLIBC version 2.14.*
\*\* Minimum GLIBC version 2.14.

::::{note}
The profiler-based agent only supports 64-bit applications. 32-bit applications aren’t supported.
While the profiler may work on older .NET runtimes such as .NET 6, it is only officially tested and supported on runtimes that are supported by Microsoft, currently .NET 8 and newer.
::::

::::{note}
The profiler-based agent only supports 64-bit applications. 32-bit applications aren’t supported.
::::

::::{note}
The profiler-based agent does not currently support ARM.
Expand Down
14 changes: 6 additions & 8 deletions docs/reference/setup-dotnet-net-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ applies_to:
apm_agent_dotnet: ga
---

# .NET Core and .NET 5+ [setup-dotnet-net-core]
# .NET 8+ [setup-dotnet-net-core]


## Quick start [_quick_start_3]

In .NET (Core) applications using `Microsoft.Extensions.Hosting`, the agent can be registered on the `IServiceCollection`. This applies to ASP.NET Core and to other .NET applications that depend on the hosting APIs, such as those created using the [worker services](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) template.
In .NET applications using `Microsoft.Extensions.Hosting`, the agent can be registered on the `IServiceCollection`. This applies to ASP.NET Core and to other .NET applications that depend on the hosting APIs, such as those created using the [worker services](https://learn.microsoft.com/en-us/dotnet/core/extensions/workers) template.

The simplest way to enable the agent and its instrumentations requires a reference to the [`Elastic.Apm.NetCoreAll`](https://www.nuget.org/packages/Elastic.Apm.NetCoreAll) package.

Expand Down Expand Up @@ -95,7 +95,7 @@ namespace WorkerServiceSample
1. The `CaptureTransaction` method creates a transaction named *UnitOfWork* and type *App*. The lambda passed to it represents the unit of work that should be captured within the context of the transaction.


When this application runs, a new transaction will be captured and sent for each while loop iteration. A span named *HTTP GET* within the transaction will be created for the HTTP request to `https://www.elastic.co`. The HTTP span is captured because the NetCoreAll package enables this instrumentation automatically.
When this application runs, a new transaction will be captured and sent for each while loop iteration. A span named *HTTP GET* within the transaction will be created for the HTTP request to `https://www.elastic.co`. The HTTP span is captured because the `NetCoreAll` package enables this instrumentation automatically.


## Manual instrumentation using OpenTelemetry [_manual_instrumentation_using_opentelemetry]
Expand Down Expand Up @@ -164,9 +164,9 @@ host.Run();



## Zero code change setup on .NET Core and .NET 5+ ([1.7]) [zero-code-change-setup]
## Zero code change setup on .NET 8+ ([1.7]) [zero-code-change-setup]

If you can’t or don’t want to reference NuGet packages in your application, you can use the startup hook feature to inject the agent during startup, if your application runs on .NET Core 3.0, .NET Core 3.1 or .NET 5 or newer.
If you can’t or don’t want to reference NuGet packages in your application, you can use the startup hook feature to inject the agent during startup, if your application runs on .NET 8 or newer.

To configure startup hooks

Expand All @@ -180,13 +180,11 @@ To configure startup hooks

1. `<path-to-agent>` is the unzipped directory from step 2.

4. Start your .NET Core application in a context where the `DOTNET_STARTUP_HOOKS` environment variable is visible.
4. Start your .NET application in a context where the `DOTNET_STARTUP_HOOKS` environment variable is visible.

With this setup, the agent will be injected into the application during startup, enabling every instrumentation feature. Incoming requests will be automatically captured on ASP.NET Core (including gRPC).

::::{note}
Agent configuration can be controlled through environment variables when using the startup hook feature.

::::


2 changes: 1 addition & 1 deletion docs/reference/setup-mongo-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Agent.Subscribe(new MongoDbDiagnosticsSubscriber());
```

::::{important}
MongoDB integration is currently supported on .NET Core and newer. Due to MongoDb.Driver assemblies not being strongly named, they cannot be used with Elastic APM’s strongly named assemblies on .NET Framework.
MongoDB integration is currently supported on .NET runtimes. Due to MongoDb.Driver assemblies not being strongly named, they cannot be used with Elastic APM’s strongly named assemblies on .NET Framework.

::::

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/setup-sqlclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Agent.Subscribe(new SqlClientDiagnosticSubscriber());
```

::::{note}
Auto instrumentation for `System.Data.SqlClient` is available for both .NET Core and .NET Framework applications, however, support of .NET Framework has one limitation: command text cannot be captured.
Auto instrumentation for `System.Data.SqlClient` is available for both .NET and .NET Framework applications, however, support of .NET Framework has one limitation: command text cannot be captured.

Auto instrumentation for `Microsoft.Data.SqlClient` is available only for .NET Core at the moment.
Auto instrumentation for `Microsoft.Data.SqlClient` is available only for .NET at the moment.

As an alternative to using the `Elastic.Apm.SqlClient` package to instrument database calls, see [Profiler Auto instrumentation](/reference/setup-auto-instrumentation.md).

Expand Down
7 changes: 3 additions & 4 deletions docs/reference/supported-technologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ If, for example, the HTTP client library of your choice is not listed, it means

## .NET versions [supported-dotnet-flavors]

The agent works on every .NET flavor and version that supports .NET Standard 2.0. This means .NET Core 2.0 or newer, and .NET Framework 4.6.2* or newer.
The agent works on every .NET flavor and version that supports .NET Standard 2.0 or .NET Standard 2.1. This means .NET Core 2.0 or newer.

** Due to binding issues introduced by Microsoft, we recommend at least .NET Framework 4.7.2 for best compatibility.*

::::{important}
While this library **should** work on .NET Core 2.0+, we limit our support to only those versions currently supported by Microsoft - .NET 6.0 and newer.

While this library **may** work on .NET Core 2.0+, we limit our support to only those versions currently supported by Microsoft (Currently .NET 8.0+). See Microsoft's [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) for details of supported runtimes.
::::


Expand All @@ -50,7 +49,7 @@ Automatic instrumentation is supported for the following web frameworks

## RPC Frameworks [supported-rpc-frameworks]

The agent supports gRPC on .NET Core both on the client and the server side. Every gRPC call is automatically captured by the agent.
The agent supports gRPC on .NET both on the client and the server side. Every gRPC call is automatically captured by the agent.

Streaming is not supported; for streaming use-cases, the agent does not create transactions and spans automatically.

Expand Down
20 changes: 14 additions & 6 deletions src/startuphook/ElasticApmAgentStartupHook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It utilizes the startup hook mechanism described [in the dotnet runtime reposito

### Prerequisites

- **.NET Core 2.2 or newer**
- **.NET 6 or newer**

### How to use it

Expand Down Expand Up @@ -48,17 +48,25 @@ The layout in the zip file is as follows

```
ElasticApmAgent_<version>.zip/
├── 4.0.0/
│ └── APM agent assemblies compiled against System.Diagnostics.DiagnosticSource 4.0.0
├── 6.0.0/
│ └── APM agent assemblies compiled against System.Diagnostics.DiagnosticSource 6.0.0
├── 5.0.0/
│ └── APM agent assemblies compiled against System.Diagnostics.DiagnosticSource 5.0.0
├── 8.0.0/
│ └── APM agent assemblies compiled against System.Diagnostics.DiagnosticSource 8.0.0
└── ElasticApmAgentStartupHook.dll
```

It contains numbered directories that each contain APM agent assemblies compiled against
a specific version System.Diagnostics.DiagnosticSource.
a specific version `System.Diagnostics.DiagnosticSource`.

We maintain the 6.0.0 folder (for now) to not break those using older, unsupported .NET runtimes. We
offer no support gauruntees and may remove this folder in a future release.

For supported runtimes, the 8.0.0 folder is used and our general dependency on
`System.Diagnostics.DiagnosticSource` is fox 8.x or newer.

On .NET Framework targets, we continue to depend on 5.0.0 of `System.Diagnostics.DiagnosticSource`.

### Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion test/startuphook/Elastic.Apm.StartupHook.Sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This sample application is a default ASP.NET (Core) application
configured to run with

- `net6.0`
- `net8.0`
- `net9.0`

target frameworks that can be used to try out the [Elastic APM
startup hooks implementation](../../src/ElasticApmAgentStartupHook).
Expand Down
Loading