You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sampler.go
    path of file: ./repos/streamdal/apps/server/vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer
    
    the code of the file until where you have to start completion: // Unless explicitly stated otherwise all files in this 
    
func (ps *prioritySampler) getRate(spn *span) float64 {
	key := "service:" + spn.Service + ",env:" + spn.Meta[ext.Environment]
	ps.mu.RLock()
	defer ps.mu.RUnlock()
	if rate, ok := ps.rates[key]; ok {
		return rate
	}
	return ps.defaultRate
}