func (c *Client) startSpan(operationName internal.Operation, itemKey ...string) oteltrace.Span {
	opts := []oteltrace.SpanStartOption{
		oteltrace.WithSpanKind(oteltrace.SpanKindClient),
		oteltrace.WithAttributes(
			c.attrsByOperationAndItemKey(operationName, itemKey...)...,
		),
	}
	_, span := c.tracer.Start(
		c.ctx,
		string(operationName),
		opts...,
	)
	return span
}
Starts span with appropriate span kind and attributes
package otelmemcache
import (
	"context"
	"github.com/bradfitz/gomemcache/memcache"
	"go.opentelemetry.io/contrib/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/internal"
	"go.opentelemetry.io/otel"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/codes"
	oteltrace "go.opentelemetry.io/otel/trace"
)
const (
	tracerName = "go.opentelemetry.io/contrib/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache"
)
type Client struct {
	*memcache.Client
	tracer oteltrace.Tracer
	ctx    context.Context
}
func NewClientWithTracing(client *memcache.Client, opts ...Option) *Client {
	cfg := &config{}
	for _, o := range opts {
		o.apply(cfg)
	}
	if cfg.tracerProvider == nil {
		cfg.tracerProvider = otel.GetTracerProvider()
	}
	return &Client{
		client,
		cfg.tracerProvider.Tracer(
			tracerName,
			oteltrace.WithInstrumentationVersion(SemVersion()),
		),
		context.Background(),
	}
}
func (c *Client) attrsByOperationAndItemKey(operation internal.Operation, key ...string) []attribute.KeyValue {
	attributes := []attribute.KeyValue{
		internal.MemcacheDBSystem(),
		internal.MemcacheDBOperation(operation),
	}
	if len(key) > 0 {
		attributes = append(attributes, internal.MemcacheDBItemKeys(key...))
	}
	return attributes
}