-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Milestone
Description
Background and Motivation
We are adding metrics and distributed tracing for Blazor.
We need to add the new services to the dependency injection.
This registration doesn't enable the metrics or traces by default.
The API is in Infrastructure
namespace, it's not expected to be called by external code.
Proposed API
namespace Microsoft.AspNetCore.Components.Infrastructure
{
+ public static class ComponentsMetricsServiceCollectionExtensions
+ {
+ public static IServiceCollection AddComponentsMetrics(IServiceCollection services)
+ public static IServiceCollection AddComponentsTracing(IServiceCollection services)
+ }
}
Alternative API
namespace Microsoft.AspNetCore.Components.Infrastructure
{
+ public static class ComponentsDiagnosticsServiceCollectionExtensions
+ {
+ public static IServiceCollection AddComponentsMetrics(IServiceCollection services)
+ public static IServiceCollection AddComponentsTracing(IServiceCollection services)
+ }
}
Usage Examples - in the internal DI code of Blazor
namespace Microsoft.Extensions.DependencyInjection;
public static class RazorComponentsServiceCollectionExtensions
{
public static IRazorComponentsBuilder AddRazorComponents(this IServiceCollection services, Action<RazorComponentsServiceOptions>? configure = null)
{
ComponentsMetricsServiceCollectionExtensions.AddComponentsMetrics(services);
ComponentsMetricsServiceCollectionExtensions.AddComponentsTracing(services);
}
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components