OpenTelemetry.Instrumentation.Remoting
0.1.0-alpha.1
Prefix Reserved
dotnet add package OpenTelemetry.Instrumentation.Remoting --version 0.1.0-alpha.1
NuGet\Install-Package OpenTelemetry.Instrumentation.Remoting -Version 0.1.0-alpha.1
<PackageReference Include="OpenTelemetry.Instrumentation.Remoting" Version="0.1.0-alpha.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Remoting" Version="0.1.0-alpha.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Remoting" />
paket add OpenTelemetry.Instrumentation.Remoting --version 0.1.0-alpha.1
#r "nuget: OpenTelemetry.Instrumentation.Remoting, 0.1.0-alpha.1"
#:package OpenTelemetry.Instrumentation.Remoting@0.1.0-alpha.1
#addin nuget:?package=OpenTelemetry.Instrumentation.Remoting&version=0.1.0-alpha.1&prerelease
#tool nuget:?package=OpenTelemetry.Instrumentation.Remoting&version=0.1.0-alpha.1&prerelease
.NET Remoting Instrumentation for OpenTelemetry .NET
| Status | |
|---|---|
| Stability | Alpha |
| Code Owners | @lewis800 |
This is an Instrumentation Library, which instruments .NET Remoting and collects telemetry about incoming and outgoing requests on client and server objects.
.NET Remoting is a legacy technology that shouldn't be used for new .NET applications and doesn't exist in .NET 6 and later versions. However, if you do have a legacy application you are looking to instrument, consider using this package.
Installation
Add a reference to the
OpenTelemetry.Instrumentation.Remoting
package. Also, add any other instrumentations & exporters you will need.
dotnet add package --prerelease OpenTelemetry.Instrumentation.Remoting
Configuration
To enable .NET remoting instrumentation, call AddRemotingInstrumentation() on
the TracerProviderBuilder during the application startup in both client and
server code.
The following example demonstrates adding .NET Framework remoting
instrumentation to a client console application. This example also
sets up the OpenTelemetry Console exporter, which requires adding
the OpenTelemetry.Exporter.Console
package to the project.
using OpenTelemetry;
using OpenTelemetry.Trace;
namespace ExampleClient
{
class Program
{
static void Main(string[] args)
{
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddRemotingInstrumentation()
.AddConsoleExporter()
.Build();
}
}
}
When hosting server objects in IIS, adding instrumentation should typically
be done in Global.asax.cs like in the below example.
This example also sets up the OpenTelemetry OTLP exporter, which requires
adding the package OpenTelemetry.Exporter.OpenTelemetryProtocol
to the project.
using System;
using OpenTelemetry;
using OpenTelemetry.Trace;
namespace ServerAspNet
{
public class Global : System.Web.HttpApplication
{
private IDisposable _tracerProvider;
protected void Application_Start(object sender, EventArgs e)
{
_tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddRemotingInstrumentation()
.AddOtlpExporter(o =>
{
o.Endpoint = new Uri("http://localhost:4317");
})
.Build();
}
// ...
protected void Application_End(object sender, EventArgs e)
{
_tracerProvider?.Dispose();
}
}
}
Additionally, when using HttpChannel
for remoting, consider registering OpenTelemetry.Instrumentation.Http
on the client and OpenTelemetry.Instrumentation.AspNet
on the server.
Filtering
By default AddRemotingInstrumentation will capture all calls leaving
or entering current AppDomain. If you are only interested in calls on
specific remote objects, you can use a Filter like below:
var tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddRemotingInstrumentation(options =>
options.Filter = message =>
{
// Only capture calls to and from "RemoteObject"
if (message is IMethodMessage methodMessage)
{
return methodMessage.TypeName.Contains("RemoteObject");
}
return false;
})
.Build()
The Filter takes an IMessage
and returns a boolean. You can inspect the message to decide if you
want to instrument it or not.
Implementation Details
The instrumentation is implemented via custom
IDynamicMessageSink
implementation, that is registered in the current AppDomain when you call
AddRemotingInstrumentation and unregistered when the constructed
TracerProvider is disposed.
References
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Microsoft.Extensions.Options (>= 10.0.0)
- OpenTelemetry.Api.ProviderBuilderExtensions (>= 1.15.3 && < 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.1 | 57 | 6/1/2026 |