@@ -52,7 +52,7 @@ def __init__(
5252
5353@dataclasses .dataclass (kw_only = True , slots = True , frozen = True )
5454class FastStreamConfig (HealthChecksConfig , LoggingConfig , OpentelemetryConfig , PrometheusConfig , SentryConfig ):
55- application : "AsgiFastStream" = dataclasses .field (default_factory = lambda : AsgiFastStream () )
55+ application : "AsgiFastStream" = dataclasses .field (default_factory = AsgiFastStream )
5656 opentelemetry_middleware_cls : type [FastStreamTelemetryMiddlewareProtocol ] | None = None
5757 prometheus_middleware_cls : type [FastStreamPrometheusMiddlewareProtocol ] | None = None
5858
@@ -103,7 +103,7 @@ def bootstrap(self) -> None:
103103 if self .bootstrap_config .opentelemetry_middleware_cls and self .bootstrap_config .application .broker :
104104 self .bootstrap_config .opentelemetry_middleware_cls (tracer_provider = get_tracer_provider ())
105105 self .bootstrap_config .application .broker .add_middleware (
106- self .bootstrap_config .opentelemetry_middleware_cls (tracer_provider = get_tracer_provider ()) # type: ignore[arg-type]
106+ self .bootstrap_config .opentelemetry_middleware_cls (tracer_provider = get_tracer_provider ())
107107 )
108108
109109
@@ -116,7 +116,7 @@ class FastStreamSentryInstrument(SentryInstrument):
116116class FastStreamPrometheusInstrument (PrometheusInstrument ):
117117 bootstrap_config : FastStreamConfig
118118 collector_registry : "prometheus_client.CollectorRegistry" = dataclasses .field (
119- default_factory = lambda : prometheus_client .CollectorRegistry () , init = False
119+ default_factory = prometheus_client .CollectorRegistry , init = False
120120 )
121121 not_ready_message = PrometheusInstrument .not_ready_message + " or prometheus_middleware_cls is missing"
122122 missing_dependency_message = "prometheus_client is not installed"
@@ -138,7 +138,7 @@ def bootstrap(self) -> None:
138138 )
139139 if self .bootstrap_config .prometheus_middleware_cls and self .bootstrap_config .application .broker :
140140 self .bootstrap_config .application .broker .add_middleware (
141- self .bootstrap_config .prometheus_middleware_cls (registry = self .collector_registry ) # type: ignore[arg-type]
141+ self .bootstrap_config .prometheus_middleware_cls (registry = self .collector_registry )
142142 )
143143
144144
0 commit comments