class MicrometerSpan extends Span {

        private final LettuceObservationContext context;

        private final Function<LettuceObservationContext, Observation> observationFactory;

        private Map<String, String> highCardinalityKeyValue;

        private Observation observation;

        public MicrometerSpan(String serviceName, Function<LettuceObservationContext, Observation> observationFactory) {
            this.context = new LettuceObservationContext(serviceName);
            this.observationFactory = observationFactory;
        }

        @Override
        public Span start(RedisCommand<?, ?, ?> command) {<FILL_FUNCTION_BODY>}

        @Override
        public Span name(String name) {
            return this;
        }

        @Override
        public Span annotate(String annotation) {
            return this;
        }

        @Override
        public Span tag(String key, String value) {
            if (this.highCardinalityKeyValue == null) {
                this.highCardinalityKeyValue = new HashMap<>();
            }
            this.highCardinalityKeyValue.put(key, value);
            return this;
        }

        @Override
        public Span error(Throwable throwable) {
            this.observation.error(throwable);
            return this;
        }

        @Override
        public Span remoteEndpoint(Endpoint endpoint) {
            this.context.setEndpoint(endpoint);
            return this;
        }

        @Override
        public void finish() {
            this.observation.stop();
        }

    }


            this.context.setCommand(command);
            this.observation = observationFactory.apply(context);
            if (this.highCardinalityKeyValue != null) {
                this.highCardinalityKeyValue.forEach(this.observation::highCardinalityKeyValue);
            }

            if (command instanceof CompleteableCommand<?>) {

                CompleteableCommand<?> completeableCommand = (CompleteableCommand<?>) command;

                completeableCommand.onComplete((o, throwable) -> {

                    if (command.getOutput() != null) {

                        String error = command.getOutput().getError();
                        if (error != null) {
                            this.observation.highCardinalityKeyValue(HighCardinalityCommandKeyNames.ERROR.withValue(error));
                        } else if (throwable != null) {
                            error(throwable);
                        }
                    }

                    finish();
                });
            } else {
                throw new IllegalArgumentException("Command " + command
                        + " must implement CompleteableCommand to attach Span completion to command completion");
            }

            this.observation.start();
            return this;
        
<no_super_class>