func TraceLookup(ctx context.Context) func(http.ResponseWriter, *http.Request) {
	p, err := phosphorFromContext(ctx)
	if err != nil {
		panic(err)
	}
	return func(w http.ResponseWriter, r *http.Request) {
		traceId := r.URL.Query().Get("traceId")
		if traceId == "" {
			errorResponse(r, w, http.StatusBadRequest, errors.New("traceId param not provided"))
			return
		}
		log.Debugf("Trace lookup - TraceId: %s", traceId)
		t, err := p.Store.ReadTrace(traceId)
		if err != nil {
			log.Errorf("Trace lookup failed: %s", err)
			errorResponse(r, w, http.StatusInternalServerError, fmt.Errorf("could not load trace: %s", err))
			return
		}
		if t == nil {
			log.Debugf("Trace not found: %s", traceId)
			errorResponse(r, w, http.StatusNotFound, errors.New("traceId not found"))
			return
		}
		response(
			r,
			w,
			map[string]interface{}{
				"trace": prettyFormatTrace(t),
			},
		)
	}
}
TraceLookup retrieves a trace from the persistence layer
package phosphor
import (
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"golang.org/x/net/context"
	log "github.com/cihub/seelog"
	"github.com/mondough/phosphor/internal/version"
)
func Index(w http.ResponseWriter, r *http.Request) {
	w.WriteHeader(http.StatusOK)
	fmt.Fprintf(w, fmt.Sprintf(`{
		"name": "phosphor",
		"version": "%s"
	}`, version.Version))
}