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()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 routingWhat 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
traceparentpropagation. - EF Core and SqlClient commands with parameters; Npgsql.
ILoggerrecords at or aboveMinimumLogLevel(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
TelescopeOptions | Default |
|---|---|
Service | NEXUS_SERVICE_NAME, else the entry assembly name |
Release | — |
SampleRate | null — the console's |
IgnorePaths, IgnoreTypes, IgnoreActivitySources | — |
RedactKeys | added to the defaults |
CaptureBodies, BodySizeLimitKb | true, 64 |
MaxEntries | 2000 |
MinimumLogLevel | Information |
FlushInterval | 2 s |
Enabled | true (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.
Telescope for Python
Django, Flask, FastAPI / Starlette, Celery and any WSGI or ASGI app — with requests, httpx, SQLAlchemy, redis-py and logging instrumented.
OpenTelemetry (any language)
Point any OpenTelemetry SDK — Go, Java / Spring, Ruby / Rails, Rust, Elixir, .NET, Node, Python — at Telescope over OTLP/HTTP JSON.
