Tenantry ProAPI reference
TenantryProAspNetCoreBuilderExtensions class
Namespace: Microsoft.Extensions.DependencyInjection · Package: Tenantry.Pro.AspNetCore · API reference
Registers Tenantry.Pro's ASP.NET Core features on IProBuilder<TKey>.
public static class TenantryProAspNetCoreBuilderExtensionsMethods
AddTenantMetrics<TKey>(IProBuilder<TKey>, Action<TenantMetricsOptions<TKey>>?)
Tags ASP.NET Core's request metrics (http.server.request.duration) with the request's tenant, as tenant.id. Add the middleware with app.UseTenantryMetrics(), after app.UseTenantry().
public static IProBuilder<TKey> AddTenantMetrics<TKey>(this IProBuilder<TKey> builder, Action<TenantMetricsOptions<TKey>>? configure = null) where TKey : IEquatable<TKey>, IParsable<TKey>Type parameters:
TKey: The tenant identifier type.
Parameters:
builderIProBuilder<TKey>: The Pro builder.configureAction<TenantMetricsOptions<TKey>>: SetsTenantMetricsOptions<TKey>, such as the tag's value for each tenant.
Returns: IProBuilder<TKey>: The same builder for chaining.