func addFields(ctx context.Context, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, span *trace.Span) {
	handlerName := runtime.FuncForPC(reflect.ValueOf(handler).Pointer()).Name()
	span.AddField("name", handlerName)
	span.AddField("meta.type", "grpc_request")
	span.AddField("handler.name", handlerName)
	span.AddField("handler.method", info.FullMethod)
	md, ok := metadata.FromIncomingContext(ctx)
	if ok {
		if val, ok := md["content-type"]; ok {
			span.AddField("request.content_type", val[0])
		}
		if val, ok := md[":authority"]; ok {
			span.AddField("request.header.authority", val[0])
		}
		if val, ok := md["user-agent"]; ok {
			span.AddField("request.header.user_agent", val[0])
		}
	}
}
addFields just adds available information about a gRPC request to the provided span.
package hnygrpc
import (
	"context"
	"reflect"
	"runtime"
	"github.com/honeycombio/beeline-go/propagation"
	"github.com/honeycombio/beeline-go/timer"
	"github.com/honeycombio/beeline-go/trace"
	"github.com/honeycombio/beeline-go/wrappers/config"
	"github.com/honeycombio/libhoney-go"
	"google.golang.org/grpc"
	"google.golang.org/grpc/metadata"
	"google.golang.org/grpc/status"
)
func getMetadataStringValue(md metadata.MD, key string) string {
	if val, ok := md[key]; ok {
		if len(val) > 0 {
			return val[0]
		}
		return ""
	}
	return ""
}
func startSpanOrTraceFromUnaryGRPC(
	ctx context.Context,
	info *grpc.UnaryServerInfo,
	parserHook config.GRPCTraceParserHook,
) (context.Context, *trace.Span) {
	span := trace.GetSpanFromContext(ctx)
	if span == nil {
		var tr *trace.Trace
		md, ok := metadata.FromIncomingContext(ctx)
		if ok {
			if parserHook == nil {
				beelineHeader := getMetadataStringValue(md, propagation.TracePropagationGRPCHeader)
				prop, _ := propagation.UnmarshalHoneycombTraceContext(beelineHeader)
				ctx, tr = trace.NewTrace(ctx, prop)
			} else {
				prop := parserHook(ctx)
				ctx, tr = trace.NewTraceFromPropagationContext(ctx, prop)
			}
		} else {
			ctx, tr = trace.NewTrace(ctx, nil)
		}
		span = tr.GetRootSpan()
	} else {
		ctx, span = span.CreateChild(ctx)
	}
	return ctx, span
}