@Override
    public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception {
        final Set<TransientServiceOption> transientServiceOptions = ctx.config().transientServiceOptions();
        if (!transientServiceOptions.contains(TransientServiceOption.WITH_TRACING) ||
            !transientServiceOptions.contains(TransientServiceOption.WITH_METRIC_COLLECTION)) {
            return unwrap().serve(ctx, req);
        }

        final ServiceObservationContext serviceObservationContext = new ServiceObservationContext(ctx, req);
        final Observation observation = HttpServiceObservationDocumentation.OBSERVATION.observation(
                observationConvention, DefaultServiceObservationConvention.INSTANCE,
                () -> serviceObservationContext, observationRegistry).start();

        final RequestContextExtension ctxExtension = ctx.as(RequestContextExtension.class);

        if (observationRegistry.isNoop() || observation.isNoop()) {
            return unwrap().serve(ctx, req);
        }

        if (ctxExtension != null) {
            // Make the span the current span and run scope decorators when the ctx is pushed.
            ctxExtension.hook(observation::openScope);
        }

        enrichObservation(ctx, serviceObservationContext, observation);

        return observation.scopedChecked(() -> unwrap().serve(ctx, req));
    }
Creates a new micrometer observation integrated {@link HttpService} decorator using the
specified {@link ObservationRegistry} and {@link ObservationConvention}.
core/src/main/java/com/linecorp/armeria/server/observation/ObservationService.java