Path: redb-route/redb.Route/Telemetry/RouteActivitySource.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Telemetry/RouteActivitySource.cs
----
using System.Diagnostics;
namespace redb.Route.Telemetry;
///
/// Centralized telemetry identifiers and the shared
/// for the route engine. Consumers of OpenTelemetry subscribe with
/// .AddSource(RouteActivitySource.SourceName) for traces and
/// .AddMeter(RouteMetrics.MeterName) for metrics; both use the same
/// canonical name ("redb.Route").
///
public static class RouteActivitySource
{
/// Canonical telemetry name shared by the meter and the activity source.
public const string TelemetryName = "redb.Route";
/// Source name used for OpenTelemetry tracing instrumentation.
public const string SourceName = TelemetryName;
/// The shared activity source instance.
public static readonly ActivitySource Source = new(SourceName, GetVersion());
private static string GetVersion()
{
return typeof(RouteActivitySource).Assembly.GetName().Version?.ToString() ?? "0.0.0";
}
}