func (sr *SpanRecorder) OnEnd(s trace.ReadOnlySpan) {
	sr.endedMu.Lock()
	defer sr.endedMu.Unlock()
	sr.ended = append(sr.ended, s)
}
OnEnd records completed spans.
package test
import (
	"context"
	"errors"
	"io"
	"strings"
	"sync"
	"testing"
	"time"
	"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
	"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/codes"
	"go.opentelemetry.io/otel/sdk/trace"
	"go.opentelemetry.io/otel/sdk/trace/tracetest"
	semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
	"github.com/golang/protobuf/proto"  
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.uber.org/goleak"
	"google.golang.org/grpc"
	grpc_codes "google.golang.org/grpc/codes"
	"google.golang.org/grpc/metadata"
	"google.golang.org/grpc/status"
)
type SpanRecorder struct {
	startedMu sync.RWMutex
	started   []trace.ReadWriteSpan
	endedMu sync.RWMutex
	ended   []trace.ReadOnlySpan
}
func NewSpanRecorder() *SpanRecorder {
	return new(SpanRecorder)
}
func (sr *SpanRecorder) OnStart(_ context.Context, s trace.ReadWriteSpan) {
	sr.startedMu.Lock()
	defer sr.startedMu.Unlock()
	sr.started = append(sr.started, s)
}