InvergeDocs
Telescope

Telescope for .NET

Request-journey tracing on System.Diagnostics.Activity — ASP.NET Core, message consumers, HttpClient, EF Core, SqlClient, Npgsql and ILogger.

Install

dotnet add package Inverge.Nexus.Telescope --prerelease     # net8.0 / net9.0
dotnet add package Inverge.Nexus.AspNetCore --prerelease    # UseNexusTelescope()
Program.cs
builder.Services.AddNexusTelescope(o =>
{
    o.Service = "orders-api";
    // o.SampleRate = 0.2;
    // o.IgnorePaths.Add("/metrics");
    // o.IgnoreTypes.Add("cache");
});

var app = builder.Build();
app.UseNexusTelescope();   // early — before routing

What is recorded

Telescope listens to what the runtime and your libraries already emit:

  • Units of work — every local-root server or consumer Activity: ASP.NET Core requests, message consumers (MassTransit, Azure SDK…).
  • HttpClient calls, with W3C traceparent propagation.
  • EF Core and SqlClient commands with parameters; Npgsql.
  • ILogger records at or above MinimumLogLevel (framework categories only from Warning up).
  • Exceptions — an exception escaping a request is recorded as a 500.

UseNexusTelescope() adds the request's route pattern, headers, query, body, response status / headers / body and the signed-in user (from claims).

Jobs, spans, manual entries

// Producer: put the current trace on the message
message.Traceparent = NexusTelescope.Traceparent();

// Consumer: run the job as its own journey in that trace
await telescope.RunAsync("job", "SendInvoice", () => SendAsync(order), message.Traceparent);

using (telescope.Span("render pdf"))   // nests across awaits
{
    await RenderAsync();
}

telescope.RecordQuery("GET orders:42", null, durationMs: 0.4, connection: "redis");
telescope.SetUser(userId, email);
telescope.Tag(new[] { "vip" });
telescope.Enrich(new Dictionary<string, object?> { ["tenant"] = tenantId });

Options

TelescopeOptionsDefault
ServiceNEXUS_SERVICE_NAME, else the entry assembly name
Release—
SampleRatenull — the console's
IgnorePaths, IgnoreTypes, IgnoreActivitySources—
RedactKeysadded to the defaults
CaptureBodies, BodySizeLimitKbtrue, 64
MaxEntries2000
MinimumLogLevelInformation
FlushInterval2 s
Enabledtrue (also NEXUS_TELESCOPE_ENABLED=false, NexusServices.Telescope)

Journeys ship in the background and are flushed when the host stops. Diagnostic payloads are read by reflection, so this package is not trim / AOT-annotated.

On this page