Class PrometheusExtensions
- Namespace
- Steeltoe.Management.Prometheus
- Assembly
- Steeltoe.Management.Prometheus.dll
public static class PrometheusExtensions
- Inheritance
-
PrometheusExtensions
- Inherited Members
Methods
AddPrometheusActuator(IServiceCollection)
Adds the services used by the Steeltoe-configured OpenTelemetry Prometheus exporter and configures the ASP.NET Core middleware pipeline.
public static IServiceCollection AddPrometheusActuator(this IServiceCollection services)
Parameters
services
IServiceCollectionThe Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.
Returns
- IServiceCollection
The incoming
services
so that additional calls can be chained.
AddPrometheusActuator(IServiceCollection, bool)
Adds the services used by the Steeltoe-configured OpenTelemetry Prometheus exporter.
public static IServiceCollection AddPrometheusActuator(this IServiceCollection services, bool configureMiddleware)
Parameters
services
IServiceCollectionThe Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.
configureMiddleware
boolWhen
false
, skips configuration of the ASP.NET Core middleware pipeline. While this provides full control over the pipeline order, it requires manual addition of the appropriate middleware for the Prometheus exporter to work correctly.
Returns
- IServiceCollection
The incoming
services
so that additional calls can be chained.
AddPrometheusActuator(IServiceCollection, bool, Action<IApplicationBuilder>?)
Adds the services used by the Steeltoe-configured OpenTelemetry Prometheus exporter.
public static IServiceCollection AddPrometheusActuator(this IServiceCollection services, bool configureMiddleware, Action<IApplicationBuilder>? configurePrometheusPipeline)
Parameters
services
IServiceCollectionThe Microsoft.Extensions.DependencyInjection.IServiceCollection to add services to.
configureMiddleware
boolWhen
false
, skips configuration of the ASP.NET Core middleware pipeline. While this provides full control over the pipeline order, it requires manual addition of the appropriate middleware for the Prometheus exporter to work correctly.configurePrometheusPipeline
Action<IApplicationBuilder>Optional callback to run additional middleware at the Prometheus endpoint path, before the Prometheus middleware runs. For example:
. Only used whenbuilder => builder.UseAuthorization()
configureMiddleware
istrue
.
Returns
- IServiceCollection
The incoming
services
so that additional calls can be chained.
UsePrometheusActuator(IApplicationBuilder)
Adds the Steeltoe-configured OpenTelemetry Prometheus exporter to an IApplicationBuilder instance.
public static IApplicationBuilder UsePrometheusActuator(this IApplicationBuilder builder)
Parameters
builder
IApplicationBuilderThe IApplicationBuilder.
Returns
- IApplicationBuilder
The incoming
builder
so that additional calls can be chained.
UsePrometheusActuator(IApplicationBuilder, Action<IApplicationBuilder>?)
Adds the Steeltoe-configured OpenTelemetry Prometheus exporter to an IApplicationBuilder instance.
public static IApplicationBuilder UsePrometheusActuator(this IApplicationBuilder builder, Action<IApplicationBuilder>? configurePrometheusPipeline)
Parameters
builder
IApplicationBuilderThe IApplicationBuilder.
configurePrometheusPipeline
Action<IApplicationBuilder>Optional callback to run additional middleware at the Prometheus endpoint path, before the Prometheus middleware runs. For example:
.builder => builder.UseAuthorization()
Returns
- IApplicationBuilder
The incoming
builder
so that additional calls can be chained.