| 285 | _, exporter = tracer_provider |
| 286 | |
| 287 | class CountingRoute(Route): |
| 288 | match_count = 0 |
| 289 | |
| 290 | def matches(self, scope: Scope) -> tuple[Match, Scope]: |
| 291 | self.match_count += 1 |
| 292 | return super().matches(scope) |
| 293 | |
| 294 | route = CountingRoute("/users/{username}", homepage) |
| 295 | app = Starlette(routes=[route], middleware=[Middleware(OpenTelemetryMiddleware)]) |
no outgoing calls